From 82f0f93c1797b408137773c98f453a375b61d82c Mon Sep 17 00:00:00 2001 From: cyderize Date: Tue, 15 Oct 2024 00:10:11 +0000 Subject: [PATCH] deploy: 5eaed1f1fc026276faf81bd07a6f2699aa8940ef --- ...-ZSeCQpPB.js => FileSaver.min-I5oEYwPn.js} | 2 +- .../{index-DeqmUj4P.js => index-DVfhyV_L.js} | 44 +++++++++---------- ....min-fAQkBUUp.js => jszip.min-C8Qcruww.js} | 2 +- develop/index.html | 2 +- 4 files changed, 25 insertions(+), 25 deletions(-) rename develop/assets/{FileSaver.min-ZSeCQpPB.js => FileSaver.min-I5oEYwPn.js} (97%) rename develop/assets/{index-DeqmUj4P.js => index-DVfhyV_L.js} (84%) rename develop/assets/{jszip.min-fAQkBUUp.js => jszip.min-C8Qcruww.js} (99%) diff --git a/develop/assets/FileSaver.min-ZSeCQpPB.js b/develop/assets/FileSaver.min-I5oEYwPn.js similarity index 97% rename from develop/assets/FileSaver.min-ZSeCQpPB.js rename to develop/assets/FileSaver.min-I5oEYwPn.js index 388cfa7..cb34bc0 100644 --- a/develop/assets/FileSaver.min-ZSeCQpPB.js +++ b/develop/assets/FileSaver.min-I5oEYwPn.js @@ -1 +1 @@ -import{g as j,c as s}from"./index-DeqmUj4P.js";var E={exports:{}};(function(b,S){(function(p,i){i()})(s,function(){function p(e,t){return typeof t>"u"?t={autoBom:!1}:typeof t!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function i(e,t,r){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){u(o.response,t,r)},o.onerror=function(){console.error("could not download file")},o.send()}function v(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function l(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof s=="object"&&s.global===s?s:void 0,m=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!m?function(e,t,r){var o=a.URL||a.webkitURL,n=document.createElement("a");t=t||e.name||"download",n.download=t,n.rel="noopener",typeof e=="string"?(n.href=e,n.origin===location.origin?l(n):v(n.href)?i(e,t,r):l(n,n.target="_blank")):(n.href=o.createObjectURL(e),setTimeout(function(){o.revokeObjectURL(n.href)},4e4),setTimeout(function(){l(n)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,r){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(p(e,r),t);else if(v(e))i(e,t,r);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){l(o)})}}:function(e,t,r,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof e=="string")return i(e,t,r);var n=e.type==="application/octet-stream",h=/constructor/i.test(a.HTMLElement)||a.safari,w=/CriOS\/[\d]+/.test(navigator.userAgent);if((w||n&&h||m)&&typeof FileReader<"u"){var d=new FileReader;d.onloadend=function(){var c=d.result;c=w?c:c.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=c:location=c,o=null},d.readAsDataURL(e)}else{var y=a.URL||a.webkitURL,f=y.createObjectURL(e);o?o.location=f:location.href=f,o=null,setTimeout(function(){y.revokeObjectURL(f)},4e4)}});a.saveAs=u.saveAs=u,b.exports=u})})(E);var L=E.exports;const R=j(L),A=Object.freeze(Object.defineProperty({__proto__:null,default:R},Symbol.toStringTag,{value:"Module"}));export{A as F}; +import{g as j,c as s}from"./index-DVfhyV_L.js";var E={exports:{}};(function(b,S){(function(p,i){i()})(s,function(){function p(e,t){return typeof t>"u"?t={autoBom:!1}:typeof t!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function i(e,t,r){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){u(o.response,t,r)},o.onerror=function(){console.error("could not download file")},o.send()}function v(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function l(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof s=="object"&&s.global===s?s:void 0,m=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!m?function(e,t,r){var o=a.URL||a.webkitURL,n=document.createElement("a");t=t||e.name||"download",n.download=t,n.rel="noopener",typeof e=="string"?(n.href=e,n.origin===location.origin?l(n):v(n.href)?i(e,t,r):l(n,n.target="_blank")):(n.href=o.createObjectURL(e),setTimeout(function(){o.revokeObjectURL(n.href)},4e4),setTimeout(function(){l(n)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,r){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(p(e,r),t);else if(v(e))i(e,t,r);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){l(o)})}}:function(e,t,r,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof e=="string")return i(e,t,r);var n=e.type==="application/octet-stream",h=/constructor/i.test(a.HTMLElement)||a.safari,w=/CriOS\/[\d]+/.test(navigator.userAgent);if((w||n&&h||m)&&typeof FileReader<"u"){var d=new FileReader;d.onloadend=function(){var c=d.result;c=w?c:c.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=c:location=c,o=null},d.readAsDataURL(e)}else{var y=a.URL||a.webkitURL,f=y.createObjectURL(e);o?o.location=f:location.href=f,o=null,setTimeout(function(){y.revokeObjectURL(f)},4e4)}});a.saveAs=u.saveAs=u,b.exports=u})})(E);var L=E.exports;const R=j(L),A=Object.freeze(Object.defineProperty({__proto__:null,default:R},Symbol.toStringTag,{value:"Module"}));export{A as F}; diff --git a/develop/assets/index-DeqmUj4P.js b/develop/assets/index-DVfhyV_L.js similarity index 84% rename from develop/assets/index-DeqmUj4P.js rename to develop/assets/index-DVfhyV_L.js index 4515ab7..e32b165 100644 --- a/develop/assets/index-DeqmUj4P.js +++ b/develop/assets/index-DVfhyV_L.js @@ -1,20 +1,20 @@ -var rC=Object.defineProperty;var sC=(n,e,t)=>e in n?rC(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Bh=(n,e,t)=>sC(n,typeof e!="symbol"?e+"":e,t);import*as lC from"https://cdn.jsdelivr.net/npm/minizinc/dist/minizinc.mjs";import*as oC from"https://cdn.jsdelivr.net/npm/minizinc@edge/dist/minizinc.mjs";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function _e(){}const Yd=n=>n;function aC(n,e){for(const t in e)n[t]=e[t];return n}function u$(n){return n()}function Wm(){return Object.create(null)}function Ft(n){n.forEach(u$)}function ru(n){return typeof n=="function"}function Oi(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Xf;function Cm(n,e){return n===e?!0:(Xf||(Xf=document.createElement("a")),Xf.href=e,n===Xf.href)}function fC(n){return Object.keys(n).length===0}function cC(n,...e){if(n==null){for(const i of e)i(void 0);return _e}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function CO(n,e,t){n.$$.on_destroy.push(cC(e,t))}function Ri(n,e,t,i){if(n){const r=h$(n,e,t,i);return n[0](r)}}function h$(n,e,t,i){return n[1]&&i?aC(t.ctx.slice(),n[1](i(e))):t.ctx}function Ai(n,e,t,i){if(n[2]&&i){const r=n[2](i(t));if(e.dirty===void 0)return r;if(typeof r=="object"){const s=[],l=Math.max(e.dirty.length,r.length);for(let o=0;o32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),Ud=O$?n=>requestAnimationFrame(n):_e;const Wl=new Set;function p$(n){Wl.forEach(e=>{e.c(n)||(Wl.delete(e),e.f())}),Wl.size!==0&&Ud(p$)}function g$(n){let e;return Wl.size===0&&Ud(p$),{promise:new Promise(t=>{Wl.add(e={c:n,f:t})}),abort(){Wl.delete(e)}}}const hC=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function Q(n,e){n.appendChild(e)}function m$(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function OC(n){const e=_("style");return e.textContent="/* empty */",dC(m$(n),e),e.sheet}function dC(n,e){return Q(n.head||n,e),e.sheet}function Y(n,e,t){n.insertBefore(e,t||null)}function X(n){n.parentNode&&n.parentNode.removeChild(n)}function di(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function S$(n){return function(e){return e.preventDefault(),n.call(this,e)}}function v(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function ta(n){return n===""?null:+n}function pC(n){return Array.from(n.childNodes)}function Ne(n,e){e=""+e,n.data!==e&&(n.data=e)}function li(n,e){n.value=e??""}function Zm(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function Ml(n,e,t){for(let i=0;ie.__value)}function ne(n,e,t){n.classList.toggle(e,!!t)}function b$(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}const yc=new Map;let vc=0;function mC(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function SC(n,e){const t={stylesheet:OC(e),rules:{}};return yc.set(n,t),t}function ZO(n,e,t,i,r,s,l,o=0){const a=16.666/i;let c=`{ +var sC=Object.defineProperty;var lC=(n,e,t)=>e in n?sC(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Bh=(n,e,t)=>lC(n,typeof e!="symbol"?e+"":e,t);import*as oC from"https://cdn.jsdelivr.net/npm/minizinc/dist/minizinc.mjs";import*as aC from"https://cdn.jsdelivr.net/npm/minizinc@edge/dist/minizinc.mjs";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function _e(){}const Yd=n=>n;function fC(n,e){for(const t in e)n[t]=e[t];return n}function h$(n){return n()}function Wm(){return Object.create(null)}function Ft(n){n.forEach(h$)}function ru(n){return typeof n=="function"}function Oi(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Xf;function Cm(n,e){return n===e?!0:(Xf||(Xf=document.createElement("a")),Xf.href=e,n===Xf.href)}function cC(n){return Object.keys(n).length===0}function uC(n,...e){if(n==null){for(const i of e)i(void 0);return _e}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function CO(n,e,t){n.$$.on_destroy.push(uC(e,t))}function Ri(n,e,t,i){if(n){const r=O$(n,e,t,i);return n[0](r)}}function O$(n,e,t,i){return n[1]&&i?fC(t.ctx.slice(),n[1](i(e))):t.ctx}function Ai(n,e,t,i){if(n[2]&&i){const r=n[2](i(t));if(e.dirty===void 0)return r;if(typeof r=="object"){const s=[],l=Math.max(e.dirty.length,r.length);for(let o=0;o32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),Ud=d$?n=>requestAnimationFrame(n):_e;const Wl=new Set;function g$(n){Wl.forEach(e=>{e.c(n)||(Wl.delete(e),e.f())}),Wl.size!==0&&Ud(g$)}function m$(n){let e;return Wl.size===0&&Ud(g$),{promise:new Promise(t=>{Wl.add(e={c:n,f:t})}),abort(){Wl.delete(e)}}}const OC=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function Q(n,e){n.appendChild(e)}function S$(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function dC(n){const e=_("style");return e.textContent="/* empty */",pC(S$(n),e),e.sheet}function pC(n,e){return Q(n.head||n,e),e.sheet}function Y(n,e,t){n.insertBefore(e,t||null)}function X(n){n.parentNode&&n.parentNode.removeChild(n)}function di(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function b$(n){return function(e){return e.preventDefault(),n.call(this,e)}}function v(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function ta(n){return n===""?null:+n}function gC(n){return Array.from(n.childNodes)}function Ne(n,e){e=""+e,n.data!==e&&(n.data=e)}function li(n,e){n.value=e??""}function Zm(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function Ml(n,e,t){for(let i=0;ie.__value)}function ne(n,e,t){n.classList.toggle(e,!!t)}function $$(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}const yc=new Map;let vc=0;function SC(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function bC(n,e){const t={stylesheet:dC(e),rules:{}};return yc.set(n,t),t}function ZO(n,e,t,i,r,s,l,o=0){const a=16.666/i;let c=`{ `;for(let y=0;y<=1;y+=a){const k=e+(t-e)*s(y);c+=y*100+`%{${l(k,1-k)}} `}const h=c+`100% {${l(t,1-t)}} -}`,O=`__svelte_${mC(h)}_${o}`,p=m$(n),{stylesheet:g,rules:m}=yc.get(p)||SC(p,n);m[O]||(m[O]=!0,g.insertRule(`@keyframes ${O} ${h}`,g.cssRules.length));const $=n.style.animation||"";return n.style.animation=`${$?`${$}, `:""}${O} ${i}ms linear ${r}ms 1 both`,vc+=1,O}function $$(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),r=t.length-i.length;r&&(n.style.animation=i.join(", "),vc-=r,vc||bC())}function bC(){Ud(()=>{vc||(yc.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&X(e)}),yc.clear())})}function $C(n,e,t,i){if(!e)return _e;const r=n.getBoundingClientRect();if(e.left===r.left&&e.right===r.right&&e.top===r.top&&e.bottom===r.bottom)return _e;const{delay:s=0,duration:l=300,easing:o=Yd,start:a=d$()+s,end:c=a+l,tick:h=_e,css:O}=t(n,{from:e,to:r},i);let p=!0,g=!1,m;function $(){O&&(m=ZO(n,0,1,l,s,o,O)),s||(g=!0)}function y(){O&&$$(n,m),p=!1}return g$(k=>{if(!g&&k>=a&&(g=!0),g&&k>=c&&(h(1,0),y()),!p)return!1;if(g){const W=k-a,Z=0+1*o(W/l);h(Z,1-Z)}return!0}),$(),h(0,1),y}function yC(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,r=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,vC(n,r)}}function vC(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),r=i.transform==="none"?"":i.transform;n.style.transform=`${r} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let ia;function Bo(n){ia=n}function y$(){if(!ia)throw new Error("Function called outside component initialization");return ia}function su(n){y$().$$.on_mount.push(n)}function nn(){const n=y$();return(e,t,{cancelable:i=!1}={})=>{const r=n.$$.callbacks[e];if(r){const s=b$(e,t,{cancelable:i});return r.slice().forEach(l=>{l.call(n,s)}),!s.defaultPrevented}return!0}}function Am(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const vl=[],Mt=[];let Cl=[];const RO=[],v$=Promise.resolve();let AO=!1;function w$(){AO||(AO=!0,v$.then(Q$))}function Gn(){return w$(),v$}function Kn(n){Cl.push(n)}function jo(n){RO.push(n)}const jh=new Set;let bl=0;function Q$(){if(bl!==0)return;const n=ia;do{try{for(;bln.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Cl=e}let Co;function kC(){return Co||(Co=Promise.resolve(),Co.then(()=>{Co=null})),Co}function Fh(n,e,t){n.dispatchEvent(b$(`${e?"intro":"outro"}${t}`))}const ac=new Set;let zr;function Je(){zr={r:0,c:[],p:zr}}function et(){zr.r||Ft(zr.c),zr=zr.p}function V(n,e){n&&n.i&&(ac.delete(n),n.i(e))}function B(n,e,t,i){if(n&&n.o){if(ac.has(n))return;ac.add(n),zr.c.push(()=>{ac.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const _C={duration:0};function kl(n,e,t,i){let s=e(n,t,{direction:"both"}),l=i?0:1,o=null,a=null,c=null,h;function O(){c&&$$(n,c)}function p(m,$){const y=m.b-l;return $*=Math.abs(y),{a:l,b:m.b,d:y,duration:$,start:m.start,end:m.start+$,group:m.group}}function g(m){const{delay:$=0,duration:y=300,easing:k=Yd,tick:W=_e,css:Z}=s||_C,A={start:d$()+$,b:m};m||(A.group=zr,zr.r+=1),"inert"in n&&(m?h!==void 0&&(n.inert=h):(h=n.inert,n.inert=!0)),o||a?a=A:(Z&&(O(),c=ZO(n,l,m,y,$,k,Z)),m&&W(0,1),o=p(A,y),Kn(()=>Fh(n,m,"start")),g$(C=>{if(a&&C>a.start&&(o=p(a,y),a=null,Fh(n,o.b,"start"),Z&&(O(),c=ZO(n,l,o.b,o.duration,0,k,s.css))),o){if(C>=o.end)W(l=o.b,1-l),Fh(n,o.b,"end"),a||(o.b?O():--o.group.r||Ft(o.group.c)),o=null;else if(C>=o.start){const U=C-o.start;l=o.a+o.d*k(U/o.duration),W(l,1-l)}}return!!(o||a)}))}return{run(m){ru(s)?kC().then(()=>{s=s({direction:m?"in":"out"}),g(m)}):g(m)},end(){O(),o=a=null}}}function st(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function PC(n,e){B(n,1,1,()=>{e.delete(n.key)})}function xC(n,e){n.f(),PC(n,e)}function WC(n,e,t,i,r,s,l,o,a,c,h,O){let p=n.length,g=s.length,m=p;const $={};for(;m--;)$[n[m].key]=m;const y=[],k=new Map,W=new Map,Z=[];for(m=g;m--;){const D=O(r,s,m),z=t(D);let j=l.get(z);j?Z.push(()=>j.p(D,e)):(j=c(z,D),j.c()),k.set(z,y[m]=j),z in $&&W.set(z,Math.abs(m-$[z]))}const A=new Set,C=new Set;function U(D){V(D,1),D.m(o,h),l.set(D.key,D),h=D.first,g--}for(;p&&g;){const D=y[g-1],z=n[p-1],j=D.key,N=z.key;D===z?(h=D.first,p--,g--):k.has(N)?!l.has(j)||A.has(j)?U(D):C.has(N)?p--:W.get(j)>W.get(N)?(C.add(j),U(D)):(A.add(N),p--):(a(z,l),p--)}for(;p--;){const D=n[p];k.has(D.key)||a(D,l)}for(;g;)U(y[g-1]);return Ft(Z),y}function Fo(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function Ye(n){n&&n.c()}function Ae(n,e,t){const{fragment:i,after_update:r}=n.$$;i&&i.m(e,t),Kn(()=>{const s=n.$$.on_mount.map(u$).filter(ru);n.$$.on_destroy?n.$$.on_destroy.push(...s):Ft(s),n.$$.on_mount=[]}),r.forEach(Kn)}function Xe(n,e){const t=n.$$;t.fragment!==null&&(QC(t.after_update),Ft(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function CC(n,e){n.$$.dirty[0]===-1&&(vl.push(n),w$(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const m=g.length?g[0]:p;return c.ctx&&r(c.ctx[O],c.ctx[O]=m)&&(!c.skip_bound&&c.bound[O]&&c.bound[O](m),h&&CC(n,O)),p}):[],c.update(),h=!0,Ft(c.before_update),c.fragment=i?i(c.ctx):!1,e.target){if(e.hydrate){const O=pC(e.target);c.fragment&&c.fragment.l(O),O.forEach(X)}else c.fragment&&c.fragment.c();e.intro&&V(n.$$.fragment),Ae(n,e.target,e.anchor),Q$()}Bo(a)}class $i{constructor(){Bh(this,"$$");Bh(this,"$$set")}$destroy(){Xe(this,1),this.$destroy=_e}$on(e,t){if(!ru(t))return _e;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!fC(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const TC="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(TC);const ZC="modulepreload",RC=function(n){return"/develop/"+n},Xm={},Ym=function(e,t,i){let r=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),o=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));r=Promise.allSettled(t.map(a=>{if(a=RC(a),a in Xm)return;Xm[a]=!0;const c=a.endsWith(".css"),h=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${h}`))return;const O=document.createElement("link");if(O.rel=c?"stylesheet":ZC,c||(O.as="script"),O.crossOrigin="",O.href=a,o&&O.setAttribute("nonce",o),document.head.appendChild(O),c)return new Promise((p,g)=>{O.addEventListener("load",p),O.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${a}`)))})}))}function s(l){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l}return r.then(l=>{for(const o of l||[])o.status==="rejected"&&s(o.reason);return e().catch(s)})};class St{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=zl(this,e,t);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(t,this.length,r,1),Or.from(r,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=zl(this,e,t);let i=[];return this.decompose(e,t,i,0),Or.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new Go(this),s=new Go(e);for(let l=t,o=t;;){if(r.next(l),s.next(l),l=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(o+=r.value.length,r.done||o>=i)return!0}}iter(e=1){return new Go(this,e)}iterRange(e,t=this.length){return new k$(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new _$(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?St.empty:e.length<=32?new ni(e):Or.from(ni.split(e,[]))}}class ni extends St{constructor(e,t=AC(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,r){for(let s=0;;s++){let l=this.text[s],o=r+l.length;if((t?i:o)>=e)return new XC(r,o,i,l);r=o+1,i++}}decompose(e,t,i,r){let s=e<=0&&t>=this.length?this:new ni(Um(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let l=i.pop(),o=fc(s.text,l.text.slice(),0,s.length);if(o.length<=32)i.push(new ni(o,l.length+s.length));else{let a=o.length>>1;i.push(new ni(o.slice(0,a)),new ni(o.slice(a)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof ni))return super.replace(e,t,i);[e,t]=zl(this,e,t);let r=fc(this.text,fc(i.text,Um(this.text,0,e)),t),s=this.length+i.length-(t-e);return r.length<=32?new ni(r,s):Or.from(ni.split(r,[]),s)}sliceString(e,t=this.length,i=` +}`,O=`__svelte_${SC(h)}_${o}`,p=S$(n),{stylesheet:g,rules:m}=yc.get(p)||bC(p,n);m[O]||(m[O]=!0,g.insertRule(`@keyframes ${O} ${h}`,g.cssRules.length));const $=n.style.animation||"";return n.style.animation=`${$?`${$}, `:""}${O} ${i}ms linear ${r}ms 1 both`,vc+=1,O}function y$(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),r=t.length-i.length;r&&(n.style.animation=i.join(", "),vc-=r,vc||$C())}function $C(){Ud(()=>{vc||(yc.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&X(e)}),yc.clear())})}function yC(n,e,t,i){if(!e)return _e;const r=n.getBoundingClientRect();if(e.left===r.left&&e.right===r.right&&e.top===r.top&&e.bottom===r.bottom)return _e;const{delay:s=0,duration:l=300,easing:o=Yd,start:a=p$()+s,end:c=a+l,tick:h=_e,css:O}=t(n,{from:e,to:r},i);let p=!0,g=!1,m;function $(){O&&(m=ZO(n,0,1,l,s,o,O)),s||(g=!0)}function y(){O&&y$(n,m),p=!1}return m$(k=>{if(!g&&k>=a&&(g=!0),g&&k>=c&&(h(1,0),y()),!p)return!1;if(g){const W=k-a,Z=0+1*o(W/l);h(Z,1-Z)}return!0}),$(),h(0,1),y}function vC(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,r=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,wC(n,r)}}function wC(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),r=i.transform==="none"?"":i.transform;n.style.transform=`${r} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let ia;function Bo(n){ia=n}function v$(){if(!ia)throw new Error("Function called outside component initialization");return ia}function su(n){v$().$$.on_mount.push(n)}function nn(){const n=v$();return(e,t,{cancelable:i=!1}={})=>{const r=n.$$.callbacks[e];if(r){const s=$$(e,t,{cancelable:i});return r.slice().forEach(l=>{l.call(n,s)}),!s.defaultPrevented}return!0}}function Am(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const vl=[],Mt=[];let Cl=[];const RO=[],w$=Promise.resolve();let AO=!1;function Q$(){AO||(AO=!0,w$.then(k$))}function Gn(){return Q$(),w$}function Kn(n){Cl.push(n)}function jo(n){RO.push(n)}const jh=new Set;let bl=0;function k$(){if(bl!==0)return;const n=ia;do{try{for(;bln.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Cl=e}let Co;function _C(){return Co||(Co=Promise.resolve(),Co.then(()=>{Co=null})),Co}function Fh(n,e,t){n.dispatchEvent($$(`${e?"intro":"outro"}${t}`))}const ac=new Set;let zr;function Je(){zr={r:0,c:[],p:zr}}function et(){zr.r||Ft(zr.c),zr=zr.p}function V(n,e){n&&n.i&&(ac.delete(n),n.i(e))}function B(n,e,t,i){if(n&&n.o){if(ac.has(n))return;ac.add(n),zr.c.push(()=>{ac.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const PC={duration:0};function kl(n,e,t,i){let s=e(n,t,{direction:"both"}),l=i?0:1,o=null,a=null,c=null,h;function O(){c&&y$(n,c)}function p(m,$){const y=m.b-l;return $*=Math.abs(y),{a:l,b:m.b,d:y,duration:$,start:m.start,end:m.start+$,group:m.group}}function g(m){const{delay:$=0,duration:y=300,easing:k=Yd,tick:W=_e,css:Z}=s||PC,A={start:p$()+$,b:m};m||(A.group=zr,zr.r+=1),"inert"in n&&(m?h!==void 0&&(n.inert=h):(h=n.inert,n.inert=!0)),o||a?a=A:(Z&&(O(),c=ZO(n,l,m,y,$,k,Z)),m&&W(0,1),o=p(A,y),Kn(()=>Fh(n,m,"start")),m$(C=>{if(a&&C>a.start&&(o=p(a,y),a=null,Fh(n,o.b,"start"),Z&&(O(),c=ZO(n,l,o.b,o.duration,0,k,s.css))),o){if(C>=o.end)W(l=o.b,1-l),Fh(n,o.b,"end"),a||(o.b?O():--o.group.r||Ft(o.group.c)),o=null;else if(C>=o.start){const U=C-o.start;l=o.a+o.d*k(U/o.duration),W(l,1-l)}}return!!(o||a)}))}return{run(m){ru(s)?_C().then(()=>{s=s({direction:m?"in":"out"}),g(m)}):g(m)},end(){O(),o=a=null}}}function st(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function xC(n,e){B(n,1,1,()=>{e.delete(n.key)})}function WC(n,e){n.f(),xC(n,e)}function CC(n,e,t,i,r,s,l,o,a,c,h,O){let p=n.length,g=s.length,m=p;const $={};for(;m--;)$[n[m].key]=m;const y=[],k=new Map,W=new Map,Z=[];for(m=g;m--;){const D=O(r,s,m),z=t(D);let j=l.get(z);j?Z.push(()=>j.p(D,e)):(j=c(z,D),j.c()),k.set(z,y[m]=j),z in $&&W.set(z,Math.abs(m-$[z]))}const A=new Set,C=new Set;function U(D){V(D,1),D.m(o,h),l.set(D.key,D),h=D.first,g--}for(;p&&g;){const D=y[g-1],z=n[p-1],j=D.key,N=z.key;D===z?(h=D.first,p--,g--):k.has(N)?!l.has(j)||A.has(j)?U(D):C.has(N)?p--:W.get(j)>W.get(N)?(C.add(j),U(D)):(A.add(N),p--):(a(z,l),p--)}for(;p--;){const D=n[p];k.has(D.key)||a(D,l)}for(;g;)U(y[g-1]);return Ft(Z),y}function Fo(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function Ye(n){n&&n.c()}function Ae(n,e,t){const{fragment:i,after_update:r}=n.$$;i&&i.m(e,t),Kn(()=>{const s=n.$$.on_mount.map(h$).filter(ru);n.$$.on_destroy?n.$$.on_destroy.push(...s):Ft(s),n.$$.on_mount=[]}),r.forEach(Kn)}function Xe(n,e){const t=n.$$;t.fragment!==null&&(kC(t.after_update),Ft(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function TC(n,e){n.$$.dirty[0]===-1&&(vl.push(n),Q$(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const m=g.length?g[0]:p;return c.ctx&&r(c.ctx[O],c.ctx[O]=m)&&(!c.skip_bound&&c.bound[O]&&c.bound[O](m),h&&TC(n,O)),p}):[],c.update(),h=!0,Ft(c.before_update),c.fragment=i?i(c.ctx):!1,e.target){if(e.hydrate){const O=gC(e.target);c.fragment&&c.fragment.l(O),O.forEach(X)}else c.fragment&&c.fragment.c();e.intro&&V(n.$$.fragment),Ae(n,e.target,e.anchor),k$()}Bo(a)}class $i{constructor(){Bh(this,"$$");Bh(this,"$$set")}$destroy(){Xe(this,1),this.$destroy=_e}$on(e,t){if(!ru(t))return _e;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!cC(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const ZC="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(ZC);const RC="modulepreload",AC=function(n){return"/develop/"+n},Xm={},Ym=function(e,t,i){let r=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),o=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));r=Promise.allSettled(t.map(a=>{if(a=AC(a),a in Xm)return;Xm[a]=!0;const c=a.endsWith(".css"),h=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${h}`))return;const O=document.createElement("link");if(O.rel=c?"stylesheet":RC,c||(O.as="script"),O.crossOrigin="",O.href=a,o&&O.setAttribute("nonce",o),document.head.appendChild(O),c)return new Promise((p,g)=>{O.addEventListener("load",p),O.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${a}`)))})}))}function s(l){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l}return r.then(l=>{for(const o of l||[])o.status==="rejected"&&s(o.reason);return e().catch(s)})};class St{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=zl(this,e,t);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(t,this.length,r,1),Or.from(r,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=zl(this,e,t);let i=[];return this.decompose(e,t,i,0),Or.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new Go(this),s=new Go(e);for(let l=t,o=t;;){if(r.next(l),s.next(l),l=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(o+=r.value.length,r.done||o>=i)return!0}}iter(e=1){return new Go(this,e)}iterRange(e,t=this.length){return new _$(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new P$(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?St.empty:e.length<=32?new ni(e):Or.from(ni.split(e,[]))}}class ni extends St{constructor(e,t=XC(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,r){for(let s=0;;s++){let l=this.text[s],o=r+l.length;if((t?i:o)>=e)return new YC(r,o,i,l);r=o+1,i++}}decompose(e,t,i,r){let s=e<=0&&t>=this.length?this:new ni(Um(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let l=i.pop(),o=fc(s.text,l.text.slice(),0,s.length);if(o.length<=32)i.push(new ni(o,l.length+s.length));else{let a=o.length>>1;i.push(new ni(o.slice(0,a)),new ni(o.slice(a)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof ni))return super.replace(e,t,i);[e,t]=zl(this,e,t);let r=fc(this.text,fc(i.text,Um(this.text,0,e)),t),s=this.length+i.length-(t-e);return r.length<=32?new ni(r,s):Or.from(ni.split(r,[]),s)}sliceString(e,t=this.length,i=` `){[e,t]=zl(this,e,t);let r="";for(let s=0,l=0;s<=t&&le&&l&&(r+=i),es&&(r+=o.slice(Math.max(0,e-s),t-s)),s=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(t.push(new ni(i,r)),i=[],r=-1);return r>-1&&t.push(new ni(i,r)),t}}class Or extends St{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,r){for(let s=0;;s++){let l=this.children[s],o=r+l.length,a=i+l.lines-1;if((t?a:o)>=e)return l.lineInner(e,t,i,r);r=o+1,i=a+1}}decompose(e,t,i,r){for(let s=0,l=0;l<=t&&s=l){let c=r&((l<=e?1:0)|(a>=t?2:0));l>=e&&a<=t&&!c?i.push(o):o.decompose(e-l,t-l,i,c)}l=a+1}}replace(e,t,i){if([e,t]=zl(this,e,t),i.lines=s&&t<=o){let a=l.replace(e-s,t-s,i),c=this.lines-l.lines+a.lines;if(a.lines>4&&a.lines>c>>6){let h=this.children.slice();return h[r]=a,new Or(h,this.length-(t-e)+i.length)}return super.replace(s,o,a)}s=o+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=` -`){[e,t]=zl(this,e,t);let r="";for(let s=0,l=0;se&&s&&(r+=i),el&&(r+=o.sliceString(e-l,t-l,i)),l=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Or))return 0;let i=0,[r,s,l,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==l||s==o)return i;let a=this.children[r],c=e.children[s];if(a!=c)return i+a.scanIdentical(c,t);i+=a.length+1}}static from(e,t=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let g of e)i+=g.lines;if(i<32){let g=[];for(let m of e)m.flatten(g);return new ni(g,t)}let r=Math.max(32,i>>5),s=r<<1,l=r>>1,o=[],a=0,c=-1,h=[];function O(g){let m;if(g.lines>s&&g instanceof Or)for(let $ of g.children)O($);else g.lines>l&&(a>l||!a)?(p(),o.push(g)):g instanceof ni&&a&&(m=h[h.length-1])instanceof ni&&g.lines+m.lines<=32?(a+=g.lines,c+=g.length+1,h[h.length-1]=new ni(m.text.concat(g.text),m.length+1+g.length)):(a+g.lines>r&&p(),a+=g.lines,c+=g.length+1,h.push(g))}function p(){a!=0&&(o.push(h.length==1?h[0]:Or.from(h,c)),c=-1,a=h.length=0)}for(let g of e)O(g);return p(),o.length==1?o[0]:new Or(o,t)}}St.empty=new ni([""],0);function AC(n){let e=-1;for(let t of n)e+=t.length+1;return e}function fc(n,e,t=0,i=1e9){for(let r=0,s=0,l=!0;s=t&&(a>i&&(o=o.slice(0,i-r)),r0?1:(e instanceof ni?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],l=s>>1,o=r instanceof ni?r.text.length:r.children.length;if(l==(t>0?o:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` -`,this;e--}else if(r instanceof ni){let a=r.text[l+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[l+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof ni?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class k${constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Go(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=i?r:t<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class _${constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(St.prototype[Symbol.iterator]=function(){return this.iter()},Go.prototype[Symbol.iterator]=k$.prototype[Symbol.iterator]=_$.prototype[Symbol.iterator]=function(){return this});class XC{constructor(e,t,i,r){this.from=e,this.to=t,this.number=i,this.text=r}get length(){return this.to-this.from}}function zl(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}let Tl="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,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,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(n=>n?parseInt(n,36):1);for(let n=1;nn)return Tl[e-1]<=n;return!1}function Em(n){return n>=127462&&n<=127487}const Mm=8205;function Pi(n,e,t=!0,i=!0){return(t?P$:UC)(n,e,i)}function P$(n,e,t){if(e==n.length)return e;e&&x$(n.charCodeAt(e))&&W$(n.charCodeAt(e-1))&&e--;let i=Qi(n,e);for(e+=Rn(i);e=0&&Em(Qi(n,l));)s++,l-=2;if(s%2==0)break;e+=2}else break}return e}function UC(n,e,t){for(;e>0;){let i=P$(n,e-2,t);if(i=56320&&n<57344}function W$(n){return n>=55296&&n<56320}function Qi(n,e){let t=n.charCodeAt(e);if(!W$(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return x$(i)?(t-55296<<10)+(i-56320)+65536:t}function Ed(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Rn(n){return n<65536?1:2}const XO=/\r\n?|\n/;var _i=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(_i||(_i={}));class Sr{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-r);s+=o}else{if(i!=_i.Simple&&c>=e&&(i==_i.TrackDel&&re||i==_i.TrackBefore&&re))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?s:s+a;s+=a}r=c}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let i=0,r=0;i=0&&r<=t&&o>=e)return rt?"cover":!0;r=o}return!1}toString(){let e="";for(let t=0;t=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Sr(e)}static create(e){return new Sr(e)}}class ui extends Sr{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return YO(this,(t,i,r,s,l)=>e=e.replace(r,r+(i-t),l),!1),e}mapDesc(e,t=!1){return UO(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let r=0,s=0;r=0){t[r]=o,t[r+1]=l;let a=r>>1;for(;i.length0&&gs(i,t,s.text),s.forward(h),o+=h}let c=e[l++];for(;o>1].toJSON()))}return e}static of(e,t,i){let r=[],s=[],l=0,o=null;function a(h=!1){if(!h&&!r.length)return;lp||O<0||p>t)throw new RangeError(`Invalid change range ${O} to ${p} (in doc of length ${t})`);let m=g?typeof g=="string"?St.of(g.split(i||XO)):g:St.empty,$=m.length;if(O==p&&$==0)return;Ol&&Zi(r,O-l,-1),Zi(r,p-O,$),gs(s,r,m),l=p}}return c(e),a(!o),o}static empty(e){return new ui(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let r=0;ro&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;i.length=0&&t<=0&&t==n[r+1]?n[r]+=e:e==0&&n[r]==0?n[r+1]+=t:i?(n[r]+=e,n[r+1]+=t):n.push(e,t)}function gs(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||l==n.sections.length||n.sections[l+1]<0);)o=n.sections[l++],a=n.sections[l++];e(r,c,s,h,O),r=c,s=h}}}function UO(n,e,t,i=!1){let r=[],s=i?[]:null,l=new na(n),o=new na(e);for(let a=-1;;)if(l.ins==-1&&o.ins==-1){let c=Math.min(l.len,o.len);Zi(r,c,-1),l.forward(c),o.forward(c)}else if(o.ins>=0&&(l.ins<0||a==l.i||l.off==0&&(o.len=0&&a=0){let c=0,h=l.len;for(;h;)if(o.ins==-1){let O=Math.min(h,o.len);c+=O,h-=O,o.forward(O)}else if(o.ins==0&&o.lena||l.ins>=0&&l.len>a)&&(o||i.length>c),s.forward2(a),l.forward(a)}}}}class na{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?St.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?St.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class js{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new js(i,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return te.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return te.range(this.anchor,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return te.range(e.anchor,e.head)}static create(e,t,i){return new js(e,t,i)}}class te{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:te.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;ie.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new te(e.ranges.map(t=>js.fromJSON(t)),e.main)}static single(e,t=e){return new te([te.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;re?8:0)|s)}static normalized(e,t=0){let i=e[t];e.sort((r,s)=>r.from-s.from),t=e.indexOf(i);for(let r=1;rs.head?te.range(a,o):te.range(o,a))}}return new te(e,t)}}function T$(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Md=0;class ye{constructor(e,t,i,r,s){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=r,this.id=Md++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new ye(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:zd),!!e.static,e.enables)}of(e){return new cc([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new cc(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new cc(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function zd(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class cc{constructor(e,t,i,r){this.dependencies=e,this.facet=t,this.type=i,this.value=r,this.id=Md++}dynamicSlot(e){var t;let i=this.value,r=this.facet.compareInput,s=this.id,l=e[s]>>1,o=this.type==2,a=!1,c=!1,h=[];for(let O of this.dependencies)O=="doc"?a=!0:O=="selection"?c=!0:((t=e[O.id])!==null&&t!==void 0?t:1)&1||h.push(e[O.id]);return{create(O){return O.values[l]=i(O),1},update(O,p){if(a&&p.docChanged||c&&(p.docChanged||p.selection)||EO(O,h)){let g=i(O);if(o?!zm(g,O.values[l],r):!r(g,O.values[l]))return O.values[l]=g,1}return 0},reconfigure:(O,p)=>{let g,m=p.config.address[s];if(m!=null){let $=Qc(p,m);if(this.dependencies.every(y=>y instanceof ye?p.facet(y)===O.facet(y):y instanceof pi?p.field(y,!1)==O.field(y,!1):!0)||(o?zm(g=i(O),$,r):r(g=i(O),$)))return O.values[l]=$,0}else g=i(O);return O.values[l]=g,1}}}}function zm(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),r=t.map(a=>a.type),s=i.filter(a=>!(a&1)),l=n[e.id]>>1;function o(a){let c=[];for(let h=0;hi===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Dm).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,r)=>{let s=i.values[t],l=this.updateF(s,r);return this.compareF(s,l)?0:(i.values[t]=l,1)},reconfigure:(i,r)=>r.config.address[this.id]!=null?(i.values[t]=r.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,Dm.of({field:this,create:e})]}get extension(){return this}}const Ls={lowest:4,low:3,default:2,high:1,highest:0};function To(n){return e=>new Z$(e,n)}const il={highest:To(Ls.highest),high:To(Ls.high),default:To(Ls.default),low:To(Ls.low),lowest:To(Ls.lowest)};class Z${constructor(e,t){this.inner=e,this.prec=t}}class Fl{of(e){return new MO(this,e)}reconfigure(e){return Fl.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class MO{constructor(e,t){this.compartment=e,this.inner=t}}class wc{constructor(e,t,i,r,s,l){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=l,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let r=[],s=Object.create(null),l=new Map;for(let p of MC(e,t,l))p instanceof pi?r.push(p):(s[p.facet.id]||(s[p.facet.id]=[])).push(p);let o=Object.create(null),a=[],c=[];for(let p of r)o[p.id]=c.length<<1,c.push(g=>p.slot(g));let h=i==null?void 0:i.config.facets;for(let p in s){let g=s[p],m=g[0].facet,$=h&&h[p]||[];if(g.every(y=>y.type==0))if(o[m.id]=a.length<<1|1,zd($,g))a.push(i.facet(m));else{let y=m.combine(g.map(k=>k.value));a.push(i&&m.compare(y,i.facet(m))?i.facet(m):y)}else{for(let y of g)y.type==0?(o[y.id]=a.length<<1|1,a.push(y.value)):(o[y.id]=c.length<<1,c.push(k=>y.dynamicSlot(k)));o[m.id]=c.length<<1,c.push(y=>EC(y,m,g))}}let O=c.map(p=>p(o));return new wc(e,l,O,o,a,s)}}function MC(n,e,t){let i=[[],[],[],[],[]],r=new Map;function s(l,o){let a=r.get(l);if(a!=null){if(a<=o)return;let c=i[a].indexOf(l);c>-1&&i[a].splice(c,1),l instanceof MO&&t.delete(l.compartment)}if(r.set(l,o),Array.isArray(l))for(let c of l)s(c,o);else if(l instanceof MO){if(t.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(l.compartment)||l.inner;t.set(l.compartment,c),s(c,o)}else if(l instanceof Z$)s(l.inner,l.prec);else if(l instanceof pi)i[o].push(l),l.provides&&s(l.provides,o);else if(l instanceof cc)i[o].push(l),l.facet.extensions&&s(l.facet.extensions,Ls.default);else{let c=l.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,o)}}return s(n,Ls.default),i.reduce((l,o)=>l.concat(o))}function Ho(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let r=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|r}function Qc(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const R$=ye.define(),zO=ye.define({combine:n=>n.some(e=>e),static:!0}),A$=ye.define({combine:n=>n.length?n[0]:void 0,static:!0}),X$=ye.define(),Y$=ye.define(),U$=ye.define(),E$=ye.define({combine:n=>n.length?n[0]:!1});class Ir{constructor(e,t){this.type=e,this.value=t}static define(){return new zC}}class zC{of(e){return new Ir(this,e)}}class DC{constructor(e){this.map=e}of(e){return new Ie(this,e)}}class Ie{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Ie(this.type,t)}is(e){return this.type==e}static define(e={}){return new DC(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(t);s&&i.push(s)}return i}}Ie.reconfigure=Ie.define();Ie.appendConfig=Ie.define();class hi{constructor(e,t,i,r,s,l){this.startState=e,this.changes=t,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=l,this._doc=null,this._state=null,i&&T$(i,t.newLength),s.some(o=>o.type==hi.time)||(this.annotations=s.concat(hi.time.of(Date.now())))}static create(e,t,i,r,s,l){return new hi(e,t,i,r,s,l)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(hi.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}hi.time=Ir.define();hi.userEvent=Ir.define();hi.addToHistory=Ir.define();hi.remote=Ir.define();function VC(n,e){let t=[];for(let i=0,r=0;;){let s,l;if(i=n[i]))s=n[i++],l=n[i++];else if(r=0;r--){let s=i[r](n);s instanceof hi?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof hi?n=s[0]:n=z$(e,Zl(s),!1)}return n}function LC(n){let e=n.startState,t=e.facet(U$),i=n;for(let r=t.length-1;r>=0;r--){let s=t[r](n);s&&Object.keys(s).length&&(i=M$(i,DO(e,s,n.changes.newLength),!0))}return i==n?n:hi.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const IC=[];function Zl(n){return n==null?IC:Array.isArray(n)?n:[n]}var It=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(It||(It={}));const NC=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let VO;try{VO=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function BC(n){if(VO)return VO.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||NC.test(t)))return!0}return!1}function jC(n){return e=>{if(!/\S/.test(e))return It.Space;if(BC(e))return It.Word;for(let t=0;t-1)return It.Word;return It.Other}}class Ot{constructor(e,t,i,r,s,l){this.config=e,this.doc=t,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,l&&(l._state=this);for(let o=0;or.set(c,a)),t=null),r.set(o.value.compartment,o.value.extension)):o.is(Ie.reconfigure)?(t=null,i=o.value):o.is(Ie.appendConfig)&&(t=null,i=Zl(i).concat(o.value));let s;t?s=e.startState.values.slice():(t=wc.resolve(i,r,this),s=new Ot(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let l=e.startState.facet(zO)?e.newSelection:e.newSelection.asSingle();new Ot(t,e.newDoc,l,s,(o,a)=>a.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:te.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),r=this.changes(i.changes),s=[i.range],l=Zl(i.effects);for(let o=1;ol.spec.fromJSON(o,a)))}}return Ot.create({doc:e.doc,selection:te.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=wc.resolve(e.extensions||[],new Map),i=e.doc instanceof St?e.doc:St.of((e.doc||"").split(t.staticFacet(Ot.lineSeparator)||XO)),r=e.selection?e.selection instanceof te?e.selection:te.single(e.selection.anchor,e.selection.head):te.single(0);return T$(r,i.length),t.staticFacet(zO)||(r=r.asSingle()),new Ot(t,i,r,t.dynamicSlots.map(()=>null),(s,l)=>l.create(s),null)}get tabSize(){return this.facet(Ot.tabSize)}get lineBreak(){return this.facet(Ot.lineSeparator)||` -`}get readOnly(){return this.facet(E$)}phrase(e,...t){for(let i of this.facet(Ot.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?i:t[s-1]})),e}languageDataAt(e,t,i=-1){let r=[];for(let s of this.facet(R$))for(let l of s(this,t,i))Object.prototype.hasOwnProperty.call(l,e)&&r.push(l[e]);return r}charCategorizer(e){return jC(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),l=e-i,o=e-i;for(;l>0;){let a=Pi(t,l,!1);if(s(t.slice(a,l))!=It.Word)break;l=a}for(;on.length?n[0]:4});Ot.lineSeparator=A$;Ot.readOnly=E$;Ot.phrases=ye.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(r=>n[r]==e[r])}});Ot.languageData=R$;Ot.changeFilter=X$;Ot.transactionFilter=Y$;Ot.transactionExtender=U$;Fl.reconfigure=Ie.define();function yr(n,e,t={}){let i={};for(let r of n)for(let s of Object.keys(r)){let l=r[s],o=i[s];if(o===void 0)i[s]=l;else if(!(o===l||l===void 0))if(Object.hasOwnProperty.call(t,s))i[s]=t[s](o,l);else throw new Error("Config merge conflict for field "+s)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}class Hs{eq(e){return this==e}range(e,t=e){return qO.create(e,t,this)}}Hs.prototype.startSide=Hs.prototype.endSide=0;Hs.prototype.point=!1;Hs.prototype.mapMode=_i.TrackDel;let qO=class D${constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new D$(e,t,i)}};function LO(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Dd{constructor(e,t,i,r){this.from=e,this.to=t,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,r=0){let s=i?this.to:this.from;for(let l=r,o=s.length;;){if(l==o)return l;let a=l+o>>1,c=s[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==l)return c>=0?l:o;c>=0?o=a:l=a+1}}between(e,t,i,r){for(let s=this.findIndex(t,-1e9,!0),l=this.findIndex(i,1e9,!1,s);sg||p==g&&c.startSide>0&&c.endSide<=0)continue;(g-p||c.endSide-c.startSide)<0||(l<0&&(l=p),c.point&&(o=Math.max(o,g-p)),i.push(c),r.push(p-l),s.push(g-l))}return{mapped:i.length?new Dd(r,s,i,o):null,pos:l}}}class mt{constructor(e,t,i,r){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=r}static create(e,t,i,r){return new mt(e,t,i,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=e,l=e.filter;if(t.length==0&&!l)return this;if(i&&(t=t.slice().sort(LO)),this.isEmpty)return t.length?mt.of(t):this;let o=new V$(this,null,-1).goto(0),a=0,c=[],h=new vs;for(;o.value||a=0){let O=t[a++];h.addInner(O.from,O.to,O.value)||c.push(O)}else o.rangeIndex==1&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||so.to||s=s&&e<=s+l.length&&l.between(s,e-s,t-s,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return ra.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return ra.from(e).goto(t)}static compare(e,t,i,r,s=-1){let l=e.filter(O=>O.maxPoint>0||!O.isEmpty&&O.maxPoint>=s),o=t.filter(O=>O.maxPoint>0||!O.isEmpty&&O.maxPoint>=s),a=Vm(l,o,i),c=new Zo(l,a,s),h=new Zo(o,a,s);i.iterGaps((O,p,g)=>qm(c,O,h,p,g,r)),i.empty&&i.length==0&&qm(c,0,h,0,0,r)}static eq(e,t,i=0,r){r==null&&(r=999999999);let s=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0),l=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(s.length!=l.length)return!1;if(!s.length)return!0;let o=Vm(s,l),a=new Zo(s,o,0).goto(i),c=new Zo(l,o,0).goto(i);for(;;){if(a.to!=c.to||!IO(a.active,c.active)||a.point&&(!c.point||!a.point.eq(c.point)))return!1;if(a.to>r)return!0;a.next(),c.next()}}static spans(e,t,i,r,s=-1){let l=new Zo(e,null,s).goto(t),o=t,a=l.openStart;for(;;){let c=Math.min(l.to,i);if(l.point){let h=l.activeForPoint(l.to),O=l.pointFromo&&(r.span(o,c,l.active,a),a=l.openEnd(c));if(l.to>i)return a+(l.point&&l.to>i?1:0);o=l.to,l.next()}}static of(e,t=!1){let i=new vs;for(let r of e instanceof qO?[e]:t?FC(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return mt.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=mt.empty;r=r.nextLayer)t=new mt(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}mt.empty=new mt([],[],null,-1);function FC(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(LO);e=i}return n}mt.empty.nextLayer=mt.empty;class vs{finishChunk(e){this.chunks.push(new Dd(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new vs)).add(e,t,i)}addInner(e,t,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(mt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=mt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Vm(n,e,t){let i=new Map;for(let s of n)for(let l=0;l=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&r.push(new V$(l,t,i,s));return r.length==1?r[0]:new ra(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)Gh(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)Gh(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Gh(this.heap,0)}}}function Gh(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let r=n[i];if(i+1=0&&(r=n[i+1],i++),t.compare(r)<0)break;n[i]=t,n[e]=r,e=i}}class Zo{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=ra.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Yf(this.active,e),Yf(this.activeTo,e),Yf(this.activeRank,e),this.minActive=Lm(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:r,rank:s}=this.cursor;for(;t0;)t++;Uf(this.active,t,i),Uf(this.activeTo,t,r),Uf(this.activeRank,t,s),e&&Uf(e,t,this.cursor.from),this.minActive=Lm(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&Yf(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[r]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function qm(n,e,t,i,r,s){n.goto(e),t.goto(i);let l=i+r,o=i,a=i-e;for(;;){let c=n.to+a-t.to||n.endSide-t.endSide,h=c<0?n.to+a:t.to,O=Math.min(h,l);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&IO(n.activeForPoint(n.to),t.activeForPoint(t.to))||s.comparePoint(o,O,n.point,t.point):O>o&&!IO(n.active,t.active)&&s.compareRange(o,O,n.active,t.active),h>l)break;o=h,c<=0&&n.next(),c>=0&&t.next()}}function IO(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function Lm(n,e){let t=-1,i=1e9;for(let r=0;r=e)return r;if(r==n.length)break;s+=n.charCodeAt(r)==9?t-s%t:1,r=Pi(n,r)}return i===!0?-1:n.length}const BO="ͼ",Im=typeof Symbol>"u"?"__"+BO:Symbol.for(BO),jO=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Nm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ws{constructor(e,t){this.rules=[];let{finish:i}=t||{};function r(l){return/^@/.test(l)?[l]:l.split(/,\s*/)}function s(l,o,a,c){let h=[],O=/^@(\w+)\b/.exec(l[0]),p=O&&O[1]=="keyframes";if(O&&o==null)return a.push(l[0]+";");for(let g in o){let m=o[g];if(/&/.test(g))s(g.split(/,\s*/).map($=>l.map(y=>$.replace(/&/,y))).reduce(($,y)=>$.concat(y)),m,a);else if(m&&typeof m=="object"){if(!O)throw new RangeError("The value of a property ("+g+") should be a primitive value.");s(r(g),m,h,p)}else m!=null&&h.push(g.replace(/_.*/,"").replace(/[A-Z]/g,$=>"-"+$.toLowerCase())+": "+m+";")}(h.length||p)&&a.push((i&&!O&&!c?l.map(i):l).join(", ")+" {"+h.join(" ")+"}")}for(let l in e)s(r(l),e[l],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let e=Nm[Im]||1;return Nm[Im]=e+1,BO+e.toString(36)}static mount(e,t,i){let r=e[jO],s=i&&i.nonce;r?s&&r.setNonce(s):r=new GC(e,s),r.mount(Array.isArray(t)?t:[t])}}let Bm=new Map;class GC{constructor(e,t){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=Bm.get(i);if(s)return e.adoptedStyleSheets=[s.sheet,...e.adoptedStyleSheets],e[jO]=s;this.sheet=new r.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],Bm.set(i,this)}else{this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let s=e.head||e;s.insertBefore(this.styleTag,s.firstChild)}this.modules=[],e[jO]=this}mount(e){let t=this.sheet,i=0,r=0;for(let s=0;s-1&&(this.modules.splice(o,1),r--,o=-1),o==-1){if(this.modules.splice(r++,0,l),t)for(let a=0;a",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},HC=typeof navigator<"u"&&/Mac/.test(navigator.platform),KC=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ki=0;ki<10;ki++)Qs[48+ki]=Qs[96+ki]=String(ki);for(var ki=1;ki<=24;ki++)Qs[ki+111]="F"+ki;for(var ki=65;ki<=90;ki++)Qs[ki]=String.fromCharCode(ki+32),sa[ki]=String.fromCharCode(ki);for(var Hh in Qs)sa.hasOwnProperty(Hh)||(sa[Hh]=Qs[Hh]);function JC(n){var e=HC&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||KC&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?sa:Qs)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function la(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function FO(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function uc(n,e){if(!e.anchorNode)return!1;try{return FO(n,e.anchorNode)}catch{return!1}}function oa(n){return n.nodeType==3?Js(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Ko(n,e,t,i){return t?jm(n,e,t,i,-1)||jm(n,e,t,i,1):!1}function Ks(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function kc(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function jm(n,e,t,i,r){for(;;){if(n==t&&e==i)return!0;if(e==(r<0?0:$r(n))){if(n.nodeName=="DIV")return!1;let s=n.parentNode;if(!s||s.nodeType!=1)return!1;e=Ks(n)+(r<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(r<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=r<0?$r(n):0}else return!1}}function $r(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function lu(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function e4(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function q$(n,e){let t=e.width/n.offsetWidth,i=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-n.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function t4(n,e,t,i,r,s,l,o){let a=n.ownerDocument,c=a.defaultView||window;for(let h=n,O=!1;h&&!O;)if(h.nodeType==1){let p,g=h==a.body,m=1,$=1;if(g)p=e4(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(O=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let W=h.getBoundingClientRect();({scaleX:m,scaleY:$}=q$(h,W)),p={left:W.left,right:W.left+h.clientWidth*m,top:W.top,bottom:W.top+h.clientHeight*$}}let y=0,k=0;if(r=="nearest")e.top0&&e.bottom>p.bottom+k&&(k=e.bottom-p.bottom+k+l)):e.bottom>p.bottom&&(k=e.bottom-p.bottom+l,t<0&&e.top-k0&&e.right>p.right+y&&(y=e.right-p.right+y+s)):e.right>p.right&&(y=e.right-p.right+s,t<0&&e.leftr.clientHeight&&(i=r),!t&&r.scrollWidth>r.clientWidth&&(t=r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;return{x:t,y:i}}class n4{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?$r(t):0),i,Math.min(e.focusOffset,i?$r(i):0))}set(e,t,i,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=r}}let $l=null;function L$(n){if(n.setActive)return n.setActive();if($l)return n.focus($l);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus($l==null?{get preventScroll(){return $l={preventScroll:!0},!0}}:void 0),!$l){$l=!1;for(let t=0;tMath.max(1,n.scrollHeight-n.clientHeight-4)}function B$(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i>0)return{node:t,offset:i};if(t.nodeType==1&&i>0){if(t.contentEditable=="false")return null;t=t.childNodes[i-1],i=$r(t)}else if(t.parentNode&&!kc(t))i=Ks(t),t=t.parentNode;else return null}}function j$(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&it)return O.domBoundsAround(e,t,c);if(p>=e&&r==-1&&(r=a,s=c),c>t&&O.dom.parentNode==this.dom){l=a,o=h;break}h=p,c=p+O.breakAfter}return{from:s,to:o<0?i+this.length:o,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:l=0?this.children[l].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=Vd){this.markDirty();for(let r=e;rthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function G$(n,e,t,i,r,s,l,o,a){let{children:c}=n,h=c.length?c[e]:null,O=s.length?s[s.length-1]:null,p=O?O.breakAfter:l;if(!(e==i&&h&&!l&&!p&&s.length<2&&h.merge(t,r,s.length?O:null,t==0,o,a))){if(i0&&(!l&&s.length&&h.merge(t,h.length,s[0],!1,o,0)?h.breakAfter=s.shift().breakAfter:(t2);var Qe={mac:Jm||/Mac/.test(Ki.platform),windows:/Win/.test(Ki.platform),linux:/Linux|X11/.test(Ki.platform),ie:ou,ie_version:K$?GO.documentMode||6:KO?+KO[1]:HO?+HO[1]:0,gecko:Hm,gecko_version:Hm?+(/Firefox\/(\d+)/.exec(Ki.userAgent)||[0,0])[1]:0,chrome:!!Kh,chrome_version:Kh?+Kh[1]:0,ios:Jm,android:/Android\b/.test(Ki.userAgent),webkit:Km,safari:J$,webkit_version:Km?+(/\bAppleWebKit\/(\d+)/.exec(Ki.userAgent)||[0,0])[1]:0,tabSize:GO.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const l4=256;class Jn extends Xt{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return this.flags&8||i&&(!(i instanceof Jn)||this.length-(t-e)+i.length>l4||i.flags&8)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Jn(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Ui(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return o4(this.dom,e,t)}}class qr extends Xt{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let r of t)r.setParent(this)}setAttrs(e){if(I$(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,r,s,l){return i&&(!(i instanceof qr&&i.mark.eq(this.mark))||e&&s<=0||te&&t.push(i=e&&(r=s),i=a,s++}let l=this.length-e;return this.length=e,r>-1&&(this.children.length=r,this.markDirty()),new qr(this.mark,t,l)}domAtPos(e){return ey(this,e)}coordsAt(e,t){return iy(this,e,t)}}function o4(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let r=e,s=e,l=0;e==0&&t<0||e==i&&t>=0?Qe.chrome||Qe.gecko||(e?(r--,l=1):s=0)?0:o.length-1];return Qe.safari&&!l&&a.width==0&&(a=Array.prototype.find.call(o,c=>c.width)||a),l?lu(a,l<0):a||null}class ms extends Xt{static create(e,t,i){return new ms(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=ms.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,i,r,s,l){return i&&(!(i instanceof ms)||!this.widget.compare(i.widget)||e>0&&s<=0||t0)?Ui.before(this.dom):Ui.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let r=this.dom.getClientRects(),s=null;if(!r.length)return null;let l=this.side?this.side<0:e>0;for(let o=l?r.length-1:0;s=r[o],!(e>0?o==0:o==r.length-1||s.top0?Ui.before(this.dom):Ui.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return St.empty}get isHidden(){return!0}}Jn.prototype.children=ms.prototype.children=Dl.prototype.children=Vd;function ey(n,e){let t=n.dom,{children:i}=n,r=0;for(let s=0;rs&&e0;s--){let l=i[s-1];if(l.dom.parentNode==t)return l.domAtPos(l.length)}for(let s=r;s0&&e instanceof qr&&r.length&&(i=r[r.length-1])instanceof qr&&i.mark.eq(e.mark)?ty(i,e.children[0],t-1):(r.push(e),e.setParent(n)),n.length+=e.length}function iy(n,e,t){let i=null,r=-1,s=null,l=-1;function o(c,h){for(let O=0,p=0;O=h&&(g.children.length?o(g,h-p):(!s||s.isHidden&&t>0)&&(m>h||p==m&&g.getSide()>0)?(s=g,l=h-p):(p-1?1:0)!=r.length-(t&&r.indexOf(t)>-1?1:0))return!1;for(let s of i)if(s!=t&&(r.indexOf(s)==-1||n[s]!==e[s]))return!1;return!0}function ed(n,e,t){let i=!1;if(e)for(let r in e)t&&r in t||(i=!0,r=="style"?n.style.cssText="":n.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(i=!0,r=="style"?n.style.cssText=t[r]:n.setAttribute(r,t[r]));return i}function f4(n){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new ks(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:l}=ny(e,t);i=(s?t?-3e8:-1:5e8)-1,r=(l?t?2e8:1:-6e8)+1}return new ks(e,i,r,t,e.widget||null,!0)}static line(e){return new ya(e)}static set(e,t=!1){return mt.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ze.none=mt.empty;class $a extends Ze{constructor(e){let{start:t,end:i}=ny(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,i;return this==e||e instanceof $a&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((i=e.attrs)===null||i===void 0?void 0:i.class))&&_c(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}$a.prototype.point=!1;class ya extends Ze{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ya&&this.spec.class==e.spec.class&&_c(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}ya.prototype.mapMode=_i.TrackBefore;ya.prototype.point=!0;class ks extends Ze{constructor(e,t,i,r,s,l){super(t,i,s,e),this.block=r,this.isReplace=l,this.mapMode=r?t<=0?_i.TrackBefore:_i.TrackAfter:_i.TrackDel}get type(){return this.startSide!=this.endSide?Li.WidgetRange:this.startSide<=0?Li.WidgetBefore:Li.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof ks&&c4(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}ks.prototype.point=!0;function ny(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function c4(n,e){return n==e||!!(n&&e&&n.compare(e))}function td(n,e,t,i=0){let r=t.length-1;r>=0&&t[r]+i>=n?t[r]=Math.max(t[r],e):t.push(n,e)}class si extends Xt{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,r,s,l){if(i){if(!(i instanceof si))return!1;this.dom||i.transferDOM(this)}return r&&this.setDeco(i?i.attrs:null),H$(this,e,t,i?i.children.slice():[],s,l),!0}split(e){let t=new si;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i,off:r}=this.childPos(e);r&&(t.append(this.children[i].split(r),0),this.children[i].merge(r,this.children[i].length,null,!1,0,0),i++);for(let s=i;s0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){_c(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){ty(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=JO(t,this.attrs||{})),i&&(this.attrs=JO({class:i},this.attrs||{}))}domAtPos(e){return ey(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(I$(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),this.prevAttrs!==void 0&&(ed(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let r=this.dom.lastChild;for(;r&&Xt.get(r)instanceof qr;)r=r.lastChild;if(!r||!this.length||r.nodeName!="BR"&&((i=Xt.get(r))===null||i===void 0?void 0:i.isEditable)==!1&&(!Qe.ios||!this.children.some(s=>s instanceof Jn))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof Jn)||/[^ -~]/.test(i.text))return null;let r=oa(i.dom);if(r.length!=1)return null;e+=r[0].width,t=r[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=iy(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:r}=this.parent.view.viewState,s=i.bottom-i.top;if(Math.abs(s-r.lineHeight)<2&&r.textHeight=t){if(s instanceof si)return s;if(l>t)break}r=l+s.breakAfter}return null}}class Dr extends Xt{constructor(e,t,i){super(),this.widget=e,this.length=t,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,r,s,l){return i&&(!(i instanceof Dr)||!this.widget.compare(i.widget)||e>0&&s<=0||t0}}class id extends Nr{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class Jo{constructor(e,t,i,r){this.doc=e,this.pos=t,this.end=i,this.disallowBlockEffectsFor=r,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=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Dr&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new si),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Ef(new Dl(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Dr)&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:s,lineBreak:l,done:o}=this.cursor.next(this.skip);if(this.skip=0,o)throw new Error("Ran out of text content when drawing inline views");if(l){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,e--;continue}else this.text=s,this.textOff=0}let r=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(Ef(new Jn(this.text.slice(this.textOff,this.textOff+r)),t),i),this.atCursorPos=!0,this.textOff+=r,e-=r,i=0}}span(e,t,i,r){this.buildText(t-e,i,r),this.pos=t,this.openStart<0&&(this.openStart=r)}point(e,t,i,r,s,l){if(this.disallowBlockEffectsFor[l]&&i instanceof ks){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let o=t-e;if(i instanceof ks)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Dr(i.widget||Vl.block,o,i));else{let a=ms.create(i.widget||Vl.inline,o,o?0:i.startSide),c=this.atCursorPos&&!a.isEditable&&s<=r.length&&(e0),h=!a.isEditable&&(er.length||i.startSide<=0),O=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(r),c&&(O.append(Ef(new Dl(1),r),s),s=r.length+Math.max(0,s-r.length)),O.append(Ef(a,r),s),this.atCursorPos=h,this.pendingBuffer=h?er.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=r.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=s)}static build(e,t,i,r,s){let l=new Jo(e,t,i,s);return l.openEnd=mt.spans(r,t,i,l),l.openStart<0&&(l.openStart=l.openEnd),l.finish(l.openEnd),l}}function Ef(n,e){for(let t of e)n=new qr(t,[n],n.length);return n}class Vl extends Nr{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Vl.inline=new Vl("span");Vl.block=new Vl("div");var Bt=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(Bt||(Bt={}));const el=Bt.LTR,qd=Bt.RTL;function ry(n){let e=[];for(let t=0;t=t){if(o.level==i)return l;(s<0||(r!=0?r<0?o.fromt:e[s].level>o.level))&&(s=l)}}if(s<0)throw new RangeError("Index out of range");return s}}function ly(n,e){if(n.length!=e.length)return!1;for(let t=0;t=0;$-=3)if(ar[$+1]==-g){let y=ar[$+2],k=y&2?r:y&4?y&1?s:r:0;k&&(At[O]=At[ar[$]]=k),o=$;break}}else{if(ar.length==189)break;ar[o++]=O,ar[o++]=p,ar[o++]=a}else if((m=At[O])==2||m==1){let $=m==r;a=$?0:1;for(let y=o-3;y>=0;y-=3){let k=ar[y+2];if(k&2)break;if($)ar[y+2]|=2;else{if(k&4)break;ar[y+2]|=4}}}}}function g4(n,e,t,i){for(let r=0,s=i;r<=t.length;r++){let l=r?t[r-1].to:n,o=ra;)m==y&&(m=t[--$].from,y=$?t[$-1].to:n),At[--m]=g;a=h}else s=c,a++}}}function rd(n,e,t,i,r,s,l){let o=i%2?2:1;if(i%2==r%2)for(let a=e,c=0;aa&&l.push(new Ss(a,$.from,g));let y=$.direction==el!=!(g%2);sd(n,y?i+1:i,r,$.inner,$.from,$.to,l),a=$.to}m=$.to}else{if(m==t||(h?At[m]!=o:At[m]==o))break;m++}p?rd(n,a,m,i+1,r,p,l):ae;){let h=!0,O=!1;if(!c||a>s[c-1].to){let $=At[a-1];$!=o&&(h=!1,O=$==16)}let p=!h&&o==1?[]:null,g=h?i:i+1,m=a;e:for(;;)if(c&&m==s[c-1].to){if(O)break e;let $=s[--c];if(!h)for(let y=$.from,k=c;;){if(y==e)break e;if(k&&s[k-1].to==y)y=s[--k].from;else{if(At[y-1]==o)break e;break}}if(p)p.push($);else{$.toAt.length;)At[At.length]=256;let i=[],r=e==el?0:1;return sd(n,r,r,t,0,n.length,i),i}function oy(n){return[new Ss(0,n,0)]}let ay="";function S4(n,e,t,i,r){var s;let l=i.head-n.from,o=Ss.find(e,l,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),a=e[o],c=a.side(r,t);if(l==c){let p=o+=r?1:-1;if(p<0||p>=e.length)return null;a=e[o=p],l=a.side(!r,t),c=a.side(r,t)}let h=Pi(n.text,l,a.forward(r,t));(ha.to)&&(h=c),ay=n.text.slice(Math.min(l,h),Math.max(l,h));let O=o==(r?e.length-1:0)?null:e[o+(r?1:-1)];return O&&h==c&&O.level+(r?0:1)n.some(e=>e)}),gy=ye.define({combine:n=>n.some(e=>e)}),my=ye.define();class Al{constructor(e,t="nearest",i="nearest",r=5,s=5,l=!1){this.range=e,this.y=t,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=l}map(e){return e.empty?this:new Al(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Al(te.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Mf=Ie.define({map:(n,e)=>n.map(e)}),Sy=Ie.define();function en(n,e,t){let i=n.facet(hy);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const ds=ye.define({combine:n=>n.length?n[0]:!0});let $4=0;const Do=ye.define();class oi{constructor(e,t,i,r,s){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=r,this.extension=s(this)}static define(e,t){const{eventHandlers:i,eventObservers:r,provide:s,decorations:l}=t||{};return new oi($4++,e,i,r,o=>{let a=[Do.of(o)];return l&&a.push(aa.of(c=>{let h=c.plugin(o);return h?l(h):Ze.none})),s&&a.push(s(o)),a})}static fromClass(e,t){return oi.define(i=>new e(i),t)}}class Jh{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(en(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){en(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){en(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const by=ye.define(),Nd=ye.define(),aa=ye.define(),$y=ye.define(),Bd=ye.define(),yy=ye.define();function t1(n,e){let t=n.state.facet(yy);if(!t.length)return t;let i=t.map(s=>s instanceof Function?s(n):s),r=[];return mt.spans(i,e.from,e.to,{point(){},span(s,l,o,a){let c=s-e.from,h=l-e.from,O=r;for(let p=o.length-1;p>=0;p--,a--){let g=o[p].spec.bidiIsolate,m;if(g==null&&(g=b4(e.text,c,h)),a>0&&O.length&&(m=O[O.length-1]).to==c&&m.direction==g)m.to=h,O=m.inner;else{let $={from:c,to:h,direction:g,inner:[]};O.push($),O=$.inner}}}}),r}const vy=ye.define();function wy(n){let e=0,t=0,i=0,r=0;for(let s of n.state.facet(vy)){let l=s(n);l&&(l.left!=null&&(e=Math.max(e,l.left)),l.right!=null&&(t=Math.max(t,l.right)),l.top!=null&&(i=Math.max(i,l.top)),l.bottom!=null&&(r=Math.max(r,l.bottom)))}return{left:e,right:t,top:i,bottom:r}}const Vo=ye.define();class Yn{constructor(e,t,i,r){this.fromA=e,this.toA=t,this.fromB=i,this.toB=r}join(e){return new Yn(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>i.toA)){if(r.toAh)break;s+=2}if(!a)return i;new Yn(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),l=a.toA,o=a.toB}}}class Pc{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=ui.empty(this.startState.doc.length);for(let s of i)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,l,o,a)=>r.push(new Yn(s,l,o,a))),this.changedRanges=r}static create(e,t,i){return new Pc(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class i1 extends Xt{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Ze.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(e.contentDOM),this.children=[new si],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Yn(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:c,toA:h})=>hthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!P4(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?v4(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;i=new Yn(c,h,e.changes.mapPos(c,-1),e.changes.mapPos(h,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Qe.ie||Qe.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let l=this.decorations,o=this.updateDeco(),a=k4(l,o,e.changes);return i=Yn.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,i);let{observer:r}=this.view;r.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let l=Qe.chrome||Qe.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,l),this.flags&=-8,l&&(l.written||r.selectionRange.focusNode!=l.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(l=>l.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to=0?r[l]:null;if(!o)break;let{fromA:a,toA:c,fromB:h,toB:O}=o,p,g,m,$;if(i&&i.range.fromBh){let A=Jo.build(this.view.state.doc,h,i.range.fromB,this.decorations,this.dynamicDecorationMap),C=Jo.build(this.view.state.doc,i.range.toB,O,this.decorations,this.dynamicDecorationMap);g=A.breakAtStart,m=A.openStart,$=C.openEnd;let U=this.compositionView(i);C.breakAtStart?U.breakAfter=1:C.content.length&&U.merge(U.length,U.length,C.content[0],!1,C.openStart,0)&&(U.breakAfter=C.content[0].breakAfter,C.content.shift()),A.content.length&&U.merge(0,0,A.content[A.content.length-1],!0,0,A.openEnd)&&A.content.pop(),p=A.content.concat(U).concat(C.content)}else({content:p,breakAtStart:g,openStart:m,openEnd:$}=Jo.build(this.view.state.doc,h,O,this.decorations,this.dynamicDecorationMap));let{i:y,off:k}=s.findPos(c,1),{i:W,off:Z}=s.findPos(a,-1);G$(this,W,Z,y,k,p,g,m,$)}i&&this.fixCompositionDOM(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let i of t.effects)i.is(Sy)&&(this.editContextFormatting=i.value)}compositionView(e){let t=new Jn(e.text.nodeValue);t.flags|=8;for(let{deco:r}of e.marks)t=new qr(r,[t],t.length);let i=new si;return i.append(t,0),i}fixCompositionDOM(e){let t=(s,l)=>{l.flags|=8|(l.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(l);let o=Xt.get(s);o&&o!=l&&(o.dom=null),l.setDOM(s)},i=this.childPos(e.range.fromB,1),r=this.children[i.i];t(e.line,r);for(let s=e.marks.length-1;s>=-1;s--)i=r.childPos(i.off,1),r=r.children[i.i],t(s>=0?e.marks[s].node:e.text,r)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,r=i==this.dom,s=!r&&uc(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(r||t||s))return;let l=this.forceSelection;this.forceSelection=!1;let o=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(o.anchor)),c=o.empty?a:this.moveToLine(this.domAtPos(o.head));if(Qe.gecko&&o.empty&&!this.hasComposition&&y4(a)){let O=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(O,a.node.childNodes[a.offset]||null)),a=c=new Ui(O,0),l=!0}let h=this.view.observer.selectionRange;(l||!h.focusNode||(!Ko(a.node,a.offset,h.anchorNode,h.anchorOffset)||!Ko(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,o))&&(this.view.observer.ignore(()=>{Qe.android&&Qe.chrome&&this.dom.contains(h.focusNode)&&_4(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let O=la(this.view.root);if(O)if(o.empty){if(Qe.gecko){let p=w4(a.node,a.offset);if(p&&p!=3){let g=(p==1?B$:j$)(a.node,a.offset);g&&(a=new Ui(g.node,g.offset))}}O.collapse(a.node,a.offset),o.bidiLevel!=null&&O.caretBidiLevel!==void 0&&(O.caretBidiLevel=o.bidiLevel)}else if(O.extend){O.collapse(a.node,a.offset);try{O.extend(c.node,c.offset)}catch{}}else{let p=document.createRange();o.anchor>o.head&&([a,c]=[c,a]),p.setEnd(c.node,c.offset),p.setStart(a.node,a.offset),O.removeAllRanges(),O.addRange(p)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new Ui(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new Ui(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Ko(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=la(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let l=si.find(this,t.head);if(!l)return;let o=l.posAtStart;if(t.head==o||t.head==o+l.length)return;let a=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(t.head+t.assoc);i.collapse(h.node,h.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let O=e.observer.selectionRange;e.docView.posFromDOM(O.anchorNode,O.anchorOffset)!=t.from&&i.collapse(r,s)}moveToLine(e){let t=this.dom,i;if(e.node!=t)return e;for(let r=e.offset;!i&&r=0;r--){let s=Xt.get(t.childNodes[r]);s instanceof si&&(i=s.domAtPos(s.length))}return i?new Ui(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=Xt.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;t=0;l--){let o=this.children[l],a=s-o.breakAfter,c=a-o.length;if(ae||o.covers(1))&&(!i||o instanceof si&&!(i instanceof si&&t>=0)))i=o,r=c;else if(i&&c==e&&a==e&&o instanceof Dr&&Math.abs(t)<2){if(o.deco.startSide<0)break;l&&(i=null)}s=c}return i?i.coordsAt(e-r,t):null}coordsForChar(e){let{i:t,off:i}=this.childPos(e,1),r=this.children[t];if(!(r instanceof si))return null;for(;r.children.length;){let{i:o,off:a}=r.childPos(i,1);for(;;o++){if(o==r.children.length)return null;if((r=r.children[o]).length)break}i=a}if(!(r instanceof Jn))return null;let s=Pi(r.text,i);if(s==i)return null;let l=Js(r.dom,i,s).getClientRects();for(let o=0;oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,a=this.view.textDirection==Bt.LTR;for(let c=0,h=0;hr)break;if(c>=i){let g=O.dom.getBoundingClientRect();if(t.push(g.height),l){let m=O.dom.lastChild,$=m?oa(m):[];if($.length){let y=$[$.length-1],k=a?y.right-g.left:g.right-y.left;k>o&&(o=k,this.minWidth=s,this.minWidthFrom=c,this.minWidthTo=p)}}}c=p+O.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?Bt.RTL:Bt.LTR}measureTextSize(){for(let s of this.children)if(s instanceof si){let l=s.measureTextSize();if(l)return l}let e=document.createElement("div"),t,i,r;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=oa(e.firstChild)[0];t=e.getBoundingClientRect().height,i=s?s.width/27:7,r=s?s.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:r}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new F$(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],l=s?s.from-1:this.length;if(l>i){let o=(t.lineBlockAt(l).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(Ze.replace({widget:new id(o),block:!0,inclusive:!0,isBlockGap:!0}).range(i,l))}if(!s)break;i=s.to+1}return Ze.set(e)}updateDeco(){let e=1,t=this.view.state.facet(aa).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet($y).map((s,l)=>{let o=typeof s=="function";return o&&(i=!0),o?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=i,t.push(mt.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];et.anchor?-1:1),r;if(!i)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=wy(this.view),l={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:o,offsetHeight:a}=this.view.scrollDOM;t4(this.view.scrollDOM,l,t.head{ie.from&&(t=!0)}),t}function x4(n,e,t=1){let i=n.charCategorizer(e),r=n.doc.lineAt(e),s=e-r.from;if(r.length==0)return te.cursor(e);s==0?t=1:s==r.length&&(t=-1);let l=s,o=s;t<0?l=Pi(r.text,s,!1):o=Pi(r.text,s);let a=i(r.text.slice(l,o));for(;l>0;){let c=Pi(r.text,l,!1);if(i(r.text.slice(c,l))!=a)break;l=c}for(;on?e.left-n:Math.max(0,n-e.right)}function C4(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function eO(n,e){return n.tope.top+1}function n1(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function od(n,e,t){let i,r,s,l,o=!1,a,c,h,O;for(let m=n.firstChild;m;m=m.nextSibling){let $=oa(m);for(let y=0;y<$.length;y++){let k=$[y];r&&eO(r,k)&&(k=n1(r1(k,r.bottom),r.top));let W=W4(e,k),Z=C4(t,k);if(W==0&&Z==0)return m.nodeType==3?s1(m,e,t):od(m,e,t);if(!i||l>Z||l==Z&&s>W){i=m,r=k,s=W,l=Z;let A=Z?t0?y<$.length-1:y>0)}W==0?t>k.bottom&&(!h||h.bottomk.top)&&(c=m,O=k):h&&eO(h,k)?h=r1(h,k.bottom):O&&eO(O,k)&&(O=n1(O,k.top))}}if(h&&h.bottom>=t?(i=a,r=h):O&&O.top<=t&&(i=c,r=O),!i)return{node:n,offset:0};let p=Math.max(r.left,Math.min(r.right,e));if(i.nodeType==3)return s1(i,p,t);if(o&&i.contentEditable!="false")return od(i,p,t);let g=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(r.left+r.right)/2?1:0);return{node:n,offset:g}}function s1(n,e,t){let i=n.nodeValue.length,r=-1,s=1e9,l=0;for(let o=0;ot?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&O=(h.left+h.right)/2,g=p;if((Qe.chrome||Qe.gecko)&&Js(n,o).getBoundingClientRect().left==h.right&&(g=!p),O<=0)return{node:n,offset:o+(g?1:0)};r=o+(g?1:0),s=O}}}return{node:n,offset:r>-1?r:l>0?n.nodeValue.length:0}}function ky(n,e,t,i=-1){var r,s;let l=n.contentDOM.getBoundingClientRect(),o=l.top+n.viewState.paddingTop,a,{docHeight:c}=n.viewState,{x:h,y:O}=e,p=O-o;if(p<0)return 0;if(p>c)return n.state.doc.length;for(let A=n.viewState.heightOracle.textHeight/2,C=!1;a=n.elementAtHeight(p),a.type!=Li.Text;)for(;p=i>0?a.bottom+A:a.top-A,!(p>=0&&p<=c);){if(C)return t?null:0;C=!0,i=-i}O=o+p;let g=a.from;if(gn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:l1(n,l,a,h,O);let m=n.dom.ownerDocument,$=n.root.elementFromPoint?n.root:m,y=$.elementFromPoint(h,O);y&&!n.contentDOM.contains(y)&&(y=null),y||(h=Math.max(l.left+1,Math.min(l.right-1,h)),y=$.elementFromPoint(h,O),y&&!n.contentDOM.contains(y)&&(y=null));let k,W=-1;if(y&&((r=n.docView.nearest(y))===null||r===void 0?void 0:r.isEditable)!=!1){if(m.caretPositionFromPoint){let A=m.caretPositionFromPoint(h,O);A&&({offsetNode:k,offset:W}=A)}else if(m.caretRangeFromPoint){let A=m.caretRangeFromPoint(h,O);A&&({startContainer:k,startOffset:W}=A,(!n.contentDOM.contains(k)||Qe.safari&&T4(k,W,h)||Qe.chrome&&Z4(k,W,h))&&(k=void 0))}k&&(W=Math.min($r(k),W))}if(!k||!n.docView.dom.contains(k)){let A=si.find(n.docView,g);if(!A)return p>a.top+a.height/2?a.to:a.from;({node:k,offset:W}=od(A.dom,h,O))}let Z=n.docView.nearest(k);if(!Z)return null;if(Z.isWidget&&((s=Z.dom)===null||s===void 0?void 0:s.nodeType)==1){let A=Z.dom.getBoundingClientRect();return e.yn.defaultLineHeight*1.5){let o=n.viewState.heightOracle.textHeight,a=Math.floor((r-t.top-(n.defaultLineHeight-o)*.5)/o);s+=a*n.viewState.heightOracle.lineLength}let l=n.state.sliceDoc(t.from,t.to);return t.from+NO(l,s,n.state.tabSize)}function T4(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let r=n.nextSibling;r;r=r.nextSibling)if(r.nodeType!=1||r.nodeName!="BR")return!1;return Js(n,i-1,i).getBoundingClientRect().left>t}function Z4(n,e,t){if(e!=0)return!1;for(let r=n;;){let s=r.parentNode;if(!s||s.nodeType!=1||s.firstChild!=r)return!1;if(s.classList.contains("cm-line"))break;r=s}let i=n.nodeType==1?n.getBoundingClientRect():Js(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function ad(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==Li.Text))return i}return t}function R4(n,e,t,i){let r=ad(n,e.head),s=!i||r.type!=Li.Text||!(n.lineWrapping||r.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let l=n.dom.getBoundingClientRect(),o=n.textDirectionAt(r.from),a=n.posAtCoords({x:t==(o==Bt.LTR)?l.right-1:l.left+1,y:(s.top+s.bottom)/2});if(a!=null)return te.cursor(a,t?-1:1)}return te.cursor(t?r.to:r.from,t?-1:1)}function o1(n,e,t,i){let r=n.state.doc.lineAt(e.head),s=n.bidiSpans(r),l=n.textDirectionAt(r.from);for(let o=e,a=null;;){let c=S4(r,s,l,o,t),h=ay;if(!c){if(r.number==(t?n.state.doc.lines:1))return o;h=` -`,r=n.state.doc.line(r.number+(t?1:-1)),s=n.bidiSpans(r),c=n.visualLineSide(r,!t)}if(a){if(!a(h))return o}else{if(!i)return c;a=i(h)}o=c}}function A4(n,e,t){let i=n.state.charCategorizer(e),r=i(t);return s=>{let l=i(s);return r==It.Space&&(r=l),r==l}}function X4(n,e,t,i){let r=e.head,s=t?1:-1;if(r==(t?n.state.doc.length:0))return te.cursor(r,e.assoc);let l=e.goalColumn,o,a=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(r,e.assoc||-1),h=n.documentTop;if(c)l==null&&(l=c.left-a.left),o=s<0?c.top:c.bottom;else{let g=n.viewState.lineBlockAt(r);l==null&&(l=Math.min(a.right-a.left,n.defaultCharacterWidth*(r-g.from))),o=(s<0?g.top:g.bottom)+h}let O=a.left+l,p=i??n.viewState.heightOracle.textHeight>>1;for(let g=0;;g+=10){let m=o+(p+g)*s,$=ky(n,{x:O,y:m},!1,s);if(ma.bottom||(s<0?$r)){let y=n.docView.coordsForChar($),k=!y||m{if(e>s&&er(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:te.cursor(i,is)&&this.lineBreak(),r=l}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,l=1,o;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,i),l=this.lineSeparator.length):(o=r.exec(t))&&(s=o.index,l=o[0].length),this.append(t.slice(i,s<0?t.length:s)),s<0)break;if(this.lineBreak(),l>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=l-1);i=s+l}}readNode(e){if(e.cmIgnore)return;let t=Xt.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(U4(e,i.node,i.offset)?t:0))}}function U4(n,e,t){for(;;){if(!e||t<$r(e))return!1;if(e==n)return!0;t=Ks(e)+1,e=e.parentNode}}class a1{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class E4{constructor(e,t,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:l}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let o=s||l?[]:D4(e),a=new Y4(o,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=V4(o,this.bounds.from)}else{let o=e.observer.selectionRange,a=s&&s.node==o.focusNode&&s.offset==o.focusOffset||!FO(e.contentDOM,o.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(o.focusNode,o.focusOffset),c=l&&l.node==o.anchorNode&&l.offset==o.anchorOffset||!FO(e.contentDOM,o.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(o.anchorNode,o.anchorOffset),h=e.viewport;if((Qe.ios||Qe.chrome)&&e.state.selection.main.empty&&a!=c&&(h.from>0||h.toDate.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:o}=e.bounds,a=r.from,c=null;(s===8||Qe.android&&e.text.length=r.from&&t.to<=r.to&&(t.from!=r.from||t.to!=r.to)&&r.to-r.from-(t.to-t.from)<=4?t={from:r.from,to:r.to,insert:n.state.doc.slice(r.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,r.to))}:(Qe.mac||Qe.android)&&t&&t.from==t.to&&t.from==r.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=te.single(i.main.anchor-1,i.main.head-1)),t={from:r.from,to:r.to,insert:St.of([" "])}):Qe.chrome&&t&&t.from==t.to&&t.from==r.head&&t.insert.toString()==` - `&&n.lineWrapping&&(i&&(i=te.single(i.main.anchor-1,i.main.head-1)),t={from:r.from,to:r.to,insert:St.of([" "])}),t)return jd(n,t,i,s);if(i&&!i.main.eq(r)){let l=!1,o="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(l=!0),o=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:l,userEvent:o}),!0}else return!1}function jd(n,e,t,i=-1){if(Qe.ios&&n.inputState.flushIOSKey(e))return!0;let r=n.state.selection.main;if(Qe.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&n.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Rl(n.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.lengthr.head)&&Rl(n.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Rl(n.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let l,o=()=>l||(l=M4(n,e,t));return n.state.facet(Oy).some(a=>a(n,e.from,e.to,s,o))||n.dispatch(o()),!0}function M4(n,e,t){let i,r=n.state,s=r.selection.main;if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let o=s.frome.to?r.sliceDoc(e.to,s.to):"";i=r.replaceSelection(n.state.toText(o+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let o=r.changes(e),a=t&&t.main.to<=o.newLength?t.main:void 0;if(r.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let c=n.state.sliceDoc(e.from,e.to),h,O=t&&Qy(n,t.main.head);if(O){let m=e.insert.length-(e.to-e.from);h={from:O.from,to:O.to-m}}else h=n.state.doc.lineAt(s.head);let p=s.to-e.to,g=s.to-s.from;i=r.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:o,range:a||m.map(o)};let $=m.to-p,y=$-c.length;if(m.to-m.from!=g||n.state.sliceDoc(y,$)!=c||m.to>=h.from&&m.from<=h.to)return{range:m};let k=r.changes({from:y,to:$,insert:e.insert}),W=m.to-s.to;return{changes:k,range:a?te.range(Math.max(0,a.anchor+W),Math.max(0,a.head+W)):m.map(k)}})}else i={changes:o,selection:a&&r.selection.replaceRange(a)}}let l="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,l+=".compose",n.inputState.compositionFirstChange&&(l+=".start",n.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function z4(n,e,t,i){let r=Math.min(n.length,e.length),s=0;for(;s0&&o>0&&n.charCodeAt(l-1)==e.charCodeAt(o-1);)l--,o--;if(i=="end"){let a=Math.max(0,s-Math.min(l,o));t-=l+a-s}if(l=l?s-t:0;s-=a,o=s+(o-l),l=s}else if(o=o?s-t:0;s-=a,l=s+(l-o),o=s}return{from:s,toA:l,toB:o}}function D4(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:s}=n.observer.selectionRange;return t&&(e.push(new a1(t,i)),(r!=t||s!=i)&&e.push(new a1(r,s))),e}function V4(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?te.single(t+e,i+e):null}class q4{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,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=e.hasFocus,Qe.safari&&e.contentDOM.addEventListener("input",()=>null),Qe.gecko&&s5(e.contentDOM.ownerDocument)}handleEvent(e){!H4(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,t);for(let r of i.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=L4(e),i=this.handlers,r=this.view.contentDOM;for(let s in t)if(s!="scroll"){let l=!t[s].handlers.length,o=i[s];o&&l!=!o.handlers.length&&(r.removeEventListener(s,this.handleEvent),o=null),o||r.addEventListener(s,this.handleEvent,{passive:l})}for(let s in i)s!="scroll"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&xy.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Qe.android&&Qe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Qe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=Py.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||I4.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from0?!0:Qe.safari&&!Qe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function f1(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(r){en(t.state,r)}}}function L4(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let r=i.spec;if(r&&r.domEventHandlers)for(let s in r.domEventHandlers){let l=r.domEventHandlers[s];l&&t(s).handlers.push(f1(i.value,l))}if(r&&r.domEventObservers)for(let s in r.domEventObservers){let l=r.domEventObservers[s];l&&t(s).observers.push(f1(i.value,l))}}for(let i in er)t(i).handlers.push(er[i]);for(let i in Un)t(i).observers.push(Un[i]);return e}const Py=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],I4="dthko",xy=[16,17,18,20,91,92,224,225],zf=6;function Df(n){return Math.max(0,n)*.7+8}function N4(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class B4{constructor(e,t,i,r){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=i4(e.contentDOM),this.atoms=e.state.facet(Bd).map(l=>l(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Ot.allowMultipleSelections)&&j4(e,t),this.dragging=G4(e,t)&&Ty(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&N4(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,r=0,s=0,l=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:l}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:o}=this.scrollParents.y.getBoundingClientRect());let a=wy(this.view);e.clientX-a.left<=r+zf?t=-Df(r-e.clientX):e.clientX+a.right>=l-zf&&(t=Df(e.clientX-l)),e.clientY-a.top<=s+zf?i=-Df(s-e.clientY):e.clientY+a.bottom>=o-zf&&(i=Df(e.clientY-o)),this.setScrollSpeed(t,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let i=0;it.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function j4(n,e){let t=n.state.facet(fy);return t.length?t[0](e):Qe.mac?e.metaKey:e.ctrlKey}function F4(n,e){let t=n.state.facet(cy);return t.length?t[0](e):Qe.mac?!e.altKey:!e.ctrlKey}function G4(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=la(n.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&l.top<=e.clientY&&l.bottom>=e.clientY)return!0}return!1}function H4(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=Xt.get(t))&&i.ignoreEvent(e))return!1;return!0}const er=Object.create(null),Un=Object.create(null),Wy=Qe.ie&&Qe.ie_version<15||Qe.ios&&Qe.webkit_version<604;function K4(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),Cy(n,t.value)},50)}function au(n,e,t){for(let i of n.facet(e))t=i(t,n);return t}function Cy(n,e){e=au(n.state,Ld,e);let{state:t}=n,i,r=1,s=t.toText(e),l=s.lines==t.selection.ranges.length;if(fd!=null&&t.selection.ranges.every(a=>a.empty)&&fd==s.toString()){let a=-1;i=t.changeByRange(c=>{let h=t.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let O=t.toText((l?s.line(r++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:O},range:te.cursor(c.from+O.length)}})}else l?i=t.changeByRange(a=>{let c=s.line(r++);return{changes:{from:a.from,to:a.to,insert:c.text},range:te.cursor(a.from+c.length)}}):i=t.replaceSelection(s);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Un.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};er.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);Un.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};Un.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};er.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(uy))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=t5(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new B4(n,e,t,i)),i&&n.observer.ignore(()=>{L$(n.contentDOM);let s=n.root.activeElement;s&&!s.contains(n.contentDOM)&&s.blur()});let r=n.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}return!1};function c1(n,e,t,i){if(i==1)return te.cursor(e,t);if(i==2)return x4(n.state,e,t);{let r=si.find(n.docView,e),s=n.state.doc.lineAt(r?r.posAtEnd:e),l=r?r.posAtStart:s.from,o=r?r.posAtEnd:s.to;return oe>=t.top&&e<=t.bottom&&n>=t.left&&n<=t.right;function J4(n,e,t,i){let r=si.find(n.docView,e);if(!r)return 1;let s=e-r.posAtStart;if(s==0)return 1;if(s==r.length)return-1;let l=r.coordsAt(s,-1);if(l&&u1(t,i,l))return-1;let o=r.coordsAt(s,1);return o&&u1(t,i,o)?1:l&&l.bottom>=i?-1:1}function h1(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:J4(n,t,e.clientX,e.clientY)}}const e5=Qe.ie&&Qe.ie_version<=11;let O1=null,d1=0,p1=0;function Ty(n){if(!e5)return n.detail;let e=O1,t=p1;return O1=n,p1=Date.now(),d1=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(d1+1)%3:1}function t5(n,e){let t=h1(n,e),i=Ty(e),r=n.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,l,o){let a=h1(n,s),c,h=c1(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!l){let O=c1(n,t.pos,t.bias,i),p=Math.min(O.from,h.from),g=Math.max(O.to,h.to);h=p1&&(c=i5(r,a.pos))?c:o?r.addRange(h):te.create([h])}}}function i5(n,e){for(let t=0;t=e)return te.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}er.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let r=n.docView.nearest(e.target);if(r&&r.isWidget){let s=r.posAtStart,l=s+r.length;(s>=t.to||l<=t.from)&&(t=te.range(s,l))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",au(n.state,Id,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};er.dragend=n=>(n.inputState.draggedContent=null,!1);function g1(n,e,t,i){if(t=au(n.state,Ld,t),!t)return;let r=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=n.inputState,l=i&&s&&F4(n,e)?{from:s.from,to:s.to}:null,o={from:r,insert:t},a=n.state.changes(l?[l,o]:o);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:l?"move.drop":"input.drop"}),n.inputState.draggedContent=null}er.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),r=0,s=()=>{++r==t.length&&g1(n,e,i.filter(l=>l!=null).join(n.state.lineBreak),!1)};for(let l=0;l{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(i[l]=o.result),s()},o.readAsText(t[l])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return g1(n,e,i,!0),!0}return!1};er.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=Wy?null:e.clipboardData;return t?(Cy(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(K4(n),!1)};function n5(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function r5(n){let e=[],t=[],i=!1;for(let r of n.selection.ranges)r.empty||(e.push(n.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of n.selection.ranges){let l=n.doc.lineAt(s);l.number>r&&(e.push(l.text),t.push({from:l.from,to:Math.min(n.doc.length,l.to+1)})),r=l.number}i=!0}return{text:au(n,Id,e.join(n.lineBreak)),ranges:t,linewise:i}}let fd=null;er.copy=er.cut=(n,e)=>{let{text:t,ranges:i,linewise:r}=r5(n.state);if(!t&&!r)return!1;fd=r?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=Wy?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(n5(n,t),!1)};const Zy=Ir.define();function Ry(n,e){let t=[];for(let i of n.facet(dy)){let r=i(n,e);r&&t.push(r)}return t?n.update({effects:t,annotations:Zy.of(!0)}):null}function Ay(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=Ry(n.state,e);t?n.dispatch(t):n.update([])}},10)}Un.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),Ay(n)};Un.blur=n=>{n.observer.clearSelectionRange(),Ay(n)};Un.compositionstart=Un.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};Un.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,Qe.chrome&&Qe.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};Un.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};er.beforeinput=(n,e)=>{var t,i;if(e.inputType=="insertReplacementText"&&n.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),l=e.getTargetRanges();if(s&&l.length){let o=l[0],a=n.posAtDOM(o.startContainer,o.startOffset),c=n.posAtDOM(o.endContainer,o.endOffset);return jd(n,{from:a,to:c,insert:n.state.toText(s)},null),!0}}let r;if(Qe.chrome&&Qe.android&&(r=Py.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var l;(((l=window.visualViewport)===null||l===void 0?void 0:l.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return Qe.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),Qe.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>Un.compositionend(n,e),20),!1};const m1=new Set;function s5(n){m1.has(n)||(m1.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const S1=["pre-wrap","normal","pre-line","break-spaces"];let ql=!1;function b1(){ql=!1}class l5{constructor(e){this.lineWrapping=e,this.doc=St.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return S1.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=i,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let c=0;c0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Oc&&(ql=!0),this.height=e)}replace(e,t,i){return Ii.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,r){let s=this,l=i.doc;for(let o=r.length-1;o>=0;o--){let{fromA:a,toA:c,fromB:h,toB:O}=r[o],p=s.lineAt(a,Dt.ByPosNoHeight,i.setDoc(t),0,0),g=p.to>=c?p:s.lineAt(c,Dt.ByPosNoHeight,i,0,0);for(O+=g.to-c,c=g.to;o>0&&p.from<=r[o-1].toA;)a=r[o-1].fromA,h=r[o-1].fromB,o--,as*2){let o=e[t-1];o.break?e.splice(--t,1,o.left,null,o.right):e.splice(--t,1,o.left,o.right),i+=1+o.break,r-=o.size}else if(s>r*2){let o=e[i];o.break?e.splice(i,1,o.left,null,o.right):e.splice(i,1,o.left,o.right),i+=2+o.break,s-=o.size}else break;else if(r=s&&l(this.blockAt(0,i,r,s))}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class dn extends Xy{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,r){return new dr(r,this.length,i,this.height,this.breaks)}replace(e,t,i){let r=i[0];return i.length==1&&(r instanceof dn||r instanceof wi&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof wi?r=new dn(r.length,this.height):r.height=this.height,this.outdated||(r.outdated=!1),r):Ii.of(i)}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more?this.setHeight(r.heights[r.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class wi extends Ii{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-i+1,l,o=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);l=a/s,this.length>s+1&&(o=(this.height-a)/(this.length-s-1))}else l=this.height/s;return{firstLine:i,lastLine:r,perLine:l,perChar:o}}blockAt(e,t,i,r){let{firstLine:s,lastLine:l,perLine:o,perChar:a}=this.heightMetrics(t,r);if(t.lineWrapping){let c=r+(e0){let s=i[i.length-1];s instanceof wi?i[i.length-1]=new wi(s.length+r):i.push(null,new wi(r-1))}if(e>0){let s=i[0];s instanceof wi?i[0]=new wi(e+s.length):i.unshift(new wi(e-1),null)}return Ii.of(i)}decomposeLeft(e,t){t.push(new wi(e-1),null)}decomposeRight(e,t){t.push(null,new wi(this.length-e-1))}updateHeight(e,t=0,i=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let l=[],o=Math.max(t,r.from),a=-1;for(r.from>t&&l.push(new wi(r.from-t-1).updateHeight(e,t));o<=s&&r.more;){let h=e.doc.lineAt(o).length;l.length&&l.push(null);let O=r.heights[r.index++];a==-1?a=O:Math.abs(O-a)>=Oc&&(a=-2);let p=new dn(h,O);p.outdated=!1,l.push(p),o+=h+1}o<=s&&l.push(null,new wi(s-o).updateHeight(e,o));let c=Ii.of(l);return(a<0||Math.abs(c.height-this.height)>=Oc||Math.abs(a-this.heightMetrics(e,t).perLine)>=Oc)&&(ql=!0),xc(this,c)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class a5 extends Ii{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,r){let s=i+this.left.height;return eo))return c;let h=t==Dt.ByPosNoHeight?Dt.ByPosNoHeight:Dt.ByPos;return a?c.join(this.right.lineAt(o,h,i,l,o)):this.left.lineAt(o,h,i,r,s).join(c)}forEachLine(e,t,i,r,s,l){let o=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,o,a,l);else{let c=this.lineAt(a,Dt.ByPos,i,r,s);e=e&&c.from<=t&&l(c),t>c.to&&this.right.forEachLine(c.to+1,t,i,o,a,l)}}replace(e,t,i){let r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,i));let s=[];e>0&&this.decomposeLeft(e,s);let l=s.length;for(let o of i)s.push(o);if(e>0&&$1(s,l-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?Ii.of(this.break?[e,null,t]:[e,t]):(this.left=xc(this.left,e),this.right=xc(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,r){let{left:s,right:l}=this,o=t+s.length+this.break,a=null;return r&&r.from<=t+s.length&&r.more?a=s=s.updateHeight(e,t,i,r):s.updateHeight(e,t,i),r&&r.from<=o+l.length&&r.more?a=l=l.updateHeight(e,o,i,r):l.updateHeight(e,o,i),a?this.balanced(s,l):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function $1(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof wi&&(i=n[e+1])instanceof wi&&n.splice(e-1,3,new wi(t.length+1+i.length))}const f5=5;class Fd{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof dn?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new dn(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=f5)&&this.addLineDeco(r,s,l)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new dn(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new wi(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof dn)return e;let t=new dn(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof dn)&&!this.isCovered?this.nodes.push(new dn(0,-1)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&O.overflow!="visible"){let p=h.getBoundingClientRect();s=Math.max(s,p.left),l=Math.min(l,p.right),o=Math.max(o,p.top),a=Math.min(c==n.parentNode?r.innerHeight:a,p.bottom)}c=O.position=="absolute"||O.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-t.left,right:Math.max(s,l)-t.left,top:o-(t.top+e),bottom:Math.max(o,a)-(t.top+e)}}function O5(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class iO{constructor(e,t,i,r){this.from=e,this.to=t,this.size=i,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new l5(t),this.stateDeco=e.facet(aa).filter(i=>typeof i!="function"),this.heightMap=Ii.empty().applyChanges(this.stateDeco,St.empty,this.heightOracle.setDoc(e.doc),[new Yn(0,0,0,e.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ze.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let r=i?t.head:t.anchor;if(!e.some(({from:s,to:l})=>r>=s&&r<=l)){let{from:s,to:l}=this.lineBlockAt(r);e.push(new Vf(s,l))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?v1:new Gd(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Lo(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(aa).filter(h=>typeof h!="function");let r=e.changedRanges,s=Yn.extendWithRanges(r,c5(i,this.stateDeco,e?e.changes:ui.empty(this.state.doc.length))),l=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);b1(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=l||ql)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(gy)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Bt.RTL:Bt.LTR;let l=this.heightOracle.mustRefreshForWrapping(s),o=t.getBoundingClientRect(),a=l||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,h=0;if(o.width&&o.height){let{scaleX:A,scaleY:C}=q$(t,o);(A>.005&&Math.abs(this.scaleX-A)>.005||C>.005&&Math.abs(this.scaleY-C)>.005)&&(this.scaleX=A,this.scaleY=C,c|=8,l=a=!0)}let O=(parseInt(i.paddingTop)||0)*this.scaleY,p=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=O||this.paddingBottom!=p)&&(this.paddingTop=O,this.paddingBottom=p,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let g=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=g&&(this.scrollAnchorHeight=-1,this.scrollTop=g),this.scrolledToBottom=N$(e.scrollDOM);let m=(this.printing?O5:h5)(t,this.paddingTop),$=m.top-this.pixelViewport.top,y=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let k=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(k!=this.inView&&(this.inView=k,k&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let W=o.width;if((this.contentDOMWidth!=W||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),a){let A=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(A)&&(l=!0),l||r.lineWrapping&&Math.abs(W-this.contentDOMWidth)>r.charWidth){let{lineHeight:C,charWidth:U,textHeight:D}=e.docView.measureTextSize();l=C>0&&r.refresh(s,C,U,D,W/U,A),l&&(e.docView.minWidth=0,c|=8)}$>0&&y>0?h=Math.max($,y):$<0&&y<0&&(h=Math.min($,y)),b1();for(let C of this.viewports){let U=C.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(C);this.heightMap=(l?Ii.empty().applyChanges(this.stateDeco,St.empty,this.heightOracle,[new Yn(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,l,new o5(C.from,U))}ql&&(c|=2)}let Z=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return Z&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||Z)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:l,visibleBottom:o}=this,a=new Vf(r.lineAt(l-i*1e3,Dt.ByHeight,s,0,0).from,r.lineAt(o+(1-i)*1e3,Dt.ByHeight,s,0,0).to);if(t){let{head:c}=t.range;if(ca.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),O=r.lineAt(c,Dt.ByPos,s,0,0),p;t.y=="center"?p=(O.top+O.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&c=o+Math.max(10,Math.min(i,250)))&&r>l-2*1e3&&s>1,l=r<<1;if(this.defaultTextDirection!=Bt.LTR&&!i)return[];let o=[],a=(h,O,p,g)=>{if(O-hh&&kk.from>=p.from&&k.to<=p.to&&Math.abs(k.from-h)k.fromW));if(!y){if(OZ.from<=O&&Z.to>=O)){let Z=t.moveToLineBoundary(te.cursor(O),!1,!0).head;Z>h&&(O=Z)}let k=this.gapSize(p,h,O,g),W=i||k<2e6?k:2e6;y=new iO(h,O,k,W)}o.push(y)},c=h=>{if(h.length2e6)for(let U of e)U.from>=h.from&&U.fromh.from&&a(h.from,g,h,O),mt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];mt.spans(e,this.viewport.from,this.viewport.to,{span(r,s){t.push({from:r,to:s})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((r,s)=>r.from!=t[s].from||r.to!=t[s].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Lo(this.heightMap.lineAt(e,Dt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Lo(this.heightMap.lineAt(this.scaler.fromDOM(e),Dt.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Lo(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Vf{constructor(e,t){this.from=e,this.to=t}}function p5(n,e,t){let i=[],r=n,s=0;return mt.spans(t,n,e,{span(){},point(l,o){l>r&&(i.push({from:r,to:l}),s+=l-r),r=o}},20),r=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let r=0;;r++){let{from:s,to:l}=e[r],o=l-s;if(i<=o)return s+i;i-=o}}function Lf(n,e){let t=0;for(let{from:i,to:r}of n.ranges){if(e<=r){t+=e-i;break}t+=r-i}return t/n.total}function g5(n,e){for(let t of n)if(e(t))return t}const v1={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};class Gd{constructor(e,t,i){let r=0,s=0,l=0;this.viewports=i.map(({from:o,to:a})=>{let c=t.lineAt(o,Dt.ByPos,e,0,0).top,h=t.lineAt(a,Dt.ByPos,e,0,0).bottom;return r+=h-c,{from:o,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let o of this.viewports)o.domTop=l+(o.top-s)*this.scale,l=o.domBottom=o.domTop+(o.bottom-o.top),s=o.bottom}toDOM(e){for(let t=0,i=0,r=0;;t++){let s=tt.from==e.viewports[i].from&&t.to==e.viewports[i].to):!1}}function Lo(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new dr(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(r=>Lo(r,e)):n._content)}const If=ye.define({combine:n=>n.join(" ")}),cd=ye.define({combine:n=>n.indexOf(!0)>-1}),ud=ws.newName(),Yy=ws.newName(),Uy=ws.newName(),Ey={"&light":"."+Yy,"&dark":"."+Uy};function hd(n,e,t){return new ws(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return n;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):n+" "+i}})}const m5=hd("."+ud,{"&":{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:"#444"},".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,')`,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"}},Ey),S5={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},nO=Qe.ie&&Qe.ie_version<=11;class b5{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new n4,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(Qe.ie&&Qe.ie_version<=11||Qe.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(Qe.chrome&&Qe.chrome_version<126)&&(this.editContext=new y5(e),e.state.facet(ds)&&(e.contentDOM.editContext=this.editContext.editContext)),nO&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(ds)?i.root.activeElement!=this.dom:!uc(this.dom,r))return;let s=r.anchorNode&&i.docView.nearest(r.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Qe.ie&&Qe.ie_version<=11||Qe.android&&Qe.chrome)&&!i.state.selection.main.empty&&r.focusNode&&Ko(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=la(e.root);if(!t)return!1;let i=Qe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&$5(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let r=uc(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Rl(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,r=!1;for(let s of e){let l=this.readMutation(s);l&&(l.typeOver&&(r=!0),t==-1?{from:t,to:i}=l:(t=Math.min(l.from,t),i=Math.max(l.to,i)))}return{from:t,to:i,typeOver:r}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),r=this.selectionChanged&&uc(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new E4(this.view,e,t,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,r=_y(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let i=w1(t,e.previousSibling||e.target.previousSibling,-1),r=w1(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(ds)!=e.state.facet(ds)&&(e.view.contentDOM.editContext=e.state.facet(ds)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.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 w1(n,e,t){for(;e;){let i=Xt.get(e);if(i&&i.parent==n)return i;let r=e.parentNode;e=r!=n.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function Q1(n,e){let t=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,l=n.docView.domAtPos(n.state.selection.main.anchor);return Ko(l.node,l.offset,r,s)&&([t,i,r,s]=[r,s,t,i]),{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:s}}function $5(n,e){if(e.getComposedRanges){let r=e.getComposedRanges(n.root)[0];if(r)return Q1(n,r)}let t=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",i,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",i,!0),t?Q1(n,t):null}class y5{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let{anchor:r}=e.state.selection.main,s={from:this.toEditorPos(i.updateRangeStart),to:this.toEditorPos(i.updateRangeEnd),insert:St.of(i.text.split(` -`))};s.from==this.from&&rthis.to&&(s.to=r),!(s.from==s.to&&!s.insert.length)&&(this.pendingContextChange=s,e.state.readOnly||jd(e,s,te.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let l=this.toEditorPos(i.rangeStart),o=this.toEditorPos(i.rangeEnd);l{let r=[];for(let s of i.getTextFormats()){let l=s.underlineStyle,o=s.underlineThickness;if(l!="None"&&o!="None"){let a=`text-decoration: underline ${l=="Dashed"?"dashed ":l=="Squiggle"?"wavy ":""}${o=="Thin"?1:2}px`;r.push(Ze.mark({attributes:{style:a}}).range(this.toEditorPos(s.rangeStart),this.toEditorPos(s.rangeEnd)))}}e.dispatch({effects:Sy.of(Ze.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let r=la(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,l,o,a,c)=>{if(i)return;let h=c.length-(l-s);if(r&&l>=r.to)if(r.from==s&&r.to==l&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=h,this.to+=h;return}else r=null,this.revertPending(e.state);if(s+=t,l+=t,l<=this.from)this.from+=h,this.to+=h;else if(sthis.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(l),c.toString()),this.to+=h}t+=h}),r&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Oe{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(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||r4(e.parent)||document,this.viewState=new y1(e.state||Ot.create(e)),e.scrollTo&&e.scrollTo.is(Mf)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Do).map(r=>new Jh(r));for(let r of this.plugins)r.update(this);this.observer=new b5(this),this.inputState=new q4(this),this.inputState.ensureHandlers(this.plugins),this.docView=new i1(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof hi?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,r,s=this.state;for(let p of e){if(p.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=p.state}if(this.destroyed){this.viewState.state=s;return}let l=this.hasFocus,o=0,a=null;e.some(p=>p.annotation(Zy))?(this.inputState.notifiedFocused=l,o=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,a=Ry(s,l),a||(o=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(Ot.phrases)!=this.state.facet(Ot.phrases))return this.setState(s);r=Pc.create(this,s,e),r.flags|=o;let O=this.viewState.scrollTarget;try{this.updateState=2;for(let p of e){if(O&&(O=O.map(p.changes)),p.scrollIntoView){let{main:g}=p.state.selection;O=new Al(g.empty?g:te.cursor(g.head,g.head>g.anchor?-1:1))}for(let g of p.effects)g.is(Mf)&&(O=g.value.clip(this.state))}this.viewState.update(r,O),this.bidiCache=Wc.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(Vo)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(p=>p.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(If)!=r.state.facet(If)&&(this.viewState.mustMeasureContent=!0),(t||i||O||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let p of this.state.facet(ld))try{p(r)}catch(g){en(this.state,g,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!_y(this,h)&&c.force&&Rl(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new y1(e),this.plugins=e.facet(Do).map(i=>new Jh(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new i1(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Do),i=e.state.facet(Do);if(t!=i){let r=[];for(let s of i){let l=t.indexOf(s);if(l<0)r.push(new Jh(s));else{let o=this.plugins[l];o.mustUpdate=e,r.push(o)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,r=i.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:l}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(l=-1),this.viewState.scrollAnchorHeight=-1;try{for(let o=0;;o++){if(l<0)if(N$(i))s=-1,l=this.viewState.heightMap.height;else{let g=this.viewState.scrollAnchorAt(r);s=g.from,l=g.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(g=>{try{return g.read(this)}catch(m){return en(this.state,m),k1}}),O=Pc.create(this,this.state,[]),p=!1;O.flags|=a,t?t.flags|=a:t=O,this.updateState=2,O.empty||(this.updatePlugins(O),this.inputState.update(O),this.updateAttrs(),p=this.docView.update(O),p&&this.docViewUpdate());for(let g=0;g1||m<-1){r=r+m,i.scrollTop=r/this.scaleY,l=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let o of this.state.facet(ld))o(t)}get themeClasses(){return ud+" "+(this.state.facet(cd)?Uy:Yy)+" "+this.state.facet(If)}updateAttrs(){let e=_1(this,by,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(ds)?"true":"false",class:"cm-content",style:`${Qe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),_1(this,Nd,t);let i=this.observer.ignore(()=>{let r=ed(this.contentDOM,this.contentAttrs,t),s=ed(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let r of i.effects)if(r.is(Oe.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Vo);let e=this.state.facet(Oe.cspNonce);ws.mount(this.root,this.styleModules.concat(m5).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;ti.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return tO(this,e,o1(this,e,t,i))}moveByGroup(e,t){return tO(this,e,o1(this,e,t,i=>A4(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=i[t?i.length-1:0];return te.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,i=!0){return R4(this,e,t,i)}moveVertically(e,t,i){return tO(this,e,X4(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),ky(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),l=s[Ss.find(s,e-r.from,-1,t)];return lu(i,l.dir==Bt.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(py)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>v5)return oy(e.length);let t=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||ly(s.isolates,i=t1(this,e))))return s.order;i||(i=t1(this,e));let r=m4(e.text,t,i);return this.bidiCache.push(new Wc(e.from,e.to,t,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Qe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{L$(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Mf.of(new Al(typeof e=="number"?te.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return Mf.of(new Al(te.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return oi.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return oi.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=ws.newName(),r=[If.of(i),Vo.of(hd(`.${i}`,e))];return t&&t.dark&&r.push(cd.of(!0)),r}static baseTheme(e){return il.lowest(Vo.of(hd("."+ud,e,Ey)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),r=i&&Xt.get(i)||Xt.get(e);return((t=r==null?void 0:r.rootView)===null||t===void 0?void 0:t.view)||null}}Oe.styleModule=Vo;Oe.inputHandler=Oy;Oe.clipboardInputFilter=Ld;Oe.clipboardOutputFilter=Id;Oe.scrollHandler=my;Oe.focusChangeEffect=dy;Oe.perLineTextDirection=py;Oe.exceptionSink=hy;Oe.updateListener=ld;Oe.editable=ds;Oe.mouseSelectionStyle=uy;Oe.dragMovesSelection=cy;Oe.clickAddsSelectionRange=fy;Oe.decorations=aa;Oe.outerDecorations=$y;Oe.atomicRanges=Bd;Oe.bidiIsolatedRanges=yy;Oe.scrollMargins=vy;Oe.darkTheme=cd;Oe.cspNonce=ye.define({combine:n=>n.length?n[0]:""});Oe.contentAttributes=Nd;Oe.editorAttributes=by;Oe.lineWrapping=Oe.contentAttributes.of({class:"cm-lineWrapping"});Oe.announce=Ie.define();const v5=4096,k1={};class Wc{constructor(e,t,i,r,s,l){this.from=e,this.to=t,this.dir=i,this.isolates=r,this.fresh=s,this.order=l}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:Bt.LTR;for(let s=Math.max(0,e.length-10);s=0;r--){let s=i[r],l=typeof s=="function"?s(n):s;l&&JO(l,t)}return t}const w5=Qe.mac?"mac":Qe.windows?"win":Qe.linux?"linux":"key";function Q5(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let r,s,l,o;for(let a=0;ai.concat(r),[]))),t}function _5(n,e,t){return zy(My(n.state),e,n,t)}let ps=null;const P5=4e3;function x5(n,e=w5){let t=Object.create(null),i=Object.create(null),r=(l,o)=>{let a=i[l];if(a==null)i[l]=o;else if(a!=o)throw new Error("Key binding "+l+" is used both as a regular binding and as a multi-stroke prefix")},s=(l,o,a,c,h)=>{var O,p;let g=t[l]||(t[l]=Object.create(null)),m=o.split(/ (?!$)/).map(k=>Q5(k,e));for(let k=1;k{let A=ps={view:Z,prefix:W,scope:l};return setTimeout(()=>{ps==A&&(ps=null)},P5),!0}]})}let $=m.join(" ");r($,!1);let y=g[$]||(g[$]={preventDefault:!1,stopPropagation:!1,run:((p=(O=g._any)===null||O===void 0?void 0:O.run)===null||p===void 0?void 0:p.slice())||[]});a&&y.run.push(a),c&&(y.preventDefault=!0),h&&(y.stopPropagation=!0)};for(let l of n){let o=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let c of o){let h=t[c]||(t[c]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:O}=l;for(let p in h)h[p].run.push(g=>O(g,Od))}let a=l[e]||l.key;if(a)for(let c of o)s(c,a,l.run,l.preventDefault,l.stopPropagation),l.shift&&s(c,"Shift-"+a,l.shift,l.preventDefault,l.stopPropagation)}return t}let Od=null;function zy(n,e,t,i){Od=e;let r=JC(e),s=Qi(r,0),l=Rn(s)==r.length&&r!=" ",o="",a=!1,c=!1,h=!1;ps&&ps.view==t&&ps.scope==i&&(o=ps.prefix+" ",xy.indexOf(e.keyCode)<0&&(c=!0,ps=null));let O=new Set,p=y=>{if(y){for(let k of y.run)if(!O.has(k)&&(O.add(k),k(t)))return y.stopPropagation&&(h=!0),!0;y.preventDefault&&(y.stopPropagation&&(h=!0),c=!0)}return!1},g=n[i],m,$;return g&&(p(g[o+Nf(r,e,!l)])?a=!0:l&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Qe.windows&&e.ctrlKey&&e.altKey)&&(m=Qs[e.keyCode])&&m!=r?(p(g[o+Nf(m,e,!0)])||e.shiftKey&&($=sa[e.keyCode])!=r&&$!=m&&p(g[o+Nf($,e,!1)]))&&(a=!0):l&&e.shiftKey&&p(g[o+Nf(r,e,!0)])&&(a=!0),!a&&p(g._any)&&(a=!0)),c&&(a=!0),a&&h&&e.stopPropagation(),Od=null,a}class wa{constructor(e,t,i,r,s){this.className=e,this.left=t,this.top=i,this.width=r,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let r=e.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=Dy(e);return[new wa(t,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return W5(e,t,i)}}function Dy(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==Bt.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function x1(n,e,t,i){let r=n.coordsAtPos(e,t*2);if(!r)return i;let s=n.dom.getBoundingClientRect(),l=(r.top+r.bottom)/2,o=n.posAtCoords({x:s.left+1,y:l}),a=n.posAtCoords({x:s.right-1,y:l});return o==null||a==null?i:{from:Math.max(i.from,Math.min(o,a)),to:Math.min(i.to,Math.max(o,a))}}function W5(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),r=Math.min(t.to,n.viewport.to),s=n.textDirection==Bt.LTR,l=n.contentDOM,o=l.getBoundingClientRect(),a=Dy(n),c=l.querySelector(".cm-line"),h=c&&window.getComputedStyle(c),O=o.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),p=o.right-(h?parseInt(h.paddingRight):0),g=ad(n,i),m=ad(n,r),$=g.type==Li.Text?g:null,y=m.type==Li.Text?m:null;if($&&(n.lineWrapping||g.widgetLineBreaks)&&($=x1(n,i,1,$)),y&&(n.lineWrapping||m.widgetLineBreaks)&&(y=x1(n,r,-1,y)),$&&y&&$.from==y.from&&$.to==y.to)return W(Z(t.from,t.to,$));{let C=$?Z(t.from,null,$):A(g,!1),U=y?Z(null,t.to,y):A(m,!0),D=[];return($||g).to<(y||m).from-($&&y?1:0)||g.widgetLineBreaks>1&&C.bottom+n.defaultLineHeight/2E&&ae.from=Se)break;Pe>ve&&G(Math.max(Le,ve),C==null&&Le<=E,Math.min(Pe,Se),U==null&&Pe>=re,Ue.dir)}if(ve=ge.to+1,ve>=Se)break}return N.length==0&&G(E,C==null,re,U==null,n.textDirection),{top:z,bottom:j,horizontal:N}}function A(C,U){let D=o.top+(U?C.top:C.bottom);return{top:D,bottom:D,horizontal:[]}}}function C5(n,e){return n.constructor==e.constructor&&n.eq(e)}class T5{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(dc)!=e.state.facet(dc)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(dc);for(;t!C5(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[i].constructor&&r.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(r.draw(),t);for(;t;){let r=t.nextSibling;t.remove(),t=r}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const dc=ye.define();function Vy(n){return[oi.define(e=>new T5(e,n)),dc.of(n)]}const qy=!Qe.ios,fa=ye.define({combine(n){return yr(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function Z5(n={}){return[fa.of(n),R5,A5,X5,gy.of(!0)]}function Ly(n){return n.startState.facet(fa)!=n.state.facet(fa)}const R5=Vy({above:!0,markers(n){let{state:e}=n,t=e.facet(fa),i=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty?!s||qy:t.drawRangeCursor){let l=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",o=r.empty?r:te.cursor(r.head,r.head>r.anchor?-1:1);for(let a of wa.forRange(n,l,o))i.push(a)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=Ly(n);return t&&W1(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){W1(e.state,n)},class:"cm-cursorLayer"});function W1(n,e){e.style.animationDuration=n.facet(fa).cursorBlinkRate+"ms"}const A5=Vy({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:wa.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||Ly(n)},class:"cm-selectionLayer"}),dd={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};qy&&(dd[".cm-line"].caretColor=dd[".cm-content"].caretColor="transparent !important");const X5=il.highest(Oe.theme(dd)),Iy=Ie.define({map(n,e){return n==null?null:e.mapPos(n)}}),Io=pi.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(Iy)?i.value:t,n)}}),Y5=oi.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(Io);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(Io)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(Io),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:t.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(Io)!=n&&this.view.dispatch({effects:Iy.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function U5(){return[Io,Y5]}function C1(n,e,t,i,r){e.lastIndex=0;for(let s=n.iterRange(t,i),l=t,o;!s.next().done;l+=s.value.length)if(!s.lineBreak)for(;o=e.exec(s.value);)r(l+o.index,o)}function E5(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:r,to:s}of t)r=Math.max(n.state.doc.lineAt(r).from,r-e),s=Math.min(n.state.doc.lineAt(s).to,s+e),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class M5{constructor(e){const{regexp:t,decoration:i,decorate:r,boundary:s,maxLength:l=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(o,a,c,h)=>r(h,c,c+o[0].length,o,a);else if(typeof i=="function")this.addMatch=(o,a,c,h)=>{let O=i(o,a,c);O&&h(c,c+o[0].length,O)};else if(i)this.addMatch=(o,a,c,h)=>h(c,c+o[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=l}createDeco(e){let t=new vs,i=t.add.bind(t);for(let{from:r,to:s}of E5(e,this.maxLength))C1(e.state.doc,this.regexp,r,s,(l,o)=>this.addMatch(o,e,l,i));return t.finish()}updateDeco(e,t){let i=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((s,l,o,a)=>{a>e.view.viewport.from&&o1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),i,r):t}updateRange(e,t,i,r){for(let s of e.visibleRanges){let l=Math.max(s.from,i),o=Math.min(s.to,r);if(o>l){let a=e.state.doc.lineAt(l),c=a.toa.from;l--)if(this.boundary.test(a.text[l-1-a.from])){h=l;break}for(;op.push(k.range($,y));if(a==c)for(this.regexp.lastIndex=h-a.from;(g=this.regexp.exec(a.text))&&g.indexthis.addMatch(y,e,$,m));t=t.update({filterFrom:h,filterTo:O,filter:($,y)=>$O,add:p})}}return t}}const pd=/x/.unicode!=null?"gu":"g",z5=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,pd),D5={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 rO=null;function V5(){var n;if(rO==null&&typeof document<"u"&&document.body){let e=document.body.style;rO=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return rO||!1}const pc=ye.define({combine(n){let e=yr(n,{render:null,specialChars:z5,addSpecialChars:null});return(e.replaceTabs=!V5())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,pd)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,pd)),e}});function q5(n={}){return[pc.of(n),L5()]}let T1=null;function L5(){return T1||(T1=oi.fromClass(class{constructor(n){this.view=n,this.decorations=Ze.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(pc)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new M5({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:r}=t.state,s=Qi(e[0],0);if(s==9){let l=r.lineAt(i),o=t.state.tabSize,a=Gl(l.text,o,i-l.from);return Ze.replace({widget:new j5((o-a%o)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Ze.replace({widget:new B5(n,s)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(pc);n.startState.facet(pc)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const I5="•";function N5(n){return n>=32?I5:n==10?"␤":String.fromCharCode(9216+n)}class B5 extends Nr{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=N5(this.code),i=e.state.phrase("Control character")+" "+(D5[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,t);if(r)return r;let s=document.createElement("span");return s.textContent=t,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class j5 extends Nr{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function F5(){return H5}const G5=Ze.line({class:"cm-activeLine"}),H5=oi.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let i of n.state.selection.ranges){let r=n.lineBlockAt(i.head);r.from>e&&(t.push(G5.range(r.from)),e=r.from)}return Ze.set(t)}},{decorations:n=>n.decorations}),gd=2e3;function K5(n,e,t){let i=Math.min(e.line,t.line),r=Math.max(e.line,t.line),s=[];if(e.off>gd||t.off>gd||e.col<0||t.col<0){let l=Math.min(e.off,t.off),o=Math.max(e.off,t.off);for(let a=i;a<=r;a++){let c=n.doc.line(a);c.length<=o&&s.push(te.range(c.from+l,c.to+o))}}else{let l=Math.min(e.col,t.col),o=Math.max(e.col,t.col);for(let a=i;a<=r;a++){let c=n.doc.line(a),h=NO(c.text,l,n.tabSize,!0);if(h<0)s.push(te.cursor(c.to));else{let O=NO(c.text,o,n.tabSize);s.push(te.range(c.from+h,c.from+O))}}}return s}function J5(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function Z1(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),r=t-i.from,s=r>gd?-1:r==i.length?J5(n,e.clientX):Gl(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:s,off:r}}function e3(n,e){let t=Z1(n,e),i=n.state.selection;return t?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(t.line).from),l=r.state.doc.lineAt(s);t={line:l.number,col:t.col,off:Math.min(t.off,l.length)},i=i.map(r.changes)}},get(r,s,l){let o=Z1(n,r);if(!o)return i;let a=K5(n.state,t,o);return a.length?l?te.create(a.concat(i.ranges)):te.create(a):i}}:null}function t3(n){let e=t=>t.altKey&&t.button==0;return Oe.mouseSelectionStyle.of((t,i)=>e(i)?e3(t,i):null)}const i3={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},n3={style:"cursor: crosshair"};function r3(n={}){let[e,t]=i3[n.key||"Alt"],i=oi.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[i,Oe.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?n3:null})]}const Ro="-10000px";class Ny{constructor(e,t,i,r){this.facet=t,this.createTooltipView=i,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(l=>l);let s=null;this.tooltipViews=this.tooltips.map(l=>s=i(l,s))}update(e,t){var i;let r=e.state.facet(this.facet),s=r.filter(a=>a);if(r===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let l=[],o=t?[]:null;for(let a=0;at[c]=a),t.length=o.length),this.input=r,this.tooltips=s,this.tooltipViews=l,!0}}function s3(n){let{win:e}=n;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const sO=ye.define({combine:n=>{var e,t,i;return{position:Qe.ios?"absolute":((e=n.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(r=>r.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||s3}}}),R1=new WeakMap,Hd=oi.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(sO);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Ny(n,Kd,(t,i)=>this.createTooltip(t,i),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.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 n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(sO);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),i=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",t.dom.appendChild(r)}return t.dom.style.position=this.position,t.dom.style.top=Ro,t.dom.style.left="0px",this.container.insertBefore(t.dom,i),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect(),e=1,t=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(Qe.gecko)i=r.offsetParent!=this.container.ownerDocument.body;else if(r.style.top==Ro&&r.style.left=="0px"){let s=r.getBoundingClientRect();i=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}}if(i||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(e=r.width/this.parent.offsetWidth,t=r.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((r,s)=>{let l=this.manager.tooltipViews[s];return l.getCoords?l.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(sO).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:i}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let o of this.manager.tooltipViews)o.dom.style.position="absolute"}let{editor:t,space:i,scaleX:r,scaleY:s}=n,l=[];for(let o=0;o=Math.min(t.bottom,i.bottom)||O.rightMath.min(t.right,i.right)+.1){h.style.top=Ro;continue}let g=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,m=g?7:0,$=p.right-p.left,y=(e=R1.get(c))!==null&&e!==void 0?e:p.bottom-p.top,k=c.offset||o3,W=this.view.textDirection==Bt.LTR,Z=p.width>i.right-i.left?W?i.left:i.right-p.width:W?Math.max(i.left,Math.min(O.left-(g?14:0)+k.x,i.right-$)):Math.min(Math.max(i.left,O.left-$+(g?14:0)-k.x),i.right-$),A=this.above[o];!a.strictSide&&(A?O.top-(p.bottom-p.top)-k.yi.bottom)&&A==i.bottom-O.bottom>O.top-i.top&&(A=this.above[o]=!A);let C=(A?O.top-i.top:i.bottom-O.bottom)-m;if(CZ&&z.topU&&(U=A?z.top-y-2-m:z.bottom+m+2);if(this.position=="absolute"?(h.style.top=(U-n.parent.top)/s+"px",h.style.left=(Z-n.parent.left)/r+"px"):(h.style.top=U/s+"px",h.style.left=Z/r+"px"),g){let z=O.left+(W?k.x:-k.x)-(Z+14-7);g.style.left=z/r+"px"}c.overlap!==!0&&l.push({left:Z,top:U,right:D,bottom:U+y}),h.classList.toggle("cm-tooltip-above",A),h.classList.toggle("cm-tooltip-below",!A),c.positioned&&c.positioned(n.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 n of this.manager.tooltipViews)n.dom.style.top=Ro}},{eventObservers:{scroll(){this.maybeMeasure()}}}),l3=Oe.baseTheme({".cm-tooltip":{zIndex:100,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:`${7*2}px`,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"}}}),o3={x:0,y:0},Kd=ye.define({enables:[Hd,l3]}),Cc=ye.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class fu{static create(e){return new fu(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Ny(e,Cc,(t,i)=>this.createHostedView(t,i),t=>t.dom.remove())}createHostedView(e,t){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let r=i[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}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 a3=Kd.compute([Cc],n=>{let e=n.facet(Cc);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var i;return(i=t.end)!==null&&i!==void 0?i:t.pos})),create:fu.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class f3{constructor(e,t,i,r,s){this.view=e,this.source=t,this.field=i,this.setHover=r,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.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 e=Date.now()-this.lastMove.time;eo.bottom||t.xo.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(h=>h.from<=r&&h.to>=r),c=a&&a.dir==Bt.RTL?-1:1;s=t.x{this.pending==o&&(this.pending=null,a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])}))},a=>en(e.state,a,"hover tooltip"))}else l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])})}get tooltip(){let e=this.view.plugin(Hd),t=e?e.manager.tooltips.findIndex(i=>i.create==fu.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&s&&!c3(s.dom,e)||this.pending){let{pos:l}=r[0]||this.pending,o=(i=(t=r[0])===null||t===void 0?void 0:t.end)!==null&&i!==void 0?i:l;(l==o?this.view.posAtCoords(this.lastMove)!=l:!u3(this.view,l,o,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=i=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Bf=4;function c3(n,e){let{left:t,right:i,top:r,bottom:s}=n.getBoundingClientRect(),l;if(l=n.querySelector(".cm-tooltip-arrow")){let o=l.getBoundingClientRect();r=Math.min(o.top,r),s=Math.max(o.bottom,s)}return e.clientX>=t-Bf&&e.clientX<=i+Bf&&e.clientY>=r-Bf&&e.clientY<=s+Bf}function u3(n,e,t,i,r,s){let l=n.scrollDOM.getBoundingClientRect(),o=n.documentTop+n.documentPadding.top+n.contentHeight;if(l.left>i||l.rightr||Math.min(l.bottom,o)=e&&a<=t}function h3(n,e={}){let t=Ie.define(),i=pi.define({create(){return[]},update(r,s){if(r.length&&(e.hideOnChange&&(s.docChanged||s.selection)?r=[]:e.hideOn&&(r=r.filter(l=>!e.hideOn(s,l))),s.docChanged)){let l=[];for(let o of r){let a=s.changes.mapPos(o.pos,-1,_i.TrackDel);if(a!=null){let c=Object.assign(Object.create(null),o);c.pos=a,c.end!=null&&(c.end=s.changes.mapPos(c.end)),l.push(c)}}r=l}for(let l of s.effects)l.is(t)&&(r=l.value),l.is(O3)&&(r=[]);return r},provide:r=>Cc.from(r)});return{active:i,extension:[i,oi.define(r=>new f3(r,n,i,t,e.hoverTime||300)),a3]}}function By(n,e){let t=n.plugin(Hd);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const O3=Ie.define(),A1=ye.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function ca(n,e){let t=n.plugin(jy),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const jy=oi.fromClass(class{constructor(n){this.input=n.state.facet(ua),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(A1);this.top=new jf(n,!0,e.topContainer),this.bottom=new jf(n,!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(n){let e=n.state.facet(A1);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new jf(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new jf(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(ua);if(t!=this.input){let i=t.filter(a=>a),r=[],s=[],l=[],o=[];for(let a of i){let c=this.specs.indexOf(a),h;c<0?(h=a(n.view),o.push(h)):(h=this.panels[c],h.update&&h.update(n)),r.push(h),(h.top?s:l).push(h)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(l);for(let a of o)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>Oe.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class jf{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}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 e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=X1(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=X1(e)}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 e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function X1(n){let e=n.nextSibling;return n.remove(),e}const ua=ye.define({enables:jy});class Lr extends Hs{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Lr.prototype.elementClass="";Lr.prototype.toDOM=void 0;Lr.prototype.mapMode=_i.TrackBefore;Lr.prototype.startSide=Lr.prototype.endSide=-1;Lr.prototype.point=!0;const gc=ye.define(),d3=ye.define(),p3={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>mt.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},ea=ye.define();function g3(n){return[Fy(),ea.of(Object.assign(Object.assign({},p3),n))]}const Y1=ye.define({combine:n=>n.some(e=>e)});function Fy(n){return[m3]}const m3=oi.fromClass(class{constructor(n){this.view=n,this.prevViewport=n.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=n.state.facet(ea).map(e=>new E1(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(Y1),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}n.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(Y1)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&this.dom.remove();let t=mt.iter(this.view.state.facet(gc),this.view.viewport.from),i=[],r=this.gutters.map(s=>new S3(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let l=!0;for(let o of s.type)if(o.type==Li.Text&&l){md(t,i,o.from);for(let a of r)a.line(this.view,o,i);l=!1}else if(o.widget)for(let a of r)a.widget(this.view,o)}else if(s.type==Li.Text){md(t,i,s.from);for(let l of r)l.line(this.view,s,i)}else if(s.widget)for(let l of r)l.widget(this.view,s);for(let s of r)s.finish();n&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(n){let e=n.startState.facet(ea),t=n.state.facet(ea),i=n.docChanged||n.heightChanged||n.viewportChanged||!mt.eq(n.startState.facet(gc),n.state.facet(gc),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(n)&&(i=!0);else{i=!0;let r=[];for(let s of t){let l=e.indexOf(s);l<0?r.push(new E1(this.view,s)):(this.gutters[l].update(n),r.push(this.gutters[l]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>Oe.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==Bt.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function U1(n){return Array.isArray(n)?n:[n]}function md(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class S3{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=mt.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:r}=this,s=(t.top-this.height)/e.scaleY,l=t.height/e.scaleY;if(this.i==r.elements.length){let o=new Gy(e,l,s,i);r.elements.push(o),r.dom.appendChild(o.dom)}else r.elements[this.i].update(e,l,s,i);this.height=t.bottom,this.i++}line(e,t,i){let r=[];md(this.cursor,r,t.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(e,t,r);s&&r.unshift(s);let l=this.gutter;r.length==0&&!l.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),r=i?[i]:null;for(let s of e.state.facet(d3)){let l=s(e,t.widget,t);l&&(r||(r=[])).push(l)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class E1{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,l;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let a=s.getBoundingClientRect();l=(a.top+a.bottom)/2}else l=r.clientY;let o=e.lineBlockAtHeight(l-e.documentTop);t.domEventHandlers[i](e,o,r)&&r.preventDefault()});this.markers=U1(t.markers(e)),t.initialSpacer&&(this.spacer=new Gy(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=U1(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!mt.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Gy{constructor(e,t,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,r)}update(e,t,i,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),b3(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,l=0;;){let o=l,a=ss(o,a,c)||l(o,a,c):l}return i}})}});class lO extends Lr{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function oO(n,e){return n.state.facet(_l).formatNumber(e,n.state)}const v3=ea.compute([_l],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet($3)},lineMarker(e,t,i){return i.some(r=>r.toDOM)?null:new lO(oO(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let r of e.state.facet(y3)){let s=r(e,t,i);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(_l)!=e.state.facet(_l),initialSpacer(e){return new lO(oO(e,M1(e.state.doc.lines)))},updateSpacer(e,t){let i=oO(t.view,M1(t.view.state.doc.lines));return i==e.number?e:new lO(i)},domEventHandlers:n.facet(_l).domEventHandlers}));function w3(n={}){return[_l.of(n),Fy(),v3]}function M1(n){let e=9;for(;e{let e=[],t=-1;for(let i of n.selection.ranges){let r=n.doc.lineAt(i.head).from;r>t&&(t=r,e.push(Q3.range(r)))}return mt.of(e)});function _3(){return k3}function P3(n){let e;return{c(){e=_("div"),v(e,"class","mzn-editor svelte-1fycn7h")},m(t,i){Y(t,e,i),n[7](e)},p:_e,i:_e,o:_e,d(t){t&&X(e),n[7](null)}}}function x3(n,e,t){let{state:i}=e,r,s;su(()=>{t(6,s=new Oe({parent:r}))});function l(){return s||null}function o(){return s?s.state:null}async function a(O){s&&(await Gn(),s.dispatch({selection:{anchor:O}}))}function c(){s.focus()}function h(O){Mt[O?"unshift":"push"](()=>{r=O,t(0,r)})}return n.$$set=O=>{"state"in O&&t(1,i=O.state)},n.$$.update=()=>{n.$$.dirty&66&&s&&i&&s.state!==i&&s.setState(i)},[r,i,l,o,a,c,s,h]}class W3 extends $i{constructor(e){super(),bi(this,e,x3,P3,Oi,{state:1,getView:2,getState:3,setCursor:4,focus:5})}get getView(){return this.$$.ctx[2]}get getState(){return this.$$.ctx[3]}get setCursor(){return this.$$.ctx[4]}get focus(){return this.$$.ctx[5]}}var Cn=typeof window<"u"?window:null,Jd=Cn===null,ha=Jd?void 0:Cn.document,Nn="addEventListener",Bn="removeEventListener",aO="getBoundingClientRect",Ao="_a",jn="_b",Er="_c",Ff="horizontal",Fn=function(){return!1},C3=Jd?"calc":["","-webkit-","-moz-","-o-"].filter(function(n){var e=ha.createElement("div");return e.style.cssText="width:"+n+"calc(9px)",!!e.style.length}).shift()+"calc",Hy=function(n){return typeof n=="string"||n instanceof String},z1=function(n){if(Hy(n)){var e=ha.querySelector(n);if(!e)throw new Error("Selector "+n+" did not match a DOM element");return e}return n},Ti=function(n,e,t){var i=n[e];return i!==void 0?i:t},Gf=function(n,e,t,i){if(e){if(i==="end")return 0;if(i==="center")return n/2}else if(t){if(i==="start")return 0;if(i==="center")return n/2}return n},T3=function(n,e){var t=ha.createElement("div");return t.className="gutter gutter-"+e,t},Z3=function(n,e,t){var i={};return Hy(e)?i[n]=e:i[n]=C3+"("+e+"% - "+t+"px)",i},R3=function(n,e){var t;return t={},t[n]=e+"px",t},A3=function(n,e){if(e===void 0&&(e={}),Jd)return{};var t=n,i,r,s,l,o,a;Array.from&&(t=Array.from(t));var c=z1(t[0]),h=c.parentNode,O=getComputedStyle?getComputedStyle(h):null,p=O?O.flexDirection:null,g=Ti(e,"sizes")||t.map(function(){return 100/t.length}),m=Ti(e,"minSize",100),$=Array.isArray(m)?m:t.map(function(){return m}),y=Ti(e,"maxSize",1/0),k=Array.isArray(y)?y:t.map(function(){return y}),W=Ti(e,"expandToMin",!1),Z=Ti(e,"gutterSize",10),A=Ti(e,"gutterAlign","center"),C=Ti(e,"snapOffset",30),U=Array.isArray(C)?C:t.map(function(){return C}),D=Ti(e,"dragInterval",1),z=Ti(e,"direction",Ff),j=Ti(e,"cursor",z===Ff?"col-resize":"row-resize"),N=Ti(e,"gutter",T3),G=Ti(e,"elementStyle",Z3),E=Ti(e,"gutterStyle",R3);z===Ff?(i="width",r="clientX",s="left",l="right",o="clientWidth"):z==="vertical"&&(i="height",r="clientY",s="top",l="bottom",o="clientHeight");function re(oe,H,ue,ce){var Ee=G(i,H,ue,ce);Object.keys(Ee).forEach(function(tt){oe.style[tt]=Ee[tt]})}function ae(oe,H,ue){var ce=E(i,H,ue);Object.keys(ce).forEach(function(Ee){oe.style[Ee]=ce[Ee]})}function ve(){return a.map(function(oe){return oe.size})}function Se(oe){return"touches"in oe?oe.touches[0][r]:oe[r]}function ge(oe){var H=a[this.a],ue=a[this.b],ce=H.size+ue.size;H.size=oe/this.size*ce,ue.size=ce-oe/this.size*ce,re(H.element,H.size,this[jn],H.i),re(ue.element,ue.size,this[Er],ue.i)}function Ue(oe){var H,ue=a[this.a],ce=a[this.b];this.dragging&&(H=Se(oe)-this.start+(this[jn]-this.dragOffset),D>1&&(H=Math.round(H/D)*D),H<=ue.minSize+ue.snapOffset+this[jn]?H=ue.minSize+this[jn]:H>=this.size-(ce.minSize+ce.snapOffset+this[Er])&&(H=this.size-(ce.minSize+this[Er])),H>=ue.maxSize-ue.snapOffset+this[jn]?H=ue.maxSize+this[jn]:H<=this.size-(ce.maxSize-ce.snapOffset+this[Er])&&(H=this.size-(ce.maxSize+this[Er])),ge.call(this,H),Ti(e,"onDrag",Fn)(ve()))}function Le(){var oe=a[this.a].element,H=a[this.b].element,ue=oe[aO](),ce=H[aO]();this.size=ue[i]+ce[i]+this[jn]+this[Er],this.start=ue[s],this.end=ue[l]}function Pe(oe){if(!getComputedStyle)return null;var H=getComputedStyle(oe);if(!H)return null;var ue=oe[o];return ue===0?null:(z===Ff?ue-=parseFloat(H.paddingLeft)+parseFloat(H.paddingRight):ue-=parseFloat(H.paddingTop)+parseFloat(H.paddingBottom),ue)}function We(oe){var H=Pe(h);if(H===null||$.reduce(function(tt,ft){return tt+ft},0)>H)return oe;var ue=0,ce=[],Ee=oe.map(function(tt,ft){var Be=H*tt/100,Yt=Gf(Z,ft===0,ft===oe.length-1,A),ut=$[ft]+Yt;return Be0&&ce[ft]-ue>0){var Yt=Math.min(ue,ce[ft]-ue);ue-=Yt,Be=tt-Yt}return Be/H*100})}function lt(){var oe=this,H=a[oe.a].element,ue=a[oe.b].element;oe.dragging&&Ti(e,"onDragEnd",Fn)(ve()),oe.dragging=!1,Cn[Bn]("mouseup",oe.stop),Cn[Bn]("touchend",oe.stop),Cn[Bn]("touchcancel",oe.stop),Cn[Bn]("mousemove",oe.move),Cn[Bn]("touchmove",oe.move),oe.stop=null,oe.move=null,H[Bn]("selectstart",Fn),H[Bn]("dragstart",Fn),ue[Bn]("selectstart",Fn),ue[Bn]("dragstart",Fn),H.style.userSelect="",H.style.webkitUserSelect="",H.style.MozUserSelect="",H.style.pointerEvents="",ue.style.userSelect="",ue.style.webkitUserSelect="",ue.style.MozUserSelect="",ue.style.pointerEvents="",oe.gutter.style.cursor="",oe.parent.style.cursor="",ha.body.style.cursor=""}function Vt(oe){if(!("button"in oe&&oe.button!==0)){var H=this,ue=a[H.a].element,ce=a[H.b].element;H.dragging||Ti(e,"onDragStart",Fn)(ve()),oe.preventDefault(),H.dragging=!0,H.move=Ue.bind(H),H.stop=lt.bind(H),Cn[Nn]("mouseup",H.stop),Cn[Nn]("touchend",H.stop),Cn[Nn]("touchcancel",H.stop),Cn[Nn]("mousemove",H.move),Cn[Nn]("touchmove",H.move),ue[Nn]("selectstart",Fn),ue[Nn]("dragstart",Fn),ce[Nn]("selectstart",Fn),ce[Nn]("dragstart",Fn),ue.style.userSelect="none",ue.style.webkitUserSelect="none",ue.style.MozUserSelect="none",ue.style.pointerEvents="none",ce.style.userSelect="none",ce.style.webkitUserSelect="none",ce.style.MozUserSelect="none",ce.style.pointerEvents="none",H.gutter.style.cursor=j,H.parent.style.cursor=j,ha.body.style.cursor=j,Le.call(H),H.dragOffset=Se(oe)-H.end}}g=We(g);var Qt=[];a=t.map(function(oe,H){var ue={element:z1(oe),size:g[H],minSize:$[H],maxSize:k[H],snapOffset:U[H],i:H},ce;if(H>0&&(ce={a:H-1,b:H,dragging:!1,direction:z,parent:h},ce[jn]=Gf(Z,H-1===0,!1,A),ce[Er]=Gf(Z,!1,H===t.length-1,A),p==="row-reverse"||p==="column-reverse")){var Ee=ce.a;ce.a=ce.b,ce.b=Ee}if(H>0){var tt=N(H,z,ue.element);ae(tt,Z,H),ce[Ao]=Vt.bind(ce),tt[Nn]("mousedown",ce[Ao]),tt[Nn]("touchstart",ce[Ao]),h.insertBefore(tt,ue.element),ce.gutter=tt}return re(ue.element,ue.size,Gf(Z,H===0,H===t.length-1,A),H),H>0&&Qt.push(ce),ue});function pt(oe){var H=oe.i===Qt.length,ue=H?Qt[oe.i-1]:Qt[oe.i];Le.call(ue);var ce=H?ue.size-oe.minSize-ue[Er]:oe.minSize+ue[jn];ge.call(ue,ce)}a.forEach(function(oe){var H=oe.element[aO]()[i];H0){var Ee=Qt[ce-1],tt=a[Ee.a],ft=a[Ee.b];tt.size=H[ce-1],ft.size=ue,re(tt.element,tt.size,Ee[jn],tt.i),re(ft.element,ft.size,Ee[Er],ft.i)}})}function $e(oe,H){Qt.forEach(function(ue){if(H!==!0?ue.parent.removeChild(ue.gutter):(ue.gutter[Bn]("mousedown",ue[Ao]),ue.gutter[Bn]("touchstart",ue[Ao])),oe!==!0){var ce=G(i,ue.a.size,ue[jn]);Object.keys(ce).forEach(function(Ee){a[ue.a].element.style[Ee]="",a[ue.b].element.style[Ee]=""})}})}return{setSizes:qt,getSizes:ve,collapse:function(H){pt(a[H])},destroy:$e,parent:h,pairs:Qt}};const X3=n=>({}),D1=n=>({}),Y3=n=>({}),V1=n=>({});function U3(n){let e,t,i,r,s;const l=n[6].panelA,o=Ri(l,n,n[5],V1),a=n[6].panelB,c=Ri(a,n,n[5],D1);return{c(){e=_("div"),t=_("div"),o&&o.c(),i=I(),r=_("div"),c&&c.c(),v(t,"class","split-panel svelte-1k68mj4"),ne(t,"no-splitter",n[1]!=="all"),ne(t,"is-hidden",!Hf("a",n[1])),v(r,"class","split-panel svelte-1k68mj4"),ne(r,"no-splitter",n[1]!=="all"),ne(r,"is-hidden",!Hf("b",n[1])),v(e,"class","split svelte-1k68mj4"),ne(e,"horizontal",n[0]==="horizontal")},m(h,O){Y(h,e,O),Q(e,t),o&&o.m(t,null),n[7](t),Q(e,i),Q(e,r),c&&c.m(r,null),n[8](r),s=!0},p(h,[O]){o&&o.p&&(!s||O&32)&&Xi(o,l,h,h[5],s?Ai(l,h[5],O,Y3):Yi(h[5]),V1),(!s||O&2)&&ne(t,"no-splitter",h[1]!=="all"),(!s||O&2)&&ne(t,"is-hidden",!Hf("a",h[1])),c&&c.p&&(!s||O&32)&&Xi(c,a,h,h[5],s?Ai(a,h[5],O,X3):Yi(h[5]),D1),(!s||O&2)&&ne(r,"no-splitter",h[1]!=="all"),(!s||O&2)&&ne(r,"is-hidden",!Hf("b",h[1])),(!s||O&1)&&ne(e,"horizontal",h[0]==="horizontal")},i(h){s||(V(o,h),V(c,h),s=!0)},o(h){B(o,h),B(c,h),s=!1},d(h){h&&X(e),o&&o.d(h),n[7](null),c&&c.d(h),n[8](null)}}}function Hf(n,e){return e==="all"||e===n}function E3(n,e,t){let{$$slots:i={},$$scope:r}=e,{direction:s="horizontal"}=e,{split:l=50}=e,{showPanels:o="all"}=e,a,c,h=null;function O(y,k){p(),k==="all"&&a&&c&&(h=A3([a,c],{direction:y,minSize:0,sizes:[l,100-l],onDragEnd(W){t(4,l=W[0])}}))}function p(){h&&(h.destroy(),h=null)}function g(y){h&&h.getSizes()[0]!==y&&h.setSizes([y,100-y])}su(()=>(O(s,o),p));function m(y){Mt[y?"unshift":"push"](()=>{a=y,t(2,a)})}function $(y){Mt[y?"unshift":"push"](()=>{c=y,t(3,c)})}return n.$$set=y=>{"direction"in y&&t(0,s=y.direction),"split"in y&&t(4,l=y.split),"showPanels"in y&&t(1,o=y.showPanels),"$$scope"in y&&t(5,r=y.$$scope)},n.$$.update=()=>{n.$$.dirty&3&&O(s,o),n.$$.dirty&16&&g(l)},[s,o,a,c,l,r,i,m,$]}class M3 extends $i{constructor(e){super(),bi(this,e,E3,U3,Oi,{direction:0,split:4,showPanels:1})}}function z3(n,e){e&&e!=="lg"&&e!=="sm"&&e!=="xs"?n.style.fontSize=e.replace("x","em"):n.style.fontSize=""}function D3(n,e,t,i,r,s=1,l="",o=""){let a=1,c=1;r&&(r=="horizontal"?a=-1:r=="vertical"?c=-1:a=c=-1),typeof n=="string"&&(n=parseFloat(n)),typeof e=="string"&&(e=parseFloat(e)),typeof t=="string"&&(t=parseFloat(t));const h=`${e*s}${l}`,O=`${t*s}${l}`;let p=`translate(${h},${O}) scale(${a*n},${c*n})`;return i&&(p+=` rotate(${i}${o})`),p}function q1(n){let e,t,i,r,s,l,o,a=n[3]&&L1(n);function c(p,g){return typeof p[17][4]=="string"?q3:V3}let h=c(n),O=h(n);return{c(){e=Gs("svg"),a&&a.c(),t=Gs("g"),i=Gs("g"),O.c(),v(i,"transform",n[16]),v(t,"transform",r="translate("+n[17][0]/2+" "+n[17][1]/2+")"),v(t,"transform-origin",s=n[17][0]/4+" 0"),v(e,"id",n[1]),v(e,"class",l="svelte-fa svelte-fa-base "+n[0]+" svelte-bvo74f"),v(e,"style",n[2]),v(e,"viewBox",o="0 0 "+n[17][0]+" "+n[17][1]),v(e,"aria-hidden","true"),v(e,"role","img"),v(e,"xmlns","http://www.w3.org/2000/svg"),ne(e,"pulse",n[9]),ne(e,"svelte-fa-size-lg",n[4]==="lg"),ne(e,"svelte-fa-size-sm",n[4]==="sm"),ne(e,"svelte-fa-size-xs",n[4]==="xs"),ne(e,"svelte-fa-fw",n[6]),ne(e,"svelte-fa-pull-left",n[7]==="left"),ne(e,"svelte-fa-pull-right",n[7]==="right"),ne(e,"spin",n[8])},m(p,g){Y(p,e,g),a&&a.m(e,null),Q(e,t),Q(t,i),O.m(i,null),n[24](e)},p(p,g){p[3]?a?a.p(p,g):(a=L1(p),a.c(),a.m(e,t)):a&&(a.d(1),a=null),h===(h=c(p))&&O?O.p(p,g):(O.d(1),O=h(p),O&&(O.c(),O.m(i,null))),g&65536&&v(i,"transform",p[16]),g&131072&&r!==(r="translate("+p[17][0]/2+" "+p[17][1]/2+")")&&v(t,"transform",r),g&131072&&s!==(s=p[17][0]/4+" 0")&&v(t,"transform-origin",s),g&2&&v(e,"id",p[1]),g&1&&l!==(l="svelte-fa svelte-fa-base "+p[0]+" svelte-bvo74f")&&v(e,"class",l),g&4&&v(e,"style",p[2]),g&131072&&o!==(o="0 0 "+p[17][0]+" "+p[17][1])&&v(e,"viewBox",o),g&513&&ne(e,"pulse",p[9]),g&17&&ne(e,"svelte-fa-size-lg",p[4]==="lg"),g&17&&ne(e,"svelte-fa-size-sm",p[4]==="sm"),g&17&&ne(e,"svelte-fa-size-xs",p[4]==="xs"),g&65&&ne(e,"svelte-fa-fw",p[6]),g&129&&ne(e,"svelte-fa-pull-left",p[7]==="left"),g&129&&ne(e,"svelte-fa-pull-right",p[7]==="right"),g&257&&ne(e,"spin",p[8])},d(p){p&&X(e),a&&a.d(),O.d(),n[24](null)}}}function L1(n){let e,t;return{c(){e=Gs("title"),t=pe(n[3])},m(i,r){Y(i,e,r),Q(e,t)},p(i,r){r&8&&Ne(t,i[3])},d(i){i&&X(e)}}}function V3(n){let e,t,i,r,s,l,o,a,c,h;return{c(){e=Gs("path"),l=Gs("path"),v(e,"d",t=n[17][4][0]),v(e,"fill",i=n[11]||n[5]||"currentColor"),v(e,"fill-opacity",r=n[14]!=!1?n[12]:n[13]),v(e,"transform",s="translate("+n[17][0]/-2+" "+n[17][1]/-2+")"),v(l,"d",o=n[17][4][1]),v(l,"fill",a=n[10]||n[5]||"currentColor"),v(l,"fill-opacity",c=n[14]!=!1?n[13]:n[12]),v(l,"transform",h="translate("+n[17][0]/-2+" "+n[17][1]/-2+")")},m(O,p){Y(O,e,p),Y(O,l,p)},p(O,p){p&131072&&t!==(t=O[17][4][0])&&v(e,"d",t),p&2080&&i!==(i=O[11]||O[5]||"currentColor")&&v(e,"fill",i),p&28672&&r!==(r=O[14]!=!1?O[12]:O[13])&&v(e,"fill-opacity",r),p&131072&&s!==(s="translate("+O[17][0]/-2+" "+O[17][1]/-2+")")&&v(e,"transform",s),p&131072&&o!==(o=O[17][4][1])&&v(l,"d",o),p&1056&&a!==(a=O[10]||O[5]||"currentColor")&&v(l,"fill",a),p&28672&&c!==(c=O[14]!=!1?O[13]:O[12])&&v(l,"fill-opacity",c),p&131072&&h!==(h="translate("+O[17][0]/-2+" "+O[17][1]/-2+")")&&v(l,"transform",h)},d(O){O&&(X(e),X(l))}}}function q3(n){let e,t,i,r;return{c(){e=Gs("path"),v(e,"d",t=n[17][4]),v(e,"fill",i=n[5]||n[10]||"currentColor"),v(e,"transform",r="translate("+n[17][0]/-2+" "+n[17][1]/-2+")")},m(s,l){Y(s,e,l)},p(s,l){l&131072&&t!==(t=s[17][4])&&v(e,"d",t),l&1056&&i!==(i=s[5]||s[10]||"currentColor")&&v(e,"fill",i),l&131072&&r!==(r="translate("+s[17][0]/-2+" "+s[17][1]/-2+")")&&v(e,"transform",r)},d(s){s&&X(e)}}}function L3(n){let e,t=n[17][4]&&q1(n);return{c(){t&&t.c(),e=Gt()},m(i,r){t&&t.m(i,r),Y(i,e,r)},p(i,[r]){i[17][4]?t?t.p(i,r):(t=q1(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:_e,o:_e,d(i){i&&X(e),t&&t.d(i)}}}function I3(n,e,t){let i,r,{class:s=void 0}=e,{id:l=void 0}=e,{style:o=void 0}=e,{icon:a}=e,{title:c=void 0}=e,{size:h=void 0}=e,{color:O=void 0}=e,{fw:p=!1}=e,{pull:g=void 0}=e,{scale:m=1}=e,{translateX:$=0}=e,{translateY:y=0}=e,{rotate:k=void 0}=e,{flip:W=void 0}=e,{spin:Z=!1}=e,{pulse:A=!1}=e,{primaryColor:C=""}=e,{secondaryColor:U=""}=e,{primaryOpacity:D=1}=e,{secondaryOpacity:z=.4}=e,{swapOpacity:j=!1}=e,N;function G(E){Mt[E?"unshift":"push"](()=>{N=E,t(15,N)})}return n.$$set=E=>{"class"in E&&t(0,s=E.class),"id"in E&&t(1,l=E.id),"style"in E&&t(2,o=E.style),"icon"in E&&t(18,a=E.icon),"title"in E&&t(3,c=E.title),"size"in E&&t(4,h=E.size),"color"in E&&t(5,O=E.color),"fw"in E&&t(6,p=E.fw),"pull"in E&&t(7,g=E.pull),"scale"in E&&t(19,m=E.scale),"translateX"in E&&t(20,$=E.translateX),"translateY"in E&&t(21,y=E.translateY),"rotate"in E&&t(22,k=E.rotate),"flip"in E&&t(23,W=E.flip),"spin"in E&&t(8,Z=E.spin),"pulse"in E&&t(9,A=E.pulse),"primaryColor"in E&&t(10,C=E.primaryColor),"secondaryColor"in E&&t(11,U=E.secondaryColor),"primaryOpacity"in E&&t(12,D=E.primaryOpacity),"secondaryOpacity"in E&&t(13,z=E.secondaryOpacity),"swapOpacity"in E&&t(14,j=E.swapOpacity)},n.$$.update=()=>{n.$$.dirty&32784&&N&&h&&z3(N,h),n.$$.dirty&262144&&t(17,i=a&&a.icon||[0,0,"",[],""]),n.$$.dirty&16252928&&t(16,r=D3(m,$,y,k,W,512))},[s,l,o,c,h,O,p,g,Z,A,C,U,D,z,j,N,r,i,a,m,$,y,k,W,G]}class wt extends $i{constructor(e){super(),bi(this,e,I3,L3,Oi,{class:0,id:1,style:2,icon:18,title:3,size:4,color:5,fw:6,pull:7,scale:19,translateX:20,translateY:21,rotate:22,flip:23,spin:8,pulse:9,primaryColor:10,secondaryColor:11,primaryOpacity:12,secondaryOpacity:13,swapOpacity:14})}}const Sd={prefix:"fas",iconName:"lock",icon:[448,512,[128274],"f023","M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z"]},Ky={prefix:"fas",iconName:"share-nodes",icon:[448,512,["share-alt"],"f1e0","M352 224c53 0 96-43 96-96s-43-96-96-96s-96 43-96 96c0 4 .2 8 .7 11.9l-94.1 47C145.4 170.2 121.9 160 96 160c-53 0-96 43-96 96s43 96 96 96c25.9 0 49.4-10.2 66.6-26.9l94.1 47c-.5 3.9-.7 7.8-.7 11.9c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-25.9 0-49.4 10.2-66.6 26.9l-94.1-47c.5-3.9 .7-7.8 .7-11.9s-.2-8-.7-11.9l94.1-47C302.6 213.8 326.1 224 352 224z"]},I1={prefix:"fas",iconName:"eye-slash",icon:[640,512,[],"f070","M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zM373 389.9c-16.4 6.5-34.3 10.1-53 10.1c-79.5 0-144-64.5-144-144c0-6.9 .5-13.6 1.4-20.2L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5L373 389.9z"]},N3={prefix:"fas",iconName:"shuffle",icon:[512,512,[128256,"random"],"f074","M403.8 34.4c12-5 25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-10.1 0-19.6 4.7-25.6 12.8L284 229.3 244 176l31.2-41.6C293.3 110.2 321.8 96 352 96l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6zM164 282.7L204 336l-31.2 41.6C154.7 401.8 126.2 416 96 416l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c10.1 0 19.6-4.7 25.6-12.8L164 282.7zm274.6 188c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-30.2 0-58.7-14.2-76.8-38.4L121.6 172.8c-6-8.1-15.5-12.8-25.6-12.8l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c30.2 0 58.7 14.2 76.8 38.4L326.4 339.2c6 8.1 15.5 12.8 25.6 12.8l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64z"]},B3={prefix:"fas",iconName:"clipboard",icon:[384,512,[128203],"f328","M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM112 192l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]},Jy={prefix:"fas",iconName:"arrow-up-right-from-square",icon:[512,512,["external-link"],"f08e","M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l82.7 0L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3l0 82.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-17.7-14.3-32-32-32L320 0zM80 32C35.8 32 0 67.8 0 112L0 432c0 44.2 35.8 80 80 80l320 0c44.2 0 80-35.8 80-80l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-320c0-8.8 7.2-16 16-16l112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z"]},N1={prefix:"fas",iconName:"lock-open",icon:[576,512,[],"f3c1","M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z"]},j3={prefix:"fas",iconName:"forward-fast",icon:[512,512,[9197,"fast-forward"],"f050","M18.4 445c11.2 5.3 24.5 3.6 34.1-4.4L224 297.7 224 416c0 12.4 7.2 23.7 18.4 29s24.5 3.6 34.1-4.4L448 297.7 448 416c0 17.7 14.3 32 32 32s32-14.3 32-32l0-320c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 118.3L276.5 71.4c-9.5-7.9-22.8-9.7-34.1-4.4S224 83.6 224 96l0 118.3L52.5 71.4c-9.5-7.9-22.8-9.7-34.1-4.4S0 83.6 0 96L0 416c0 12.4 7.2 23.7 18.4 29z"]},B1={prefix:"fas",iconName:"eye",icon:[576,512,[128065],"f06e","M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"]},ev={prefix:"fas",iconName:"trash",icon:[448,512,[],"f1f8","M135.2 17.7L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-7.2-14.3C307.4 6.8 296.3 0 284.2 0L163.8 0c-12.1 0-23.2 6.8-28.6 17.7zM416 128L32 128 53.2 467c1.6 25.3 22.6 45 47.9 45l245.8 0c25.3 0 46.3-19.7 47.9-45L416 128z"]},F3={prefix:"fas",iconName:"gear",icon:[512,512,[9881,"cog"],"f013","M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"]},tv=F3,G3={prefix:"fas",iconName:"folder-tree",icon:[576,512,[],"f802","M64 32C64 14.3 49.7 0 32 0S0 14.3 0 32l0 96L0 384c0 35.3 28.7 64 64 64l192 0 0-64L64 384l0-224 192 0 0-64L64 96l0-64zM288 192c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l-98.7 0c-8.5 0-16.6-3.4-22.6-9.4L409.4 9.4c-6-6-14.1-9.4-22.6-9.4L320 0c-17.7 0-32 14.3-32 32l0 160zm0 288c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l-98.7 0c-8.5 0-16.6-3.4-22.6-9.4l-13.3-13.3c-6-6-14.1-9.4-22.6-9.4L320 288c-17.7 0-32 14.3-32 32l0 160z"]},H3={prefix:"fas",iconName:"download",icon:[512,512,[],"f019","M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]},K3={prefix:"fas",iconName:"stop",icon:[384,512,[9209],"f04d","M0 128C0 92.7 28.7 64 64 64H320c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z"]},J3={prefix:"fas",iconName:"angle-down",icon:[448,512,[8964],"f107","M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"]},eT={prefix:"fas",iconName:"eraser",icon:[576,512,[],"f12d","M290.7 57.4L57.4 290.7c-25 25-25 65.5 0 90.5l80 80c12 12 28.3 18.7 45.3 18.7L288 480l9.4 0L512 480c17.7 0 32-14.3 32-32s-14.3-32-32-32l-124.1 0L518.6 285.3c25-25 25-65.5 0-90.5L381.3 57.4c-25-25-65.5-25-90.5 0zM297.4 416l-9.4 0-105.4 0-80-80L227.3 211.3 364.7 348.7 297.4 416z"]},tT={prefix:"fas",iconName:"play",icon:[384,512,[9654],"f04b","M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80L0 432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"]},iv={prefix:"fas",iconName:"plus",icon:[448,512,[10133,61543,"add"],"2b","M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"]},nv={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]},iT={prefix:"fas",iconName:"hammer",icon:[576,512,[128296],"f6e3","M413.5 237.5c-28.2 4.8-58.2-3.6-80-25.4l-38.1-38.1C280.4 159 272 138.8 272 117.6l0-12.1L192.3 62c-5.3-2.9-8.6-8.6-8.3-14.7s3.9-11.5 9.5-14l47.2-21C259.1 4.2 279 0 299.2 0l18.1 0c36.7 0 72 14 98.7 39.1l44.6 42c24.2 22.8 33.2 55.7 26.6 86L503 183l8-8c9.4-9.4 24.6-9.4 33.9 0l24 24c9.4 9.4 9.4 24.6 0 33.9l-88 88c-9.4 9.4-24.6 9.4-33.9 0l-24-24c-9.4-9.4-9.4-24.6 0-33.9l8-8-17.5-17.5zM27.4 377.1L260.9 182.6c3.5 4.9 7.5 9.6 11.8 14l38.1 38.1c6 6 12.4 11.2 19.2 15.7L134.9 484.6c-14.5 17.4-36 27.4-58.6 27.4C34.1 512 0 477.8 0 435.7c0-22.6 10.1-44.1 27.4-58.6z"]},rv={prefix:"fas",iconName:"rotate",icon:[512,512,[128260,"sync-alt"],"f2f1","M142.9 142.9c-17.5 17.5-30.1 38-37.8 59.8c-5.9 16.7-24.2 25.4-40.8 19.5s-25.4-24.2-19.5-40.8C55.6 150.7 73.2 122 97.6 97.6c87.2-87.2 228.3-87.5 315.8-1L455 55c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2l0 128c0 13.3-10.7 24-24 24l-8.4 0c0 0 0 0 0 0L344 224c-9.7 0-18.5-5.8-22.2-14.8s-1.7-19.3 5.2-26.2l41.1-41.1c-62.6-61.5-163.1-61.2-225.3 1zM16 312c0-13.3 10.7-24 24-24l7.6 0 .7 0L168 288c9.7 0 18.5 5.8 22.2 14.8s1.7 19.3-5.2 26.2l-41.1 41.1c62.6 61.5 163.1 61.2 225.3-1c17.5-17.5 30.1-38 37.8-59.8c5.9-16.7 24.2-25.4 40.8-19.5s25.4 24.2 19.5 40.8c-10.8 30.6-28.4 59.3-52.9 83.8c-87.2 87.2-228.3 87.5-315.8 1L57 457c-6.9 6.9-17.2 8.9-26.2 5.2S16 449.7 16 440l0-119.6 0-.7 0-7.6z"]},sv={prefix:"fas",iconName:"clock-rotate-left",icon:[512,512,["history"],"f1da","M75 75L41 41C25.9 25.9 0 36.6 0 57.9L0 168c0 13.3 10.7 24 24 24l110.1 0c21.4 0 32.1-25.9 17-41l-30.8-30.8C155 85.5 203 64 256 64c106 0 192 86 192 192s-86 192-192 192c-40.8 0-78.6-12.7-109.7-34.4c-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6C151.2 495 201.7 512 256 512c141.4 0 256-114.6 256-256S397.4 0 256 0C185.3 0 121.3 28.7 75 75zm181 53c-13.3 0-24 10.7-24 24l0 104c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65 0-94.1c0-13.3-10.7-24-24-24z"]};function nT(n){let e,t,i,r,s,l,o,a,c=n[0]&&!n[3]&&j1(n);return{c(){e=_("span"),t=pe(n[1]),i=pe(n[2]),r=I(),c&&c.c(),s=Gt(),v(e,"class","filename svelte-1ul6ap")},m(h,O){Y(h,e,O),Q(e,t),Q(e,i),Y(h,r,O),c&&c.m(h,O),Y(h,s,O),l=!0,o||(a=le(e,"click",n[8]),o=!0)},p(h,O){(!l||O&2)&&Ne(t,h[1]),(!l||O&4)&&Ne(i,h[2]),h[0]&&!h[3]?c?(c.p(h,O),O&9&&V(c,1)):(c=j1(h),c.c(),V(c,1),c.m(s.parentNode,s)):c&&(Je(),B(c,1,1,()=>{c=null}),et())},i(h){l||(V(c),l=!0)},o(h){B(c),l=!1},d(h){h&&(X(e),X(r),X(s)),c&&c.d(h),o=!1,a()}}}function rT(n){let e,t,i,r,s;return{c(){e=_("input"),i=pe(n[2]),v(e,"size",t=n[4].length||n[1].length),v(e,"placeholder",n[1])},m(l,o){Y(l,e,o),n[11](e),li(e,n[4]),Y(l,i,o),r||(s=[le(e,"input",n[12]),le(e,"blur",n[10]),le(e,"keyup",n[9])],r=!0)},p(l,o){o&18&&t!==(t=l[4].length||l[1].length)&&v(e,"size",t),o&2&&v(e,"placeholder",l[1]),o&16&&e.value!==l[4]&&li(e,l[4]),o&4&&Ne(i,l[2])},i:_e,o:_e,d(l){l&&(X(e),X(i)),n[11](null),r=!1,Ft(s)}}}function j1(n){let e,t,i,r,s;return t=new wt({props:{icon:nv}}),{c(){e=_("span"),Ye(t.$$.fragment),v(e,"class","close-tab svelte-1ul6ap")},m(l,o){Y(l,e,o),Ae(t,e,null),i=!0,r||(s=le(e,"click",n[13]),r=!0)},p:_e,i(l){i||(V(t.$$.fragment,l),i=!0)},o(l){B(t.$$.fragment,l),i=!1},d(l){l&&X(e),Xe(t),r=!1,s()}}}function sT(n){let e,t,i,r,s,l;const o=[rT,nT],a=[];function c(h,O){return h[5]?0:1}return t=c(n),i=a[t]=o[t](n),{c(){e=_("a"),i.c(),v(e,"class","filename-link svelte-1ul6ap"),ne(e,"active",n[0]),ne(e,"readonly",n[3])},m(h,O){Y(h,e,O),a[t].m(e,null),r=!0,s||(l=le(e,"click",n[14]),s=!0)},p(h,[O]){let p=t;t=c(h),t===p?a[t].p(h,O):(Je(),B(a[p],1,1,()=>{a[p]=null}),et(),i=a[t],i?i.p(h,O):(i=a[t]=o[t](h),i.c()),V(i,1),i.m(e,null)),(!r||O&1)&&ne(e,"active",h[0]),(!r||O&8)&&ne(e,"readonly",h[3])},i(h){r||(V(i),r=!0)},o(h){B(i),r=!1},d(h){h&&X(e),a[t].d(),s=!1,l()}}}function lT(n,e,t){let{active:i=!1}=e,{name:r="Untitled"}=e,{suffix:s=".mzn"}=e,{readonly:l=!1}=e;const o=nn();let a=!1,c,h="";async function O(){!i||l||(t(5,a=!0),t(4,h=r),await Gn(),c.focus())}function p(W){W.key==="Enter"?(W.preventDefault(),g()):W.key==="Escape"&&t(5,a=!1)}function g(){t(5,a=!1),h.length>0&&o("rename",{name:h,suffix:s})}function m(W){Mt[W?"unshift":"push"](()=>{c=W,t(6,c)})}function $(){h=this.value,t(4,h)}const y=()=>o("close"),k=()=>{a||o("click")};return n.$$set=W=>{"active"in W&&t(0,i=W.active),"name"in W&&t(1,r=W.name),"suffix"in W&&t(2,s=W.suffix),"readonly"in W&&t(3,l=W.readonly)},n.$$.update=()=>{n.$$.dirty&16&&/[\/\\\.]/.test(h)&&t(4,h=h.replaceAll(/[\/\\\.]/g,""))},[i,r,s,l,h,a,c,o,O,p,g,m,$,y,k]}class oT extends $i{constructor(e){super(),bi(this,e,lT,sT,Oi,{active:0,name:1,suffix:2,readonly:3})}}function lv(n){const e=n-1;return e*e*e+1}function aT(n,{from:e,to:t},i={}){const r=getComputedStyle(n),s=r.transform==="none"?"":r.transform,[l,o]=r.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*l/t.width-(t.left+l),c=e.top+e.height*o/t.height-(t.top+o),{delay:h=0,duration:O=g=>Math.sqrt(g)*120,easing:p=lv}=i;return{delay:h,duration:ru(O)?O(Math.sqrt(a*a+c*c)):O,easing:p,css:(g,m)=>{const $=m*a,y=m*c,k=g+m*e.width/t.width,W=g+m*e.height/t.height;return`transform: ${s} translate(${$}px, ${y}px) scale(${k}, ${W});`}}}function F1(n,e,t){const i=n.slice();return i[19]=e[t],i}function G1(n,e){let t,i,r,s=_e,l,o,a;function c(){return e[11](e[19])}function h(...m){return e[12](e[19],...m)}function O(...m){return e[13](e[19],...m)}i=new oT({props:{name:e[19].stem,suffix:e[19].suffix,active:e[0]===e[19].index,readonly:e[1]||e[19].readonlyTab}}),i.$on("click",c),i.$on("rename",h),i.$on("close",O);function p(...m){return e[14](e[19],...m)}function g(...m){return e[15](e[19],...m)}return{key:n,first:null,c(){t=_("li"),Ye(i.$$.fragment),v(t,"draggable",!0),ne(t,"is-active",e[0]===e[19].index),this.first=t},m(m,$){Y(m,t,$),Ae(i,t,null),l=!0,o||(a=[le(t,"dragstart",p),le(t,"dragover",e[7]),le(t,"drop",g)],o=!0)},p(m,$){e=m;const y={};$&4&&(y.name=e[19].stem),$&4&&(y.suffix=e[19].suffix),$&5&&(y.active=e[0]===e[19].index),$&6&&(y.readonly=e[1]||e[19].readonlyTab),i.$set(y),(!l||$&5)&&ne(t,"is-active",e[0]===e[19].index)},r(){r=t.getBoundingClientRect()},f(){yC(t),s()},a(){s(),s=$C(t,r,aT,{duration:200})},i(m){l||(V(i.$$.fragment,m),l=!0)},o(m){B(i.$$.fragment,m),l=!1},d(m){m&&X(t),Xe(i),o=!1,Ft(a)}}}function H1(n){let e,t,i,r,s,l,o,a,c,h,O,p;return r=new wt({props:{icon:iv}}),c=new wt({props:{icon:G3}}),{c(){e=_("li"),t=_("a"),i=_("span"),Ye(r.$$.fragment),s=I(),l=_("li"),o=_("button"),a=_("span"),Ye(c.$$.fragment),v(i,"class","icon add-icon svelte-7ub6h4"),v(t,"title","Add new file"),v(a,"class","icon"),v(o,"class","button is-small"),v(o,"title","Manage files"),v(l,"class","right svelte-7ub6h4")},m(g,m){Y(g,e,m),Q(e,t),Q(t,i),Ae(r,i,null),Y(g,s,m),Y(g,l,m),Q(l,o),Q(o,a),Ae(c,a,null),h=!0,O||(p=[le(t,"click",n[16]),le(o,"click",n[17])],O=!0)},p:_e,i(g){h||(V(r.$$.fragment,g),V(c.$$.fragment,g),h=!0)},o(g){B(r.$$.fragment,g),B(c.$$.fragment,g),h=!1},d(g){g&&(X(e),X(s),X(l)),Xe(r),Xe(c),O=!1,Ft(p)}}}function fT(n){let e,t,i=[],r=new Map,s,l,o=st(n[2]);const a=h=>h[19].name;for(let h=0;h{c=null}),et()):c?(c.p(h,O),O&2&&V(c,1)):(c=H1(h),c.c(),V(c,1),c.m(t,null))},i(h){if(!l){for(let O=0;Oa(U.index),y=(U,D)=>c(D,U.index),k=(U,D)=>m(U.index),W=(U,D)=>O(D,U.index),Z=(U,D)=>g(D,U.index),A=()=>o("newFile"),C=()=>o("manageFiles");return n.$$set=U=>{"files"in U&&t(10,r=U.files),"currentIndex"in U&&t(0,s=U.currentIndex),"readonly"in U&&t(1,l=U.readonly)},n.$$.update=()=>{n.$$.dirty&1024&&t(2,i=r.map((U,D)=>{const z=U.name.endsWith(".mzc.mzn")?U.name.length-8:U.name.lastIndexOf(".");return{...U,stem:U.name.substring(0,z),suffix:U.name.substring(z),index:D}}).filter(U=>!U.hidden))},[s,l,i,o,a,c,O,p,g,m,r,$,y,k,W,Z,A,C]}class uT extends $i{constructor(e){super(),bi(this,e,cT,fT,Oi,{files:10,currentIndex:0,readonly:1})}}function K1(n,{delay:e=0,duration:t=400,easing:i=Yd}={}){const r=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*r}`}}function Tc(n,{delay:e=0,duration:t=400,easing:i=lv,x:r=0,y:s=0,opacity:l=0}={}){const o=getComputedStyle(n),a=+o.opacity,c=o.transform==="none"?"":o.transform,h=a*(1-l),[O,p]=Tm(r),[g,m]=Tm(s);return{delay:e,duration:t,easing:i,css:($,y)=>` +`){[e,t]=zl(this,e,t);let r="";for(let s=0,l=0;se&&s&&(r+=i),el&&(r+=o.sliceString(e-l,t-l,i)),l=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Or))return 0;let i=0,[r,s,l,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==l||s==o)return i;let a=this.children[r],c=e.children[s];if(a!=c)return i+a.scanIdentical(c,t);i+=a.length+1}}static from(e,t=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let g of e)i+=g.lines;if(i<32){let g=[];for(let m of e)m.flatten(g);return new ni(g,t)}let r=Math.max(32,i>>5),s=r<<1,l=r>>1,o=[],a=0,c=-1,h=[];function O(g){let m;if(g.lines>s&&g instanceof Or)for(let $ of g.children)O($);else g.lines>l&&(a>l||!a)?(p(),o.push(g)):g instanceof ni&&a&&(m=h[h.length-1])instanceof ni&&g.lines+m.lines<=32?(a+=g.lines,c+=g.length+1,h[h.length-1]=new ni(m.text.concat(g.text),m.length+1+g.length)):(a+g.lines>r&&p(),a+=g.lines,c+=g.length+1,h.push(g))}function p(){a!=0&&(o.push(h.length==1?h[0]:Or.from(h,c)),c=-1,a=h.length=0)}for(let g of e)O(g);return p(),o.length==1?o[0]:new Or(o,t)}}St.empty=new ni([""],0);function XC(n){let e=-1;for(let t of n)e+=t.length+1;return e}function fc(n,e,t=0,i=1e9){for(let r=0,s=0,l=!0;s=t&&(a>i&&(o=o.slice(0,i-r)),r0?1:(e instanceof ni?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],l=s>>1,o=r instanceof ni?r.text.length:r.children.length;if(l==(t>0?o:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(r instanceof ni){let a=r.text[l+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[l+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof ni?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class _${constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Go(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=i?r:t<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class P${constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(St.prototype[Symbol.iterator]=function(){return this.iter()},Go.prototype[Symbol.iterator]=_$.prototype[Symbol.iterator]=P$.prototype[Symbol.iterator]=function(){return this});class YC{constructor(e,t,i,r){this.from=e,this.to=t,this.number=i,this.text=r}get length(){return this.to-this.from}}function zl(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}let Tl="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,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,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(n=>n?parseInt(n,36):1);for(let n=1;nn)return Tl[e-1]<=n;return!1}function Em(n){return n>=127462&&n<=127487}const Mm=8205;function Pi(n,e,t=!0,i=!0){return(t?x$:EC)(n,e,i)}function x$(n,e,t){if(e==n.length)return e;e&&W$(n.charCodeAt(e))&&C$(n.charCodeAt(e-1))&&e--;let i=Qi(n,e);for(e+=Rn(i);e=0&&Em(Qi(n,l));)s++,l-=2;if(s%2==0)break;e+=2}else break}return e}function EC(n,e,t){for(;e>0;){let i=x$(n,e-2,t);if(i=56320&&n<57344}function C$(n){return n>=55296&&n<56320}function Qi(n,e){let t=n.charCodeAt(e);if(!C$(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return W$(i)?(t-55296<<10)+(i-56320)+65536:t}function Ed(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Rn(n){return n<65536?1:2}const XO=/\r\n?|\n/;var _i=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(_i||(_i={}));class Sr{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-r);s+=o}else{if(i!=_i.Simple&&c>=e&&(i==_i.TrackDel&&re||i==_i.TrackBefore&&re))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?s:s+a;s+=a}r=c}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let i=0,r=0;i=0&&r<=t&&o>=e)return rt?"cover":!0;r=o}return!1}toString(){let e="";for(let t=0;t=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Sr(e)}static create(e){return new Sr(e)}}class ui extends Sr{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return YO(this,(t,i,r,s,l)=>e=e.replace(r,r+(i-t),l),!1),e}mapDesc(e,t=!1){return UO(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let r=0,s=0;r=0){t[r]=o,t[r+1]=l;let a=r>>1;for(;i.length0&&gs(i,t,s.text),s.forward(h),o+=h}let c=e[l++];for(;o>1].toJSON()))}return e}static of(e,t,i){let r=[],s=[],l=0,o=null;function a(h=!1){if(!h&&!r.length)return;lp||O<0||p>t)throw new RangeError(`Invalid change range ${O} to ${p} (in doc of length ${t})`);let m=g?typeof g=="string"?St.of(g.split(i||XO)):g:St.empty,$=m.length;if(O==p&&$==0)return;Ol&&Zi(r,O-l,-1),Zi(r,p-O,$),gs(s,r,m),l=p}}return c(e),a(!o),o}static empty(e){return new ui(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let r=0;ro&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;i.length=0&&t<=0&&t==n[r+1]?n[r]+=e:e==0&&n[r]==0?n[r+1]+=t:i?(n[r]+=e,n[r+1]+=t):n.push(e,t)}function gs(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||l==n.sections.length||n.sections[l+1]<0);)o=n.sections[l++],a=n.sections[l++];e(r,c,s,h,O),r=c,s=h}}}function UO(n,e,t,i=!1){let r=[],s=i?[]:null,l=new na(n),o=new na(e);for(let a=-1;;)if(l.ins==-1&&o.ins==-1){let c=Math.min(l.len,o.len);Zi(r,c,-1),l.forward(c),o.forward(c)}else if(o.ins>=0&&(l.ins<0||a==l.i||l.off==0&&(o.len=0&&a=0){let c=0,h=l.len;for(;h;)if(o.ins==-1){let O=Math.min(h,o.len);c+=O,h-=O,o.forward(O)}else if(o.ins==0&&o.lena||l.ins>=0&&l.len>a)&&(o||i.length>c),s.forward2(a),l.forward(a)}}}}class na{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?St.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?St.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class js{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new js(i,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return te.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return te.range(this.anchor,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return te.range(e.anchor,e.head)}static create(e,t,i){return new js(e,t,i)}}class te{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:te.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;ie.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new te(e.ranges.map(t=>js.fromJSON(t)),e.main)}static single(e,t=e){return new te([te.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;re?8:0)|s)}static normalized(e,t=0){let i=e[t];e.sort((r,s)=>r.from-s.from),t=e.indexOf(i);for(let r=1;rs.head?te.range(a,o):te.range(o,a))}}return new te(e,t)}}function Z$(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Md=0;class ye{constructor(e,t,i,r,s){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=r,this.id=Md++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new ye(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:zd),!!e.static,e.enables)}of(e){return new cc([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new cc(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new cc(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function zd(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class cc{constructor(e,t,i,r){this.dependencies=e,this.facet=t,this.type=i,this.value=r,this.id=Md++}dynamicSlot(e){var t;let i=this.value,r=this.facet.compareInput,s=this.id,l=e[s]>>1,o=this.type==2,a=!1,c=!1,h=[];for(let O of this.dependencies)O=="doc"?a=!0:O=="selection"?c=!0:((t=e[O.id])!==null&&t!==void 0?t:1)&1||h.push(e[O.id]);return{create(O){return O.values[l]=i(O),1},update(O,p){if(a&&p.docChanged||c&&(p.docChanged||p.selection)||EO(O,h)){let g=i(O);if(o?!zm(g,O.values[l],r):!r(g,O.values[l]))return O.values[l]=g,1}return 0},reconfigure:(O,p)=>{let g,m=p.config.address[s];if(m!=null){let $=Qc(p,m);if(this.dependencies.every(y=>y instanceof ye?p.facet(y)===O.facet(y):y instanceof pi?p.field(y,!1)==O.field(y,!1):!0)||(o?zm(g=i(O),$,r):r(g=i(O),$)))return O.values[l]=$,0}else g=i(O);return O.values[l]=g,1}}}}function zm(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),r=t.map(a=>a.type),s=i.filter(a=>!(a&1)),l=n[e.id]>>1;function o(a){let c=[];for(let h=0;hi===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Dm).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,r)=>{let s=i.values[t],l=this.updateF(s,r);return this.compareF(s,l)?0:(i.values[t]=l,1)},reconfigure:(i,r)=>r.config.address[this.id]!=null?(i.values[t]=r.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,Dm.of({field:this,create:e})]}get extension(){return this}}const Ls={lowest:4,low:3,default:2,high:1,highest:0};function To(n){return e=>new R$(e,n)}const il={highest:To(Ls.highest),high:To(Ls.high),default:To(Ls.default),low:To(Ls.low),lowest:To(Ls.lowest)};class R${constructor(e,t){this.inner=e,this.prec=t}}class Fl{of(e){return new MO(this,e)}reconfigure(e){return Fl.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class MO{constructor(e,t){this.compartment=e,this.inner=t}}class wc{constructor(e,t,i,r,s,l){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=l,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let r=[],s=Object.create(null),l=new Map;for(let p of zC(e,t,l))p instanceof pi?r.push(p):(s[p.facet.id]||(s[p.facet.id]=[])).push(p);let o=Object.create(null),a=[],c=[];for(let p of r)o[p.id]=c.length<<1,c.push(g=>p.slot(g));let h=i==null?void 0:i.config.facets;for(let p in s){let g=s[p],m=g[0].facet,$=h&&h[p]||[];if(g.every(y=>y.type==0))if(o[m.id]=a.length<<1|1,zd($,g))a.push(i.facet(m));else{let y=m.combine(g.map(k=>k.value));a.push(i&&m.compare(y,i.facet(m))?i.facet(m):y)}else{for(let y of g)y.type==0?(o[y.id]=a.length<<1|1,a.push(y.value)):(o[y.id]=c.length<<1,c.push(k=>y.dynamicSlot(k)));o[m.id]=c.length<<1,c.push(y=>MC(y,m,g))}}let O=c.map(p=>p(o));return new wc(e,l,O,o,a,s)}}function zC(n,e,t){let i=[[],[],[],[],[]],r=new Map;function s(l,o){let a=r.get(l);if(a!=null){if(a<=o)return;let c=i[a].indexOf(l);c>-1&&i[a].splice(c,1),l instanceof MO&&t.delete(l.compartment)}if(r.set(l,o),Array.isArray(l))for(let c of l)s(c,o);else if(l instanceof MO){if(t.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(l.compartment)||l.inner;t.set(l.compartment,c),s(c,o)}else if(l instanceof R$)s(l.inner,l.prec);else if(l instanceof pi)i[o].push(l),l.provides&&s(l.provides,o);else if(l instanceof cc)i[o].push(l),l.facet.extensions&&s(l.facet.extensions,Ls.default);else{let c=l.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,o)}}return s(n,Ls.default),i.reduce((l,o)=>l.concat(o))}function Ho(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let r=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|r}function Qc(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const A$=ye.define(),zO=ye.define({combine:n=>n.some(e=>e),static:!0}),X$=ye.define({combine:n=>n.length?n[0]:void 0,static:!0}),Y$=ye.define(),U$=ye.define(),E$=ye.define(),M$=ye.define({combine:n=>n.length?n[0]:!1});class Ir{constructor(e,t){this.type=e,this.value=t}static define(){return new DC}}class DC{of(e){return new Ir(this,e)}}class VC{constructor(e){this.map=e}of(e){return new Ie(this,e)}}class Ie{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Ie(this.type,t)}is(e){return this.type==e}static define(e={}){return new VC(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(t);s&&i.push(s)}return i}}Ie.reconfigure=Ie.define();Ie.appendConfig=Ie.define();class hi{constructor(e,t,i,r,s,l){this.startState=e,this.changes=t,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=l,this._doc=null,this._state=null,i&&Z$(i,t.newLength),s.some(o=>o.type==hi.time)||(this.annotations=s.concat(hi.time.of(Date.now())))}static create(e,t,i,r,s,l){return new hi(e,t,i,r,s,l)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(hi.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}hi.time=Ir.define();hi.userEvent=Ir.define();hi.addToHistory=Ir.define();hi.remote=Ir.define();function qC(n,e){let t=[];for(let i=0,r=0;;){let s,l;if(i=n[i]))s=n[i++],l=n[i++];else if(r=0;r--){let s=i[r](n);s instanceof hi?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof hi?n=s[0]:n=D$(e,Zl(s),!1)}return n}function IC(n){let e=n.startState,t=e.facet(E$),i=n;for(let r=t.length-1;r>=0;r--){let s=t[r](n);s&&Object.keys(s).length&&(i=z$(i,DO(e,s,n.changes.newLength),!0))}return i==n?n:hi.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const NC=[];function Zl(n){return n==null?NC:Array.isArray(n)?n:[n]}var It=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(It||(It={}));const BC=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let VO;try{VO=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function jC(n){if(VO)return VO.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||BC.test(t)))return!0}return!1}function FC(n){return e=>{if(!/\S/.test(e))return It.Space;if(jC(e))return It.Word;for(let t=0;t-1)return It.Word;return It.Other}}class Ot{constructor(e,t,i,r,s,l){this.config=e,this.doc=t,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,l&&(l._state=this);for(let o=0;or.set(c,a)),t=null),r.set(o.value.compartment,o.value.extension)):o.is(Ie.reconfigure)?(t=null,i=o.value):o.is(Ie.appendConfig)&&(t=null,i=Zl(i).concat(o.value));let s;t?s=e.startState.values.slice():(t=wc.resolve(i,r,this),s=new Ot(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let l=e.startState.facet(zO)?e.newSelection:e.newSelection.asSingle();new Ot(t,e.newDoc,l,s,(o,a)=>a.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:te.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),r=this.changes(i.changes),s=[i.range],l=Zl(i.effects);for(let o=1;ol.spec.fromJSON(o,a)))}}return Ot.create({doc:e.doc,selection:te.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=wc.resolve(e.extensions||[],new Map),i=e.doc instanceof St?e.doc:St.of((e.doc||"").split(t.staticFacet(Ot.lineSeparator)||XO)),r=e.selection?e.selection instanceof te?e.selection:te.single(e.selection.anchor,e.selection.head):te.single(0);return Z$(r,i.length),t.staticFacet(zO)||(r=r.asSingle()),new Ot(t,i,r,t.dynamicSlots.map(()=>null),(s,l)=>l.create(s),null)}get tabSize(){return this.facet(Ot.tabSize)}get lineBreak(){return this.facet(Ot.lineSeparator)||` +`}get readOnly(){return this.facet(M$)}phrase(e,...t){for(let i of this.facet(Ot.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?i:t[s-1]})),e}languageDataAt(e,t,i=-1){let r=[];for(let s of this.facet(A$))for(let l of s(this,t,i))Object.prototype.hasOwnProperty.call(l,e)&&r.push(l[e]);return r}charCategorizer(e){return FC(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),l=e-i,o=e-i;for(;l>0;){let a=Pi(t,l,!1);if(s(t.slice(a,l))!=It.Word)break;l=a}for(;on.length?n[0]:4});Ot.lineSeparator=X$;Ot.readOnly=M$;Ot.phrases=ye.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(r=>n[r]==e[r])}});Ot.languageData=A$;Ot.changeFilter=Y$;Ot.transactionFilter=U$;Ot.transactionExtender=E$;Fl.reconfigure=Ie.define();function yr(n,e,t={}){let i={};for(let r of n)for(let s of Object.keys(r)){let l=r[s],o=i[s];if(o===void 0)i[s]=l;else if(!(o===l||l===void 0))if(Object.hasOwnProperty.call(t,s))i[s]=t[s](o,l);else throw new Error("Config merge conflict for field "+s)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}class Hs{eq(e){return this==e}range(e,t=e){return qO.create(e,t,this)}}Hs.prototype.startSide=Hs.prototype.endSide=0;Hs.prototype.point=!1;Hs.prototype.mapMode=_i.TrackDel;let qO=class V${constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new V$(e,t,i)}};function LO(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Dd{constructor(e,t,i,r){this.from=e,this.to=t,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,r=0){let s=i?this.to:this.from;for(let l=r,o=s.length;;){if(l==o)return l;let a=l+o>>1,c=s[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==l)return c>=0?l:o;c>=0?o=a:l=a+1}}between(e,t,i,r){for(let s=this.findIndex(t,-1e9,!0),l=this.findIndex(i,1e9,!1,s);sg||p==g&&c.startSide>0&&c.endSide<=0)continue;(g-p||c.endSide-c.startSide)<0||(l<0&&(l=p),c.point&&(o=Math.max(o,g-p)),i.push(c),r.push(p-l),s.push(g-l))}return{mapped:i.length?new Dd(r,s,i,o):null,pos:l}}}class mt{constructor(e,t,i,r){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=r}static create(e,t,i,r){return new mt(e,t,i,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=e,l=e.filter;if(t.length==0&&!l)return this;if(i&&(t=t.slice().sort(LO)),this.isEmpty)return t.length?mt.of(t):this;let o=new q$(this,null,-1).goto(0),a=0,c=[],h=new vs;for(;o.value||a=0){let O=t[a++];h.addInner(O.from,O.to,O.value)||c.push(O)}else o.rangeIndex==1&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||so.to||s=s&&e<=s+l.length&&l.between(s,e-s,t-s,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return ra.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return ra.from(e).goto(t)}static compare(e,t,i,r,s=-1){let l=e.filter(O=>O.maxPoint>0||!O.isEmpty&&O.maxPoint>=s),o=t.filter(O=>O.maxPoint>0||!O.isEmpty&&O.maxPoint>=s),a=Vm(l,o,i),c=new Zo(l,a,s),h=new Zo(o,a,s);i.iterGaps((O,p,g)=>qm(c,O,h,p,g,r)),i.empty&&i.length==0&&qm(c,0,h,0,0,r)}static eq(e,t,i=0,r){r==null&&(r=999999999);let s=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0),l=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(s.length!=l.length)return!1;if(!s.length)return!0;let o=Vm(s,l),a=new Zo(s,o,0).goto(i),c=new Zo(l,o,0).goto(i);for(;;){if(a.to!=c.to||!IO(a.active,c.active)||a.point&&(!c.point||!a.point.eq(c.point)))return!1;if(a.to>r)return!0;a.next(),c.next()}}static spans(e,t,i,r,s=-1){let l=new Zo(e,null,s).goto(t),o=t,a=l.openStart;for(;;){let c=Math.min(l.to,i);if(l.point){let h=l.activeForPoint(l.to),O=l.pointFromo&&(r.span(o,c,l.active,a),a=l.openEnd(c));if(l.to>i)return a+(l.point&&l.to>i?1:0);o=l.to,l.next()}}static of(e,t=!1){let i=new vs;for(let r of e instanceof qO?[e]:t?GC(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return mt.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=mt.empty;r=r.nextLayer)t=new mt(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}mt.empty=new mt([],[],null,-1);function GC(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(LO);e=i}return n}mt.empty.nextLayer=mt.empty;class vs{finishChunk(e){this.chunks.push(new Dd(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new vs)).add(e,t,i)}addInner(e,t,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(mt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=mt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Vm(n,e,t){let i=new Map;for(let s of n)for(let l=0;l=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&r.push(new q$(l,t,i,s));return r.length==1?r[0]:new ra(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)Gh(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)Gh(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Gh(this.heap,0)}}}function Gh(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let r=n[i];if(i+1=0&&(r=n[i+1],i++),t.compare(r)<0)break;n[i]=t,n[e]=r,e=i}}class Zo{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=ra.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Yf(this.active,e),Yf(this.activeTo,e),Yf(this.activeRank,e),this.minActive=Lm(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:r,rank:s}=this.cursor;for(;t0;)t++;Uf(this.active,t,i),Uf(this.activeTo,t,r),Uf(this.activeRank,t,s),e&&Uf(e,t,this.cursor.from),this.minActive=Lm(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&Yf(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[r]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function qm(n,e,t,i,r,s){n.goto(e),t.goto(i);let l=i+r,o=i,a=i-e;for(;;){let c=n.to+a-t.to||n.endSide-t.endSide,h=c<0?n.to+a:t.to,O=Math.min(h,l);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&IO(n.activeForPoint(n.to),t.activeForPoint(t.to))||s.comparePoint(o,O,n.point,t.point):O>o&&!IO(n.active,t.active)&&s.compareRange(o,O,n.active,t.active),h>l)break;o=h,c<=0&&n.next(),c>=0&&t.next()}}function IO(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function Lm(n,e){let t=-1,i=1e9;for(let r=0;r=e)return r;if(r==n.length)break;s+=n.charCodeAt(r)==9?t-s%t:1,r=Pi(n,r)}return i===!0?-1:n.length}const BO="ͼ",Im=typeof Symbol>"u"?"__"+BO:Symbol.for(BO),jO=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Nm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ws{constructor(e,t){this.rules=[];let{finish:i}=t||{};function r(l){return/^@/.test(l)?[l]:l.split(/,\s*/)}function s(l,o,a,c){let h=[],O=/^@(\w+)\b/.exec(l[0]),p=O&&O[1]=="keyframes";if(O&&o==null)return a.push(l[0]+";");for(let g in o){let m=o[g];if(/&/.test(g))s(g.split(/,\s*/).map($=>l.map(y=>$.replace(/&/,y))).reduce(($,y)=>$.concat(y)),m,a);else if(m&&typeof m=="object"){if(!O)throw new RangeError("The value of a property ("+g+") should be a primitive value.");s(r(g),m,h,p)}else m!=null&&h.push(g.replace(/_.*/,"").replace(/[A-Z]/g,$=>"-"+$.toLowerCase())+": "+m+";")}(h.length||p)&&a.push((i&&!O&&!c?l.map(i):l).join(", ")+" {"+h.join(" ")+"}")}for(let l in e)s(r(l),e[l],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=Nm[Im]||1;return Nm[Im]=e+1,BO+e.toString(36)}static mount(e,t,i){let r=e[jO],s=i&&i.nonce;r?s&&r.setNonce(s):r=new HC(e,s),r.mount(Array.isArray(t)?t:[t])}}let Bm=new Map;class HC{constructor(e,t){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=Bm.get(i);if(s)return e.adoptedStyleSheets=[s.sheet,...e.adoptedStyleSheets],e[jO]=s;this.sheet=new r.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],Bm.set(i,this)}else{this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let s=e.head||e;s.insertBefore(this.styleTag,s.firstChild)}this.modules=[],e[jO]=this}mount(e){let t=this.sheet,i=0,r=0;for(let s=0;s-1&&(this.modules.splice(o,1),r--,o=-1),o==-1){if(this.modules.splice(r++,0,l),t)for(let a=0;a",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},KC=typeof navigator<"u"&&/Mac/.test(navigator.platform),JC=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ki=0;ki<10;ki++)Qs[48+ki]=Qs[96+ki]=String(ki);for(var ki=1;ki<=24;ki++)Qs[ki+111]="F"+ki;for(var ki=65;ki<=90;ki++)Qs[ki]=String.fromCharCode(ki+32),sa[ki]=String.fromCharCode(ki);for(var Hh in Qs)sa.hasOwnProperty(Hh)||(sa[Hh]=Qs[Hh]);function e4(n){var e=KC&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||JC&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?sa:Qs)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function la(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function FO(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function uc(n,e){if(!e.anchorNode)return!1;try{return FO(n,e.anchorNode)}catch{return!1}}function oa(n){return n.nodeType==3?Js(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Ko(n,e,t,i){return t?jm(n,e,t,i,-1)||jm(n,e,t,i,1):!1}function Ks(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function kc(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function jm(n,e,t,i,r){for(;;){if(n==t&&e==i)return!0;if(e==(r<0?0:$r(n))){if(n.nodeName=="DIV")return!1;let s=n.parentNode;if(!s||s.nodeType!=1)return!1;e=Ks(n)+(r<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(r<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=r<0?$r(n):0}else return!1}}function $r(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function lu(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function t4(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function L$(n,e){let t=e.width/n.offsetWidth,i=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-n.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function i4(n,e,t,i,r,s,l,o){let a=n.ownerDocument,c=a.defaultView||window;for(let h=n,O=!1;h&&!O;)if(h.nodeType==1){let p,g=h==a.body,m=1,$=1;if(g)p=t4(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(O=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let W=h.getBoundingClientRect();({scaleX:m,scaleY:$}=L$(h,W)),p={left:W.left,right:W.left+h.clientWidth*m,top:W.top,bottom:W.top+h.clientHeight*$}}let y=0,k=0;if(r=="nearest")e.top0&&e.bottom>p.bottom+k&&(k=e.bottom-p.bottom+k+l)):e.bottom>p.bottom&&(k=e.bottom-p.bottom+l,t<0&&e.top-k0&&e.right>p.right+y&&(y=e.right-p.right+y+s)):e.right>p.right&&(y=e.right-p.right+s,t<0&&e.leftr.clientHeight&&(i=r),!t&&r.scrollWidth>r.clientWidth&&(t=r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;return{x:t,y:i}}class r4{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?$r(t):0),i,Math.min(e.focusOffset,i?$r(i):0))}set(e,t,i,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=r}}let $l=null;function I$(n){if(n.setActive)return n.setActive();if($l)return n.focus($l);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus($l==null?{get preventScroll(){return $l={preventScroll:!0},!0}}:void 0),!$l){$l=!1;for(let t=0;tMath.max(1,n.scrollHeight-n.clientHeight-4)}function j$(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i>0)return{node:t,offset:i};if(t.nodeType==1&&i>0){if(t.contentEditable=="false")return null;t=t.childNodes[i-1],i=$r(t)}else if(t.parentNode&&!kc(t))i=Ks(t),t=t.parentNode;else return null}}function F$(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&it)return O.domBoundsAround(e,t,c);if(p>=e&&r==-1&&(r=a,s=c),c>t&&O.dom.parentNode==this.dom){l=a,o=h;break}h=p,c=p+O.breakAfter}return{from:s,to:o<0?i+this.length:o,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:l=0?this.children[l].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=Vd){this.markDirty();for(let r=e;rthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function H$(n,e,t,i,r,s,l,o,a){let{children:c}=n,h=c.length?c[e]:null,O=s.length?s[s.length-1]:null,p=O?O.breakAfter:l;if(!(e==i&&h&&!l&&!p&&s.length<2&&h.merge(t,r,s.length?O:null,t==0,o,a))){if(i0&&(!l&&s.length&&h.merge(t,h.length,s[0],!1,o,0)?h.breakAfter=s.shift().breakAfter:(t2);var Qe={mac:Jm||/Mac/.test(Ki.platform),windows:/Win/.test(Ki.platform),linux:/Linux|X11/.test(Ki.platform),ie:ou,ie_version:J$?GO.documentMode||6:KO?+KO[1]:HO?+HO[1]:0,gecko:Hm,gecko_version:Hm?+(/Firefox\/(\d+)/.exec(Ki.userAgent)||[0,0])[1]:0,chrome:!!Kh,chrome_version:Kh?+Kh[1]:0,ios:Jm,android:/Android\b/.test(Ki.userAgent),webkit:Km,safari:ey,webkit_version:Km?+(/\bAppleWebKit\/(\d+)/.exec(Ki.userAgent)||[0,0])[1]:0,tabSize:GO.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const o4=256;class Jn extends Xt{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return this.flags&8||i&&(!(i instanceof Jn)||this.length-(t-e)+i.length>o4||i.flags&8)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Jn(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Ui(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return a4(this.dom,e,t)}}class qr extends Xt{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let r of t)r.setParent(this)}setAttrs(e){if(N$(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,r,s,l){return i&&(!(i instanceof qr&&i.mark.eq(this.mark))||e&&s<=0||te&&t.push(i=e&&(r=s),i=a,s++}let l=this.length-e;return this.length=e,r>-1&&(this.children.length=r,this.markDirty()),new qr(this.mark,t,l)}domAtPos(e){return ty(this,e)}coordsAt(e,t){return ny(this,e,t)}}function a4(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let r=e,s=e,l=0;e==0&&t<0||e==i&&t>=0?Qe.chrome||Qe.gecko||(e?(r--,l=1):s=0)?0:o.length-1];return Qe.safari&&!l&&a.width==0&&(a=Array.prototype.find.call(o,c=>c.width)||a),l?lu(a,l<0):a||null}class ms extends Xt{static create(e,t,i){return new ms(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=ms.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,i,r,s,l){return i&&(!(i instanceof ms)||!this.widget.compare(i.widget)||e>0&&s<=0||t0)?Ui.before(this.dom):Ui.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let r=this.dom.getClientRects(),s=null;if(!r.length)return null;let l=this.side?this.side<0:e>0;for(let o=l?r.length-1:0;s=r[o],!(e>0?o==0:o==r.length-1||s.top0?Ui.before(this.dom):Ui.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return St.empty}get isHidden(){return!0}}Jn.prototype.children=ms.prototype.children=Dl.prototype.children=Vd;function ty(n,e){let t=n.dom,{children:i}=n,r=0;for(let s=0;rs&&e0;s--){let l=i[s-1];if(l.dom.parentNode==t)return l.domAtPos(l.length)}for(let s=r;s0&&e instanceof qr&&r.length&&(i=r[r.length-1])instanceof qr&&i.mark.eq(e.mark)?iy(i,e.children[0],t-1):(r.push(e),e.setParent(n)),n.length+=e.length}function ny(n,e,t){let i=null,r=-1,s=null,l=-1;function o(c,h){for(let O=0,p=0;O=h&&(g.children.length?o(g,h-p):(!s||s.isHidden&&t>0)&&(m>h||p==m&&g.getSide()>0)?(s=g,l=h-p):(p-1?1:0)!=r.length-(t&&r.indexOf(t)>-1?1:0))return!1;for(let s of i)if(s!=t&&(r.indexOf(s)==-1||n[s]!==e[s]))return!1;return!0}function ed(n,e,t){let i=!1;if(e)for(let r in e)t&&r in t||(i=!0,r=="style"?n.style.cssText="":n.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(i=!0,r=="style"?n.style.cssText=t[r]:n.setAttribute(r,t[r]));return i}function c4(n){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new ks(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:l}=ry(e,t);i=(s?t?-3e8:-1:5e8)-1,r=(l?t?2e8:1:-6e8)+1}return new ks(e,i,r,t,e.widget||null,!0)}static line(e){return new ya(e)}static set(e,t=!1){return mt.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ze.none=mt.empty;class $a extends Ze{constructor(e){let{start:t,end:i}=ry(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,i;return this==e||e instanceof $a&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((i=e.attrs)===null||i===void 0?void 0:i.class))&&_c(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}$a.prototype.point=!1;class ya extends Ze{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ya&&this.spec.class==e.spec.class&&_c(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}ya.prototype.mapMode=_i.TrackBefore;ya.prototype.point=!0;class ks extends Ze{constructor(e,t,i,r,s,l){super(t,i,s,e),this.block=r,this.isReplace=l,this.mapMode=r?t<=0?_i.TrackBefore:_i.TrackAfter:_i.TrackDel}get type(){return this.startSide!=this.endSide?Li.WidgetRange:this.startSide<=0?Li.WidgetBefore:Li.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof ks&&u4(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}ks.prototype.point=!0;function ry(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function u4(n,e){return n==e||!!(n&&e&&n.compare(e))}function td(n,e,t,i=0){let r=t.length-1;r>=0&&t[r]+i>=n?t[r]=Math.max(t[r],e):t.push(n,e)}class si extends Xt{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,r,s,l){if(i){if(!(i instanceof si))return!1;this.dom||i.transferDOM(this)}return r&&this.setDeco(i?i.attrs:null),K$(this,e,t,i?i.children.slice():[],s,l),!0}split(e){let t=new si;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i,off:r}=this.childPos(e);r&&(t.append(this.children[i].split(r),0),this.children[i].merge(r,this.children[i].length,null,!1,0,0),i++);for(let s=i;s0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){_c(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){iy(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=JO(t,this.attrs||{})),i&&(this.attrs=JO({class:i},this.attrs||{}))}domAtPos(e){return ty(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(N$(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),this.prevAttrs!==void 0&&(ed(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let r=this.dom.lastChild;for(;r&&Xt.get(r)instanceof qr;)r=r.lastChild;if(!r||!this.length||r.nodeName!="BR"&&((i=Xt.get(r))===null||i===void 0?void 0:i.isEditable)==!1&&(!Qe.ios||!this.children.some(s=>s instanceof Jn))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof Jn)||/[^ -~]/.test(i.text))return null;let r=oa(i.dom);if(r.length!=1)return null;e+=r[0].width,t=r[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=ny(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:r}=this.parent.view.viewState,s=i.bottom-i.top;if(Math.abs(s-r.lineHeight)<2&&r.textHeight=t){if(s instanceof si)return s;if(l>t)break}r=l+s.breakAfter}return null}}class Dr extends Xt{constructor(e,t,i){super(),this.widget=e,this.length=t,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,r,s,l){return i&&(!(i instanceof Dr)||!this.widget.compare(i.widget)||e>0&&s<=0||t0}}class id extends Nr{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class Jo{constructor(e,t,i,r){this.doc=e,this.pos=t,this.end=i,this.disallowBlockEffectsFor=r,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=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Dr&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new si),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Ef(new Dl(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Dr)&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:s,lineBreak:l,done:o}=this.cursor.next(this.skip);if(this.skip=0,o)throw new Error("Ran out of text content when drawing inline views");if(l){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,e--;continue}else this.text=s,this.textOff=0}let r=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(Ef(new Jn(this.text.slice(this.textOff,this.textOff+r)),t),i),this.atCursorPos=!0,this.textOff+=r,e-=r,i=0}}span(e,t,i,r){this.buildText(t-e,i,r),this.pos=t,this.openStart<0&&(this.openStart=r)}point(e,t,i,r,s,l){if(this.disallowBlockEffectsFor[l]&&i instanceof ks){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let o=t-e;if(i instanceof ks)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Dr(i.widget||Vl.block,o,i));else{let a=ms.create(i.widget||Vl.inline,o,o?0:i.startSide),c=this.atCursorPos&&!a.isEditable&&s<=r.length&&(e0),h=!a.isEditable&&(er.length||i.startSide<=0),O=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(r),c&&(O.append(Ef(new Dl(1),r),s),s=r.length+Math.max(0,s-r.length)),O.append(Ef(a,r),s),this.atCursorPos=h,this.pendingBuffer=h?er.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=r.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=s)}static build(e,t,i,r,s){let l=new Jo(e,t,i,s);return l.openEnd=mt.spans(r,t,i,l),l.openStart<0&&(l.openStart=l.openEnd),l.finish(l.openEnd),l}}function Ef(n,e){for(let t of e)n=new qr(t,[n],n.length);return n}class Vl extends Nr{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Vl.inline=new Vl("span");Vl.block=new Vl("div");var Bt=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(Bt||(Bt={}));const el=Bt.LTR,qd=Bt.RTL;function sy(n){let e=[];for(let t=0;t=t){if(o.level==i)return l;(s<0||(r!=0?r<0?o.fromt:e[s].level>o.level))&&(s=l)}}if(s<0)throw new RangeError("Index out of range");return s}}function oy(n,e){if(n.length!=e.length)return!1;for(let t=0;t=0;$-=3)if(ar[$+1]==-g){let y=ar[$+2],k=y&2?r:y&4?y&1?s:r:0;k&&(At[O]=At[ar[$]]=k),o=$;break}}else{if(ar.length==189)break;ar[o++]=O,ar[o++]=p,ar[o++]=a}else if((m=At[O])==2||m==1){let $=m==r;a=$?0:1;for(let y=o-3;y>=0;y-=3){let k=ar[y+2];if(k&2)break;if($)ar[y+2]|=2;else{if(k&4)break;ar[y+2]|=4}}}}}function m4(n,e,t,i){for(let r=0,s=i;r<=t.length;r++){let l=r?t[r-1].to:n,o=ra;)m==y&&(m=t[--$].from,y=$?t[$-1].to:n),At[--m]=g;a=h}else s=c,a++}}}function rd(n,e,t,i,r,s,l){let o=i%2?2:1;if(i%2==r%2)for(let a=e,c=0;aa&&l.push(new Ss(a,$.from,g));let y=$.direction==el!=!(g%2);sd(n,y?i+1:i,r,$.inner,$.from,$.to,l),a=$.to}m=$.to}else{if(m==t||(h?At[m]!=o:At[m]==o))break;m++}p?rd(n,a,m,i+1,r,p,l):ae;){let h=!0,O=!1;if(!c||a>s[c-1].to){let $=At[a-1];$!=o&&(h=!1,O=$==16)}let p=!h&&o==1?[]:null,g=h?i:i+1,m=a;e:for(;;)if(c&&m==s[c-1].to){if(O)break e;let $=s[--c];if(!h)for(let y=$.from,k=c;;){if(y==e)break e;if(k&&s[k-1].to==y)y=s[--k].from;else{if(At[y-1]==o)break e;break}}if(p)p.push($);else{$.toAt.length;)At[At.length]=256;let i=[],r=e==el?0:1;return sd(n,r,r,t,0,n.length,i),i}function ay(n){return[new Ss(0,n,0)]}let fy="";function b4(n,e,t,i,r){var s;let l=i.head-n.from,o=Ss.find(e,l,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),a=e[o],c=a.side(r,t);if(l==c){let p=o+=r?1:-1;if(p<0||p>=e.length)return null;a=e[o=p],l=a.side(!r,t),c=a.side(r,t)}let h=Pi(n.text,l,a.forward(r,t));(ha.to)&&(h=c),fy=n.text.slice(Math.min(l,h),Math.max(l,h));let O=o==(r?e.length-1:0)?null:e[o+(r?1:-1)];return O&&h==c&&O.level+(r?0:1)n.some(e=>e)}),my=ye.define({combine:n=>n.some(e=>e)}),Sy=ye.define();class Al{constructor(e,t="nearest",i="nearest",r=5,s=5,l=!1){this.range=e,this.y=t,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=l}map(e){return e.empty?this:new Al(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Al(te.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Mf=Ie.define({map:(n,e)=>n.map(e)}),by=Ie.define();function en(n,e,t){let i=n.facet(Oy);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const ds=ye.define({combine:n=>n.length?n[0]:!0});let y4=0;const Do=ye.define();class oi{constructor(e,t,i,r,s){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=r,this.extension=s(this)}static define(e,t){const{eventHandlers:i,eventObservers:r,provide:s,decorations:l}=t||{};return new oi(y4++,e,i,r,o=>{let a=[Do.of(o)];return l&&a.push(aa.of(c=>{let h=c.plugin(o);return h?l(h):Ze.none})),s&&a.push(s(o)),a})}static fromClass(e,t){return oi.define(i=>new e(i),t)}}class Jh{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(en(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){en(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){en(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const $y=ye.define(),Nd=ye.define(),aa=ye.define(),yy=ye.define(),Bd=ye.define(),vy=ye.define();function t1(n,e){let t=n.state.facet(vy);if(!t.length)return t;let i=t.map(s=>s instanceof Function?s(n):s),r=[];return mt.spans(i,e.from,e.to,{point(){},span(s,l,o,a){let c=s-e.from,h=l-e.from,O=r;for(let p=o.length-1;p>=0;p--,a--){let g=o[p].spec.bidiIsolate,m;if(g==null&&(g=$4(e.text,c,h)),a>0&&O.length&&(m=O[O.length-1]).to==c&&m.direction==g)m.to=h,O=m.inner;else{let $={from:c,to:h,direction:g,inner:[]};O.push($),O=$.inner}}}}),r}const wy=ye.define();function Qy(n){let e=0,t=0,i=0,r=0;for(let s of n.state.facet(wy)){let l=s(n);l&&(l.left!=null&&(e=Math.max(e,l.left)),l.right!=null&&(t=Math.max(t,l.right)),l.top!=null&&(i=Math.max(i,l.top)),l.bottom!=null&&(r=Math.max(r,l.bottom)))}return{left:e,right:t,top:i,bottom:r}}const Vo=ye.define();class Yn{constructor(e,t,i,r){this.fromA=e,this.toA=t,this.fromB=i,this.toB=r}join(e){return new Yn(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>i.toA)){if(r.toAh)break;s+=2}if(!a)return i;new Yn(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),l=a.toA,o=a.toB}}}class Pc{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=ui.empty(this.startState.doc.length);for(let s of i)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,l,o,a)=>r.push(new Yn(s,l,o,a))),this.changedRanges=r}static create(e,t,i){return new Pc(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class i1 extends Xt{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Ze.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(e.contentDOM),this.children=[new si],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Yn(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:c,toA:h})=>hthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!x4(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?w4(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;i=new Yn(c,h,e.changes.mapPos(c,-1),e.changes.mapPos(h,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Qe.ie||Qe.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let l=this.decorations,o=this.updateDeco(),a=_4(l,o,e.changes);return i=Yn.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,i);let{observer:r}=this.view;r.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let l=Qe.chrome||Qe.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,l),this.flags&=-8,l&&(l.written||r.selectionRange.focusNode!=l.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(l=>l.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to=0?r[l]:null;if(!o)break;let{fromA:a,toA:c,fromB:h,toB:O}=o,p,g,m,$;if(i&&i.range.fromBh){let A=Jo.build(this.view.state.doc,h,i.range.fromB,this.decorations,this.dynamicDecorationMap),C=Jo.build(this.view.state.doc,i.range.toB,O,this.decorations,this.dynamicDecorationMap);g=A.breakAtStart,m=A.openStart,$=C.openEnd;let U=this.compositionView(i);C.breakAtStart?U.breakAfter=1:C.content.length&&U.merge(U.length,U.length,C.content[0],!1,C.openStart,0)&&(U.breakAfter=C.content[0].breakAfter,C.content.shift()),A.content.length&&U.merge(0,0,A.content[A.content.length-1],!0,0,A.openEnd)&&A.content.pop(),p=A.content.concat(U).concat(C.content)}else({content:p,breakAtStart:g,openStart:m,openEnd:$}=Jo.build(this.view.state.doc,h,O,this.decorations,this.dynamicDecorationMap));let{i:y,off:k}=s.findPos(c,1),{i:W,off:Z}=s.findPos(a,-1);H$(this,W,Z,y,k,p,g,m,$)}i&&this.fixCompositionDOM(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let i of t.effects)i.is(by)&&(this.editContextFormatting=i.value)}compositionView(e){let t=new Jn(e.text.nodeValue);t.flags|=8;for(let{deco:r}of e.marks)t=new qr(r,[t],t.length);let i=new si;return i.append(t,0),i}fixCompositionDOM(e){let t=(s,l)=>{l.flags|=8|(l.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(l);let o=Xt.get(s);o&&o!=l&&(o.dom=null),l.setDOM(s)},i=this.childPos(e.range.fromB,1),r=this.children[i.i];t(e.line,r);for(let s=e.marks.length-1;s>=-1;s--)i=r.childPos(i.off,1),r=r.children[i.i],t(s>=0?e.marks[s].node:e.text,r)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,r=i==this.dom,s=!r&&uc(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(r||t||s))return;let l=this.forceSelection;this.forceSelection=!1;let o=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(o.anchor)),c=o.empty?a:this.moveToLine(this.domAtPos(o.head));if(Qe.gecko&&o.empty&&!this.hasComposition&&v4(a)){let O=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(O,a.node.childNodes[a.offset]||null)),a=c=new Ui(O,0),l=!0}let h=this.view.observer.selectionRange;(l||!h.focusNode||(!Ko(a.node,a.offset,h.anchorNode,h.anchorOffset)||!Ko(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,o))&&(this.view.observer.ignore(()=>{Qe.android&&Qe.chrome&&this.dom.contains(h.focusNode)&&P4(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let O=la(this.view.root);if(O)if(o.empty){if(Qe.gecko){let p=Q4(a.node,a.offset);if(p&&p!=3){let g=(p==1?j$:F$)(a.node,a.offset);g&&(a=new Ui(g.node,g.offset))}}O.collapse(a.node,a.offset),o.bidiLevel!=null&&O.caretBidiLevel!==void 0&&(O.caretBidiLevel=o.bidiLevel)}else if(O.extend){O.collapse(a.node,a.offset);try{O.extend(c.node,c.offset)}catch{}}else{let p=document.createRange();o.anchor>o.head&&([a,c]=[c,a]),p.setEnd(c.node,c.offset),p.setStart(a.node,a.offset),O.removeAllRanges(),O.addRange(p)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new Ui(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new Ui(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Ko(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=la(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let l=si.find(this,t.head);if(!l)return;let o=l.posAtStart;if(t.head==o||t.head==o+l.length)return;let a=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(t.head+t.assoc);i.collapse(h.node,h.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let O=e.observer.selectionRange;e.docView.posFromDOM(O.anchorNode,O.anchorOffset)!=t.from&&i.collapse(r,s)}moveToLine(e){let t=this.dom,i;if(e.node!=t)return e;for(let r=e.offset;!i&&r=0;r--){let s=Xt.get(t.childNodes[r]);s instanceof si&&(i=s.domAtPos(s.length))}return i?new Ui(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=Xt.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;t=0;l--){let o=this.children[l],a=s-o.breakAfter,c=a-o.length;if(ae||o.covers(1))&&(!i||o instanceof si&&!(i instanceof si&&t>=0)))i=o,r=c;else if(i&&c==e&&a==e&&o instanceof Dr&&Math.abs(t)<2){if(o.deco.startSide<0)break;l&&(i=null)}s=c}return i?i.coordsAt(e-r,t):null}coordsForChar(e){let{i:t,off:i}=this.childPos(e,1),r=this.children[t];if(!(r instanceof si))return null;for(;r.children.length;){let{i:o,off:a}=r.childPos(i,1);for(;;o++){if(o==r.children.length)return null;if((r=r.children[o]).length)break}i=a}if(!(r instanceof Jn))return null;let s=Pi(r.text,i);if(s==i)return null;let l=Js(r.dom,i,s).getClientRects();for(let o=0;oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,a=this.view.textDirection==Bt.LTR;for(let c=0,h=0;hr)break;if(c>=i){let g=O.dom.getBoundingClientRect();if(t.push(g.height),l){let m=O.dom.lastChild,$=m?oa(m):[];if($.length){let y=$[$.length-1],k=a?y.right-g.left:g.right-y.left;k>o&&(o=k,this.minWidth=s,this.minWidthFrom=c,this.minWidthTo=p)}}}c=p+O.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?Bt.RTL:Bt.LTR}measureTextSize(){for(let s of this.children)if(s instanceof si){let l=s.measureTextSize();if(l)return l}let e=document.createElement("div"),t,i,r;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=oa(e.firstChild)[0];t=e.getBoundingClientRect().height,i=s?s.width/27:7,r=s?s.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:r}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new G$(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],l=s?s.from-1:this.length;if(l>i){let o=(t.lineBlockAt(l).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(Ze.replace({widget:new id(o),block:!0,inclusive:!0,isBlockGap:!0}).range(i,l))}if(!s)break;i=s.to+1}return Ze.set(e)}updateDeco(){let e=1,t=this.view.state.facet(aa).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(yy).map((s,l)=>{let o=typeof s=="function";return o&&(i=!0),o?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=i,t.push(mt.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];et.anchor?-1:1),r;if(!i)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=Qy(this.view),l={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:o,offsetHeight:a}=this.view.scrollDOM;i4(this.view.scrollDOM,l,t.head{ie.from&&(t=!0)}),t}function W4(n,e,t=1){let i=n.charCategorizer(e),r=n.doc.lineAt(e),s=e-r.from;if(r.length==0)return te.cursor(e);s==0?t=1:s==r.length&&(t=-1);let l=s,o=s;t<0?l=Pi(r.text,s,!1):o=Pi(r.text,s);let a=i(r.text.slice(l,o));for(;l>0;){let c=Pi(r.text,l,!1);if(i(r.text.slice(c,l))!=a)break;l=c}for(;on?e.left-n:Math.max(0,n-e.right)}function T4(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function eO(n,e){return n.tope.top+1}function n1(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function od(n,e,t){let i,r,s,l,o=!1,a,c,h,O;for(let m=n.firstChild;m;m=m.nextSibling){let $=oa(m);for(let y=0;y<$.length;y++){let k=$[y];r&&eO(r,k)&&(k=n1(r1(k,r.bottom),r.top));let W=C4(e,k),Z=T4(t,k);if(W==0&&Z==0)return m.nodeType==3?s1(m,e,t):od(m,e,t);if(!i||l>Z||l==Z&&s>W){i=m,r=k,s=W,l=Z;let A=Z?t0?y<$.length-1:y>0)}W==0?t>k.bottom&&(!h||h.bottomk.top)&&(c=m,O=k):h&&eO(h,k)?h=r1(h,k.bottom):O&&eO(O,k)&&(O=n1(O,k.top))}}if(h&&h.bottom>=t?(i=a,r=h):O&&O.top<=t&&(i=c,r=O),!i)return{node:n,offset:0};let p=Math.max(r.left,Math.min(r.right,e));if(i.nodeType==3)return s1(i,p,t);if(o&&i.contentEditable!="false")return od(i,p,t);let g=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(r.left+r.right)/2?1:0);return{node:n,offset:g}}function s1(n,e,t){let i=n.nodeValue.length,r=-1,s=1e9,l=0;for(let o=0;ot?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&O=(h.left+h.right)/2,g=p;if((Qe.chrome||Qe.gecko)&&Js(n,o).getBoundingClientRect().left==h.right&&(g=!p),O<=0)return{node:n,offset:o+(g?1:0)};r=o+(g?1:0),s=O}}}return{node:n,offset:r>-1?r:l>0?n.nodeValue.length:0}}function _y(n,e,t,i=-1){var r,s;let l=n.contentDOM.getBoundingClientRect(),o=l.top+n.viewState.paddingTop,a,{docHeight:c}=n.viewState,{x:h,y:O}=e,p=O-o;if(p<0)return 0;if(p>c)return n.state.doc.length;for(let A=n.viewState.heightOracle.textHeight/2,C=!1;a=n.elementAtHeight(p),a.type!=Li.Text;)for(;p=i>0?a.bottom+A:a.top-A,!(p>=0&&p<=c);){if(C)return t?null:0;C=!0,i=-i}O=o+p;let g=a.from;if(gn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:l1(n,l,a,h,O);let m=n.dom.ownerDocument,$=n.root.elementFromPoint?n.root:m,y=$.elementFromPoint(h,O);y&&!n.contentDOM.contains(y)&&(y=null),y||(h=Math.max(l.left+1,Math.min(l.right-1,h)),y=$.elementFromPoint(h,O),y&&!n.contentDOM.contains(y)&&(y=null));let k,W=-1;if(y&&((r=n.docView.nearest(y))===null||r===void 0?void 0:r.isEditable)!=!1){if(m.caretPositionFromPoint){let A=m.caretPositionFromPoint(h,O);A&&({offsetNode:k,offset:W}=A)}else if(m.caretRangeFromPoint){let A=m.caretRangeFromPoint(h,O);A&&({startContainer:k,startOffset:W}=A,(!n.contentDOM.contains(k)||Qe.safari&&Z4(k,W,h)||Qe.chrome&&R4(k,W,h))&&(k=void 0))}k&&(W=Math.min($r(k),W))}if(!k||!n.docView.dom.contains(k)){let A=si.find(n.docView,g);if(!A)return p>a.top+a.height/2?a.to:a.from;({node:k,offset:W}=od(A.dom,h,O))}let Z=n.docView.nearest(k);if(!Z)return null;if(Z.isWidget&&((s=Z.dom)===null||s===void 0?void 0:s.nodeType)==1){let A=Z.dom.getBoundingClientRect();return e.yn.defaultLineHeight*1.5){let o=n.viewState.heightOracle.textHeight,a=Math.floor((r-t.top-(n.defaultLineHeight-o)*.5)/o);s+=a*n.viewState.heightOracle.lineLength}let l=n.state.sliceDoc(t.from,t.to);return t.from+NO(l,s,n.state.tabSize)}function Z4(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let r=n.nextSibling;r;r=r.nextSibling)if(r.nodeType!=1||r.nodeName!="BR")return!1;return Js(n,i-1,i).getBoundingClientRect().left>t}function R4(n,e,t){if(e!=0)return!1;for(let r=n;;){let s=r.parentNode;if(!s||s.nodeType!=1||s.firstChild!=r)return!1;if(s.classList.contains("cm-line"))break;r=s}let i=n.nodeType==1?n.getBoundingClientRect():Js(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function ad(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==Li.Text))return i}return t}function A4(n,e,t,i){let r=ad(n,e.head),s=!i||r.type!=Li.Text||!(n.lineWrapping||r.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let l=n.dom.getBoundingClientRect(),o=n.textDirectionAt(r.from),a=n.posAtCoords({x:t==(o==Bt.LTR)?l.right-1:l.left+1,y:(s.top+s.bottom)/2});if(a!=null)return te.cursor(a,t?-1:1)}return te.cursor(t?r.to:r.from,t?-1:1)}function o1(n,e,t,i){let r=n.state.doc.lineAt(e.head),s=n.bidiSpans(r),l=n.textDirectionAt(r.from);for(let o=e,a=null;;){let c=b4(r,s,l,o,t),h=fy;if(!c){if(r.number==(t?n.state.doc.lines:1))return o;h=` +`,r=n.state.doc.line(r.number+(t?1:-1)),s=n.bidiSpans(r),c=n.visualLineSide(r,!t)}if(a){if(!a(h))return o}else{if(!i)return c;a=i(h)}o=c}}function X4(n,e,t){let i=n.state.charCategorizer(e),r=i(t);return s=>{let l=i(s);return r==It.Space&&(r=l),r==l}}function Y4(n,e,t,i){let r=e.head,s=t?1:-1;if(r==(t?n.state.doc.length:0))return te.cursor(r,e.assoc);let l=e.goalColumn,o,a=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(r,e.assoc||-1),h=n.documentTop;if(c)l==null&&(l=c.left-a.left),o=s<0?c.top:c.bottom;else{let g=n.viewState.lineBlockAt(r);l==null&&(l=Math.min(a.right-a.left,n.defaultCharacterWidth*(r-g.from))),o=(s<0?g.top:g.bottom)+h}let O=a.left+l,p=i??n.viewState.heightOracle.textHeight>>1;for(let g=0;;g+=10){let m=o+(p+g)*s,$=_y(n,{x:O,y:m},!1,s);if(ma.bottom||(s<0?$r)){let y=n.docView.coordsForChar($),k=!y||m{if(e>s&&er(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:te.cursor(i,is)&&this.lineBreak(),r=l}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,l=1,o;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,i),l=this.lineSeparator.length):(o=r.exec(t))&&(s=o.index,l=o[0].length),this.append(t.slice(i,s<0?t.length:s)),s<0)break;if(this.lineBreak(),l>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=l-1);i=s+l}}readNode(e){if(e.cmIgnore)return;let t=Xt.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(E4(e,i.node,i.offset)?t:0))}}function E4(n,e,t){for(;;){if(!e||t<$r(e))return!1;if(e==n)return!0;t=Ks(e)+1,e=e.parentNode}}class a1{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class M4{constructor(e,t,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:l}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let o=s||l?[]:V4(e),a=new U4(o,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=q4(o,this.bounds.from)}else{let o=e.observer.selectionRange,a=s&&s.node==o.focusNode&&s.offset==o.focusOffset||!FO(e.contentDOM,o.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(o.focusNode,o.focusOffset),c=l&&l.node==o.anchorNode&&l.offset==o.anchorOffset||!FO(e.contentDOM,o.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(o.anchorNode,o.anchorOffset),h=e.viewport;if((Qe.ios||Qe.chrome)&&e.state.selection.main.empty&&a!=c&&(h.from>0||h.toDate.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:o}=e.bounds,a=r.from,c=null;(s===8||Qe.android&&e.text.length=r.from&&t.to<=r.to&&(t.from!=r.from||t.to!=r.to)&&r.to-r.from-(t.to-t.from)<=4?t={from:r.from,to:r.to,insert:n.state.doc.slice(r.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,r.to))}:(Qe.mac||Qe.android)&&t&&t.from==t.to&&t.from==r.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=te.single(i.main.anchor-1,i.main.head-1)),t={from:r.from,to:r.to,insert:St.of([" "])}):Qe.chrome&&t&&t.from==t.to&&t.from==r.head&&t.insert.toString()==` + `&&n.lineWrapping&&(i&&(i=te.single(i.main.anchor-1,i.main.head-1)),t={from:r.from,to:r.to,insert:St.of([" "])}),t)return jd(n,t,i,s);if(i&&!i.main.eq(r)){let l=!1,o="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(l=!0),o=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:l,userEvent:o}),!0}else return!1}function jd(n,e,t,i=-1){if(Qe.ios&&n.inputState.flushIOSKey(e))return!0;let r=n.state.selection.main;if(Qe.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&n.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Rl(n.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.lengthr.head)&&Rl(n.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Rl(n.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let l,o=()=>l||(l=z4(n,e,t));return n.state.facet(dy).some(a=>a(n,e.from,e.to,s,o))||n.dispatch(o()),!0}function z4(n,e,t){let i,r=n.state,s=r.selection.main;if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let o=s.frome.to?r.sliceDoc(e.to,s.to):"";i=r.replaceSelection(n.state.toText(o+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let o=r.changes(e),a=t&&t.main.to<=o.newLength?t.main:void 0;if(r.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let c=n.state.sliceDoc(e.from,e.to),h,O=t&&ky(n,t.main.head);if(O){let m=e.insert.length-(e.to-e.from);h={from:O.from,to:O.to-m}}else h=n.state.doc.lineAt(s.head);let p=s.to-e.to,g=s.to-s.from;i=r.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:o,range:a||m.map(o)};let $=m.to-p,y=$-c.length;if(m.to-m.from!=g||n.state.sliceDoc(y,$)!=c||m.to>=h.from&&m.from<=h.to)return{range:m};let k=r.changes({from:y,to:$,insert:e.insert}),W=m.to-s.to;return{changes:k,range:a?te.range(Math.max(0,a.anchor+W),Math.max(0,a.head+W)):m.map(k)}})}else i={changes:o,selection:a&&r.selection.replaceRange(a)}}let l="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,l+=".compose",n.inputState.compositionFirstChange&&(l+=".start",n.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function D4(n,e,t,i){let r=Math.min(n.length,e.length),s=0;for(;s0&&o>0&&n.charCodeAt(l-1)==e.charCodeAt(o-1);)l--,o--;if(i=="end"){let a=Math.max(0,s-Math.min(l,o));t-=l+a-s}if(l=l?s-t:0;s-=a,o=s+(o-l),l=s}else if(o=o?s-t:0;s-=a,l=s+(l-o),o=s}return{from:s,toA:l,toB:o}}function V4(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:s}=n.observer.selectionRange;return t&&(e.push(new a1(t,i)),(r!=t||s!=i)&&e.push(new a1(r,s))),e}function q4(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?te.single(t+e,i+e):null}class L4{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,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=e.hasFocus,Qe.safari&&e.contentDOM.addEventListener("input",()=>null),Qe.gecko&&l5(e.contentDOM.ownerDocument)}handleEvent(e){!K4(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,t);for(let r of i.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=I4(e),i=this.handlers,r=this.view.contentDOM;for(let s in t)if(s!="scroll"){let l=!t[s].handlers.length,o=i[s];o&&l!=!o.handlers.length&&(r.removeEventListener(s,this.handleEvent),o=null),o||r.addEventListener(s,this.handleEvent,{passive:l})}for(let s in i)s!="scroll"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Wy.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Qe.android&&Qe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Qe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=xy.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||N4.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from0?!0:Qe.safari&&!Qe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function f1(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(r){en(t.state,r)}}}function I4(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let r=i.spec;if(r&&r.domEventHandlers)for(let s in r.domEventHandlers){let l=r.domEventHandlers[s];l&&t(s).handlers.push(f1(i.value,l))}if(r&&r.domEventObservers)for(let s in r.domEventObservers){let l=r.domEventObservers[s];l&&t(s).observers.push(f1(i.value,l))}}for(let i in er)t(i).handlers.push(er[i]);for(let i in Un)t(i).observers.push(Un[i]);return e}const xy=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],N4="dthko",Wy=[16,17,18,20,91,92,224,225],zf=6;function Df(n){return Math.max(0,n)*.7+8}function B4(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class j4{constructor(e,t,i,r){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=n4(e.contentDOM),this.atoms=e.state.facet(Bd).map(l=>l(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Ot.allowMultipleSelections)&&F4(e,t),this.dragging=H4(e,t)&&Zy(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&B4(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,r=0,s=0,l=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:l}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:o}=this.scrollParents.y.getBoundingClientRect());let a=Qy(this.view);e.clientX-a.left<=r+zf?t=-Df(r-e.clientX):e.clientX+a.right>=l-zf&&(t=Df(e.clientX-l)),e.clientY-a.top<=s+zf?i=-Df(s-e.clientY):e.clientY+a.bottom>=o-zf&&(i=Df(e.clientY-o)),this.setScrollSpeed(t,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let i=0;it.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function F4(n,e){let t=n.state.facet(cy);return t.length?t[0](e):Qe.mac?e.metaKey:e.ctrlKey}function G4(n,e){let t=n.state.facet(uy);return t.length?t[0](e):Qe.mac?!e.altKey:!e.ctrlKey}function H4(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=la(n.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&l.top<=e.clientY&&l.bottom>=e.clientY)return!0}return!1}function K4(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=Xt.get(t))&&i.ignoreEvent(e))return!1;return!0}const er=Object.create(null),Un=Object.create(null),Cy=Qe.ie&&Qe.ie_version<15||Qe.ios&&Qe.webkit_version<604;function J4(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),Ty(n,t.value)},50)}function au(n,e,t){for(let i of n.facet(e))t=i(t,n);return t}function Ty(n,e){e=au(n.state,Ld,e);let{state:t}=n,i,r=1,s=t.toText(e),l=s.lines==t.selection.ranges.length;if(fd!=null&&t.selection.ranges.every(a=>a.empty)&&fd==s.toString()){let a=-1;i=t.changeByRange(c=>{let h=t.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let O=t.toText((l?s.line(r++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:O},range:te.cursor(c.from+O.length)}})}else l?i=t.changeByRange(a=>{let c=s.line(r++);return{changes:{from:a.from,to:a.to,insert:c.text},range:te.cursor(a.from+c.length)}}):i=t.replaceSelection(s);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Un.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};er.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);Un.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};Un.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};er.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(hy))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=i5(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new j4(n,e,t,i)),i&&n.observer.ignore(()=>{I$(n.contentDOM);let s=n.root.activeElement;s&&!s.contains(n.contentDOM)&&s.blur()});let r=n.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}return!1};function c1(n,e,t,i){if(i==1)return te.cursor(e,t);if(i==2)return W4(n.state,e,t);{let r=si.find(n.docView,e),s=n.state.doc.lineAt(r?r.posAtEnd:e),l=r?r.posAtStart:s.from,o=r?r.posAtEnd:s.to;return oe>=t.top&&e<=t.bottom&&n>=t.left&&n<=t.right;function e5(n,e,t,i){let r=si.find(n.docView,e);if(!r)return 1;let s=e-r.posAtStart;if(s==0)return 1;if(s==r.length)return-1;let l=r.coordsAt(s,-1);if(l&&u1(t,i,l))return-1;let o=r.coordsAt(s,1);return o&&u1(t,i,o)?1:l&&l.bottom>=i?-1:1}function h1(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:e5(n,t,e.clientX,e.clientY)}}const t5=Qe.ie&&Qe.ie_version<=11;let O1=null,d1=0,p1=0;function Zy(n){if(!t5)return n.detail;let e=O1,t=p1;return O1=n,p1=Date.now(),d1=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(d1+1)%3:1}function i5(n,e){let t=h1(n,e),i=Zy(e),r=n.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,l,o){let a=h1(n,s),c,h=c1(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!l){let O=c1(n,t.pos,t.bias,i),p=Math.min(O.from,h.from),g=Math.max(O.to,h.to);h=p1&&(c=n5(r,a.pos))?c:o?r.addRange(h):te.create([h])}}}function n5(n,e){for(let t=0;t=e)return te.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}er.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let r=n.docView.nearest(e.target);if(r&&r.isWidget){let s=r.posAtStart,l=s+r.length;(s>=t.to||l<=t.from)&&(t=te.range(s,l))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",au(n.state,Id,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};er.dragend=n=>(n.inputState.draggedContent=null,!1);function g1(n,e,t,i){if(t=au(n.state,Ld,t),!t)return;let r=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=n.inputState,l=i&&s&&G4(n,e)?{from:s.from,to:s.to}:null,o={from:r,insert:t},a=n.state.changes(l?[l,o]:o);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:l?"move.drop":"input.drop"}),n.inputState.draggedContent=null}er.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),r=0,s=()=>{++r==t.length&&g1(n,e,i.filter(l=>l!=null).join(n.state.lineBreak),!1)};for(let l=0;l{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(i[l]=o.result),s()},o.readAsText(t[l])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return g1(n,e,i,!0),!0}return!1};er.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=Cy?null:e.clipboardData;return t?(Ty(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(J4(n),!1)};function r5(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function s5(n){let e=[],t=[],i=!1;for(let r of n.selection.ranges)r.empty||(e.push(n.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of n.selection.ranges){let l=n.doc.lineAt(s);l.number>r&&(e.push(l.text),t.push({from:l.from,to:Math.min(n.doc.length,l.to+1)})),r=l.number}i=!0}return{text:au(n,Id,e.join(n.lineBreak)),ranges:t,linewise:i}}let fd=null;er.copy=er.cut=(n,e)=>{let{text:t,ranges:i,linewise:r}=s5(n.state);if(!t&&!r)return!1;fd=r?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=Cy?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(r5(n,t),!1)};const Ry=Ir.define();function Ay(n,e){let t=[];for(let i of n.facet(py)){let r=i(n,e);r&&t.push(r)}return t?n.update({effects:t,annotations:Ry.of(!0)}):null}function Xy(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=Ay(n.state,e);t?n.dispatch(t):n.update([])}},10)}Un.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),Xy(n)};Un.blur=n=>{n.observer.clearSelectionRange(),Xy(n)};Un.compositionstart=Un.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};Un.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,Qe.chrome&&Qe.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};Un.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};er.beforeinput=(n,e)=>{var t,i;if(e.inputType=="insertReplacementText"&&n.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),l=e.getTargetRanges();if(s&&l.length){let o=l[0],a=n.posAtDOM(o.startContainer,o.startOffset),c=n.posAtDOM(o.endContainer,o.endOffset);return jd(n,{from:a,to:c,insert:n.state.toText(s)},null),!0}}let r;if(Qe.chrome&&Qe.android&&(r=xy.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var l;(((l=window.visualViewport)===null||l===void 0?void 0:l.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return Qe.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),Qe.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>Un.compositionend(n,e),20),!1};const m1=new Set;function l5(n){m1.has(n)||(m1.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const S1=["pre-wrap","normal","pre-line","break-spaces"];let ql=!1;function b1(){ql=!1}class o5{constructor(e){this.lineWrapping=e,this.doc=St.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return S1.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=i,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let c=0;c0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Oc&&(ql=!0),this.height=e)}replace(e,t,i){return Ii.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,r){let s=this,l=i.doc;for(let o=r.length-1;o>=0;o--){let{fromA:a,toA:c,fromB:h,toB:O}=r[o],p=s.lineAt(a,Dt.ByPosNoHeight,i.setDoc(t),0,0),g=p.to>=c?p:s.lineAt(c,Dt.ByPosNoHeight,i,0,0);for(O+=g.to-c,c=g.to;o>0&&p.from<=r[o-1].toA;)a=r[o-1].fromA,h=r[o-1].fromB,o--,as*2){let o=e[t-1];o.break?e.splice(--t,1,o.left,null,o.right):e.splice(--t,1,o.left,o.right),i+=1+o.break,r-=o.size}else if(s>r*2){let o=e[i];o.break?e.splice(i,1,o.left,null,o.right):e.splice(i,1,o.left,o.right),i+=2+o.break,s-=o.size}else break;else if(r=s&&l(this.blockAt(0,i,r,s))}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class dn extends Yy{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,r){return new dr(r,this.length,i,this.height,this.breaks)}replace(e,t,i){let r=i[0];return i.length==1&&(r instanceof dn||r instanceof wi&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof wi?r=new dn(r.length,this.height):r.height=this.height,this.outdated||(r.outdated=!1),r):Ii.of(i)}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more?this.setHeight(r.heights[r.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class wi extends Ii{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-i+1,l,o=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);l=a/s,this.length>s+1&&(o=(this.height-a)/(this.length-s-1))}else l=this.height/s;return{firstLine:i,lastLine:r,perLine:l,perChar:o}}blockAt(e,t,i,r){let{firstLine:s,lastLine:l,perLine:o,perChar:a}=this.heightMetrics(t,r);if(t.lineWrapping){let c=r+(e0){let s=i[i.length-1];s instanceof wi?i[i.length-1]=new wi(s.length+r):i.push(null,new wi(r-1))}if(e>0){let s=i[0];s instanceof wi?i[0]=new wi(e+s.length):i.unshift(new wi(e-1),null)}return Ii.of(i)}decomposeLeft(e,t){t.push(new wi(e-1),null)}decomposeRight(e,t){t.push(null,new wi(this.length-e-1))}updateHeight(e,t=0,i=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let l=[],o=Math.max(t,r.from),a=-1;for(r.from>t&&l.push(new wi(r.from-t-1).updateHeight(e,t));o<=s&&r.more;){let h=e.doc.lineAt(o).length;l.length&&l.push(null);let O=r.heights[r.index++];a==-1?a=O:Math.abs(O-a)>=Oc&&(a=-2);let p=new dn(h,O);p.outdated=!1,l.push(p),o+=h+1}o<=s&&l.push(null,new wi(s-o).updateHeight(e,o));let c=Ii.of(l);return(a<0||Math.abs(c.height-this.height)>=Oc||Math.abs(a-this.heightMetrics(e,t).perLine)>=Oc)&&(ql=!0),xc(this,c)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class f5 extends Ii{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,r){let s=i+this.left.height;return eo))return c;let h=t==Dt.ByPosNoHeight?Dt.ByPosNoHeight:Dt.ByPos;return a?c.join(this.right.lineAt(o,h,i,l,o)):this.left.lineAt(o,h,i,r,s).join(c)}forEachLine(e,t,i,r,s,l){let o=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,o,a,l);else{let c=this.lineAt(a,Dt.ByPos,i,r,s);e=e&&c.from<=t&&l(c),t>c.to&&this.right.forEachLine(c.to+1,t,i,o,a,l)}}replace(e,t,i){let r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,i));let s=[];e>0&&this.decomposeLeft(e,s);let l=s.length;for(let o of i)s.push(o);if(e>0&&$1(s,l-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?Ii.of(this.break?[e,null,t]:[e,t]):(this.left=xc(this.left,e),this.right=xc(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,r){let{left:s,right:l}=this,o=t+s.length+this.break,a=null;return r&&r.from<=t+s.length&&r.more?a=s=s.updateHeight(e,t,i,r):s.updateHeight(e,t,i),r&&r.from<=o+l.length&&r.more?a=l=l.updateHeight(e,o,i,r):l.updateHeight(e,o,i),a?this.balanced(s,l):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function $1(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof wi&&(i=n[e+1])instanceof wi&&n.splice(e-1,3,new wi(t.length+1+i.length))}const c5=5;class Fd{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof dn?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new dn(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=c5)&&this.addLineDeco(r,s,l)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new dn(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new wi(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof dn)return e;let t=new dn(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof dn)&&!this.isCovered?this.nodes.push(new dn(0,-1)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&O.overflow!="visible"){let p=h.getBoundingClientRect();s=Math.max(s,p.left),l=Math.min(l,p.right),o=Math.max(o,p.top),a=Math.min(c==n.parentNode?r.innerHeight:a,p.bottom)}c=O.position=="absolute"||O.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-t.left,right:Math.max(s,l)-t.left,top:o-(t.top+e),bottom:Math.max(o,a)-(t.top+e)}}function d5(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class iO{constructor(e,t,i,r){this.from=e,this.to=t,this.size=i,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new o5(t),this.stateDeco=e.facet(aa).filter(i=>typeof i!="function"),this.heightMap=Ii.empty().applyChanges(this.stateDeco,St.empty,this.heightOracle.setDoc(e.doc),[new Yn(0,0,0,e.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ze.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let r=i?t.head:t.anchor;if(!e.some(({from:s,to:l})=>r>=s&&r<=l)){let{from:s,to:l}=this.lineBlockAt(r);e.push(new Vf(s,l))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?v1:new Gd(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Lo(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(aa).filter(h=>typeof h!="function");let r=e.changedRanges,s=Yn.extendWithRanges(r,u5(i,this.stateDeco,e?e.changes:ui.empty(this.state.doc.length))),l=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);b1(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=l||ql)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(my)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Bt.RTL:Bt.LTR;let l=this.heightOracle.mustRefreshForWrapping(s),o=t.getBoundingClientRect(),a=l||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,h=0;if(o.width&&o.height){let{scaleX:A,scaleY:C}=L$(t,o);(A>.005&&Math.abs(this.scaleX-A)>.005||C>.005&&Math.abs(this.scaleY-C)>.005)&&(this.scaleX=A,this.scaleY=C,c|=8,l=a=!0)}let O=(parseInt(i.paddingTop)||0)*this.scaleY,p=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=O||this.paddingBottom!=p)&&(this.paddingTop=O,this.paddingBottom=p,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let g=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=g&&(this.scrollAnchorHeight=-1,this.scrollTop=g),this.scrolledToBottom=B$(e.scrollDOM);let m=(this.printing?d5:O5)(t,this.paddingTop),$=m.top-this.pixelViewport.top,y=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let k=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(k!=this.inView&&(this.inView=k,k&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let W=o.width;if((this.contentDOMWidth!=W||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),a){let A=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(A)&&(l=!0),l||r.lineWrapping&&Math.abs(W-this.contentDOMWidth)>r.charWidth){let{lineHeight:C,charWidth:U,textHeight:D}=e.docView.measureTextSize();l=C>0&&r.refresh(s,C,U,D,W/U,A),l&&(e.docView.minWidth=0,c|=8)}$>0&&y>0?h=Math.max($,y):$<0&&y<0&&(h=Math.min($,y)),b1();for(let C of this.viewports){let U=C.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(C);this.heightMap=(l?Ii.empty().applyChanges(this.stateDeco,St.empty,this.heightOracle,[new Yn(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,l,new a5(C.from,U))}ql&&(c|=2)}let Z=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return Z&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||Z)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:l,visibleBottom:o}=this,a=new Vf(r.lineAt(l-i*1e3,Dt.ByHeight,s,0,0).from,r.lineAt(o+(1-i)*1e3,Dt.ByHeight,s,0,0).to);if(t){let{head:c}=t.range;if(ca.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),O=r.lineAt(c,Dt.ByPos,s,0,0),p;t.y=="center"?p=(O.top+O.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&c=o+Math.max(10,Math.min(i,250)))&&r>l-2*1e3&&s>1,l=r<<1;if(this.defaultTextDirection!=Bt.LTR&&!i)return[];let o=[],a=(h,O,p,g)=>{if(O-hh&&kk.from>=p.from&&k.to<=p.to&&Math.abs(k.from-h)k.fromW));if(!y){if(OZ.from<=O&&Z.to>=O)){let Z=t.moveToLineBoundary(te.cursor(O),!1,!0).head;Z>h&&(O=Z)}let k=this.gapSize(p,h,O,g),W=i||k<2e6?k:2e6;y=new iO(h,O,k,W)}o.push(y)},c=h=>{if(h.length2e6)for(let U of e)U.from>=h.from&&U.fromh.from&&a(h.from,g,h,O),mt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];mt.spans(e,this.viewport.from,this.viewport.to,{span(r,s){t.push({from:r,to:s})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((r,s)=>r.from!=t[s].from||r.to!=t[s].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Lo(this.heightMap.lineAt(e,Dt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Lo(this.heightMap.lineAt(this.scaler.fromDOM(e),Dt.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Lo(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Vf{constructor(e,t){this.from=e,this.to=t}}function g5(n,e,t){let i=[],r=n,s=0;return mt.spans(t,n,e,{span(){},point(l,o){l>r&&(i.push({from:r,to:l}),s+=l-r),r=o}},20),r=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let r=0;;r++){let{from:s,to:l}=e[r],o=l-s;if(i<=o)return s+i;i-=o}}function Lf(n,e){let t=0;for(let{from:i,to:r}of n.ranges){if(e<=r){t+=e-i;break}t+=r-i}return t/n.total}function m5(n,e){for(let t of n)if(e(t))return t}const v1={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};class Gd{constructor(e,t,i){let r=0,s=0,l=0;this.viewports=i.map(({from:o,to:a})=>{let c=t.lineAt(o,Dt.ByPos,e,0,0).top,h=t.lineAt(a,Dt.ByPos,e,0,0).bottom;return r+=h-c,{from:o,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let o of this.viewports)o.domTop=l+(o.top-s)*this.scale,l=o.domBottom=o.domTop+(o.bottom-o.top),s=o.bottom}toDOM(e){for(let t=0,i=0,r=0;;t++){let s=tt.from==e.viewports[i].from&&t.to==e.viewports[i].to):!1}}function Lo(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new dr(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(r=>Lo(r,e)):n._content)}const If=ye.define({combine:n=>n.join(" ")}),cd=ye.define({combine:n=>n.indexOf(!0)>-1}),ud=ws.newName(),Uy=ws.newName(),Ey=ws.newName(),My={"&light":"."+Uy,"&dark":"."+Ey};function hd(n,e,t){return new ws(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return n;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):n+" "+i}})}const S5=hd("."+ud,{"&":{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:"#444"},".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,')`,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"}},My),b5={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},nO=Qe.ie&&Qe.ie_version<=11;class $5{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new r4,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(Qe.ie&&Qe.ie_version<=11||Qe.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(Qe.chrome&&Qe.chrome_version<126)&&(this.editContext=new v5(e),e.state.facet(ds)&&(e.contentDOM.editContext=this.editContext.editContext)),nO&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(ds)?i.root.activeElement!=this.dom:!uc(this.dom,r))return;let s=r.anchorNode&&i.docView.nearest(r.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Qe.ie&&Qe.ie_version<=11||Qe.android&&Qe.chrome)&&!i.state.selection.main.empty&&r.focusNode&&Ko(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=la(e.root);if(!t)return!1;let i=Qe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&y5(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let r=uc(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Rl(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,r=!1;for(let s of e){let l=this.readMutation(s);l&&(l.typeOver&&(r=!0),t==-1?{from:t,to:i}=l:(t=Math.min(l.from,t),i=Math.max(l.to,i)))}return{from:t,to:i,typeOver:r}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),r=this.selectionChanged&&uc(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new M4(this.view,e,t,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,r=Py(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let i=w1(t,e.previousSibling||e.target.previousSibling,-1),r=w1(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(ds)!=e.state.facet(ds)&&(e.view.contentDOM.editContext=e.state.facet(ds)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.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 w1(n,e,t){for(;e;){let i=Xt.get(e);if(i&&i.parent==n)return i;let r=e.parentNode;e=r!=n.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function Q1(n,e){let t=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,l=n.docView.domAtPos(n.state.selection.main.anchor);return Ko(l.node,l.offset,r,s)&&([t,i,r,s]=[r,s,t,i]),{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:s}}function y5(n,e){if(e.getComposedRanges){let r=e.getComposedRanges(n.root)[0];if(r)return Q1(n,r)}let t=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",i,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",i,!0),t?Q1(n,t):null}class v5{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let{anchor:r}=e.state.selection.main,s={from:this.toEditorPos(i.updateRangeStart),to:this.toEditorPos(i.updateRangeEnd),insert:St.of(i.text.split(` +`))};s.from==this.from&&rthis.to&&(s.to=r),!(s.from==s.to&&!s.insert.length)&&(this.pendingContextChange=s,e.state.readOnly||jd(e,s,te.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let l=this.toEditorPos(i.rangeStart),o=this.toEditorPos(i.rangeEnd);l{let r=[];for(let s of i.getTextFormats()){let l=s.underlineStyle,o=s.underlineThickness;if(l!="None"&&o!="None"){let a=`text-decoration: underline ${l=="Dashed"?"dashed ":l=="Squiggle"?"wavy ":""}${o=="Thin"?1:2}px`;r.push(Ze.mark({attributes:{style:a}}).range(this.toEditorPos(s.rangeStart),this.toEditorPos(s.rangeEnd)))}}e.dispatch({effects:by.of(Ze.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let r=la(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,l,o,a,c)=>{if(i)return;let h=c.length-(l-s);if(r&&l>=r.to)if(r.from==s&&r.to==l&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=h,this.to+=h;return}else r=null,this.revertPending(e.state);if(s+=t,l+=t,l<=this.from)this.from+=h,this.to+=h;else if(sthis.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(l),c.toString()),this.to+=h}t+=h}),r&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Oe{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(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||s4(e.parent)||document,this.viewState=new y1(e.state||Ot.create(e)),e.scrollTo&&e.scrollTo.is(Mf)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Do).map(r=>new Jh(r));for(let r of this.plugins)r.update(this);this.observer=new $5(this),this.inputState=new L4(this),this.inputState.ensureHandlers(this.plugins),this.docView=new i1(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof hi?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,r,s=this.state;for(let p of e){if(p.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=p.state}if(this.destroyed){this.viewState.state=s;return}let l=this.hasFocus,o=0,a=null;e.some(p=>p.annotation(Ry))?(this.inputState.notifiedFocused=l,o=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,a=Ay(s,l),a||(o=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(Ot.phrases)!=this.state.facet(Ot.phrases))return this.setState(s);r=Pc.create(this,s,e),r.flags|=o;let O=this.viewState.scrollTarget;try{this.updateState=2;for(let p of e){if(O&&(O=O.map(p.changes)),p.scrollIntoView){let{main:g}=p.state.selection;O=new Al(g.empty?g:te.cursor(g.head,g.head>g.anchor?-1:1))}for(let g of p.effects)g.is(Mf)&&(O=g.value.clip(this.state))}this.viewState.update(r,O),this.bidiCache=Wc.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(Vo)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(p=>p.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(If)!=r.state.facet(If)&&(this.viewState.mustMeasureContent=!0),(t||i||O||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let p of this.state.facet(ld))try{p(r)}catch(g){en(this.state,g,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!Py(this,h)&&c.force&&Rl(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new y1(e),this.plugins=e.facet(Do).map(i=>new Jh(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new i1(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Do),i=e.state.facet(Do);if(t!=i){let r=[];for(let s of i){let l=t.indexOf(s);if(l<0)r.push(new Jh(s));else{let o=this.plugins[l];o.mustUpdate=e,r.push(o)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,r=i.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:l}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(l=-1),this.viewState.scrollAnchorHeight=-1;try{for(let o=0;;o++){if(l<0)if(B$(i))s=-1,l=this.viewState.heightMap.height;else{let g=this.viewState.scrollAnchorAt(r);s=g.from,l=g.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(g=>{try{return g.read(this)}catch(m){return en(this.state,m),k1}}),O=Pc.create(this,this.state,[]),p=!1;O.flags|=a,t?t.flags|=a:t=O,this.updateState=2,O.empty||(this.updatePlugins(O),this.inputState.update(O),this.updateAttrs(),p=this.docView.update(O),p&&this.docViewUpdate());for(let g=0;g1||m<-1){r=r+m,i.scrollTop=r/this.scaleY,l=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let o of this.state.facet(ld))o(t)}get themeClasses(){return ud+" "+(this.state.facet(cd)?Ey:Uy)+" "+this.state.facet(If)}updateAttrs(){let e=_1(this,$y,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(ds)?"true":"false",class:"cm-content",style:`${Qe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),_1(this,Nd,t);let i=this.observer.ignore(()=>{let r=ed(this.contentDOM,this.contentAttrs,t),s=ed(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let r of i.effects)if(r.is(Oe.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Vo);let e=this.state.facet(Oe.cspNonce);ws.mount(this.root,this.styleModules.concat(S5).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;ti.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return tO(this,e,o1(this,e,t,i))}moveByGroup(e,t){return tO(this,e,o1(this,e,t,i=>X4(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=i[t?i.length-1:0];return te.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,i=!0){return A4(this,e,t,i)}moveVertically(e,t,i){return tO(this,e,Y4(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),_y(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),l=s[Ss.find(s,e-r.from,-1,t)];return lu(i,l.dir==Bt.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(gy)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>w5)return ay(e.length);let t=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||oy(s.isolates,i=t1(this,e))))return s.order;i||(i=t1(this,e));let r=S4(e.text,t,i);return this.bidiCache.push(new Wc(e.from,e.to,t,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Qe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{I$(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Mf.of(new Al(typeof e=="number"?te.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return Mf.of(new Al(te.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return oi.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return oi.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=ws.newName(),r=[If.of(i),Vo.of(hd(`.${i}`,e))];return t&&t.dark&&r.push(cd.of(!0)),r}static baseTheme(e){return il.lowest(Vo.of(hd("."+ud,e,My)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),r=i&&Xt.get(i)||Xt.get(e);return((t=r==null?void 0:r.rootView)===null||t===void 0?void 0:t.view)||null}}Oe.styleModule=Vo;Oe.inputHandler=dy;Oe.clipboardInputFilter=Ld;Oe.clipboardOutputFilter=Id;Oe.scrollHandler=Sy;Oe.focusChangeEffect=py;Oe.perLineTextDirection=gy;Oe.exceptionSink=Oy;Oe.updateListener=ld;Oe.editable=ds;Oe.mouseSelectionStyle=hy;Oe.dragMovesSelection=uy;Oe.clickAddsSelectionRange=cy;Oe.decorations=aa;Oe.outerDecorations=yy;Oe.atomicRanges=Bd;Oe.bidiIsolatedRanges=vy;Oe.scrollMargins=wy;Oe.darkTheme=cd;Oe.cspNonce=ye.define({combine:n=>n.length?n[0]:""});Oe.contentAttributes=Nd;Oe.editorAttributes=$y;Oe.lineWrapping=Oe.contentAttributes.of({class:"cm-lineWrapping"});Oe.announce=Ie.define();const w5=4096,k1={};class Wc{constructor(e,t,i,r,s,l){this.from=e,this.to=t,this.dir=i,this.isolates=r,this.fresh=s,this.order=l}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:Bt.LTR;for(let s=Math.max(0,e.length-10);s=0;r--){let s=i[r],l=typeof s=="function"?s(n):s;l&&JO(l,t)}return t}const Q5=Qe.mac?"mac":Qe.windows?"win":Qe.linux?"linux":"key";function k5(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let r,s,l,o;for(let a=0;ai.concat(r),[]))),t}function P5(n,e,t){return Dy(zy(n.state),e,n,t)}let ps=null;const x5=4e3;function W5(n,e=Q5){let t=Object.create(null),i=Object.create(null),r=(l,o)=>{let a=i[l];if(a==null)i[l]=o;else if(a!=o)throw new Error("Key binding "+l+" is used both as a regular binding and as a multi-stroke prefix")},s=(l,o,a,c,h)=>{var O,p;let g=t[l]||(t[l]=Object.create(null)),m=o.split(/ (?!$)/).map(k=>k5(k,e));for(let k=1;k{let A=ps={view:Z,prefix:W,scope:l};return setTimeout(()=>{ps==A&&(ps=null)},x5),!0}]})}let $=m.join(" ");r($,!1);let y=g[$]||(g[$]={preventDefault:!1,stopPropagation:!1,run:((p=(O=g._any)===null||O===void 0?void 0:O.run)===null||p===void 0?void 0:p.slice())||[]});a&&y.run.push(a),c&&(y.preventDefault=!0),h&&(y.stopPropagation=!0)};for(let l of n){let o=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let c of o){let h=t[c]||(t[c]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:O}=l;for(let p in h)h[p].run.push(g=>O(g,Od))}let a=l[e]||l.key;if(a)for(let c of o)s(c,a,l.run,l.preventDefault,l.stopPropagation),l.shift&&s(c,"Shift-"+a,l.shift,l.preventDefault,l.stopPropagation)}return t}let Od=null;function Dy(n,e,t,i){Od=e;let r=e4(e),s=Qi(r,0),l=Rn(s)==r.length&&r!=" ",o="",a=!1,c=!1,h=!1;ps&&ps.view==t&&ps.scope==i&&(o=ps.prefix+" ",Wy.indexOf(e.keyCode)<0&&(c=!0,ps=null));let O=new Set,p=y=>{if(y){for(let k of y.run)if(!O.has(k)&&(O.add(k),k(t)))return y.stopPropagation&&(h=!0),!0;y.preventDefault&&(y.stopPropagation&&(h=!0),c=!0)}return!1},g=n[i],m,$;return g&&(p(g[o+Nf(r,e,!l)])?a=!0:l&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Qe.windows&&e.ctrlKey&&e.altKey)&&(m=Qs[e.keyCode])&&m!=r?(p(g[o+Nf(m,e,!0)])||e.shiftKey&&($=sa[e.keyCode])!=r&&$!=m&&p(g[o+Nf($,e,!1)]))&&(a=!0):l&&e.shiftKey&&p(g[o+Nf(r,e,!0)])&&(a=!0),!a&&p(g._any)&&(a=!0)),c&&(a=!0),a&&h&&e.stopPropagation(),Od=null,a}class wa{constructor(e,t,i,r,s){this.className=e,this.left=t,this.top=i,this.width=r,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let r=e.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=Vy(e);return[new wa(t,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return C5(e,t,i)}}function Vy(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==Bt.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function x1(n,e,t,i){let r=n.coordsAtPos(e,t*2);if(!r)return i;let s=n.dom.getBoundingClientRect(),l=(r.top+r.bottom)/2,o=n.posAtCoords({x:s.left+1,y:l}),a=n.posAtCoords({x:s.right-1,y:l});return o==null||a==null?i:{from:Math.max(i.from,Math.min(o,a)),to:Math.min(i.to,Math.max(o,a))}}function C5(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),r=Math.min(t.to,n.viewport.to),s=n.textDirection==Bt.LTR,l=n.contentDOM,o=l.getBoundingClientRect(),a=Vy(n),c=l.querySelector(".cm-line"),h=c&&window.getComputedStyle(c),O=o.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),p=o.right-(h?parseInt(h.paddingRight):0),g=ad(n,i),m=ad(n,r),$=g.type==Li.Text?g:null,y=m.type==Li.Text?m:null;if($&&(n.lineWrapping||g.widgetLineBreaks)&&($=x1(n,i,1,$)),y&&(n.lineWrapping||m.widgetLineBreaks)&&(y=x1(n,r,-1,y)),$&&y&&$.from==y.from&&$.to==y.to)return W(Z(t.from,t.to,$));{let C=$?Z(t.from,null,$):A(g,!1),U=y?Z(null,t.to,y):A(m,!0),D=[];return($||g).to<(y||m).from-($&&y?1:0)||g.widgetLineBreaks>1&&C.bottom+n.defaultLineHeight/2E&&ae.from=Se)break;Pe>ve&&G(Math.max(Le,ve),C==null&&Le<=E,Math.min(Pe,Se),U==null&&Pe>=re,Ue.dir)}if(ve=ge.to+1,ve>=Se)break}return N.length==0&&G(E,C==null,re,U==null,n.textDirection),{top:z,bottom:j,horizontal:N}}function A(C,U){let D=o.top+(U?C.top:C.bottom);return{top:D,bottom:D,horizontal:[]}}}function T5(n,e){return n.constructor==e.constructor&&n.eq(e)}class Z5{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(dc)!=e.state.facet(dc)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(dc);for(;t!T5(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[i].constructor&&r.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(r.draw(),t);for(;t;){let r=t.nextSibling;t.remove(),t=r}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const dc=ye.define();function qy(n){return[oi.define(e=>new Z5(e,n)),dc.of(n)]}const Ly=!Qe.ios,fa=ye.define({combine(n){return yr(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function R5(n={}){return[fa.of(n),A5,X5,Y5,my.of(!0)]}function Iy(n){return n.startState.facet(fa)!=n.state.facet(fa)}const A5=qy({above:!0,markers(n){let{state:e}=n,t=e.facet(fa),i=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty?!s||Ly:t.drawRangeCursor){let l=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",o=r.empty?r:te.cursor(r.head,r.head>r.anchor?-1:1);for(let a of wa.forRange(n,l,o))i.push(a)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=Iy(n);return t&&W1(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){W1(e.state,n)},class:"cm-cursorLayer"});function W1(n,e){e.style.animationDuration=n.facet(fa).cursorBlinkRate+"ms"}const X5=qy({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:wa.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||Iy(n)},class:"cm-selectionLayer"}),dd={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};Ly&&(dd[".cm-line"].caretColor=dd[".cm-content"].caretColor="transparent !important");const Y5=il.highest(Oe.theme(dd)),Ny=Ie.define({map(n,e){return n==null?null:e.mapPos(n)}}),Io=pi.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(Ny)?i.value:t,n)}}),U5=oi.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(Io);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(Io)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(Io),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:t.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(Io)!=n&&this.view.dispatch({effects:Ny.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function E5(){return[Io,U5]}function C1(n,e,t,i,r){e.lastIndex=0;for(let s=n.iterRange(t,i),l=t,o;!s.next().done;l+=s.value.length)if(!s.lineBreak)for(;o=e.exec(s.value);)r(l+o.index,o)}function M5(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:r,to:s}of t)r=Math.max(n.state.doc.lineAt(r).from,r-e),s=Math.min(n.state.doc.lineAt(s).to,s+e),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class z5{constructor(e){const{regexp:t,decoration:i,decorate:r,boundary:s,maxLength:l=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(o,a,c,h)=>r(h,c,c+o[0].length,o,a);else if(typeof i=="function")this.addMatch=(o,a,c,h)=>{let O=i(o,a,c);O&&h(c,c+o[0].length,O)};else if(i)this.addMatch=(o,a,c,h)=>h(c,c+o[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=l}createDeco(e){let t=new vs,i=t.add.bind(t);for(let{from:r,to:s}of M5(e,this.maxLength))C1(e.state.doc,this.regexp,r,s,(l,o)=>this.addMatch(o,e,l,i));return t.finish()}updateDeco(e,t){let i=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((s,l,o,a)=>{a>e.view.viewport.from&&o1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),i,r):t}updateRange(e,t,i,r){for(let s of e.visibleRanges){let l=Math.max(s.from,i),o=Math.min(s.to,r);if(o>l){let a=e.state.doc.lineAt(l),c=a.toa.from;l--)if(this.boundary.test(a.text[l-1-a.from])){h=l;break}for(;op.push(k.range($,y));if(a==c)for(this.regexp.lastIndex=h-a.from;(g=this.regexp.exec(a.text))&&g.indexthis.addMatch(y,e,$,m));t=t.update({filterFrom:h,filterTo:O,filter:($,y)=>$O,add:p})}}return t}}const pd=/x/.unicode!=null?"gu":"g",D5=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,pd),V5={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 rO=null;function q5(){var n;if(rO==null&&typeof document<"u"&&document.body){let e=document.body.style;rO=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return rO||!1}const pc=ye.define({combine(n){let e=yr(n,{render:null,specialChars:D5,addSpecialChars:null});return(e.replaceTabs=!q5())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,pd)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,pd)),e}});function L5(n={}){return[pc.of(n),I5()]}let T1=null;function I5(){return T1||(T1=oi.fromClass(class{constructor(n){this.view=n,this.decorations=Ze.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(pc)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new z5({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:r}=t.state,s=Qi(e[0],0);if(s==9){let l=r.lineAt(i),o=t.state.tabSize,a=Gl(l.text,o,i-l.from);return Ze.replace({widget:new F5((o-a%o)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Ze.replace({widget:new j5(n,s)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(pc);n.startState.facet(pc)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const N5="•";function B5(n){return n>=32?N5:n==10?"␤":String.fromCharCode(9216+n)}class j5 extends Nr{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=B5(this.code),i=e.state.phrase("Control character")+" "+(V5[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,t);if(r)return r;let s=document.createElement("span");return s.textContent=t,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class F5 extends Nr{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function G5(){return K5}const H5=Ze.line({class:"cm-activeLine"}),K5=oi.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let i of n.state.selection.ranges){let r=n.lineBlockAt(i.head);r.from>e&&(t.push(H5.range(r.from)),e=r.from)}return Ze.set(t)}},{decorations:n=>n.decorations}),gd=2e3;function J5(n,e,t){let i=Math.min(e.line,t.line),r=Math.max(e.line,t.line),s=[];if(e.off>gd||t.off>gd||e.col<0||t.col<0){let l=Math.min(e.off,t.off),o=Math.max(e.off,t.off);for(let a=i;a<=r;a++){let c=n.doc.line(a);c.length<=o&&s.push(te.range(c.from+l,c.to+o))}}else{let l=Math.min(e.col,t.col),o=Math.max(e.col,t.col);for(let a=i;a<=r;a++){let c=n.doc.line(a),h=NO(c.text,l,n.tabSize,!0);if(h<0)s.push(te.cursor(c.to));else{let O=NO(c.text,o,n.tabSize);s.push(te.range(c.from+h,c.from+O))}}}return s}function e3(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function Z1(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),r=t-i.from,s=r>gd?-1:r==i.length?e3(n,e.clientX):Gl(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:s,off:r}}function t3(n,e){let t=Z1(n,e),i=n.state.selection;return t?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(t.line).from),l=r.state.doc.lineAt(s);t={line:l.number,col:t.col,off:Math.min(t.off,l.length)},i=i.map(r.changes)}},get(r,s,l){let o=Z1(n,r);if(!o)return i;let a=J5(n.state,t,o);return a.length?l?te.create(a.concat(i.ranges)):te.create(a):i}}:null}function i3(n){let e=t=>t.altKey&&t.button==0;return Oe.mouseSelectionStyle.of((t,i)=>e(i)?t3(t,i):null)}const n3={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},r3={style:"cursor: crosshair"};function s3(n={}){let[e,t]=n3[n.key||"Alt"],i=oi.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[i,Oe.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?r3:null})]}const Ro="-10000px";class By{constructor(e,t,i,r){this.facet=t,this.createTooltipView=i,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(l=>l);let s=null;this.tooltipViews=this.tooltips.map(l=>s=i(l,s))}update(e,t){var i;let r=e.state.facet(this.facet),s=r.filter(a=>a);if(r===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let l=[],o=t?[]:null;for(let a=0;at[c]=a),t.length=o.length),this.input=r,this.tooltips=s,this.tooltipViews=l,!0}}function l3(n){let{win:e}=n;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const sO=ye.define({combine:n=>{var e,t,i;return{position:Qe.ios?"absolute":((e=n.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(r=>r.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||l3}}}),R1=new WeakMap,Hd=oi.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(sO);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new By(n,Kd,(t,i)=>this.createTooltip(t,i),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.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 n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(sO);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),i=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",t.dom.appendChild(r)}return t.dom.style.position=this.position,t.dom.style.top=Ro,t.dom.style.left="0px",this.container.insertBefore(t.dom,i),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect(),e=1,t=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(Qe.gecko)i=r.offsetParent!=this.container.ownerDocument.body;else if(r.style.top==Ro&&r.style.left=="0px"){let s=r.getBoundingClientRect();i=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}}if(i||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(e=r.width/this.parent.offsetWidth,t=r.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((r,s)=>{let l=this.manager.tooltipViews[s];return l.getCoords?l.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(sO).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:i}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let o of this.manager.tooltipViews)o.dom.style.position="absolute"}let{editor:t,space:i,scaleX:r,scaleY:s}=n,l=[];for(let o=0;o=Math.min(t.bottom,i.bottom)||O.rightMath.min(t.right,i.right)+.1){h.style.top=Ro;continue}let g=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,m=g?7:0,$=p.right-p.left,y=(e=R1.get(c))!==null&&e!==void 0?e:p.bottom-p.top,k=c.offset||a3,W=this.view.textDirection==Bt.LTR,Z=p.width>i.right-i.left?W?i.left:i.right-p.width:W?Math.max(i.left,Math.min(O.left-(g?14:0)+k.x,i.right-$)):Math.min(Math.max(i.left,O.left-$+(g?14:0)-k.x),i.right-$),A=this.above[o];!a.strictSide&&(A?O.top-(p.bottom-p.top)-k.yi.bottom)&&A==i.bottom-O.bottom>O.top-i.top&&(A=this.above[o]=!A);let C=(A?O.top-i.top:i.bottom-O.bottom)-m;if(CZ&&z.topU&&(U=A?z.top-y-2-m:z.bottom+m+2);if(this.position=="absolute"?(h.style.top=(U-n.parent.top)/s+"px",h.style.left=(Z-n.parent.left)/r+"px"):(h.style.top=U/s+"px",h.style.left=Z/r+"px"),g){let z=O.left+(W?k.x:-k.x)-(Z+14-7);g.style.left=z/r+"px"}c.overlap!==!0&&l.push({left:Z,top:U,right:D,bottom:U+y}),h.classList.toggle("cm-tooltip-above",A),h.classList.toggle("cm-tooltip-below",!A),c.positioned&&c.positioned(n.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 n of this.manager.tooltipViews)n.dom.style.top=Ro}},{eventObservers:{scroll(){this.maybeMeasure()}}}),o3=Oe.baseTheme({".cm-tooltip":{zIndex:100,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:`${7*2}px`,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"}}}),a3={x:0,y:0},Kd=ye.define({enables:[Hd,o3]}),Cc=ye.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class fu{static create(e){return new fu(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new By(e,Cc,(t,i)=>this.createHostedView(t,i),t=>t.dom.remove())}createHostedView(e,t){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let r=i[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}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 f3=Kd.compute([Cc],n=>{let e=n.facet(Cc);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var i;return(i=t.end)!==null&&i!==void 0?i:t.pos})),create:fu.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class c3{constructor(e,t,i,r,s){this.view=e,this.source=t,this.field=i,this.setHover=r,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.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 e=Date.now()-this.lastMove.time;eo.bottom||t.xo.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(h=>h.from<=r&&h.to>=r),c=a&&a.dir==Bt.RTL?-1:1;s=t.x{this.pending==o&&(this.pending=null,a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])}))},a=>en(e.state,a,"hover tooltip"))}else l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])})}get tooltip(){let e=this.view.plugin(Hd),t=e?e.manager.tooltips.findIndex(i=>i.create==fu.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&s&&!u3(s.dom,e)||this.pending){let{pos:l}=r[0]||this.pending,o=(i=(t=r[0])===null||t===void 0?void 0:t.end)!==null&&i!==void 0?i:l;(l==o?this.view.posAtCoords(this.lastMove)!=l:!h3(this.view,l,o,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=i=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Bf=4;function u3(n,e){let{left:t,right:i,top:r,bottom:s}=n.getBoundingClientRect(),l;if(l=n.querySelector(".cm-tooltip-arrow")){let o=l.getBoundingClientRect();r=Math.min(o.top,r),s=Math.max(o.bottom,s)}return e.clientX>=t-Bf&&e.clientX<=i+Bf&&e.clientY>=r-Bf&&e.clientY<=s+Bf}function h3(n,e,t,i,r,s){let l=n.scrollDOM.getBoundingClientRect(),o=n.documentTop+n.documentPadding.top+n.contentHeight;if(l.left>i||l.rightr||Math.min(l.bottom,o)=e&&a<=t}function O3(n,e={}){let t=Ie.define(),i=pi.define({create(){return[]},update(r,s){if(r.length&&(e.hideOnChange&&(s.docChanged||s.selection)?r=[]:e.hideOn&&(r=r.filter(l=>!e.hideOn(s,l))),s.docChanged)){let l=[];for(let o of r){let a=s.changes.mapPos(o.pos,-1,_i.TrackDel);if(a!=null){let c=Object.assign(Object.create(null),o);c.pos=a,c.end!=null&&(c.end=s.changes.mapPos(c.end)),l.push(c)}}r=l}for(let l of s.effects)l.is(t)&&(r=l.value),l.is(d3)&&(r=[]);return r},provide:r=>Cc.from(r)});return{active:i,extension:[i,oi.define(r=>new c3(r,n,i,t,e.hoverTime||300)),f3]}}function jy(n,e){let t=n.plugin(Hd);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const d3=Ie.define(),A1=ye.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function ca(n,e){let t=n.plugin(Fy),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const Fy=oi.fromClass(class{constructor(n){this.input=n.state.facet(ua),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(A1);this.top=new jf(n,!0,e.topContainer),this.bottom=new jf(n,!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(n){let e=n.state.facet(A1);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new jf(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new jf(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(ua);if(t!=this.input){let i=t.filter(a=>a),r=[],s=[],l=[],o=[];for(let a of i){let c=this.specs.indexOf(a),h;c<0?(h=a(n.view),o.push(h)):(h=this.panels[c],h.update&&h.update(n)),r.push(h),(h.top?s:l).push(h)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(l);for(let a of o)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>Oe.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class jf{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}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 e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=X1(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=X1(e)}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 e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function X1(n){let e=n.nextSibling;return n.remove(),e}const ua=ye.define({enables:Fy});class Lr extends Hs{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Lr.prototype.elementClass="";Lr.prototype.toDOM=void 0;Lr.prototype.mapMode=_i.TrackBefore;Lr.prototype.startSide=Lr.prototype.endSide=-1;Lr.prototype.point=!0;const gc=ye.define(),p3=ye.define(),g3={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>mt.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},ea=ye.define();function m3(n){return[Gy(),ea.of(Object.assign(Object.assign({},g3),n))]}const Y1=ye.define({combine:n=>n.some(e=>e)});function Gy(n){return[S3]}const S3=oi.fromClass(class{constructor(n){this.view=n,this.prevViewport=n.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=n.state.facet(ea).map(e=>new E1(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(Y1),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}n.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(Y1)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&this.dom.remove();let t=mt.iter(this.view.state.facet(gc),this.view.viewport.from),i=[],r=this.gutters.map(s=>new b3(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let l=!0;for(let o of s.type)if(o.type==Li.Text&&l){md(t,i,o.from);for(let a of r)a.line(this.view,o,i);l=!1}else if(o.widget)for(let a of r)a.widget(this.view,o)}else if(s.type==Li.Text){md(t,i,s.from);for(let l of r)l.line(this.view,s,i)}else if(s.widget)for(let l of r)l.widget(this.view,s);for(let s of r)s.finish();n&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(n){let e=n.startState.facet(ea),t=n.state.facet(ea),i=n.docChanged||n.heightChanged||n.viewportChanged||!mt.eq(n.startState.facet(gc),n.state.facet(gc),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(n)&&(i=!0);else{i=!0;let r=[];for(let s of t){let l=e.indexOf(s);l<0?r.push(new E1(this.view,s)):(this.gutters[l].update(n),r.push(this.gutters[l]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>Oe.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==Bt.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function U1(n){return Array.isArray(n)?n:[n]}function md(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class b3{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=mt.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:r}=this,s=(t.top-this.height)/e.scaleY,l=t.height/e.scaleY;if(this.i==r.elements.length){let o=new Hy(e,l,s,i);r.elements.push(o),r.dom.appendChild(o.dom)}else r.elements[this.i].update(e,l,s,i);this.height=t.bottom,this.i++}line(e,t,i){let r=[];md(this.cursor,r,t.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(e,t,r);s&&r.unshift(s);let l=this.gutter;r.length==0&&!l.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),r=i?[i]:null;for(let s of e.state.facet(p3)){let l=s(e,t.widget,t);l&&(r||(r=[])).push(l)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class E1{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,l;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let a=s.getBoundingClientRect();l=(a.top+a.bottom)/2}else l=r.clientY;let o=e.lineBlockAtHeight(l-e.documentTop);t.domEventHandlers[i](e,o,r)&&r.preventDefault()});this.markers=U1(t.markers(e)),t.initialSpacer&&(this.spacer=new Hy(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=U1(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!mt.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Hy{constructor(e,t,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,r)}update(e,t,i,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),$3(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,l=0;;){let o=l,a=ss(o,a,c)||l(o,a,c):l}return i}})}});class lO extends Lr{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function oO(n,e){return n.state.facet(_l).formatNumber(e,n.state)}const w3=ea.compute([_l],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(y3)},lineMarker(e,t,i){return i.some(r=>r.toDOM)?null:new lO(oO(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let r of e.state.facet(v3)){let s=r(e,t,i);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(_l)!=e.state.facet(_l),initialSpacer(e){return new lO(oO(e,M1(e.state.doc.lines)))},updateSpacer(e,t){let i=oO(t.view,M1(t.view.state.doc.lines));return i==e.number?e:new lO(i)},domEventHandlers:n.facet(_l).domEventHandlers}));function Q3(n={}){return[_l.of(n),Gy(),w3]}function M1(n){let e=9;for(;e{let e=[],t=-1;for(let i of n.selection.ranges){let r=n.doc.lineAt(i.head).from;r>t&&(t=r,e.push(k3.range(r)))}return mt.of(e)});function P3(){return _3}function x3(n){let e;return{c(){e=_("div"),v(e,"class","mzn-editor svelte-1fycn7h")},m(t,i){Y(t,e,i),n[7](e)},p:_e,i:_e,o:_e,d(t){t&&X(e),n[7](null)}}}function W3(n,e,t){let{state:i}=e,r,s;su(()=>{t(6,s=new Oe({parent:r}))});function l(){return s||null}function o(){return s?s.state:null}async function a(O){s&&(await Gn(),s.dispatch({selection:{anchor:O}}))}function c(){s.focus()}function h(O){Mt[O?"unshift":"push"](()=>{r=O,t(0,r)})}return n.$$set=O=>{"state"in O&&t(1,i=O.state)},n.$$.update=()=>{n.$$.dirty&66&&s&&i&&s.state!==i&&s.setState(i)},[r,i,l,o,a,c,s,h]}class C3 extends $i{constructor(e){super(),bi(this,e,W3,x3,Oi,{state:1,getView:2,getState:3,setCursor:4,focus:5})}get getView(){return this.$$.ctx[2]}get getState(){return this.$$.ctx[3]}get setCursor(){return this.$$.ctx[4]}get focus(){return this.$$.ctx[5]}}var Cn=typeof window<"u"?window:null,Jd=Cn===null,ha=Jd?void 0:Cn.document,Nn="addEventListener",Bn="removeEventListener",aO="getBoundingClientRect",Ao="_a",jn="_b",Er="_c",Ff="horizontal",Fn=function(){return!1},T3=Jd?"calc":["","-webkit-","-moz-","-o-"].filter(function(n){var e=ha.createElement("div");return e.style.cssText="width:"+n+"calc(9px)",!!e.style.length}).shift()+"calc",Ky=function(n){return typeof n=="string"||n instanceof String},z1=function(n){if(Ky(n)){var e=ha.querySelector(n);if(!e)throw new Error("Selector "+n+" did not match a DOM element");return e}return n},Ti=function(n,e,t){var i=n[e];return i!==void 0?i:t},Gf=function(n,e,t,i){if(e){if(i==="end")return 0;if(i==="center")return n/2}else if(t){if(i==="start")return 0;if(i==="center")return n/2}return n},Z3=function(n,e){var t=ha.createElement("div");return t.className="gutter gutter-"+e,t},R3=function(n,e,t){var i={};return Ky(e)?i[n]=e:i[n]=T3+"("+e+"% - "+t+"px)",i},A3=function(n,e){var t;return t={},t[n]=e+"px",t},X3=function(n,e){if(e===void 0&&(e={}),Jd)return{};var t=n,i,r,s,l,o,a;Array.from&&(t=Array.from(t));var c=z1(t[0]),h=c.parentNode,O=getComputedStyle?getComputedStyle(h):null,p=O?O.flexDirection:null,g=Ti(e,"sizes")||t.map(function(){return 100/t.length}),m=Ti(e,"minSize",100),$=Array.isArray(m)?m:t.map(function(){return m}),y=Ti(e,"maxSize",1/0),k=Array.isArray(y)?y:t.map(function(){return y}),W=Ti(e,"expandToMin",!1),Z=Ti(e,"gutterSize",10),A=Ti(e,"gutterAlign","center"),C=Ti(e,"snapOffset",30),U=Array.isArray(C)?C:t.map(function(){return C}),D=Ti(e,"dragInterval",1),z=Ti(e,"direction",Ff),j=Ti(e,"cursor",z===Ff?"col-resize":"row-resize"),N=Ti(e,"gutter",Z3),G=Ti(e,"elementStyle",R3),E=Ti(e,"gutterStyle",A3);z===Ff?(i="width",r="clientX",s="left",l="right",o="clientWidth"):z==="vertical"&&(i="height",r="clientY",s="top",l="bottom",o="clientHeight");function re(oe,H,ue,ce){var Ee=G(i,H,ue,ce);Object.keys(Ee).forEach(function(tt){oe.style[tt]=Ee[tt]})}function ae(oe,H,ue){var ce=E(i,H,ue);Object.keys(ce).forEach(function(Ee){oe.style[Ee]=ce[Ee]})}function ve(){return a.map(function(oe){return oe.size})}function Se(oe){return"touches"in oe?oe.touches[0][r]:oe[r]}function ge(oe){var H=a[this.a],ue=a[this.b],ce=H.size+ue.size;H.size=oe/this.size*ce,ue.size=ce-oe/this.size*ce,re(H.element,H.size,this[jn],H.i),re(ue.element,ue.size,this[Er],ue.i)}function Ue(oe){var H,ue=a[this.a],ce=a[this.b];this.dragging&&(H=Se(oe)-this.start+(this[jn]-this.dragOffset),D>1&&(H=Math.round(H/D)*D),H<=ue.minSize+ue.snapOffset+this[jn]?H=ue.minSize+this[jn]:H>=this.size-(ce.minSize+ce.snapOffset+this[Er])&&(H=this.size-(ce.minSize+this[Er])),H>=ue.maxSize-ue.snapOffset+this[jn]?H=ue.maxSize+this[jn]:H<=this.size-(ce.maxSize-ce.snapOffset+this[Er])&&(H=this.size-(ce.maxSize+this[Er])),ge.call(this,H),Ti(e,"onDrag",Fn)(ve()))}function Le(){var oe=a[this.a].element,H=a[this.b].element,ue=oe[aO](),ce=H[aO]();this.size=ue[i]+ce[i]+this[jn]+this[Er],this.start=ue[s],this.end=ue[l]}function Pe(oe){if(!getComputedStyle)return null;var H=getComputedStyle(oe);if(!H)return null;var ue=oe[o];return ue===0?null:(z===Ff?ue-=parseFloat(H.paddingLeft)+parseFloat(H.paddingRight):ue-=parseFloat(H.paddingTop)+parseFloat(H.paddingBottom),ue)}function We(oe){var H=Pe(h);if(H===null||$.reduce(function(tt,ft){return tt+ft},0)>H)return oe;var ue=0,ce=[],Ee=oe.map(function(tt,ft){var Be=H*tt/100,Yt=Gf(Z,ft===0,ft===oe.length-1,A),ut=$[ft]+Yt;return Be0&&ce[ft]-ue>0){var Yt=Math.min(ue,ce[ft]-ue);ue-=Yt,Be=tt-Yt}return Be/H*100})}function lt(){var oe=this,H=a[oe.a].element,ue=a[oe.b].element;oe.dragging&&Ti(e,"onDragEnd",Fn)(ve()),oe.dragging=!1,Cn[Bn]("mouseup",oe.stop),Cn[Bn]("touchend",oe.stop),Cn[Bn]("touchcancel",oe.stop),Cn[Bn]("mousemove",oe.move),Cn[Bn]("touchmove",oe.move),oe.stop=null,oe.move=null,H[Bn]("selectstart",Fn),H[Bn]("dragstart",Fn),ue[Bn]("selectstart",Fn),ue[Bn]("dragstart",Fn),H.style.userSelect="",H.style.webkitUserSelect="",H.style.MozUserSelect="",H.style.pointerEvents="",ue.style.userSelect="",ue.style.webkitUserSelect="",ue.style.MozUserSelect="",ue.style.pointerEvents="",oe.gutter.style.cursor="",oe.parent.style.cursor="",ha.body.style.cursor=""}function Vt(oe){if(!("button"in oe&&oe.button!==0)){var H=this,ue=a[H.a].element,ce=a[H.b].element;H.dragging||Ti(e,"onDragStart",Fn)(ve()),oe.preventDefault(),H.dragging=!0,H.move=Ue.bind(H),H.stop=lt.bind(H),Cn[Nn]("mouseup",H.stop),Cn[Nn]("touchend",H.stop),Cn[Nn]("touchcancel",H.stop),Cn[Nn]("mousemove",H.move),Cn[Nn]("touchmove",H.move),ue[Nn]("selectstart",Fn),ue[Nn]("dragstart",Fn),ce[Nn]("selectstart",Fn),ce[Nn]("dragstart",Fn),ue.style.userSelect="none",ue.style.webkitUserSelect="none",ue.style.MozUserSelect="none",ue.style.pointerEvents="none",ce.style.userSelect="none",ce.style.webkitUserSelect="none",ce.style.MozUserSelect="none",ce.style.pointerEvents="none",H.gutter.style.cursor=j,H.parent.style.cursor=j,ha.body.style.cursor=j,Le.call(H),H.dragOffset=Se(oe)-H.end}}g=We(g);var Qt=[];a=t.map(function(oe,H){var ue={element:z1(oe),size:g[H],minSize:$[H],maxSize:k[H],snapOffset:U[H],i:H},ce;if(H>0&&(ce={a:H-1,b:H,dragging:!1,direction:z,parent:h},ce[jn]=Gf(Z,H-1===0,!1,A),ce[Er]=Gf(Z,!1,H===t.length-1,A),p==="row-reverse"||p==="column-reverse")){var Ee=ce.a;ce.a=ce.b,ce.b=Ee}if(H>0){var tt=N(H,z,ue.element);ae(tt,Z,H),ce[Ao]=Vt.bind(ce),tt[Nn]("mousedown",ce[Ao]),tt[Nn]("touchstart",ce[Ao]),h.insertBefore(tt,ue.element),ce.gutter=tt}return re(ue.element,ue.size,Gf(Z,H===0,H===t.length-1,A),H),H>0&&Qt.push(ce),ue});function pt(oe){var H=oe.i===Qt.length,ue=H?Qt[oe.i-1]:Qt[oe.i];Le.call(ue);var ce=H?ue.size-oe.minSize-ue[Er]:oe.minSize+ue[jn];ge.call(ue,ce)}a.forEach(function(oe){var H=oe.element[aO]()[i];H0){var Ee=Qt[ce-1],tt=a[Ee.a],ft=a[Ee.b];tt.size=H[ce-1],ft.size=ue,re(tt.element,tt.size,Ee[jn],tt.i),re(ft.element,ft.size,Ee[Er],ft.i)}})}function $e(oe,H){Qt.forEach(function(ue){if(H!==!0?ue.parent.removeChild(ue.gutter):(ue.gutter[Bn]("mousedown",ue[Ao]),ue.gutter[Bn]("touchstart",ue[Ao])),oe!==!0){var ce=G(i,ue.a.size,ue[jn]);Object.keys(ce).forEach(function(Ee){a[ue.a].element.style[Ee]="",a[ue.b].element.style[Ee]=""})}})}return{setSizes:qt,getSizes:ve,collapse:function(H){pt(a[H])},destroy:$e,parent:h,pairs:Qt}};const Y3=n=>({}),D1=n=>({}),U3=n=>({}),V1=n=>({});function E3(n){let e,t,i,r,s;const l=n[6].panelA,o=Ri(l,n,n[5],V1),a=n[6].panelB,c=Ri(a,n,n[5],D1);return{c(){e=_("div"),t=_("div"),o&&o.c(),i=I(),r=_("div"),c&&c.c(),v(t,"class","split-panel svelte-1k68mj4"),ne(t,"no-splitter",n[1]!=="all"),ne(t,"is-hidden",!Hf("a",n[1])),v(r,"class","split-panel svelte-1k68mj4"),ne(r,"no-splitter",n[1]!=="all"),ne(r,"is-hidden",!Hf("b",n[1])),v(e,"class","split svelte-1k68mj4"),ne(e,"horizontal",n[0]==="horizontal")},m(h,O){Y(h,e,O),Q(e,t),o&&o.m(t,null),n[7](t),Q(e,i),Q(e,r),c&&c.m(r,null),n[8](r),s=!0},p(h,[O]){o&&o.p&&(!s||O&32)&&Xi(o,l,h,h[5],s?Ai(l,h[5],O,U3):Yi(h[5]),V1),(!s||O&2)&&ne(t,"no-splitter",h[1]!=="all"),(!s||O&2)&&ne(t,"is-hidden",!Hf("a",h[1])),c&&c.p&&(!s||O&32)&&Xi(c,a,h,h[5],s?Ai(a,h[5],O,Y3):Yi(h[5]),D1),(!s||O&2)&&ne(r,"no-splitter",h[1]!=="all"),(!s||O&2)&&ne(r,"is-hidden",!Hf("b",h[1])),(!s||O&1)&&ne(e,"horizontal",h[0]==="horizontal")},i(h){s||(V(o,h),V(c,h),s=!0)},o(h){B(o,h),B(c,h),s=!1},d(h){h&&X(e),o&&o.d(h),n[7](null),c&&c.d(h),n[8](null)}}}function Hf(n,e){return e==="all"||e===n}function M3(n,e,t){let{$$slots:i={},$$scope:r}=e,{direction:s="horizontal"}=e,{split:l=50}=e,{showPanels:o="all"}=e,a,c,h=null;function O(y,k){p(),k==="all"&&a&&c&&(h=X3([a,c],{direction:y,minSize:0,sizes:[l,100-l],onDragEnd(W){t(4,l=W[0])}}))}function p(){h&&(h.destroy(),h=null)}function g(y){h&&h.getSizes()[0]!==y&&h.setSizes([y,100-y])}su(()=>(O(s,o),p));function m(y){Mt[y?"unshift":"push"](()=>{a=y,t(2,a)})}function $(y){Mt[y?"unshift":"push"](()=>{c=y,t(3,c)})}return n.$$set=y=>{"direction"in y&&t(0,s=y.direction),"split"in y&&t(4,l=y.split),"showPanels"in y&&t(1,o=y.showPanels),"$$scope"in y&&t(5,r=y.$$scope)},n.$$.update=()=>{n.$$.dirty&3&&O(s,o),n.$$.dirty&16&&g(l)},[s,o,a,c,l,r,i,m,$]}class z3 extends $i{constructor(e){super(),bi(this,e,M3,E3,Oi,{direction:0,split:4,showPanels:1})}}function D3(n,e){e&&e!=="lg"&&e!=="sm"&&e!=="xs"?n.style.fontSize=e.replace("x","em"):n.style.fontSize=""}function V3(n,e,t,i,r,s=1,l="",o=""){let a=1,c=1;r&&(r=="horizontal"?a=-1:r=="vertical"?c=-1:a=c=-1),typeof n=="string"&&(n=parseFloat(n)),typeof e=="string"&&(e=parseFloat(e)),typeof t=="string"&&(t=parseFloat(t));const h=`${e*s}${l}`,O=`${t*s}${l}`;let p=`translate(${h},${O}) scale(${a*n},${c*n})`;return i&&(p+=` rotate(${i}${o})`),p}function q1(n){let e,t,i,r,s,l,o,a=n[3]&&L1(n);function c(p,g){return typeof p[17][4]=="string"?L3:q3}let h=c(n),O=h(n);return{c(){e=Gs("svg"),a&&a.c(),t=Gs("g"),i=Gs("g"),O.c(),v(i,"transform",n[16]),v(t,"transform",r="translate("+n[17][0]/2+" "+n[17][1]/2+")"),v(t,"transform-origin",s=n[17][0]/4+" 0"),v(e,"id",n[1]),v(e,"class",l="svelte-fa svelte-fa-base "+n[0]+" svelte-bvo74f"),v(e,"style",n[2]),v(e,"viewBox",o="0 0 "+n[17][0]+" "+n[17][1]),v(e,"aria-hidden","true"),v(e,"role","img"),v(e,"xmlns","http://www.w3.org/2000/svg"),ne(e,"pulse",n[9]),ne(e,"svelte-fa-size-lg",n[4]==="lg"),ne(e,"svelte-fa-size-sm",n[4]==="sm"),ne(e,"svelte-fa-size-xs",n[4]==="xs"),ne(e,"svelte-fa-fw",n[6]),ne(e,"svelte-fa-pull-left",n[7]==="left"),ne(e,"svelte-fa-pull-right",n[7]==="right"),ne(e,"spin",n[8])},m(p,g){Y(p,e,g),a&&a.m(e,null),Q(e,t),Q(t,i),O.m(i,null),n[24](e)},p(p,g){p[3]?a?a.p(p,g):(a=L1(p),a.c(),a.m(e,t)):a&&(a.d(1),a=null),h===(h=c(p))&&O?O.p(p,g):(O.d(1),O=h(p),O&&(O.c(),O.m(i,null))),g&65536&&v(i,"transform",p[16]),g&131072&&r!==(r="translate("+p[17][0]/2+" "+p[17][1]/2+")")&&v(t,"transform",r),g&131072&&s!==(s=p[17][0]/4+" 0")&&v(t,"transform-origin",s),g&2&&v(e,"id",p[1]),g&1&&l!==(l="svelte-fa svelte-fa-base "+p[0]+" svelte-bvo74f")&&v(e,"class",l),g&4&&v(e,"style",p[2]),g&131072&&o!==(o="0 0 "+p[17][0]+" "+p[17][1])&&v(e,"viewBox",o),g&513&&ne(e,"pulse",p[9]),g&17&&ne(e,"svelte-fa-size-lg",p[4]==="lg"),g&17&&ne(e,"svelte-fa-size-sm",p[4]==="sm"),g&17&&ne(e,"svelte-fa-size-xs",p[4]==="xs"),g&65&&ne(e,"svelte-fa-fw",p[6]),g&129&&ne(e,"svelte-fa-pull-left",p[7]==="left"),g&129&&ne(e,"svelte-fa-pull-right",p[7]==="right"),g&257&&ne(e,"spin",p[8])},d(p){p&&X(e),a&&a.d(),O.d(),n[24](null)}}}function L1(n){let e,t;return{c(){e=Gs("title"),t=pe(n[3])},m(i,r){Y(i,e,r),Q(e,t)},p(i,r){r&8&&Ne(t,i[3])},d(i){i&&X(e)}}}function q3(n){let e,t,i,r,s,l,o,a,c,h;return{c(){e=Gs("path"),l=Gs("path"),v(e,"d",t=n[17][4][0]),v(e,"fill",i=n[11]||n[5]||"currentColor"),v(e,"fill-opacity",r=n[14]!=!1?n[12]:n[13]),v(e,"transform",s="translate("+n[17][0]/-2+" "+n[17][1]/-2+")"),v(l,"d",o=n[17][4][1]),v(l,"fill",a=n[10]||n[5]||"currentColor"),v(l,"fill-opacity",c=n[14]!=!1?n[13]:n[12]),v(l,"transform",h="translate("+n[17][0]/-2+" "+n[17][1]/-2+")")},m(O,p){Y(O,e,p),Y(O,l,p)},p(O,p){p&131072&&t!==(t=O[17][4][0])&&v(e,"d",t),p&2080&&i!==(i=O[11]||O[5]||"currentColor")&&v(e,"fill",i),p&28672&&r!==(r=O[14]!=!1?O[12]:O[13])&&v(e,"fill-opacity",r),p&131072&&s!==(s="translate("+O[17][0]/-2+" "+O[17][1]/-2+")")&&v(e,"transform",s),p&131072&&o!==(o=O[17][4][1])&&v(l,"d",o),p&1056&&a!==(a=O[10]||O[5]||"currentColor")&&v(l,"fill",a),p&28672&&c!==(c=O[14]!=!1?O[13]:O[12])&&v(l,"fill-opacity",c),p&131072&&h!==(h="translate("+O[17][0]/-2+" "+O[17][1]/-2+")")&&v(l,"transform",h)},d(O){O&&(X(e),X(l))}}}function L3(n){let e,t,i,r;return{c(){e=Gs("path"),v(e,"d",t=n[17][4]),v(e,"fill",i=n[5]||n[10]||"currentColor"),v(e,"transform",r="translate("+n[17][0]/-2+" "+n[17][1]/-2+")")},m(s,l){Y(s,e,l)},p(s,l){l&131072&&t!==(t=s[17][4])&&v(e,"d",t),l&1056&&i!==(i=s[5]||s[10]||"currentColor")&&v(e,"fill",i),l&131072&&r!==(r="translate("+s[17][0]/-2+" "+s[17][1]/-2+")")&&v(e,"transform",r)},d(s){s&&X(e)}}}function I3(n){let e,t=n[17][4]&&q1(n);return{c(){t&&t.c(),e=Gt()},m(i,r){t&&t.m(i,r),Y(i,e,r)},p(i,[r]){i[17][4]?t?t.p(i,r):(t=q1(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:_e,o:_e,d(i){i&&X(e),t&&t.d(i)}}}function N3(n,e,t){let i,r,{class:s=void 0}=e,{id:l=void 0}=e,{style:o=void 0}=e,{icon:a}=e,{title:c=void 0}=e,{size:h=void 0}=e,{color:O=void 0}=e,{fw:p=!1}=e,{pull:g=void 0}=e,{scale:m=1}=e,{translateX:$=0}=e,{translateY:y=0}=e,{rotate:k=void 0}=e,{flip:W=void 0}=e,{spin:Z=!1}=e,{pulse:A=!1}=e,{primaryColor:C=""}=e,{secondaryColor:U=""}=e,{primaryOpacity:D=1}=e,{secondaryOpacity:z=.4}=e,{swapOpacity:j=!1}=e,N;function G(E){Mt[E?"unshift":"push"](()=>{N=E,t(15,N)})}return n.$$set=E=>{"class"in E&&t(0,s=E.class),"id"in E&&t(1,l=E.id),"style"in E&&t(2,o=E.style),"icon"in E&&t(18,a=E.icon),"title"in E&&t(3,c=E.title),"size"in E&&t(4,h=E.size),"color"in E&&t(5,O=E.color),"fw"in E&&t(6,p=E.fw),"pull"in E&&t(7,g=E.pull),"scale"in E&&t(19,m=E.scale),"translateX"in E&&t(20,$=E.translateX),"translateY"in E&&t(21,y=E.translateY),"rotate"in E&&t(22,k=E.rotate),"flip"in E&&t(23,W=E.flip),"spin"in E&&t(8,Z=E.spin),"pulse"in E&&t(9,A=E.pulse),"primaryColor"in E&&t(10,C=E.primaryColor),"secondaryColor"in E&&t(11,U=E.secondaryColor),"primaryOpacity"in E&&t(12,D=E.primaryOpacity),"secondaryOpacity"in E&&t(13,z=E.secondaryOpacity),"swapOpacity"in E&&t(14,j=E.swapOpacity)},n.$$.update=()=>{n.$$.dirty&32784&&N&&h&&D3(N,h),n.$$.dirty&262144&&t(17,i=a&&a.icon||[0,0,"",[],""]),n.$$.dirty&16252928&&t(16,r=V3(m,$,y,k,W,512))},[s,l,o,c,h,O,p,g,Z,A,C,U,D,z,j,N,r,i,a,m,$,y,k,W,G]}class wt extends $i{constructor(e){super(),bi(this,e,N3,I3,Oi,{class:0,id:1,style:2,icon:18,title:3,size:4,color:5,fw:6,pull:7,scale:19,translateX:20,translateY:21,rotate:22,flip:23,spin:8,pulse:9,primaryColor:10,secondaryColor:11,primaryOpacity:12,secondaryOpacity:13,swapOpacity:14})}}const Sd={prefix:"fas",iconName:"lock",icon:[448,512,[128274],"f023","M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z"]},Jy={prefix:"fas",iconName:"share-nodes",icon:[448,512,["share-alt"],"f1e0","M352 224c53 0 96-43 96-96s-43-96-96-96s-96 43-96 96c0 4 .2 8 .7 11.9l-94.1 47C145.4 170.2 121.9 160 96 160c-53 0-96 43-96 96s43 96 96 96c25.9 0 49.4-10.2 66.6-26.9l94.1 47c-.5 3.9-.7 7.8-.7 11.9c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-25.9 0-49.4 10.2-66.6 26.9l-94.1-47c.5-3.9 .7-7.8 .7-11.9s-.2-8-.7-11.9l94.1-47C302.6 213.8 326.1 224 352 224z"]},I1={prefix:"fas",iconName:"eye-slash",icon:[640,512,[],"f070","M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zM373 389.9c-16.4 6.5-34.3 10.1-53 10.1c-79.5 0-144-64.5-144-144c0-6.9 .5-13.6 1.4-20.2L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5L373 389.9z"]},B3={prefix:"fas",iconName:"shuffle",icon:[512,512,[128256,"random"],"f074","M403.8 34.4c12-5 25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-10.1 0-19.6 4.7-25.6 12.8L284 229.3 244 176l31.2-41.6C293.3 110.2 321.8 96 352 96l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6zM164 282.7L204 336l-31.2 41.6C154.7 401.8 126.2 416 96 416l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c10.1 0 19.6-4.7 25.6-12.8L164 282.7zm274.6 188c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-30.2 0-58.7-14.2-76.8-38.4L121.6 172.8c-6-8.1-15.5-12.8-25.6-12.8l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c30.2 0 58.7 14.2 76.8 38.4L326.4 339.2c6 8.1 15.5 12.8 25.6 12.8l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64z"]},j3={prefix:"fas",iconName:"clipboard",icon:[384,512,[128203],"f328","M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM112 192l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]},ev={prefix:"fas",iconName:"arrow-up-right-from-square",icon:[512,512,["external-link"],"f08e","M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l82.7 0L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3l0 82.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-17.7-14.3-32-32-32L320 0zM80 32C35.8 32 0 67.8 0 112L0 432c0 44.2 35.8 80 80 80l320 0c44.2 0 80-35.8 80-80l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-320c0-8.8 7.2-16 16-16l112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z"]},N1={prefix:"fas",iconName:"lock-open",icon:[576,512,[],"f3c1","M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z"]},F3={prefix:"fas",iconName:"forward-fast",icon:[512,512,[9197,"fast-forward"],"f050","M18.4 445c11.2 5.3 24.5 3.6 34.1-4.4L224 297.7 224 416c0 12.4 7.2 23.7 18.4 29s24.5 3.6 34.1-4.4L448 297.7 448 416c0 17.7 14.3 32 32 32s32-14.3 32-32l0-320c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 118.3L276.5 71.4c-9.5-7.9-22.8-9.7-34.1-4.4S224 83.6 224 96l0 118.3L52.5 71.4c-9.5-7.9-22.8-9.7-34.1-4.4S0 83.6 0 96L0 416c0 12.4 7.2 23.7 18.4 29z"]},B1={prefix:"fas",iconName:"eye",icon:[576,512,[128065],"f06e","M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"]},tv={prefix:"fas",iconName:"trash",icon:[448,512,[],"f1f8","M135.2 17.7L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-7.2-14.3C307.4 6.8 296.3 0 284.2 0L163.8 0c-12.1 0-23.2 6.8-28.6 17.7zM416 128L32 128 53.2 467c1.6 25.3 22.6 45 47.9 45l245.8 0c25.3 0 46.3-19.7 47.9-45L416 128z"]},G3={prefix:"fas",iconName:"gear",icon:[512,512,[9881,"cog"],"f013","M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"]},iv=G3,H3={prefix:"fas",iconName:"folder-tree",icon:[576,512,[],"f802","M64 32C64 14.3 49.7 0 32 0S0 14.3 0 32l0 96L0 384c0 35.3 28.7 64 64 64l192 0 0-64L64 384l0-224 192 0 0-64L64 96l0-64zM288 192c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l-98.7 0c-8.5 0-16.6-3.4-22.6-9.4L409.4 9.4c-6-6-14.1-9.4-22.6-9.4L320 0c-17.7 0-32 14.3-32 32l0 160zm0 288c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l-98.7 0c-8.5 0-16.6-3.4-22.6-9.4l-13.3-13.3c-6-6-14.1-9.4-22.6-9.4L320 288c-17.7 0-32 14.3-32 32l0 160z"]},K3={prefix:"fas",iconName:"download",icon:[512,512,[],"f019","M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]},J3={prefix:"fas",iconName:"stop",icon:[384,512,[9209],"f04d","M0 128C0 92.7 28.7 64 64 64H320c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z"]},eT={prefix:"fas",iconName:"angle-down",icon:[448,512,[8964],"f107","M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"]},tT={prefix:"fas",iconName:"eraser",icon:[576,512,[],"f12d","M290.7 57.4L57.4 290.7c-25 25-25 65.5 0 90.5l80 80c12 12 28.3 18.7 45.3 18.7L288 480l9.4 0L512 480c17.7 0 32-14.3 32-32s-14.3-32-32-32l-124.1 0L518.6 285.3c25-25 25-65.5 0-90.5L381.3 57.4c-25-25-65.5-25-90.5 0zM297.4 416l-9.4 0-105.4 0-80-80L227.3 211.3 364.7 348.7 297.4 416z"]},iT={prefix:"fas",iconName:"play",icon:[384,512,[9654],"f04b","M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80L0 432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"]},nv={prefix:"fas",iconName:"plus",icon:[448,512,[10133,61543,"add"],"2b","M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"]},rv={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]},nT={prefix:"fas",iconName:"hammer",icon:[576,512,[128296],"f6e3","M413.5 237.5c-28.2 4.8-58.2-3.6-80-25.4l-38.1-38.1C280.4 159 272 138.8 272 117.6l0-12.1L192.3 62c-5.3-2.9-8.6-8.6-8.3-14.7s3.9-11.5 9.5-14l47.2-21C259.1 4.2 279 0 299.2 0l18.1 0c36.7 0 72 14 98.7 39.1l44.6 42c24.2 22.8 33.2 55.7 26.6 86L503 183l8-8c9.4-9.4 24.6-9.4 33.9 0l24 24c9.4 9.4 9.4 24.6 0 33.9l-88 88c-9.4 9.4-24.6 9.4-33.9 0l-24-24c-9.4-9.4-9.4-24.6 0-33.9l8-8-17.5-17.5zM27.4 377.1L260.9 182.6c3.5 4.9 7.5 9.6 11.8 14l38.1 38.1c6 6 12.4 11.2 19.2 15.7L134.9 484.6c-14.5 17.4-36 27.4-58.6 27.4C34.1 512 0 477.8 0 435.7c0-22.6 10.1-44.1 27.4-58.6z"]},sv={prefix:"fas",iconName:"rotate",icon:[512,512,[128260,"sync-alt"],"f2f1","M142.9 142.9c-17.5 17.5-30.1 38-37.8 59.8c-5.9 16.7-24.2 25.4-40.8 19.5s-25.4-24.2-19.5-40.8C55.6 150.7 73.2 122 97.6 97.6c87.2-87.2 228.3-87.5 315.8-1L455 55c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2l0 128c0 13.3-10.7 24-24 24l-8.4 0c0 0 0 0 0 0L344 224c-9.7 0-18.5-5.8-22.2-14.8s-1.7-19.3 5.2-26.2l41.1-41.1c-62.6-61.5-163.1-61.2-225.3 1zM16 312c0-13.3 10.7-24 24-24l7.6 0 .7 0L168 288c9.7 0 18.5 5.8 22.2 14.8s1.7 19.3-5.2 26.2l-41.1 41.1c62.6 61.5 163.1 61.2 225.3-1c17.5-17.5 30.1-38 37.8-59.8c5.9-16.7 24.2-25.4 40.8-19.5s25.4 24.2 19.5 40.8c-10.8 30.6-28.4 59.3-52.9 83.8c-87.2 87.2-228.3 87.5-315.8 1L57 457c-6.9 6.9-17.2 8.9-26.2 5.2S16 449.7 16 440l0-119.6 0-.7 0-7.6z"]},lv={prefix:"fas",iconName:"clock-rotate-left",icon:[512,512,["history"],"f1da","M75 75L41 41C25.9 25.9 0 36.6 0 57.9L0 168c0 13.3 10.7 24 24 24l110.1 0c21.4 0 32.1-25.9 17-41l-30.8-30.8C155 85.5 203 64 256 64c106 0 192 86 192 192s-86 192-192 192c-40.8 0-78.6-12.7-109.7-34.4c-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6C151.2 495 201.7 512 256 512c141.4 0 256-114.6 256-256S397.4 0 256 0C185.3 0 121.3 28.7 75 75zm181 53c-13.3 0-24 10.7-24 24l0 104c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65 0-94.1c0-13.3-10.7-24-24-24z"]};function rT(n){let e,t,i,r,s,l,o,a,c=n[0]&&!n[3]&&j1(n);return{c(){e=_("span"),t=pe(n[1]),i=pe(n[2]),r=I(),c&&c.c(),s=Gt(),v(e,"class","filename svelte-1ul6ap")},m(h,O){Y(h,e,O),Q(e,t),Q(e,i),Y(h,r,O),c&&c.m(h,O),Y(h,s,O),l=!0,o||(a=le(e,"click",n[8]),o=!0)},p(h,O){(!l||O&2)&&Ne(t,h[1]),(!l||O&4)&&Ne(i,h[2]),h[0]&&!h[3]?c?(c.p(h,O),O&9&&V(c,1)):(c=j1(h),c.c(),V(c,1),c.m(s.parentNode,s)):c&&(Je(),B(c,1,1,()=>{c=null}),et())},i(h){l||(V(c),l=!0)},o(h){B(c),l=!1},d(h){h&&(X(e),X(r),X(s)),c&&c.d(h),o=!1,a()}}}function sT(n){let e,t,i,r,s;return{c(){e=_("input"),i=pe(n[2]),v(e,"size",t=n[4].length||n[1].length),v(e,"placeholder",n[1])},m(l,o){Y(l,e,o),n[11](e),li(e,n[4]),Y(l,i,o),r||(s=[le(e,"input",n[12]),le(e,"blur",n[10]),le(e,"keyup",n[9])],r=!0)},p(l,o){o&18&&t!==(t=l[4].length||l[1].length)&&v(e,"size",t),o&2&&v(e,"placeholder",l[1]),o&16&&e.value!==l[4]&&li(e,l[4]),o&4&&Ne(i,l[2])},i:_e,o:_e,d(l){l&&(X(e),X(i)),n[11](null),r=!1,Ft(s)}}}function j1(n){let e,t,i,r,s;return t=new wt({props:{icon:rv}}),{c(){e=_("span"),Ye(t.$$.fragment),v(e,"class","close-tab svelte-1ul6ap")},m(l,o){Y(l,e,o),Ae(t,e,null),i=!0,r||(s=le(e,"click",n[13]),r=!0)},p:_e,i(l){i||(V(t.$$.fragment,l),i=!0)},o(l){B(t.$$.fragment,l),i=!1},d(l){l&&X(e),Xe(t),r=!1,s()}}}function lT(n){let e,t,i,r,s,l;const o=[sT,rT],a=[];function c(h,O){return h[5]?0:1}return t=c(n),i=a[t]=o[t](n),{c(){e=_("a"),i.c(),v(e,"class","filename-link svelte-1ul6ap"),ne(e,"active",n[0]),ne(e,"readonly",n[3])},m(h,O){Y(h,e,O),a[t].m(e,null),r=!0,s||(l=le(e,"click",n[14]),s=!0)},p(h,[O]){let p=t;t=c(h),t===p?a[t].p(h,O):(Je(),B(a[p],1,1,()=>{a[p]=null}),et(),i=a[t],i?i.p(h,O):(i=a[t]=o[t](h),i.c()),V(i,1),i.m(e,null)),(!r||O&1)&&ne(e,"active",h[0]),(!r||O&8)&&ne(e,"readonly",h[3])},i(h){r||(V(i),r=!0)},o(h){B(i),r=!1},d(h){h&&X(e),a[t].d(),s=!1,l()}}}function oT(n,e,t){let{active:i=!1}=e,{name:r="Untitled"}=e,{suffix:s=".mzn"}=e,{readonly:l=!1}=e;const o=nn();let a=!1,c,h="";async function O(){!i||l||(t(5,a=!0),t(4,h=r),await Gn(),c.focus())}function p(W){W.key==="Enter"?(W.preventDefault(),g()):W.key==="Escape"&&t(5,a=!1)}function g(){t(5,a=!1),h.length>0&&o("rename",{name:h,suffix:s})}function m(W){Mt[W?"unshift":"push"](()=>{c=W,t(6,c)})}function $(){h=this.value,t(4,h)}const y=()=>o("close"),k=()=>{a||o("click")};return n.$$set=W=>{"active"in W&&t(0,i=W.active),"name"in W&&t(1,r=W.name),"suffix"in W&&t(2,s=W.suffix),"readonly"in W&&t(3,l=W.readonly)},n.$$.update=()=>{n.$$.dirty&16&&/[\/\\\.]/.test(h)&&t(4,h=h.replaceAll(/[\/\\\.]/g,""))},[i,r,s,l,h,a,c,o,O,p,g,m,$,y,k]}class aT extends $i{constructor(e){super(),bi(this,e,oT,lT,Oi,{active:0,name:1,suffix:2,readonly:3})}}function ov(n){const e=n-1;return e*e*e+1}function fT(n,{from:e,to:t},i={}){const r=getComputedStyle(n),s=r.transform==="none"?"":r.transform,[l,o]=r.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*l/t.width-(t.left+l),c=e.top+e.height*o/t.height-(t.top+o),{delay:h=0,duration:O=g=>Math.sqrt(g)*120,easing:p=ov}=i;return{delay:h,duration:ru(O)?O(Math.sqrt(a*a+c*c)):O,easing:p,css:(g,m)=>{const $=m*a,y=m*c,k=g+m*e.width/t.width,W=g+m*e.height/t.height;return`transform: ${s} translate(${$}px, ${y}px) scale(${k}, ${W});`}}}function F1(n,e,t){const i=n.slice();return i[19]=e[t],i}function G1(n,e){let t,i,r,s=_e,l,o,a;function c(){return e[11](e[19])}function h(...m){return e[12](e[19],...m)}function O(...m){return e[13](e[19],...m)}i=new aT({props:{name:e[19].stem,suffix:e[19].suffix,active:e[0]===e[19].index,readonly:e[1]||e[19].readonlyTab}}),i.$on("click",c),i.$on("rename",h),i.$on("close",O);function p(...m){return e[14](e[19],...m)}function g(...m){return e[15](e[19],...m)}return{key:n,first:null,c(){t=_("li"),Ye(i.$$.fragment),v(t,"draggable",!0),ne(t,"is-active",e[0]===e[19].index),this.first=t},m(m,$){Y(m,t,$),Ae(i,t,null),l=!0,o||(a=[le(t,"dragstart",p),le(t,"dragover",e[7]),le(t,"drop",g)],o=!0)},p(m,$){e=m;const y={};$&4&&(y.name=e[19].stem),$&4&&(y.suffix=e[19].suffix),$&5&&(y.active=e[0]===e[19].index),$&6&&(y.readonly=e[1]||e[19].readonlyTab),i.$set(y),(!l||$&5)&&ne(t,"is-active",e[0]===e[19].index)},r(){r=t.getBoundingClientRect()},f(){vC(t),s()},a(){s(),s=yC(t,r,fT,{duration:200})},i(m){l||(V(i.$$.fragment,m),l=!0)},o(m){B(i.$$.fragment,m),l=!1},d(m){m&&X(t),Xe(i),o=!1,Ft(a)}}}function H1(n){let e,t,i,r,s,l,o,a,c,h,O,p;return r=new wt({props:{icon:nv}}),c=new wt({props:{icon:H3}}),{c(){e=_("li"),t=_("a"),i=_("span"),Ye(r.$$.fragment),s=I(),l=_("li"),o=_("button"),a=_("span"),Ye(c.$$.fragment),v(i,"class","icon add-icon svelte-7ub6h4"),v(t,"title","Add new file"),v(a,"class","icon"),v(o,"class","button is-small"),v(o,"title","Manage files"),v(l,"class","right svelte-7ub6h4")},m(g,m){Y(g,e,m),Q(e,t),Q(t,i),Ae(r,i,null),Y(g,s,m),Y(g,l,m),Q(l,o),Q(o,a),Ae(c,a,null),h=!0,O||(p=[le(t,"click",n[16]),le(o,"click",n[17])],O=!0)},p:_e,i(g){h||(V(r.$$.fragment,g),V(c.$$.fragment,g),h=!0)},o(g){B(r.$$.fragment,g),B(c.$$.fragment,g),h=!1},d(g){g&&(X(e),X(s),X(l)),Xe(r),Xe(c),O=!1,Ft(p)}}}function cT(n){let e,t,i=[],r=new Map,s,l,o=st(n[2]);const a=h=>h[19].name;for(let h=0;h{c=null}),et()):c?(c.p(h,O),O&2&&V(c,1)):(c=H1(h),c.c(),V(c,1),c.m(t,null))},i(h){if(!l){for(let O=0;Oa(U.index),y=(U,D)=>c(D,U.index),k=(U,D)=>m(U.index),W=(U,D)=>O(D,U.index),Z=(U,D)=>g(D,U.index),A=()=>o("newFile"),C=()=>o("manageFiles");return n.$$set=U=>{"files"in U&&t(10,r=U.files),"currentIndex"in U&&t(0,s=U.currentIndex),"readonly"in U&&t(1,l=U.readonly)},n.$$.update=()=>{n.$$.dirty&1024&&t(2,i=r.map((U,D)=>{const z=U.name.endsWith(".mzc.mzn")?U.name.length-8:U.name.lastIndexOf(".");return{...U,stem:U.name.substring(0,z),suffix:U.name.substring(z),index:D}}).filter(U=>!U.hidden))},[s,l,i,o,a,c,O,p,g,m,r,$,y,k,W,Z,A,C]}class hT extends $i{constructor(e){super(),bi(this,e,uT,cT,Oi,{files:10,currentIndex:0,readonly:1})}}function K1(n,{delay:e=0,duration:t=400,easing:i=Yd}={}){const r=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*r}`}}function Tc(n,{delay:e=0,duration:t=400,easing:i=ov,x:r=0,y:s=0,opacity:l=0}={}){const o=getComputedStyle(n),a=+o.opacity,c=o.transform==="none"?"":o.transform,h=a*(1-l),[O,p]=Tm(r),[g,m]=Tm(s);return{delay:e,duration:t,easing:i,css:($,y)=>` transform: ${c} translate(${(1-$)*O}${p}, ${(1-$)*g}${m}); - opacity: ${a-h*y}`}}const hT=n=>({}),J1=n=>({});function e0(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,k,W;const Z=n[6].default,A=Ri(Z,n,n[5],null),C=n[6].footer,U=Ri(C,n,n[5],J1),D=U||OT(n);return{c(){e=_("form"),t=_("div"),i=I(),r=_("div"),s=_("header"),l=_("p"),o=pe(n[0]),a=I(),c=_("button"),h=I(),O=_("section"),A&&A.c(),p=I(),g=_("footer"),D&&D.c(),v(t,"class","modal-background"),v(l,"class","modal-card-title"),v(c,"type","button"),v(c,"class","delete"),v(c,"aria-label","close"),v(s,"class","modal-card-head"),v(O,"class","modal-card-body"),v(g,"class","modal-card-foot"),v(r,"class","modal-card"),v(e,"tabindex","0"),v(e,"class","modal is-active")},m(z,j){Y(z,e,j),Q(e,t),Q(e,i),Q(e,r),Q(r,s),Q(s,l),Q(l,o),Q(s,a),Q(s,c),Q(r,h),Q(r,O),A&&A.m(O,null),Q(r,p),Q(r,g),D&&D.m(g,null),n[7](e),y=!0,k||(W=[le(t,"click",n[4]),le(c,"click",n[4]),le(e,"submit",S$(n[8]))],k=!0)},p(z,j){(!y||j&1)&&Ne(o,z[0]),A&&A.p&&(!y||j&32)&&Xi(A,Z,z,z[5],y?Ai(Z,z[5],j,null):Yi(z[5]),null),U&&U.p&&(!y||j&32)&&Xi(U,C,z,z[5],y?Ai(C,z[5],j,hT):Yi(z[5]),J1)},i(z){y||(V(A,z),V(D,z),z&&Kn(()=>{y&&(m||(m=kl(r,Tc,{y:-200,duration:200},!0)),m.run(1))}),z&&Kn(()=>{y&&($||($=kl(e,K1,{duration:200},!0)),$.run(1))}),y=!0)},o(z){B(A,z),B(D,z),z&&(m||(m=kl(r,Tc,{y:-200,duration:200},!1)),m.run(0)),z&&($||($=kl(e,K1,{duration:200},!1)),$.run(0)),y=!1},d(z){z&&X(e),A&&A.d(z),D&&D.d(z),z&&m&&m.end(),n[7](null),z&&$&&$.end(),k=!1,Ft(W)}}}function OT(n){let e,t,i;return{c(){e=_("button"),e.textContent="Cancel",v(e,"class","button")},m(r,s){Y(r,e,s),t||(i=le(e,"click",n[4]),t=!0)},p:_e,d(r){r&&X(e),t=!1,i()}}}function dT(n){let e,t,i=n[1]&&e0(n);return{c(){i&&i.c(),e=Gt()},m(r,s){i&&i.m(r,s),Y(r,e,s),t=!0},p(r,[s]){r[1]?i?(i.p(r,s),s&2&&V(i,1)):(i=e0(r),i.c(),V(i,1),i.m(e.parentNode,e)):i&&(Je(),B(i,1,1,()=>{i=null}),et())},i(r){t||(V(i),t=!0)},o(r){B(i),t=!1},d(r){r&&X(e),i&&i.d(r)}}}function pT(n,e,t){let{$$slots:i={},$$scope:r}=e,{title:s}=e,{active:l=!1}=e;const o=nn();let a;async function c(g){g&&(await Gn(),a&&a.focus(),o("activate"))}function h(){o("cancel")}function O(g){Mt[g?"unshift":"push"](()=>{a=g,t(2,a)})}const p=()=>o("submit");return n.$$set=g=>{"title"in g&&t(0,s=g.title),"active"in g&&t(1,l=g.active),"$$scope"in g&&t(5,r=g.$$scope)},n.$$.update=()=>{n.$$.dirty&2&&c(l)},[s,l,a,o,h,r,i,O,p]}class _s extends $i{constructor(e){super(),bi(this,e,pT,dT,Oi,{title:0,active:1})}}const ov=1024;let gT=0;class An{constructor(e,t){this.from=e,this.to=t}}class at{constructor(e={}){this.id=gT++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Ni.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}at.closedBy=new at({deserialize:n=>n.split(" ")});at.openedBy=new at({deserialize:n=>n.split(" ")});at.group=new at({deserialize:n=>n.split(" ")});at.contextHash=new at({perNode:!0});at.lookAhead=new at({perNode:!0});at.mounted=new at({perNode:!0});class Oa{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}static get(e){return e&&e.props&&e.props[at.mounted.id]}}const mT=Object.create(null);class Ni{constructor(e,t,i,r=0){this.name=e,this.props=t,this.id=i,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):mT,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new Ni(e.name||"",t,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(at.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let r of i.split(" "))t[r]=e[i];return i=>{for(let r=i.prop(at.group),s=-1;s<(r?r.length:0);s++){let l=t[s<0?i.name:r[s]];if(l)return l}}}}Ni.none=new Ni("",Object.create(null),0,8);class ep{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(l|Et.IncludeAnonymous);;){let c=!1;if(a.from<=s&&a.to>=r&&(!o&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&i&&(o||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:np(Ni.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,r)=>new jt(this.type,t,i,r,this.propValues),e.makeTree||((t,i,r)=>new jt(Ni.none,t,i,r)))}static build(e){return yT(e)}}jt.empty=new jt(Ni.none,[],[],0);class tp{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new tp(this.buffer,this.index)}}class Ps{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return Ni.none}toString(){let e=[];for(let t=0;t0));a=l[a+3]);return o}slice(e,t,i){let r=this.buffer,s=new Uint16Array(t-e),l=0;for(let o=e,a=0;o=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function da(n,e,t,i){for(var r;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?o.length:-1;e!=c;e+=t){let h=o[e],O=a[e]+l.from;if(av(r,i,O,O+h.length)){if(h instanceof Ps){if(s&Et.ExcludeBuffers)continue;let p=h.findChild(0,h.buffer.length,t,i-O,r);if(p>-1)return new pr(new ST(l,h,e,O),null,p)}else if(s&Et.IncludeAnonymous||!h.type.isAnonymous||ip(h)){let p;if(!(s&Et.IgnoreMounts)&&(p=Oa.get(h))&&!p.overlay)return new Mi(p.tree,O,e,l);let g=new Mi(h,O,e,l);return s&Et.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(t<0?h.children.length-1:0,t,i,r)}}}if(s&Et.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+t:e=t<0?-1:l._parent._tree.children.length,l=l._parent,!l))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let r;if(!(i&Et.IgnoreOverlays)&&(r=Oa.get(this._tree))&&r.overlay){let s=e-this.from;for(let{from:l,to:o}of r.overlay)if((t>0?l<=s:l=s:o>s))return new Mi(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function i0(n,e,t,i){let r=n.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(;!r.type.is(t);)if(!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function bd(n,e,t=e.length-1){for(let i=n.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class ST{constructor(e,t,i,r){this.parent=e,this.buffer=t,this.index=i,this.start=r}}class pr extends fv{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,i);return s<0?null:new pr(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&Et.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new pr(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new pr(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new pr(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let l=i.buffer[this.index+1];e.push(i.slice(r,s,l)),t.push(0)}return new jt(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function cv(n){if(!n.length)return null;let e=0,t=n[0];for(let s=1;st.from||l.to=e){let o=new Mi(l.tree,l.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(da(o,e,t,!1))}}return r?cv(r):i}class Zc{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Mi)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof Mi?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&Et.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Et.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Et.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let s=t+e,l=e<0?-1:i._tree.children.length;s!=l;s+=e){let o=i._tree.children[s];if(this.mode&Et.IncludeAnonymous||o instanceof Ps||!o.type.isAnonymous||ip(o))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let l=e;l;l=l._parent)if(l.index==r){if(r==this.index)return l;t=l,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return bd(this.node,e,r);let l=i[t.buffer[this.stack[s]]];if(!l.isAnonymous){if(e[r]&&e[r]!=l.name)return!1;r--}}return!0}}function ip(n){return n.children.some(e=>e instanceof Ps||!e.type.isAnonymous||ip(e))}function yT(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:r=ov,reused:s=[],minRepeatType:l=i.types.length}=n,o=Array.isArray(t)?new tp(t,t.length):t,a=i.types,c=0,h=0;function O(C,U,D,z,j,N){let{id:G,start:E,end:re,size:ae}=o,ve=h;for(;ae<0;)if(o.next(),ae==-1){let Pe=s[G];D.push(Pe),z.push(E-C);return}else if(ae==-3){c=G;return}else if(ae==-4){h=G;return}else throw new RangeError(`Unrecognized record size: ${ae}`);let Se=a[G],ge,Ue,Le=E-C;if(re-E<=r&&(Ue=y(o.pos-U,j))){let Pe=new Uint16Array(Ue.size-Ue.skip),We=o.pos-Ue.size,lt=Pe.length;for(;o.pos>We;)lt=k(Ue.start,Pe,lt);ge=new Ps(Pe,re-Ue.start,i),Le=Ue.start-C}else{let Pe=o.pos-ae;o.next();let We=[],lt=[],Vt=G>=l?G:-1,Qt=0,pt=re;for(;o.pos>Pe;)Vt>=0&&o.id==Vt&&o.size>=0?(o.end<=pt-r&&(m(We,lt,E,Qt,o.end,pt,Vt,ve),Qt=We.length,pt=o.end),o.next()):N>2500?p(E,Pe,We,lt):O(E,Pe,We,lt,Vt,N+1);if(Vt>=0&&Qt>0&&Qt-1&&Qt>0){let qt=g(Se);ge=np(Se,We,lt,0,We.length,0,re-E,qt,qt)}else ge=$(Se,We,lt,re-E,ve-re)}D.push(ge),z.push(Le)}function p(C,U,D,z){let j=[],N=0,G=-1;for(;o.pos>U;){let{id:E,start:re,end:ae,size:ve}=o;if(ve>4)o.next();else{if(G>-1&&re=0;ae-=3)E[ve++]=j[ae],E[ve++]=j[ae+1]-re,E[ve++]=j[ae+2]-re,E[ve++]=ve;D.push(new Ps(E,j[2]-re,i)),z.push(re-C)}}function g(C){return(U,D,z)=>{let j=0,N=U.length-1,G,E;if(N>=0&&(G=U[N])instanceof jt){if(!N&&G.type==C&&G.length==z)return G;(E=G.prop(at.lookAhead))&&(j=D[N]+G.length+E)}return $(C,U,D,z,j)}}function m(C,U,D,z,j,N,G,E){let re=[],ae=[];for(;C.length>z;)re.push(C.pop()),ae.push(U.pop()+D-j);C.push($(i.types[G],re,ae,N-j,E-N)),U.push(j-D)}function $(C,U,D,z,j=0,N){if(c){let G=[at.contextHash,c];N=N?[G].concat(N):[G]}if(j>25){let G=[at.lookAhead,j];N=N?[G].concat(N):[G]}return new jt(C,U,D,z,N)}function y(C,U){let D=o.fork(),z=0,j=0,N=0,G=D.end-r,E={size:0,start:0,skip:0};e:for(let re=D.pos-C;D.pos>re;){let ae=D.size;if(D.id==U&&ae>=0){E.size=z,E.start=j,E.skip=N,N+=4,z+=4,D.next();continue}let ve=D.pos-ae;if(ae<0||ve=l?4:0,ge=D.start;for(D.next();D.pos>ve;){if(D.size<0)if(D.size==-3)Se+=4;else break e;else D.id>=l&&(Se+=4);D.next()}j=ge,z+=ae,N+=Se}return(U<0||z==C)&&(E.size=z,E.start=j,E.skip=N),E.size>4?E:void 0}function k(C,U,D){let{id:z,start:j,end:N,size:G}=o;if(o.next(),G>=0&&z4){let re=o.pos-(G-4);for(;o.pos>re;)D=k(C,U,D)}U[--D]=E,U[--D]=N-C,U[--D]=j-C,U[--D]=z}else G==-3?c=z:G==-4&&(h=z);return D}let W=[],Z=[];for(;o.pos>0;)O(n.start||0,n.bufferStart||0,W,Z,-1,0);let A=(e=n.length)!==null&&e!==void 0?e:W.length?Z[0]+W[0].length:0;return new jt(a[n.topID],W.reverse(),Z.reverse(),A)}const n0=new WeakMap;function mc(n,e){if(!n.isAnonymous||e instanceof Ps||e.type!=n)return 1;let t=n0.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof jt)){t=1;break}t+=mc(n,i)}n0.set(e,t)}return t}function np(n,e,t,i,r,s,l,o,a){let c=0;for(let m=i;m=h)break;U+=D}if(Z==A+1){if(U>h){let D=m[A];g(D.children,D.positions,0,D.children.length,$[A]+W);continue}O.push(m[A])}else{let D=$[Z-1]+m[Z-1].length-C;O.push(np(n,m,$,A,Z,C,D,null,a))}p.push(C+W-s)}}return g(e,t,i,r,0),(o||a)(O,p,l)}class uv{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof pr?this.setBuffer(e.context.buffer,e.index,t):e instanceof Mi&&this.map.set(e.tree,t)}get(e){return e instanceof pr?this.getBuffer(e.context.buffer,e.index):e instanceof Mi?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Vr{constructor(e,t,i,r,s=!1,l=!1){this.from=e,this.to=t,this.tree=i,this.offset=r,this.open=(s?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let r=[new Vr(0,e.length,e,0,!1,i)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,i=128){if(!t.length)return e;let r=[],s=1,l=e.length?e[0]:null;for(let o=0,a=0,c=0;;o++){let h=o=i)for(;l&&l.from=p.from||O<=p.to||c){let g=Math.max(p.from,a)-c,m=Math.min(p.to,O)-c;p=g>=m?null:new Vr(g,m,p.tree,p.offset+c,o>0,!!h)}if(p&&r.push(p),l.to>O)break;l=snew An(r.from,r.to)):[new An(0,0)]:[new An(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let r=this.startParse(e,t,i);for(;;){let s=r.advance();if(s)return s}}}class vT{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function wT(n){return(e,t,i,r)=>new kT(e,n,t,i,r)}class r0{constructor(e,t,i,r,s){this.parser=e,this.parse=t,this.overlay=i,this.target=r,this.from=s}}function s0(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class QT{constructor(e,t,i,r,s,l,o){this.parser=e,this.predicate=t,this.mounts=i,this.index=r,this.start=s,this.target=l,this.prev=o,this.depth=0,this.ranges=[]}}const $d=new at({perNode:!0});class kT{constructor(e,t,i,r,s){this.nest=t,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new jt(i.type,i.children,i.positions,i.length,i.propValues.concat([[$d,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[at.mounted.id]=new Oa(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)o=!1;else if(e.hasNode(r)){if(t){let c=t.mounts.find(h=>h.frag.from<=r.from&&h.frag.to>=r.to&&h.mount.overlay);if(c)for(let h of c.mount.overlay){let O=h.from+c.pos,p=h.to+c.pos;O>=r.from&&p<=r.to&&!t.ranges.some(g=>g.fromO)&&t.ranges.push({from:O,to:p})}}o=!1}else if(i&&(l=_T(i.ranges,r.from,r.to)))o=l!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew An(O.from-r.from,O.to-r.from)):null,r.tree,h.length?h[0].from:r.from)),s.overlay?h.length&&(i={ranges:h,depth:0,prev:i}):o=!1}}else t&&(a=t.predicate(r))&&(a===!0&&(a=new An(r.from,r.to)),a.fromnew An(h.from-t.start,h.to-t.start)),t.target,c[0].from))),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function _T(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function l0(n,e,t,i,r,s){if(e=e.to);i++);let l=r.children[i],o=l.buffer,a=[i];function c(h,O,p,g,m,$){let y=t[$],k=[],W=[];l0(l,h,y,k,W,g);let Z=o[y+1],A=o[y+2];a.push(k.length);let C=$?c(y+4,o[y+3],l.set.types[o[y]],Z,A-Z,$-1):e.toTree();return k.push(C),W.push(Z-g),l0(l,o[y+3],O,k,W,g),new jt(p,k,W,m)}r.children[i]=c(0,o.length,Ni.none,0,l.length,t.length-1);for(let h of a){let O=n.tree.children[h],p=n.tree.positions[h];n.yield(new Mi(O,p+n.from,h,n._tree))}}class o0{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(Et.IncludeAnonymous|Et.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from=e&&t.enter(i,1,Et.IgnoreOverlays|Et.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof jt)t=t.children[0];else break}return!1}}let xT=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop($d))!==null&&t!==void 0?t:i.to,this.inner=new o0(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop($d))!==null&&e!==void 0?e:t.to,this.inner=new o0(t.tree,-t.offset)}}findMounts(e,t){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let l=(i=s.tree)===null||i===void 0?void 0:i.prop(at.mounted);if(l&&l.parser==t)for(let o=this.fragI;o=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:l})}}}return r}};function a0(n,e){let t=null,i=e;for(let r=1,s=0;r=o)break;a.to<=l||(t||(i=t=e.slice()),a.fromo&&t.splice(s+1,0,new An(o,a.to))):a.to>o?t[s--]=new An(o,a.to):t.splice(s--,1))}}return i}function WT(n,e,t,i){let r=0,s=0,l=!1,o=!1,a=-1e9,c=[];for(;;){let h=r==n.length?1e9:l?n[r].to:n[r].from,O=s==e.length?1e9:o?e[s].to:e[s].from;if(l!=o){let p=Math.max(a,t),g=Math.min(h,O,i);pnew An(p.from+i,p.to+i)),O=WT(e,h,a,c);for(let p=0,g=a;;p++){let m=p==O.length,$=m?c:O[p].from;if($>g&&t.push(new Vr(g,$,r.tree,-l,s.from>=g||s.openStart,s.to<=$||s.openEnd)),m)break;g=O[p].to}}else t.push(new Vr(a,c,r.tree,-l,s.from>=l||s.openStart,s.to<=o||s.openEnd))}return t}var c0={};class Rc{constructor(e,t,i,r,s,l,o,a,c,h=0,O){this.p=e,this.stack=t,this.state=i,this.reducePos=r,this.pos=s,this.score=l,this.buffer=o,this.bufferBase=a,this.curContext=c,this.lookAhead=h,this.parent=O}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let r=e.parser.context;return new Rc(e,[],t,i,i,0,[],0,r?new u0(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,r=e&65535,{parser:s}=this.p,l=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(r,c)}storeNode(e,t,i,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&l.buffer[o-4]==0&&l.buffer[o-1]>-1){if(t==i)return;if(l.buffer[o-2]>=t){l.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,t,i,r);else{let l=this.buffer.length;if(l>0&&this.buffer[l-4]!=0){let o=!1;for(let a=l;a>0&&this.buffer[a-2]>i;a-=4)if(this.buffer[a-1]>=0){o=!0;break}if(o)for(;l>0&&this.buffer[l-2]>i;)this.buffer[l]=this.buffer[l-4],this.buffer[l+1]=this.buffer[l-3],this.buffer[l+2]=this.buffer[l-2],this.buffer[l+3]=this.buffer[l-1],l-=4,r>4&&(r-=4)}this.buffer[l]=e,this.buffer[l+1]=t,this.buffer[l+2]=i,this.buffer[l+3]=r}}shift(e,t,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,r,4);else{let s=e,{parser:l}=this.p;(r>this.pos||t<=l.maxNode)&&(this.pos=r,l.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,i),this.shiftContext(t,i),t<=l.maxNode&&this.buffer.push(t,i,r,4)}}apply(e,t,i,r){e&65536?this.reduce(e):this.shift(e,t,i,r)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new Rc(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new CT(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if(!(i&65536))return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,l;sa&1&&o==l)||r.push(t[s],l)}t=r}let i=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let l=this.findForcedReduction();if(l==null)return!1;t=l}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,l=>{if(!(l&393216))if(l&65536){let o=(l>>19)-s;if(o>1){let a=l&65535,c=this.stack.length-o*3;if(c>=0&&e.getGoto(this.stack[c],a,!1)>=0)return o<<19|65536|a}}else{let o=i(l,s+1);if(o!=null)return o}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class u0{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class CT{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class Ac{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Ac(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Ac(this.stack,this.pos,this.index)}}function No(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let i=0,r=0;i=92&&l--,l>=34&&l--;let a=l-32;if(a>=46&&(a-=46,o=!0),s+=a,o)break;s*=46}t?t[r++]=s:t=new e(s)}return t}class Sc{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const h0=new Sc;class TT{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=h0,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,r=this.rangeIndex,s=this.pos+e;for(;si.to:s>=i.to;){if(r==this.ranges.length-1)return null;let l=this.ranges[++r];s+=l.from-i.to,i=l}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,r;if(t>=0&&t=this.chunk2Pos&&io.to&&(this.chunk2=this.chunk2.slice(0,o.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=h0,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return i}}class Xl{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;Ov(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}Xl.prototype.contextual=Xl.prototype.fallback=Xl.prototype.extend=!1;class Xc{constructor(e,t,i){this.precTable=t,this.elseToken=i,this.data=typeof e=="string"?No(e):e}token(e,t){let i=e.pos,r=0;for(;;){let s=e.next<0,l=e.resolveOffset(1,1);if(Ov(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,l==null)break;e.reset(l,e.token)}r&&(e.reset(i,e.token),e.acceptToken(this.elseToken,r))}}Xc.prototype.contextual=Xl.prototype.fallback=Xl.prototype.extend=!1;class vr{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Ov(n,e,t,i,r,s){let l=0,o=1<0){let m=n[g];if(a.allows(m)&&(e.token.value==-1||e.token.value==m||ZT(m,e.token.value,r,s))){e.acceptToken(m);break}}let h=e.next,O=0,p=n[l+2];if(e.next<0&&p>O&&n[c+p*3-3]==65535){l=n[c+p*3-1];continue e}for(;O>1,m=c+g+(g<<1),$=n[m],y=n[m+1]||65536;if(h<$)p=g;else if(h>=y)O=g+1;else{l=n[m+2],e.advance();continue e}}break}}function O0(n,e,t){for(let i=e,r;(r=n[i])!=65535;i++)if(r==t)return i-e;return-1}function ZT(n,e,t,i){let r=O0(t,i,e);return r<0||O0(t,i,n)e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}class RT{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?d0(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?d0(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=l,null;if(s instanceof jt){if(l==e){if(l=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(l),this.index.push(0))}else this.index[t]++,this.nextStart=l+s.length}}}class AT{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new Sc)}getActions(e){let t=0,i=null,{parser:r}=e.p,{tokenizers:s}=r,l=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,a=0;for(let c=0;cO.end+25&&(a=Math.max(O.lookAhead,a)),O.value!=0)){let p=t;if(O.extended>-1&&(t=this.addActions(e,O.extended,O.end,t)),t=this.addActions(e,O.value,O.end,t),!h.extend&&(i=O,t>p))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!i&&e.pos==this.stream.end&&(i=new Sc,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Sc,{pos:i,p:r}=e;return t.start=i,t.end=Math.min(i+1,r.stream.end),t.value=i==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,i){let r=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(r,e),i),e.value>-1){let{parser:s}=i.p;for(let l=0;l=0&&i.p.parser.dialect.allows(o>>1)){o&1?e.extended=o>>1:e.value=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,i,r){for(let s=0;se.bufferLength*4?new RT(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[l]=e;for(;l.forceReduce()&&l.stack.length&&l.stack[l.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let l=0;lt)i.push(o);else{if(this.advanceStack(o,i,e))continue;{r||(r=[],s=[]),r.push(o);let a=this.tokens.getMainToken(o);s.push(a.value,a.end)}}break}}if(!i.length){let l=r&&UT(r);if(l)return un&&console.log("Finish with "+this.stackID(l)),this.stackToTree(l);if(this.parser.strict)throw un&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let l=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(l)return un&&console.log("Force-finish "+this.stackID(l)),this.stackToTree(l.forceAll())}if(this.recovering){let l=this.recovering==1?1:this.recovering*3;if(i.length>l)for(i.sort((o,a)=>a.score-o.score);i.length>l;)i.pop();i.some(o=>o.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let l=0;l500&&c.buffer.length>500)if((o.score-c.score||o.buffer.length-c.buffer.length)>0)i.splice(a--,1);else{i.splice(l--,1);continue e}}}i.length>12&&i.splice(12,i.length-12)}this.minStackPos=i[0].pos;for(let l=1;l ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,h=c?e.curContext.hash:0;for(let O=this.fragments.nodeAt(r);O;){let p=this.parser.nodeSet.types[O.type.id]==O.type?s.getGoto(e.state,O.type.id):-1;if(p>-1&&O.length&&(!c||(O.prop(at.contextHash)||0)==h))return e.useNode(O,p),un&&console.log(l+this.stackID(e)+` (via reuse of ${s.getName(O.type.id)})`),!0;if(!(O instanceof jt)||O.children.length==0||O.positions[0]>0)break;let g=O.children[0];if(g instanceof jt&&O.positions[0]==0)O=g;else break}}let o=s.stateSlot(e.state,4);if(o>0)return e.reduce(o),un&&console.log(l+this.stackID(e)+` (via always-reduce ${s.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let c=0;cr?t.push(m):i.push(m)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return p0(e,t),!0}}runRecovery(e,t,i){let r=null,s=!1;for(let l=0;l ":"";if(o.deadEnd&&(s||(s=!0,o.restart(),un&&console.log(h+this.stackID(o)+" (restarted)"),this.advanceFully(o,i))))continue;let O=o.split(),p=h;for(let g=0;O.forceReduce()&&g<10&&(un&&console.log(p+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,i));g++)un&&(p=this.stackID(O)+" -> ");for(let g of o.recoverByInsert(a))un&&console.log(h+this.stackID(g)+" (via recover-insert)"),this.advanceFully(g,i);this.stream.end>o.pos?(c==o.pos&&(c++,a=0),o.recoverByDelete(a,c),un&&console.log(h+this.stackID(o)+` (via recover-delete ${this.parser.getName(a)})`),p0(o,i)):(!r||r.scoren;class dv{constructor(e){this.start=e.start,this.shift=e.shift||cO,this.reduce=e.reduce||cO,this.reuse=e.reuse||cO,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class xs extends hv{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let o=0;oe.topRules[o][1]),r=[];for(let o=0;o=0)s(h,a,o[c++]);else{let O=o[c+-h];for(let p=-h;p>0;p--)s(o[c++],a,O);c++}}}this.nodeSet=new ep(t.map((o,a)=>Ni.define({name:a>=this.minRepeatTerm?void 0:o,id:a,props:r[a],top:i.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=ov;let l=No(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new Xl(l,o):o),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let r=new XT(this,e,t,i);for(let s of this.wrappers)r=s(r,e,t,i);return r}getGoto(e,t,i=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let l=r[s++],o=l&1,a=r[s++];if(o&&i)return a;for(let c=s+(l>>1);s0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),r=i?t(i):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Mr(this.data,s+2);else break;r=t(Mr(this.data,s+1))}return r}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Mr(this.data,i+2);else break;if(!(this.data[i+2]&1)){let r=this.data[i+1];t.some((s,l)=>l&1&&s==r)||t.push(this.data[i],r)}}return t}configure(e){let t=Object.assign(Object.create(xs.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(s=>s.from==i);return r?r.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=e.specializers.find(o=>o.from==i.external);if(!s)return i;let l=Object.assign(Object.assign({},i),{external:s.to});return t.specializers[r]=g0(l),l})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let s of e.split(" ")){let l=t.indexOf(s);l>=0&&(i[l]=!0)}let r=null;for(let s=0;si)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scoren.external(t,i)<<1|e}return n.get}const ET={__proto__:null,annotation:12,array:20,var:24,par:26,opt:28,ann:32,bool:34,float:36,int:38,string:40,_:50,true:62,false:64,infinity:68,"∅":74,in:92,where:94,if:98,then:100,elseif:102,else:104,endif:106,xor:110,subset:112,superset:114,union:116,diff:118,symdiff:120,intersect:122,div:124,mod:126,default:128,let:132,constraint:140,not:144,"¬":146,any:170,of:172,set:176,tuple:180,record:184,op:190,enum:198,function:202,solve:206,satisfy:208,maximize:210,minimize:212,include:216,output:220,predicate:224,test:226,type:230},MT=xs.deserialize({version:14,states:"!0jQ]QPOOOOQO'#F]'#F]O&XQPO'#CvO&`QPO'#CxOOQO'#C}'#C}O&gQPO'#DSO&nOQO'#DTO$kQPO'#DWOOQO'#Fc'#FcO*}QPO'#CgO+eQPO'#DrO$kQPO'#DuO$kQPO'#DuO/qQPO'#FbOOQO'#Fb'#FbOOQO'#Cg'#CgOOQO'#F`'#F`OOQO'#F['#F[Q/xQPO'#EtQ]QPOOOOQO'#Ck'#CkOOQO'#Ct'#CtOOQO'#Cz'#CzOOQO'#DQ'#DQO$kQPO'#D^O/}QPO'#DsO0UQPO'#DoO0ZQPO'#CgO0wQPO'#CgO1hQPO'#E`O1|QPO'#CeO2RQPO'#EVO2WQPO'#EXO2]QPO'#EZO2bQPO'#E^O2gQPO'#C`O2gQPO'#EbO2oQPO'#EdO3uQPO'#EfO4TQPO'#EkO4YQPO'#EmO2gQPO'#EoO2gQPO'#ErO4aQPO'#CwO4qQPO,59bOOQO,59b,59bO4{QPO,59bO5TQPO'#FbO7`QPO,59tO7pQPO,59dO7xQPO,59dOOQO,59d,59dO8PQPO,59nO8^QPO,59nOOQO,59n,59nO$kQPO'#DUOOOO'#E{'#E{O8eOQO,59oOOQO,59o,59oO8sQPO,5:jO=UQPO'#FbO=`QPO,59rO$kQPO,5:OO$kQPO,5:OO$kQPO,5:OO$kQPO,5:OO$kQPO,5:OO$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%oU'i%}'l(wQ'n&QQ'o&RQ'v&YQ(P&`Q(Q&bQ(R&cQ(h&zQ(k'PQ(l'RQ(m'SQ(y'sQ)S'|Q)T(OQ)e(iQ)m(xQ)o(zQ)p(|Q)q)RQ*Q)fQ*R)gQ*U)nQ*X)rQ*`*PQ*b*VQ*e*oQ*f*pQ*g*qQ*h*rQ*i*sQ*j*tQ*k*uQ*l*vS*m*d*wQ*n*xQ+S*{Q+T+ZQ+U*|Q+V*}Q+W+OQ+X+PR+Y+Q",nodeNames:"⚠ LineComment BlockComment SourceFile Annotation Identifier Keyword QuotedIdentifier Parameter ArrayType Keyword TypeBase Keyword Keyword Keyword PrimitiveType Keyword Keyword Keyword Keyword Keyword TypeInstId TypeInstEnumId Absent Anonymous Keyword ArrayLiteral2d ArrayLiteral2dRow ArrayLiteral ArrayLiteralMember BooleanLiteral Keyword Keyword Infinity Keyword Number EmptySet Keyword SetLiteral StringLiteral Interpolation TupleLiteral RecordLiteral RecordMember ArrayComprehension Generator Keyword Keyword IfThenElse Keyword Keyword Keyword Keyword Keyword InfixOperator Keyword Keyword Keyword Keyword Keyword Keyword Keyword Keyword Keyword Keyword LetExpression Keyword LetItems Declaration Constraint Keyword PrefixOperator Keyword Keyword PostfixOperator SetComprehension Call Application GeneratorCall GeneratorCallGenerators ParenthesisedExpression IndexedAccess TupleAccess Number RecordAccess Keyword Keyword SetType Keyword TupleType Keyword RecordType Keyword RecordTypeField OperationType Keyword AnyType Assignment Enumeration Keyword FunctionItem Keyword Goal Keyword Keyword Keyword Keyword Include Keyword Output Keyword Predicate Keyword Keyword TypeAlias Keyword",maxTerm:210,skippedNodes:[0,1,2],repeatNodeCount:19,tokenData:"!8_~R!oOX&SXY&qYZ'nZ]&S]^&q^p&Spq&qqr(Prs)Xsu&Suv)^vw&Swx*lxy,ryz-]z{-v{|.a|}/k}!O0U!O!P1`!P!Q3Z!Q!R9g!R![@|![!]Bz!]!^DU!^!_Do!_!`Is!`!aJ}!a!c&S!c!}LX!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oU$wP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!5YU$zP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!5sU$}P$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!6^U%PP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!6wU%QP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!7bU$qP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!7{U$gP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&S",tokenizers:[0,1,2],topRules:{SourceFile:[0,3]},specialized:[{term:5,get:n=>ET[n]||-1}],tokenPrec:0});let zT=0;class Zn{constructor(e,t,i,r){this.name=e,this.set=t,this.base=i,this.modified=r,this.id=zT++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof Zn&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let r=new Zn(i,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new Yc(e);return i=>i.modified.indexOf(t)>-1?i:Yc.get(i.base||i,i.modified.concat(t).sort((r,s)=>r.id-s.id))}}let DT=0;class Yc{constructor(e){this.name=e,this.instances=[],this.id=DT++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(o=>o.base==e&&VT(t,o.modified));if(i)return i;let r=[],s=new Zn(e.name,r,e,t);for(let o of t)o.instances.push(s);let l=qT(t);for(let o of e.set)if(!o.modified.length)for(let a of l)r.push(Yc.get(o,a));return s}}function VT(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function qT(n){let e=[[]];for(let t=0;ti.length-t.length)}function Hl(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let r of t.split(" "))if(r){let s=[],l=2,o=r;for(let O=0;;){if(o=="..."&&O>0&&O+3==r.length){l=1;break}let p=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!p)throw new RangeError("Invalid path: "+r);if(s.push(p[0]=="*"?"":p[0][0]=='"'?JSON.parse(p[0]):p[0]),O+=p[0].length,O==r.length)break;let g=r[O++];if(O==r.length&&g=="!"){l=0;break}if(g!="/")throw new RangeError("Invalid path: "+r);o=r.slice(O)}let a=s.length-1,c=s[a];if(!c)throw new RangeError("Invalid path: "+r);let h=new Uc(i,l,a>0?s.slice(0,a):null);e[c]=h.sort(e[c])}}return pv.add(e)}const pv=new at;class Uc{constructor(e,t,i,r){this.tags=e,this.mode=t,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let l=r;for(let o of s)for(let a of o.set){let c=t[a.id];if(c){l=l?l+" "+c:c;break}}return l},scope:i}}function LT(n,e){let t=null;for(let i of n){let r=i.style(e);r&&(t=t?t+" "+r:r)}return t}function IT(n,e,t,i=0,r=n.length){let s=new NT(i,Array.isArray(e)?e:[e],t);s.highlightRange(n.cursor(),i,r,"",s.highlighters),s.flush(r)}class NT{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,r,s){let{type:l,from:o,to:a}=e;if(o>=i||a<=t)return;l.isTop&&(s=this.highlighters.filter(g=>!g.scope||g.scope(l)));let c=r,h=BT(e)||Uc.empty,O=LT(s,h.tags);if(O&&(c&&(c+=" "),c+=O,h.mode==1&&(r+=(r?" ":"")+O)),this.startSpan(Math.max(t,o),c),h.opaque)return;let p=e.tree&&e.tree.prop(at.mounted);if(p&&p.overlay){let g=e.node.enter(p.overlay[0].from+o,1),m=this.highlighters.filter(y=>!y.scope||y.scope(p.tree.type)),$=e.firstChild();for(let y=0,k=o;;y++){let W=y=Z||!e.nextSibling())););if(!W||Z>i)break;k=W.to+o,k>t&&(this.highlightRange(g.cursor(),Math.max(t,W.from+o),Math.min(i,k),"",m),this.startSpan(Math.min(i,k),c))}$&&e.parent()}else if(e.firstChild()){p&&(r="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,r,s),this.startSpan(Math.min(i,e.to),c)}while(e.nextSibling());e.parent()}}}function BT(n){let e=n.type.prop(pv);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const de=Zn.define,Jf=de(),hs=de(),m0=de(hs),S0=de(hs),Os=de(),ec=de(Os),uO=de(Os),ur=de(),qs=de(ur),fr=de(),cr=de(),yd=de(),Xo=de(yd),tc=de(),b={comment:Jf,lineComment:de(Jf),blockComment:de(Jf),docComment:de(Jf),name:hs,variableName:de(hs),typeName:m0,tagName:de(m0),propertyName:S0,attributeName:de(S0),className:de(hs),labelName:de(hs),namespace:de(hs),macroName:de(hs),literal:Os,string:ec,docString:de(ec),character:de(ec),attributeValue:de(ec),number:uO,integer:de(uO),float:de(uO),bool:de(Os),regexp:de(Os),escape:de(Os),color:de(Os),url:de(Os),keyword:fr,self:de(fr),null:de(fr),atom:de(fr),unit:de(fr),modifier:de(fr),operatorKeyword:de(fr),controlKeyword:de(fr),definitionKeyword:de(fr),moduleKeyword:de(fr),operator:cr,derefOperator:de(cr),arithmeticOperator:de(cr),logicOperator:de(cr),bitwiseOperator:de(cr),compareOperator:de(cr),updateOperator:de(cr),definitionOperator:de(cr),typeOperator:de(cr),controlOperator:de(cr),punctuation:yd,separator:de(yd),bracket:Xo,angleBracket:de(Xo),squareBracket:de(Xo),paren:de(Xo),brace:de(Xo),content:ur,heading:qs,heading1:de(qs),heading2:de(qs),heading3:de(qs),heading4:de(qs),heading5:de(qs),heading6:de(qs),contentSeparator:de(ur),list:de(ur),quote:de(ur),emphasis:de(ur),strong:de(ur),link:de(ur),monospace:de(ur),strikethrough:de(ur),inserted:de(),deleted:de(),changed:de(),invalid:de(),meta:tc,documentMeta:de(tc),annotation:de(tc),processingInstruction:de(tc),definition:Zn.defineModifier("definition"),constant:Zn.defineModifier("constant"),function:Zn.defineModifier("function"),standard:Zn.defineModifier("standard"),local:Zn.defineModifier("local"),special:Zn.defineModifier("special")};for(let n in b){let e=b[n];e instanceof Zn&&(e.name=n)}gv([{tag:b.link,class:"tok-link"},{tag:b.heading,class:"tok-heading"},{tag:b.emphasis,class:"tok-emphasis"},{tag:b.strong,class:"tok-strong"},{tag:b.keyword,class:"tok-keyword"},{tag:b.atom,class:"tok-atom"},{tag:b.bool,class:"tok-bool"},{tag:b.url,class:"tok-url"},{tag:b.labelName,class:"tok-labelName"},{tag:b.inserted,class:"tok-inserted"},{tag:b.deleted,class:"tok-deleted"},{tag:b.literal,class:"tok-literal"},{tag:b.string,class:"tok-string"},{tag:b.number,class:"tok-number"},{tag:[b.regexp,b.escape,b.special(b.string)],class:"tok-string2"},{tag:b.variableName,class:"tok-variableName"},{tag:b.local(b.variableName),class:"tok-variableName tok-local"},{tag:b.definition(b.variableName),class:"tok-variableName tok-definition"},{tag:b.special(b.variableName),class:"tok-variableName2"},{tag:b.definition(b.propertyName),class:"tok-propertyName tok-definition"},{tag:b.typeName,class:"tok-typeName"},{tag:b.namespace,class:"tok-namespace"},{tag:b.className,class:"tok-className"},{tag:b.macroName,class:"tok-macroName"},{tag:b.propertyName,class:"tok-propertyName"},{tag:b.operator,class:"tok-operator"},{tag:b.comment,class:"tok-comment"},{tag:b.meta,class:"tok-meta"},{tag:b.invalid,class:"tok-invalid"},{tag:b.punctuation,class:"tok-punctuation"}]);var hO;const Pl=new at;function mv(n){return ye.define({combine:n?e=>e.concat(n):void 0})}const rp=new at;class Hn{constructor(e,t,i=[],r=""){this.data=e,this.name=r,Ot.prototype.hasOwnProperty("tree")||Object.defineProperty(Ot.prototype,"tree",{get(){return ei(this)}}),this.parser=t,this.extension=[Cs.of(this),Ot.languageData.of((s,l,o)=>{let a=b0(s,l,o),c=a.type.prop(Pl);if(!c)return[];let h=s.facet(c),O=a.type.prop(rp);if(O){let p=a.resolve(l-a.from,o);for(let g of O)if(g.test(p,s)){let m=s.facet(g.facet);return g.type=="replace"?m:m.concat(h)}}return h})].concat(i)}isActiveAt(e,t,i=-1){return b0(e,t,i).type.prop(Pl)==this.data}findRegions(e){let t=e.facet(Cs);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],r=(s,l)=>{if(s.prop(Pl)==this.data){i.push({from:l,to:l+s.length});return}let o=s.prop(at.mounted);if(o){if(o.tree.prop(Pl)==this.data){if(o.overlay)for(let a of o.overlay)i.push({from:a.from+l,to:a.to+l});else i.push({from:l,to:l+s.length});return}else if(o.overlay){let a=i.length;if(r(o.tree,o.overlay[0].from+l),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new Ws(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ei(n){let e=n.field(Hn.state,!1);return e?e.tree:jt.empty}class jT{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Yo=null;class Ec{constructor(e,t,i=[],r,s,l,o,a){this.parser=e,this.state=t,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=l,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Ec(e,t,[],jt.empty,0,i,[],null)}startParse(){return this.parser.startParse(new jT(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=jt.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Vr.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Yo;Yo=this;try{return e()}finally{Yo=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=$0(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:r,treeLen:s,viewport:l,skipped:o}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,h,O,p)=>a.push({fromA:c,toA:h,fromB:O,toB:p})),i=Vr.applyChanges(i,a),r=jt.empty,s=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){o=[];for(let c of this.skipped){let h=e.mapPos(c.from,1),O=e.mapPos(c.to,-1);he.from&&(this.fragments=$0(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends hv{createParse(t,i,r){let s=r[0].from,l=r[r.length-1].to;return{parsedPos:s,advance(){let a=Yo;if(a){for(let c of r)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=l,new jt(Ni.none,[],[],l-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Yo}}function $0(n,e,t){return Vr.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Ll{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new Ll(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Ec.create(e.facet(Cs).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new Ll(i)}}Hn.state=pi.define({create:Ll.init,update(n,e){for(let t of e.effects)if(t.is(Hn.setState))return t.value;return e.startState.facet(Cs)!=e.state.facet(Cs)?Ll.init(e.state):n.apply(e)}});let Sv=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Sv=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const OO=typeof navigator<"u"&&(!((hO=navigator.scheduling)===null||hO===void 0)&&hO.isInputPending)?()=>navigator.scheduling.isInputPending():null,FT=oi.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Hn.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Hn.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Sv(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndr+1e3,a=s.context.work(()=>OO&&OO()||Date.now()>l,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Hn.setState.of(new Ll(s.context))})),this.chunkBudget>0&&!(a&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>en(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Cs=ye.define({combine(n){return n.length?n[0]:null},enables:n=>[Hn.state,FT,Oe.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Qa{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const GT=ye.define(),cu=ye.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Mc(n){let e=n.facet(cu);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function pa(n,e){let t="",i=n.tabSize,r=n.facet(cu)[0];if(r==" "){for(;e>=i;)t+=" ",e-=i;r=" "}for(let s=0;s=e?HT(n,t,e):null}class uu{constructor(e,t={}){this.state=e,this.options=t,this.unit=Mc(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:"",from:e}:(t<0?r-1&&(s+=l-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,t=e.length){return Gl(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let l=s(r);if(l>-1)return l}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Kl=new at;function HT(n,e,t){let i=e.resolveStack(t),r=i.node.enterUnfinishedNodesBefore(t);if(r!=i.node){let s=[];for(let l=r;l!=i.node;l=l.parent)s.push(l);for(let l=s.length-1;l>=0;l--)i={node:s[l],next:i}}return bv(i,n,t)}function bv(n,e,t){for(let i=n;i;i=i.next){let r=JT(i.node);if(r)return r(lp.create(e,t,i))}return 0}function KT(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function JT(n){let e=n.type.prop(Kl);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(at.closedBy))){let r=n.lastChild,s=r&&i.indexOf(r.name)>-1;return l=>$v(l,!0,1,void 0,s&&!KT(l)?r.from:void 0)}return n.parent==null?eZ:null}function eZ(){return 0}class lp extends uu{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new lp(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(tZ(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return bv(this.context.next,this.base,this.pos)}}function tZ(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function iZ(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let r=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),l=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let o=t.to;;){let a=e.childAfter(o);if(!a||a==i)return null;if(!a.type.isSkipped)return a.from$v(i,e,t,n)}function $v(n,e,t,i,r){let s=n.textAfter,l=s.match(/^\s*/)[0].length,o=i&&s.slice(l,l+i.length)==i||r==n.pos+l,a=e?iZ(n):null;return a?o?n.column(a.from):n.column(a.to):n.baseIndent+(o?0:n.unit*t)}const nZ=n=>n.baseIndent;function Yl({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const rZ=200;function sZ(){return Ot.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,r=t.lineAt(i);if(i>r.from+rZ)return n;let s=t.sliceString(r.from,i);if(!e.some(c=>c.test(s)))return n;let{state:l}=n,o=-1,a=[];for(let{head:c}of l.selection.ranges){let h=l.doc.lineAt(c);if(h.from==o)continue;o=h.from;let O=sp(l,h.from);if(O==null)continue;let p=/^\s*/.exec(h.text)[0],g=pa(l,O);p!=g&&a.push({from:h.from,to:h.from+p.length,insert:g})}return a.length?[n,{changes:a,sequential:!0}]:n})}const lZ=ye.define(),Jl=new at;function hr(n){let e=n.firstChild,t=n.lastChild;return e&&e.tot)continue;if(s&&o.from=e&&c.to>t&&(s=c)}}return s}function aZ(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function zc(n,e,t){for(let i of n.facet(lZ)){let r=i(n,e,t);if(r)return r}return oZ(n,e,t)}function yv(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const hu=Ie.define({map:yv}),ka=Ie.define({map:yv});function vv(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const tl=pi.define({create(){return Ze.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)if(t.is(hu)&&!fZ(n,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(kv),r=i?Ze.replace({widget:new gZ(i(e.state,t.value))}):y0;n=n.update({add:[r.range(t.value.from,t.value.to)]})}else t.is(ka)&&(n=n.update({filter:(i,r)=>t.value.from!=i||t.value.to!=r,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:i}=e.selection.main;n.between(i,i,(r,s)=>{ri&&(t=!0)}),t&&(n=n.update({filterFrom:i,filterTo:i,filter:(r,s)=>s<=i||r>=i}))}return n},provide:n=>Oe.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,r)=>{t.push(i,r)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!r||r.from>s)&&(r={from:s,to:l})}),r}function fZ(n,e,t){let i=!1;return n.between(e,e,(r,s)=>{r==e&&s==t&&(i=!0)}),i}function wv(n,e){return n.field(tl,!1)?e:e.concat(Ie.appendConfig.of(_v()))}const cZ=n=>{for(let e of vv(n)){let t=zc(n.state,e.from,e.to);if(t)return n.dispatch({effects:wv(n.state,[hu.of(t),Qv(n,t)])}),!0}return!1},uZ=n=>{if(!n.state.field(tl,!1))return!1;let e=[];for(let t of vv(n)){let i=Dc(n.state,t.from,t.to);i&&e.push(ka.of(i),Qv(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function Qv(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,r=n.state.doc.lineAt(e.to).number;return Oe.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${n.state.phrase("to")} ${r}.`)}const hZ=n=>{let{state:e}=n,t=[];for(let i=0;i{let e=n.state.field(tl,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,r)=>{t.push(ka.of({from:i,to:r}))}),n.dispatch({effects:t}),!0},dZ=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:cZ},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:uZ},{key:"Ctrl-Alt-[",run:hZ},{key:"Ctrl-Alt-]",run:OZ}],pZ={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},kv=ye.define({combine(n){return yr(n,pZ)}});function _v(n){return[tl,bZ]}function Pv(n,e){let{state:t}=n,i=t.facet(kv),r=l=>{let o=n.lineBlockAt(n.posAtDOM(l.target)),a=Dc(n.state,o.from,o.to);a&&n.dispatch({effects:ka.of(a)}),l.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,r,e);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const y0=Ze.replace({widget:new class extends Nr{toDOM(n){return Pv(n,null)}}});class gZ extends Nr{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Pv(e,this.value)}}const mZ={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class dO extends Lr{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function SZ(n={}){let e=Object.assign(Object.assign({},mZ),n),t=new dO(e,!0),i=new dO(e,!1),r=oi.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(Cs)!=l.state.facet(Cs)||l.startState.field(tl,!1)!=l.state.field(tl,!1)||ei(l.startState)!=ei(l.state)||e.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let o=new vs;for(let a of l.viewportLineBlocks){let c=Dc(l.state,a.from,a.to)?i:zc(l.state,a.from,a.to)?t:null;c&&o.add(a.from,a.from,c)}return o.finish()}}),{domEventHandlers:s}=e;return[r,g3({class:"cm-foldGutter",markers(l){var o;return((o=l.plugin(r))===null||o===void 0?void 0:o.markers)||mt.empty},initialSpacer(){return new dO(e,!1)},domEventHandlers:Object.assign(Object.assign({},s),{click:(l,o,a)=>{if(s.click&&s.click(l,o,a))return!0;let c=Dc(l.state,o.from,o.to);if(c)return l.dispatch({effects:ka.of(c)}),!0;let h=zc(l.state,o.from,o.to);return h?(l.dispatch({effects:hu.of(h)}),!0):!1}})}),_v()]}const bZ=Oe.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 _a{constructor(e,t){this.specs=e;let i;function r(o){let a=ws.newName();return(i||(i=Object.create(null)))["."+a]=o,a}const s=typeof t.all=="string"?t.all:t.all?r(t.all):void 0,l=t.scope;this.scope=l instanceof Hn?o=>o.prop(Pl)==l.data:l?o=>o==l:void 0,this.style=gv(e.map(o=>({tag:o.tag,class:o.class||r(Object.assign({},o,{tag:null}))})),{all:s}).style,this.module=i?new ws(i):null,this.themeType=t.themeType}static define(e,t){return new _a(e,t||{})}}const vd=ye.define(),xv=ye.define({combine(n){return n.length?[n[0]]:null}});function pO(n){let e=n.facet(vd);return e.length?e:n.facet(xv)}function Wv(n,e){let t=[yZ],i;return n instanceof _a&&(n.module&&t.push(Oe.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(xv.of(n)):i?t.push(vd.computeN([Oe.darkTheme],r=>r.facet(Oe.darkTheme)==(i=="dark")?[n]:[])):t.push(vd.of(n)),t}class $Z{constructor(e){this.markCache=Object.create(null),this.tree=ei(e.state),this.decorations=this.buildDeco(e,pO(e.state))}update(e){let t=ei(e.state),i=pO(e.state),r=i!=pO(e.startState);t.length{i.add(l,o,this.markCache[a]||(this.markCache[a]=Ze.mark({class:a})))},r,s);return i.finish()}}const yZ=il.high(oi.fromClass($Z,{decorations:n=>n.decorations})),vZ=_a.define([{tag:b.meta,color:"#404740"},{tag:b.link,textDecoration:"underline"},{tag:b.heading,textDecoration:"underline",fontWeight:"bold"},{tag:b.emphasis,fontStyle:"italic"},{tag:b.strong,fontWeight:"bold"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.keyword,color:"#708"},{tag:[b.atom,b.bool,b.url,b.contentSeparator,b.labelName],color:"#219"},{tag:[b.literal,b.inserted],color:"#164"},{tag:[b.string,b.deleted],color:"#a11"},{tag:[b.regexp,b.escape,b.special(b.string)],color:"#e40"},{tag:b.definition(b.variableName),color:"#00f"},{tag:b.local(b.variableName),color:"#30a"},{tag:[b.typeName,b.namespace],color:"#085"},{tag:b.className,color:"#167"},{tag:[b.special(b.variableName),b.macroName],color:"#256"},{tag:b.definition(b.propertyName),color:"#00c"},{tag:b.comment,color:"#940"},{tag:b.invalid,color:"#f00"}]),wZ=Oe.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Cv=1e4,Tv="()[]{}",Zv=ye.define({combine(n){return yr(n,{afterCursor:!0,brackets:Tv,maxScanDistance:Cv,renderMatch:_Z})}}),QZ=Ze.mark({class:"cm-matchingBracket"}),kZ=Ze.mark({class:"cm-nonmatchingBracket"});function _Z(n){let e=[],t=n.matched?QZ:kZ;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const PZ=pi.define({create(){return Ze.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(Zv);for(let r of e.state.selection.ranges){if(!r.empty)continue;let s=gr(e.state,r.head,-1,i)||r.head>0&&gr(e.state,r.head-1,1,i)||i.afterCursor&&(gr(e.state,r.head,1,i)||r.headOe.decorations.from(n)}),xZ=[PZ,wZ];function WZ(n={}){return[Zv.of(n),xZ]}const Rv=new at;function wd(n,e,t){let i=n.prop(e<0?at.openedBy:at.closedBy);if(i)return i;if(n.name.length==1){let r=t.indexOf(n.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function Qd(n){let e=n.type.prop(Rv);return e?e(n.node):n}function gr(n,e,t,i={}){let r=i.maxScanDistance||Cv,s=i.brackets||Tv,l=ei(n),o=l.resolveInner(e,t);for(let a=o;a;a=a.parent){let c=wd(a.type,t,s);if(c&&a.from0?e>=h.from&&eh.from&&e<=h.to))return CZ(n,e,t,a,h,c,s)}}return TZ(n,e,t,l,o.type,r,s)}function CZ(n,e,t,i,r,s,l){let o=i.parent,a={from:r.from,to:r.to},c=0,h=o==null?void 0:o.cursor();if(h&&(t<0?h.childBefore(i.from):h.childAfter(i.to)))do if(t<0?h.to<=i.from:h.from>=i.to){if(c==0&&s.indexOf(h.type.name)>-1&&h.from0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},h=n.doc.iterRange(e,t>0?n.doc.length:0),O=0;for(let p=0;!h.next().done&&p<=s;){let g=h.value;t<0&&(p+=g.length);let m=e+p*t;for(let $=t>0?0:g.length-1,y=t>0?g.length:-1;$!=y;$+=t){let k=l.indexOf(g[$]);if(!(k<0||i.resolveInner(m+$,1).type!=r))if(k%2==0==t>0)O++;else{if(O==1)return{start:c,end:{from:m+$,to:m+$+1},matched:k>>1==a>>1};O--}}t>0&&(p+=g.length)}return h.done?{start:c,matched:!1}:null}const ZZ=Object.create(null),v0=[Ni.none],w0=[],RZ=Object.create(null);for(let[n,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"]])RZ[n]=AZ(ZZ,e);function gO(n,e){w0.indexOf(n)>-1||(w0.push(n),console.warn(e))}function AZ(n,e){let t=[];for(let s of e.split(" ")){let l=[];for(let o of s.split(".")){let a=n[o]||b[o];a?typeof a=="function"?l.length?l=l.map(a):gO(o,`Modifier ${o} used at start of tag`):l.length?gO(o,`Tag ${o} used as modifier`):l=Array.isArray(a)?a:[a]:gO(o,`Unknown highlighting tag ${o}`)}for(let o of l)t.push(o)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),r=Ni.define({id:v0.length,name:i,props:[Hl({[i]:t})]});return v0.push(r),r.id}const XZ=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=ap(n.state,t.from);return i.line?YZ(n):i.block?EZ(n):!1};function op(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let r=n(e,t);return r?(i(t.update(r)),!0):!1}}const YZ=op(DZ,0),UZ=op(Av,0),EZ=op((n,e)=>Av(n,e,zZ(e)),0);function ap(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const Uo=50;function MZ(n,{open:e,close:t},i,r){let s=n.sliceDoc(i-Uo,i),l=n.sliceDoc(r,r+Uo),o=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(l)[0].length,c=s.length-o;if(s.slice(c-e.length,c)==e&&l.slice(a,a+t.length)==t)return{open:{pos:i-o,margin:o&&1},close:{pos:r+a,margin:a&&1}};let h,O;r-i<=2*Uo?h=O=n.sliceDoc(i,r):(h=n.sliceDoc(i,i+Uo),O=n.sliceDoc(r-Uo,r));let p=/^\s*/.exec(h)[0].length,g=/\s*$/.exec(O)[0].length,m=O.length-g-t.length;return h.slice(p,p+e.length)==e&&O.slice(m,m+t.length)==t?{open:{pos:i+p+e.length,margin:/\s/.test(h.charAt(p+e.length))?1:0},close:{pos:r-g-t.length,margin:/\s/.test(O.charAt(m-1))?1:0}}:null}function zZ(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),r=t.to<=i.to?i:n.doc.lineAt(t.to),s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function Av(n,e,t=e.selection.ranges){let i=t.map(s=>ap(e,s.from).block);if(!i.every(s=>s))return null;let r=t.map((s,l)=>MZ(e,i[l],s.from,s.to));if(n!=2&&!r.every(s=>s))return{changes:e.changes(t.map((s,l)=>r[l]?[]:[{from:s.from,insert:i[l].open+" "},{from:s.to,insert:" "+i[l].close}]))};if(n!=1&&r.some(s=>s)){let s=[];for(let l=0,o;lr&&(s==l||l>O.from)){r=O.from;let p=/^\s*/.exec(O.text)[0].length,g=p==O.length,m=O.text.slice(p,p+c.length)==c?p:-1;ps.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:o,token:a,indent:c,empty:h,single:O}of i)(O||!h)&&s.push({from:o.from+c,insert:a+" "});let l=e.changes(s);return{changes:l,selection:e.selection.map(l,1)}}else if(n!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:l,comment:o,token:a}of i)if(o>=0){let c=l.from+o,h=c+a.length;l.text[h-l.from]==" "&&h++,s.push({from:c,to:h})}return{changes:s}}return null}const kd=Ir.define(),VZ=Ir.define(),qZ=ye.define(),Xv=ye.define({combine(n){return yr(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,r)=>e(i,r)||t(i,r)})}}),Yv=pi.define({create(){return mr.empty},update(n,e){let t=e.state.facet(Xv),i=e.annotation(kd);if(i){let a=tn.fromTransaction(e,i.selection),c=i.side,h=c==0?n.undone:n.done;return a?h=Vc(h,h.length,t.minDepth,a):h=Mv(h,e.startState.selection),new mr(c==0?i.rest:h,c==0?h:i.rest)}let r=e.annotation(VZ);if((r=="full"||r=="before")&&(n=n.isolate()),e.annotation(hi.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let s=tn.fromTransaction(e),l=e.annotation(hi.time),o=e.annotation(hi.userEvent);return s?n=n.addChanges(s,l,o,t,e):e.selection&&(n=n.addSelection(e.startState.selection,l,o,t.newGroupDelay)),(r=="full"||r=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new mr(n.done.map(tn.fromJSON),n.undone.map(tn.fromJSON))}});function LZ(n={}){return[Yv,Xv.of(n),Oe.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Uv:e.inputType=="historyRedo"?_d:null;return i?(e.preventDefault(),i(t)):!1}})]}function Ou(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let r=t.field(Yv,!1);if(!r)return!1;let s=r.pop(n,t,e);return s?(i(s),!0):!1}}const Uv=Ou(0,!1),_d=Ou(1,!1),IZ=Ou(0,!0),NZ=Ou(1,!0);class tn{constructor(e,t,i,r,s){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new tn(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new tn(e.changes&&ui.fromJSON(e.changes),[],e.mapped&&Sr.fromJSON(e.mapped),e.startSelection&&te.fromJSON(e.startSelection),e.selectionsAfter.map(te.fromJSON))}static fromTransaction(e,t){let i=Xn;for(let r of e.startState.facet(qZ)){let s=r(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new tn(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Xn)}static selection(e){return new tn(void 0,Xn,void 0,void 0,e)}}function Vc(n,e,t,i){let r=e+1>t+20?e-t-1:0,s=n.slice(r,e);return s.push(i),s}function BZ(n,e){let t=[],i=!1;return n.iterChangedRanges((r,s)=>t.push(r,s)),e.iterChangedRanges((r,s,l,o)=>{for(let a=0;a=c&&l<=h&&(i=!0)}}),i}function jZ(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function Ev(n,e){return n.length?e.length?n.concat(e):n:e}const Xn=[],FZ=200;function Mv(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-FZ));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),Vc(n,n.length-1,1e9,t.setSelAfter(i)))}else return[tn.selection([e])]}function GZ(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function mO(n,e){if(!n.length)return n;let t=n.length,i=Xn;for(;t;){let r=HZ(n[t-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=n.slice(0,t);return s[t-1]=r,s}else e=r.mapped,t--,i=r.selectionsAfter}return i.length?[tn.selection(i)]:Xn}function HZ(n,e,t){let i=Ev(n.selectionsAfter.length?n.selectionsAfter.map(o=>o.map(e)):Xn,t);if(!n.changes)return tn.selection(i);let r=n.changes.map(e),s=e.mapDesc(n.changes,!0),l=n.mapped?n.mapped.composeDesc(s):s;return new tn(r,Ie.mapEffects(n.effects,e),l,n.startSelection.map(s),i)}const KZ=/^(input\.type|delete)($|\.)/;class mr{constructor(e,t,i=0,r=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new mr(this.done,this.undone):this}addChanges(e,t,i,r,s){let l=this.done,o=l[l.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!i||KZ.test(i))&&(!o.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):du(t,e))}function zi(n){return n.textDirectionAt(n.state.selection.main.head)==Bt.LTR}const Dv=n=>zv(n,!zi(n)),Vv=n=>zv(n,zi(n));function qv(n,e){return tr(n,t=>t.empty?n.moveByGroup(t,e):du(t,e))}const eR=n=>qv(n,!zi(n)),tR=n=>qv(n,zi(n));function iR(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function pu(n,e,t){let i=ei(n).resolveInner(e.head),r=t?at.closedBy:at.openedBy;for(let a=e.head;;){let c=t?i.childAfter(a):i.childBefore(a);if(!c)break;iR(n,c,r)?i=c:a=t?c.to:c.from}let s=i.type.prop(r),l,o;return s&&(l=t?gr(n,i.from,1):gr(n,i.to,-1))&&l.matched?o=t?l.end.to:l.end.from:o=t?i.to:i.from,te.cursor(o,t?-1:1)}const nR=n=>tr(n,e=>pu(n.state,e,!zi(n))),rR=n=>tr(n,e=>pu(n.state,e,zi(n)));function Lv(n,e){return tr(n,t=>{if(!t.empty)return du(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const Iv=n=>Lv(n,!1),Nv=n=>Lv(n,!0);function Bv(n){let e=n.scrollDOM.clientHeightl.empty?n.moveVertically(l,e,t.height):du(l,e));if(r.eq(i.selection))return!1;let s;if(t.selfScroll){let l=n.coordsAtPos(i.selection.main.head),o=n.scrollDOM.getBoundingClientRect(),a=o.top+t.marginTop,c=o.bottom-t.marginBottom;l&&l.top>a&&l.bottomjv(n,!1),Pd=n=>jv(n,!0);function Ts(n,e,t){let i=n.lineBlockAt(e.head),r=n.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?i.to:i.from)&&(r=n.moveToLineBoundary(e,t,!1)),!t&&r.head==i.from&&i.length){let s=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=te.cursor(i.from+s))}return r}const sR=n=>tr(n,e=>Ts(n,e,!0)),lR=n=>tr(n,e=>Ts(n,e,!1)),oR=n=>tr(n,e=>Ts(n,e,!zi(n))),aR=n=>tr(n,e=>Ts(n,e,zi(n))),fR=n=>tr(n,e=>te.cursor(n.lineBlockAt(e.head).from,1)),cR=n=>tr(n,e=>te.cursor(n.lineBlockAt(e.head).to,-1));function uR(n,e,t){let i=!1,r=eo(n.selection,s=>{let l=gr(n,s.head,-1)||gr(n,s.head,1)||s.head>0&&gr(n,s.head-1,1)||s.headuR(n,e);function En(n,e){let t=eo(n.state.selection,i=>{let r=e(i);return te.range(i.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(wr(n.state,t)),!0)}function Fv(n,e){return En(n,t=>n.moveByChar(t,e))}const Gv=n=>Fv(n,!zi(n)),Hv=n=>Fv(n,zi(n));function Kv(n,e){return En(n,t=>n.moveByGroup(t,e))}const OR=n=>Kv(n,!zi(n)),dR=n=>Kv(n,zi(n)),pR=n=>En(n,e=>pu(n.state,e,!zi(n))),gR=n=>En(n,e=>pu(n.state,e,zi(n)));function Jv(n,e){return En(n,t=>n.moveVertically(t,e))}const ew=n=>Jv(n,!1),tw=n=>Jv(n,!0);function iw(n,e){return En(n,t=>n.moveVertically(t,e,Bv(n).height))}const k0=n=>iw(n,!1),_0=n=>iw(n,!0),mR=n=>En(n,e=>Ts(n,e,!0)),SR=n=>En(n,e=>Ts(n,e,!1)),bR=n=>En(n,e=>Ts(n,e,!zi(n))),$R=n=>En(n,e=>Ts(n,e,zi(n))),yR=n=>En(n,e=>te.cursor(n.lineBlockAt(e.head).from)),vR=n=>En(n,e=>te.cursor(n.lineBlockAt(e.head).to)),P0=({state:n,dispatch:e})=>(e(wr(n,{anchor:0})),!0),x0=({state:n,dispatch:e})=>(e(wr(n,{anchor:n.doc.length})),!0),W0=({state:n,dispatch:e})=>(e(wr(n,{anchor:n.selection.main.anchor,head:0})),!0),C0=({state:n,dispatch:e})=>(e(wr(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),wR=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),QR=({state:n,dispatch:e})=>{let t=gu(n).map(({from:i,to:r})=>te.range(i,Math.min(r+1,n.doc.length)));return e(n.update({selection:te.create(t),userEvent:"select"})),!0},kR=({state:n,dispatch:e})=>{let t=eo(n.selection,i=>{let r=ei(n),s=r.resolveStack(i.from,1);if(i.empty){let l=r.resolveStack(i.from,-1);l.node.from>=s.node.from&&l.node.to<=s.node.to&&(s=l)}for(let l=s;l;l=l.next){let{node:o}=l;if((o.from=i.to||o.to>i.to&&o.from<=i.from)&&l.next)return te.range(o.to,o.from)}return i});return t.eq(n.selection)?!1:(e(wr(n,t)),!0)},_R=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=te.create([t.main]):t.main.empty||(i=te.create([te.cursor(t.main.head)])),i?(e(wr(n,i)),!0):!1};function Pa(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,r=i.changeByRange(s=>{let{from:l,to:o}=s;if(l==o){let a=e(s);al&&(t="delete.forward",a=ic(n,a,!0)),l=Math.min(l,a),o=Math.max(o,a)}else l=ic(n,l,!1),o=ic(n,o,!0);return l==o?{range:s}:{changes:{from:l,to:o},range:te.cursor(l,lr(n)))i.between(e,e,(r,s)=>{re&&(e=t?s:r)});return e}const nw=(n,e,t)=>Pa(n,i=>{let r=i.from,{state:s}=n,l=s.doc.lineAt(r),o,a;if(t&&!e&&r>l.from&&rnw(n,!1,!0),rw=n=>nw(n,!0,!1),sw=(n,e)=>Pa(n,t=>{let i=t.head,{state:r}=n,s=r.doc.lineAt(i),l=r.charCategorizer(i);for(let o=null;;){if(i==(e?s.to:s.from)){i==t.head&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let a=Pi(s.text,i-s.from,e)+s.from,c=s.text.slice(Math.min(i,a)-s.from,Math.max(i,a)-s.from),h=l(c);if(o!=null&&h!=o)break;(c!=" "||i!=t.head)&&(o=h),i=a}return i}),lw=n=>sw(n,!1),PR=n=>sw(n,!0),xR=n=>Pa(n,e=>{let t=n.lineBlockAt(e.head).to;return e.headPa(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),CR=n=>Pa(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:St.of(["",""])},range:te.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},ZR=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let r=i.from,s=n.doc.lineAt(r),l=r==s.from?r-1:Pi(s.text,r-s.from,!1)+s.from,o=r==s.to?r+1:Pi(s.text,r-s.from,!0)+s.from;return{changes:{from:l,to:o,insert:n.doc.slice(r,o).append(n.doc.slice(l,r))},range:te.cursor(o)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function gu(n){let e=[],t=-1;for(let i of n.selection.ranges){let r=n.doc.lineAt(i.from),s=n.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=n.doc.lineAt(i.to-1)),t>=r.number){let l=e[e.length-1];l.to=s.to,l.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});t=s.number+1}return e}function ow(n,e,t){if(n.readOnly)return!1;let i=[],r=[];for(let s of gu(n)){if(t?s.to==n.doc.length:s.from==0)continue;let l=n.doc.lineAt(t?s.to+1:s.from-1),o=l.length+1;if(t){i.push({from:s.to,to:l.to},{from:s.from,insert:l.text+n.lineBreak});for(let a of s.ranges)r.push(te.range(Math.min(n.doc.length,a.anchor+o),Math.min(n.doc.length,a.head+o)))}else{i.push({from:l.from,to:s.from},{from:s.to,insert:n.lineBreak+l.text});for(let a of s.ranges)r.push(te.range(a.anchor-o,a.head-o))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:te.create(r,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const RR=({state:n,dispatch:e})=>ow(n,e,!1),AR=({state:n,dispatch:e})=>ow(n,e,!0);function aw(n,e,t){if(n.readOnly)return!1;let i=[];for(let r of gu(n))t?i.push({from:r.from,insert:n.doc.slice(r.from,r.to)+n.lineBreak}):i.push({from:r.to,insert:n.lineBreak+n.doc.slice(r.from,r.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const XR=({state:n,dispatch:e})=>aw(n,e,!1),YR=({state:n,dispatch:e})=>aw(n,e,!0),UR=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(gu(e).map(({from:r,to:s})=>(r>0?r--:s{let s;if(n.lineWrapping){let l=n.lineBlockAt(r.head),o=n.coordsAtPos(r.head,r.assoc||1);o&&(s=l.bottom+n.documentTop-o.bottom+n.defaultLineHeight/2)}return n.moveVertically(r,!0,s)}).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function ER(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=ei(n).resolveInner(e),i=t.childBefore(e),r=t.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(at.closedBy))&&s.indexOf(r.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(r.from).from&&!/\S/.test(n.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const MR=fw(!1),zR=fw(!0);function fw(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:s,to:l}=r,o=e.doc.lineAt(s),a=!n&&s==l&&ER(e,s);n&&(s=l=(l<=o.to?o:e.doc.lineAt(l)).to);let c=new uu(e,{simulateBreak:s,simulateDoubleBreak:!!a}),h=sp(c,s);for(h==null&&(h=Gl(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));lo.from&&s{let r=[];for(let l=i.from;l<=i.to;){let o=n.doc.lineAt(l);o.number>t&&(i.empty||i.to>o.from)&&(e(o,r,i),t=o.number),l=o.to+1}let s=n.changes(r);return{changes:r,range:te.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const DR=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new uu(n,{overrideIndentation:s=>{let l=t[s];return l??-1}}),r=fp(n,(s,l,o)=>{let a=sp(i,s.from);if(a==null)return;/\S/.test(s.text)||(a=0);let c=/^\s*/.exec(s.text)[0],h=pa(n,a);(c!=h||o.fromn.readOnly?!1:(e(n.update(fp(n,(t,i)=>{i.push({from:t.from,insert:n.facet(cu)})}),{userEvent:"input.indent"})),!0),uw=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(fp(n,(t,i)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let s=Gl(r,n.tabSize),l=0,o=pa(n,Math.max(0,s-Mc(n)));for(;l(n.setTabFocusMode(),!0),qR=[{key:"Ctrl-b",run:Dv,shift:Gv,preventDefault:!0},{key:"Ctrl-f",run:Vv,shift:Hv},{key:"Ctrl-p",run:Iv,shift:ew},{key:"Ctrl-n",run:Nv,shift:tw},{key:"Ctrl-a",run:fR,shift:yR},{key:"Ctrl-e",run:cR,shift:vR},{key:"Ctrl-d",run:rw},{key:"Ctrl-h",run:xd},{key:"Ctrl-k",run:xR},{key:"Ctrl-Alt-h",run:lw},{key:"Ctrl-o",run:TR},{key:"Ctrl-t",run:ZR},{key:"Ctrl-v",run:Pd}],LR=[{key:"ArrowLeft",run:Dv,shift:Gv,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:eR,shift:OR,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:oR,shift:bR,preventDefault:!0},{key:"ArrowRight",run:Vv,shift:Hv,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:tR,shift:dR,preventDefault:!0},{mac:"Cmd-ArrowRight",run:aR,shift:$R,preventDefault:!0},{key:"ArrowUp",run:Iv,shift:ew,preventDefault:!0},{mac:"Cmd-ArrowUp",run:P0,shift:W0},{mac:"Ctrl-ArrowUp",run:Q0,shift:k0},{key:"ArrowDown",run:Nv,shift:tw,preventDefault:!0},{mac:"Cmd-ArrowDown",run:x0,shift:C0},{mac:"Ctrl-ArrowDown",run:Pd,shift:_0},{key:"PageUp",run:Q0,shift:k0},{key:"PageDown",run:Pd,shift:_0},{key:"Home",run:lR,shift:SR,preventDefault:!0},{key:"Mod-Home",run:P0,shift:W0},{key:"End",run:sR,shift:mR,preventDefault:!0},{key:"Mod-End",run:x0,shift:C0},{key:"Enter",run:MR},{key:"Mod-a",run:wR},{key:"Backspace",run:xd,shift:xd},{key:"Delete",run:rw},{key:"Mod-Backspace",mac:"Alt-Backspace",run:lw},{key:"Mod-Delete",mac:"Alt-Delete",run:PR},{mac:"Mod-Backspace",run:WR},{mac:"Mod-Delete",run:CR}].concat(qR.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),IR=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:nR,shift:pR},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:rR,shift:gR},{key:"Alt-ArrowUp",run:RR},{key:"Shift-Alt-ArrowUp",run:XR},{key:"Alt-ArrowDown",run:AR},{key:"Shift-Alt-ArrowDown",run:YR},{key:"Escape",run:_R},{key:"Mod-Enter",run:zR},{key:"Alt-l",mac:"Ctrl-l",run:QR},{key:"Mod-i",run:kR,preventDefault:!0},{key:"Mod-[",run:uw},{key:"Mod-]",run:cw},{key:"Mod-Alt-\\",run:DR},{key:"Shift-Mod-k",run:UR},{key:"Shift-Mod-\\",run:hR},{key:"Mod-/",run:XZ},{key:"Alt-A",run:UZ},{key:"Ctrl-m",mac:"Shift-Alt-m",run:VR}].concat(LR);function Ut(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i];typeof r=="string"?n.setAttribute(i,r):r!=null&&(n[i]=r)}e++}for(;en.normalize("NFKD"):n=>n;class Il{constructor(e,t,i=0,r=e.length,s,l){this.test=l,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,r),this.bufferStart=i,this.normalize=s?o=>s(T0(o)):T0,this.query=this.normalize(t)}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 Qi(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Ed(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Rn(e);let r=this.normalize(t);for(let s=0,l=i;;s++){let o=r.charCodeAt(s),a=this.match(o,l);if(s==r.length-1){if(a)return this.value=a,this;break}l==i&&sthis.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 e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,r=i+t[0].length;if(this.matchPos=qc(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,r,t)))return this.value={from:i,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||r.to<=t){let o=new Ul(t,e.sliceString(t,i));return SO.set(e,o),o}if(r.from==t&&r.to==i)return r;let{text:s,from:l}=r;return l>t&&(s=e.sliceString(t,l)+s,l=t),r.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,r=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,t)))return this.value={from:i,to:r,match:t},this.matchPos=qc(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ul.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(dw.prototype[Symbol.iterator]=pw.prototype[Symbol.iterator]=function(){return this});function NR(n){try{return new RegExp(n,cp),!0}catch{return!1}}function qc(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function Wd(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=Ut("input",{class:"cm-textfield",name:"line",value:e}),i=Ut("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:Lc.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),r())},onsubmit:s=>{s.preventDefault(),r()}},Ut("label",n.state.phrase("Go to line"),": ",t)," ",Ut("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function r(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!s)return;let{state:l}=n,o=l.doc.lineAt(l.selection.main.head),[,a,c,h,O]=s,p=h?+h.slice(1):0,g=c?+c:o.number;if(c&&O){let y=g/100;a&&(y=y*(a=="-"?-1:1)+o.number/l.doc.lines),g=Math.round(l.doc.lines*y)}else c&&a&&(g=g*(a=="-"?-1:1)+o.number);let m=l.doc.line(Math.max(1,Math.min(l.doc.lines,g))),$=te.cursor(m.from+Math.max(0,Math.min(p,m.length)));n.dispatch({effects:[Lc.of(!1),Oe.scrollIntoView($.from,{y:"center"})],selection:$}),n.focus()}return{dom:i}}const Lc=Ie.define(),Z0=pi.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(Lc)&&(n=t.value);return n},provide:n=>ua.from(n,e=>e?Wd:null)}),BR=n=>{let e=ca(n,Wd);if(!e){let t=[Lc.of(!0)];n.state.field(Z0,!1)==null&&t.push(Ie.appendConfig.of([Z0,jR])),n.dispatch({effects:t}),e=ca(n,Wd)}return e&&e.dom.querySelector("input").select(),!0},jR=Oe.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),FR={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},GR=ye.define({combine(n){return yr(n,FR,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function HR(n){return[iA,tA]}const KR=Ze.mark({class:"cm-selectionMatch"}),JR=Ze.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function R0(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=It.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=It.Word)}function eA(n,e,t,i){return n(e.sliceDoc(t,t+1))==It.Word&&n(e.sliceDoc(i-1,i))==It.Word}const tA=oi.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(GR),{state:t}=n,i=t.selection;if(i.ranges.length>1)return Ze.none;let r=i.main,s,l=null;if(r.empty){if(!e.highlightWordAroundCursor)return Ze.none;let a=t.wordAt(r.head);if(!a)return Ze.none;l=t.charCategorizer(r.head),s=t.sliceDoc(a.from,a.to)}else{let a=r.to-r.from;if(a200)return Ze.none;if(e.wholeWords){if(s=t.sliceDoc(r.from,r.to),l=t.charCategorizer(r.head),!(R0(l,t,r.from,r.to)&&eA(l,t,r.from,r.to)))return Ze.none}else if(s=t.sliceDoc(r.from,r.to).trim(),!s)return Ze.none}let o=[];for(let a of n.visibleRanges){let c=new Il(t.doc,s,a.from,a.to);for(;!c.next().done;){let{from:h,to:O}=c.value;if((!l||R0(l,t,h,O))&&(r.empty&&h<=r.from&&O>=r.to?o.push(JR.range(h,O)):(h>=r.to||O<=r.from)&&o.push(KR.range(h,O)),o.length>e.maxMatches))return Ze.none}}return Ze.set(o)}},{decorations:n=>n.decorations}),iA=Oe.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),nA=({state:n,dispatch:e})=>{let{selection:t}=n,i=te.create(t.ranges.map(r=>n.wordAt(r.head)||te.cursor(r.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function rA(n,e){let{main:t,ranges:i}=n.selection,r=n.wordAt(t.head),s=r&&r.from==t.from&&r.to==t.to;for(let l=!1,o=new Il(n.doc,e,i[i.length-1].to);;)if(o.next(),o.done){if(l)return null;o=new Il(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),l=!0}else{if(l&&i.some(a=>a.from==o.value.from))continue;if(s){let a=n.wordAt(o.value.from);if(!a||a.from!=o.value.from||a.to!=o.value.to)continue}return o.value}}const sA=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(s=>s.from===s.to))return nA({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(s=>n.sliceDoc(s.from,s.to)!=i))return!1;let r=rA(n,i);return r?(e(n.update({selection:n.selection.addRange(te.range(r.from,r.to),!1),effects:Oe.scrollIntoView(r.to)})),!0):!1},to=ye.define({combine(n){return yr(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new mA(e),scrollToMatch:e=>Oe.scrollIntoView(e)})}});class gw{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||NR(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` -`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new fA(this):new oA(this)}getCursor(e,t=0,i){let r=e.doc?e:Ot.create({doc:e});return i==null&&(i=r.doc.length),this.regexp?Ql(this,r,t,i):wl(this,r,t,i)}}class mw{constructor(e){this.spec=e}}function wl(n,e,t,i){return new Il(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:r=>r.toLowerCase(),n.wholeWord?lA(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function lA(n,e){return(t,i,r,s)=>((s>t||s+r.length=t)return null;r.push(i.value)}return r}highlight(e,t,i,r){let s=wl(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function Ql(n,e,t,i){return new dw(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?aA(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function Ic(n,e){return n.slice(Pi(n,e,!1),e)}function Nc(n,e){return n.slice(e,Pi(n,e))}function aA(n){return(e,t,i)=>!i[0].length||(n(Ic(i.input,i.index))!=It.Word||n(Nc(i.input,i.index))!=It.Word)&&(n(Nc(i.input,i.index+i[0].length))!=It.Word||n(Ic(i.input,i.index+i[0].length))!=It.Word)}class fA extends mw{nextMatch(e,t,i){let r=Ql(this.spec,e,i,e.doc.length).next();return r.done&&(r=Ql(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,i){for(let r=1;;r++){let s=Math.max(t,i-r*1e4),l=Ql(this.spec,e,s,i),o=null;for(;!l.next().done;)o=l.value;if(o&&(s==t||o.from>s+10))return o;if(s==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i=t)return null;r.push(i.value)}return r}highlight(e,t,i,r){let s=Ql(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const ga=Ie.define(),up=Ie.define(),$s=pi.define({create(n){return new bO(Cd(n).create(),null)},update(n,e){for(let t of e.effects)t.is(ga)?n=new bO(t.value.create(),n.panel):t.is(up)&&(n=new bO(n.query,t.value?hp:null));return n},provide:n=>ua.from(n,e=>e.panel)});class bO{constructor(e,t){this.query=e,this.panel=t}}const cA=Ze.mark({class:"cm-searchMatch"}),uA=Ze.mark({class:"cm-searchMatch cm-searchMatch-selected"}),hA=oi.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field($s))}update(n){let e=n.state.field($s);(e!=n.startState.field($s)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Ze.none;let{view:t}=this,i=new vs;for(let r=0,s=t.visibleRanges,l=s.length;rs[r+1].from-2*250;)a=s[++r].to;n.highlight(t.state,o,a,(c,h)=>{let O=t.state.selection.ranges.some(p=>p.from==c&&p.to==h);i.add(c,h,O?uA:cA)})}return i.finish()}},{decorations:n=>n.decorations});function xa(n){return e=>{let t=e.state.field($s,!1);return t&&t.query.spec.valid?n(e,t):$w(e)}}const Bc=xa((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let r=te.single(i.from,i.to),s=n.state.facet(to);return n.dispatch({selection:r,effects:[Op(n,i),s.scrollToMatch(r.main,n)],userEvent:"select.search"}),bw(n),!0}),jc=xa((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,r=e.prevMatch(t,i,i);if(!r)return!1;let s=te.single(r.from,r.to),l=n.state.facet(to);return n.dispatch({selection:s,effects:[Op(n,r),l.scrollToMatch(s.main,n)],userEvent:"select.search"}),bw(n),!0}),OA=xa((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:te.create(t.map(i=>te.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),dA=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:r}=t.main,s=[],l=0;for(let o=new Il(n.doc,n.sliceDoc(i,r));!o.next().done;){if(s.length>1e3)return!1;o.value.from==i&&(l=s.length),s.push(te.range(o.value.from,o.value.to))}return e(n.update({selection:te.create(s,l),userEvent:"select.search.matches"})),!0},A0=xa((n,{query:e})=>{let{state:t}=n,{from:i,to:r}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,i,i);if(!s)return!1;let l=[],o,a,c=[];if(s.from==i&&s.to==r&&(a=t.toText(e.getReplacement(s)),l.push({from:s.from,to:s.to,insert:a}),s=e.nextMatch(t,s.from,s.to),c.push(Oe.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),s){let h=l.length==0||l[0].from>=s.to?0:s.to-s.from-a.length;o=te.single(s.from-h,s.to-h),c.push(Op(n,s)),c.push(t.facet(to).scrollToMatch(o.main,n))}return n.dispatch({changes:l,selection:o,effects:c,userEvent:"input.replace"}),!0}),pA=xa((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(r=>{let{from:s,to:l}=r;return{from:s,to:l,insert:e.getReplacement(r)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:Oe.announce.of(i),userEvent:"input.replace.all"}),!0});function hp(n){return n.state.facet(to).createPanel(n)}function Cd(n,e){var t,i,r,s,l;let o=n.selection.main,a=o.empty||o.to>o.from+100?"":n.sliceDoc(o.from,o.to);if(e&&!a)return e;let c=n.facet(to);return new gw({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:c.caseSensitive,literal:(r=e==null?void 0:e.literal)!==null&&r!==void 0?r:c.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:c.regexp,wholeWord:(l=e==null?void 0:e.wholeWord)!==null&&l!==void 0?l:c.wholeWord})}function Sw(n){let e=ca(n,hp);return e&&e.dom.querySelector("[main-field]")}function bw(n){let e=Sw(n);e&&e==n.root.activeElement&&e.select()}const $w=n=>{let e=n.state.field($s,!1);if(e&&e.panel){let t=Sw(n);if(t&&t!=n.root.activeElement){let i=Cd(n.state,e.query.spec);i.valid&&n.dispatch({effects:ga.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[up.of(!0),e?ga.of(Cd(n.state,e.query.spec)):Ie.appendConfig.of(bA)]});return!0},yw=n=>{let e=n.state.field($s,!1);if(!e||!e.panel)return!1;let t=ca(n,hp);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:up.of(!1)}),!0},gA=[{key:"Mod-f",run:$w,scope:"editor search-panel"},{key:"F3",run:Bc,shift:jc,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Bc,shift:jc,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:yw,scope:"editor search-panel"},{key:"Mod-Shift-l",run:dA},{key:"Alt-g",run:BR},{key:"Mod-d",run:sA,preventDefault:!0}];class mA{constructor(e){this.view=e;let t=this.query=e.state.field($s).query.spec;this.commit=this.commit.bind(this),this.searchField=Ut("input",{value:t.search,placeholder:hn(e,"Find"),"aria-label":hn(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ut("input",{value:t.replace,placeholder:hn(e,"Replace"),"aria-label":hn(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ut("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Ut("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Ut("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(r,s,l){return Ut("button",{class:"cm-button",name:r,onclick:s,type:"button"},l)}this.dom=Ut("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>Bc(e),[hn(e,"next")]),i("prev",()=>jc(e),[hn(e,"previous")]),i("select",()=>OA(e),[hn(e,"all")]),Ut("label",null,[this.caseField,hn(e,"match case")]),Ut("label",null,[this.reField,hn(e,"regexp")]),Ut("label",null,[this.wordField,hn(e,"by word")]),...e.state.readOnly?[]:[Ut("br"),this.replaceField,i("replace",()=>A0(e),[hn(e,"replace")]),i("replaceAll",()=>pA(e),[hn(e,"replace all")])],Ut("button",{name:"close",onclick:()=>yw(e),"aria-label":hn(e,"close"),type:"button"},["×"])])}commit(){let e=new gw({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:ga.of(e)}))}keydown(e){_5(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?jc:Bc)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),A0(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(ga)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(to).top}}function hn(n,e){return n.state.phrase(e)}const nc=30,rc=/[\s\.,:;?!]/;function Op(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),r=n.state.doc.lineAt(t).to,s=Math.max(i.from,e-nc),l=Math.min(r,t+nc),o=n.state.sliceDoc(s,l);if(s!=i.from){for(let a=0;ao.length-nc;a--)if(!rc.test(o[a-1])&&rc.test(o[a])){o=o.slice(0,a);break}}return Oe.announce.of(`${n.state.phrase("current match")}. ${o} ${n.state.phrase("on line")} ${i.number}.`)}const SA=Oe.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"}}),bA=[$s,il.low(hA),SA];class vw{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=ei(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),r=t.text.slice(i-t.from,this.pos-t.from),s=r.search(Qw(e,!1));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function X0(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function $A(n){let e=Object.create(null),t=Object.create(null);for(let{label:r}of n){e[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[t,i]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:$A(e);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:t}:null}}function yA(n,e){return t=>{for(let i=ei(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class Y0{constructor(e,t,i,r){this.completion=e,this.source=t,this.match=i,this.score=r}}function ys(n){return n.selection.main.from}function Qw(n,e){var t;let{source:i}=n,r=e&&i[0]!="^",s=i[i.length-1]!="$";return!r&&!s?n:new RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const kw=Ir.define();function vA(n,e,t,i){let{main:r}=n.selection,s=t-r.from,l=i-r.from;return Object.assign(Object.assign({},n.changeByRange(o=>o!=r&&t!=i&&n.sliceDoc(o.from+s,o.from+l)!=n.sliceDoc(t,i)?{range:o}:{changes:{from:o.from+s,to:i==r.from?o.to:o.from+l,insert:e},range:te.cursor(o.from+s+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const U0=new WeakMap;function wA(n){if(!Array.isArray(n))return n;let e=U0.get(n);return e||U0.set(n,e=ww(n)),e}const dp=Ie.define(),ma=Ie.define();class QA{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&C<=57||C>=97&&C<=122?2:C>=65&&C<=90?1:0:(U=Ed(C))!=U.toLowerCase()?1:U!=U.toUpperCase()?2:0;(!W||D==1&&y||A==0&&D!=0)&&(t[O]==C||i[O]==C&&(p=!0)?l[O++]=W:l.length&&(k=!1)),A=D,W+=Rn(C)}return O==a&&l[0]==0&&k?this.result(-100+(p?-200:0),l,e):g==a&&m==0?this.ret(-200-e.length+($==e.length?0:-100),[0,$]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):g==a?this.ret(-900-e.length,[m,$]):O==a?this.result(-100+(p?-200:0)+-700+(k?0:-1100),l,e):t.length==2?!1:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,i){let r=[],s=0;for(let l of t){let o=l+(this.astral?Rn(Qi(i,l)):1);s&&r[s-1]==l?r[s-1]=o:(r[s++]=l,r[s++]=o)}return this.ret(e-i.length,r)}}const Ei=ye.define({combine(n){return yr(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:kA,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>E0(e(i),t(i)),optionClass:(e,t)=>i=>E0(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})}});function E0(n,e){return n?e?n+" "+e:n:e}function kA(n,e,t,i,r,s){let l=n.textDirection==Bt.RTL,o=l,a=!1,c="top",h,O,p=e.left-r.left,g=r.right-e.right,m=i.right-i.left,$=i.bottom-i.top;if(o&&p=$||W>e.top?h=t.bottom-e.top:(c="bottom",h=e.bottom-t.top)}let y=(e.bottom-e.top)/s.offsetHeight,k=(e.right-e.left)/s.offsetWidth;return{style:`${c}: ${h/y}px; max-width: ${O/k}px`,class:"cm-completionInfo-"+(a?l?"left-narrow":"right-narrow":o?"left":"right")}}function _A(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,r,s){let l=document.createElement("span");l.className="cm-completionLabel";let o=t.displayLabel||t.label,a=0;for(let c=0;ca&&l.appendChild(document.createTextNode(o.slice(a,h)));let p=l.appendChild(document.createElement("span"));p.appendChild(document.createTextNode(o.slice(h,O))),p.className="cm-completionMatchedText",a=O}return at.position-i.position).map(t=>t.render)}function $O(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let r=Math.floor(e/t);return{from:r*t,to:(r+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class PA{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:s,selected:l}=r.open,o=e.state.facet(Ei);this.optionContent=_A(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=$O(s.length,l,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:c}=e.state.field(t).open;for(let h=a.target,O;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(O=/-(\d+)$/.exec(h.id))&&+O[1]{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(Ei).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:ma.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=r){let{options:s,selected:l,disabled:o}=i.open;(!r.open||r.open.options!=s)&&(this.range=$O(s.length,l,e.state.facet(Ei).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),o!=((t=r.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=$O(t.options.length,t.selected,this.view.state.facet(Ei).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:r}=i;if(!r)return;let s=typeof r=="string"?document.createTextNode(r):r(i);if(!s)return;"then"in s?s.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,i)}).catch(l=>en(this.view.state,l,"completion info")):this.addInfoPane(s,i)}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:s}=e;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&WA(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.space;if(!s){let l=this.dom.ownerDocument.defaultView||window;s={left:0,top:0,right:l.innerWidth,bottom:l.innerHeight}}return r.top>Math.min(s.bottom,t.bottom)-10||r.bottomi.from||i.from==0))if(s=p,typeof c!="string"&&c.header)r.appendChild(c.header(c));else{let g=r.appendChild(document.createElement("completion-section"));g.textContent=p}}const h=r.appendChild(document.createElement("li"));h.id=t+"-"+l,h.setAttribute("role","option");let O=this.optionClass(o);O&&(h.className=O);for(let p of this.optionContent){let g=p(o,this.view.state,this.view,a);g&&h.appendChild(g)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.tonew PA(t,n,e)}function WA(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),r=t.height/n.offsetHeight;i.topt.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/r)}function M0(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function CA(n,e){let t=[],i=null,r=a=>{t.push(a);let{section:c}=a.completion;if(c){i||(i=[]);let h=typeof c=="string"?c:c.name;i.some(O=>O.name==h)||i.push(typeof c=="string"?{name:h}:c)}};for(let a of n)if(a.hasResult()){let c=a.result.getMatch;if(a.result.filter===!1)for(let h of a.result.options)r(new Y0(h,a.source,c?c(h):[],1e9-t.length));else{let h=new QA(e.sliceDoc(a.from,a.to));for(let O of a.result.options)if(h.match(O.label)){let p=O.displayLabel?c?c(O,h.matched):[]:h.matched;r(new Y0(O,a.source,p,h.score+(O.boost||0)))}}}if(i){let a=Object.create(null),c=0,h=(O,p)=>{var g,m;return((g=O.rank)!==null&&g!==void 0?g:1e9)-((m=p.rank)!==null&&m!==void 0?m:1e9)||(O.nameh.score-c.score||o(c.completion,h.completion))){let c=a.completion;!l||l.label!=c.label||l.detail!=c.detail||l.type!=null&&c.type!=null&&l.type!=c.type||l.apply!=c.apply||l.boost!=c.boost?s.push(a):M0(a.completion)>M0(l)&&(s[s.length-1]=a),l=a.completion}return s}class xl{constructor(e,t,i,r,s,l){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=l}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new xl(this.options,z0(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,r,s){let l=CA(e,t);if(!l.length)return r&&e.some(a=>a.state==1)?new xl(r.options,r.attrs,r.tooltip,r.timestamp,r.selected,!0):null;let o=t.facet(Ei).selectOnOpen?0:-1;if(r&&r.selected!=o&&r.selected!=-1){let a=r.options[r.selected].completion;for(let c=0;cc.hasResult()?Math.min(a,c.from):a,1e8),create:XA,above:s.aboveCursor},r?r.timestamp:Date.now(),o,!1)}map(e){return new xl(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Fc{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new Fc(RA,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(Ei),s=(i.override||t.languageDataAt("autocomplete",ys(t)).map(wA)).map(o=>(this.active.find(c=>c.source==o)||new Ji(o,this.active.some(c=>c.state!=0)?1:0)).update(e,i));s.length==this.active.length&&s.every((o,a)=>o==this.active[a])&&(s=this.active);let l=this.open;l&&e.docChanged&&(l=l.map(e.changes)),e.selection||s.some(o=>o.hasResult()&&e.changes.touchesRange(o.from,o.to))||!TA(s,this.active)?l=xl.build(s,t,this.id,l,i):l&&l.disabled&&!s.some(o=>o.state==1)&&(l=null),!l&&s.every(o=>o.state!=1)&&s.some(o=>o.hasResult())&&(s=s.map(o=>o.hasResult()?new Ji(o.source,0):o));for(let o of e.effects)o.is(Pw)&&(l=l&&l.setSelected(o.value,this.id));return s==this.active&&l==this.open?this:new Fc(s,this.id,l)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:ZA}}function TA(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const RA=[];function Td(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class Ji{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=Td(e),r=this;i?r=r.handleUserEvent(e,i,t):e.docChanged?r=r.handleChange(e):e.selection&&r.state!=0&&(r=new Ji(r.source,0));for(let s of e.effects)if(s.is(dp))r=new Ji(r.source,1,s.value?ys(e.state):-1);else if(s.is(ma))r=new Ji(r.source,0);else if(s.is(_w))for(let l of s.value)l.source==r.source&&(r=l);return r}handleUserEvent(e,t,i){return t=="delete"||!i.activateOnTyping?this.map(e.changes):new Ji(this.source,1)}handleChange(e){return e.changes.touchesRange(ys(e.startState))?new Ji(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Ji(this.source,this.state,e.mapPos(this.explicitPos))}}class El extends Ji{constructor(e,t,i,r,s){super(e,2,t),this.result=i,this.from=r,this.to=s}hasResult(){return!0}handleUserEvent(e,t,i){var r;let s=e.changes.mapPos(this.from),l=e.changes.mapPos(this.to,1),o=ys(e.state);if((this.explicitPos<0?o<=s:ol||t=="delete"&&ys(e.startState)==this.from)return new Ji(this.source,t=="input"&&i.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),c;return AA(this.result.validFor,e.state,s,l)?new El(this.source,a,this.result,s,l):this.result.update&&(c=this.result.update(this.result,s,l,new vw(e.state,o,a>=0)))?new El(this.source,a,c,c.from,(r=c.to)!==null&&r!==void 0?r:ys(e.state)):new Ji(this.source,1,a)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Ji(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new El(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function AA(n,e,t,i){if(!n)return!1;let r=e.sliceDoc(t,i);return typeof n=="function"?n(r,t,i,e):Qw(n,!0).test(r)}const _w=Ie.define({map(n,e){return n.map(t=>t.map(e))}}),Pw=Ie.define(),pn=pi.define({create(){return Fc.start()},update(n,e){return n.update(e)},provide:n=>[Kd.from(n,e=>e.tooltip),Oe.contentAttributes.from(n,e=>e.attrs)]});function xw(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(pn).active.find(r=>r.source==e.source);return i instanceof El?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},vA(n.state,t,i.from,i.to)),{annotations:kw.of(e.completion)})):t(n,e.completion,i.from,i.to),!0):!1}const XA=xA(pn,xw);function sc(n,e="option"){return t=>{let i=t.state.field(pn,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+r*(n?1:-1):n?0:l-1;return o<0?o=e=="page"?0:l-1:o>=l&&(o=e=="page"?l-1:0),t.dispatch({effects:Pw.of(o)}),!0}}const YA=n=>{let e=n.state.field(pn,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(pn,!1)?(n.dispatch({effects:dp.of(!0)}),!0):!1,EA=n=>{let e=n.state.field(pn,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:ma.of(null)}),!0)};class MA{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const zA=50,DA=1e3,VA=oi.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of n.state.field(pn).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(pn);if(!n.selectionSet&&!n.docChanged&&n.startState.field(pn)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!Td(i));for(let i=0;izA&&Date.now()-r.time>DA){for(let s of r.context.abortListeners)try{s()}catch(l){en(this.view.state,l)}r.context.abortListeners=null,this.running.splice(i--,1)}else r.updates.push(...n.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(r=>r.active.source==i.source))?setTimeout(()=>this.startUpdate(),50):-1,this.composing!=0)for(let i of n.transactions)Td(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:n}=this.view,e=n.field(pn);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=ys(e),i=new vw(e,t,n.explicitPos==t),r=new MA(n,i);this.running.push(r),Promise.resolve(n.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:ma.of(null)}),en(this.view.state,s)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ei).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Ei);for(let i=0;il.source==r.active.source);if(s&&s.state==1)if(r.done==null){let l=new Ji(r.active.source,0);for(let o of r.updates)l=l.update(o,t);l.state!=1&&e.push(l)}else this.startQuery(s)}e.length&&this.view.dispatch({effects:_w.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(pn,!1);if(e&&e.tooltip&&this.view.state.facet(Ei).closeOnBlur){let t=e.open&&By(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&this.view.dispatch({effects:ma.of(null)})}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:dp.of(!1)}),20),this.composing=0}}}),Ww=Oe.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"},".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 qA{constructor(e,t,i,r){this.field=e,this.line=t,this.from=i,this.to=r}}class pp{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,_i.TrackDel),i=e.mapPos(this.to,1,_i.TrackDel);return t==null||i==null?null:new pp(this.field,t,i)}}class gp{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],r=[t],s=e.doc.lineAt(t),l=/^\s*/.exec(s.text)[0];for(let a of this.lines){if(i.length){let c=l,h=/^\t*/.exec(a)[0].length;for(let O=0;Onew pp(a.field,r[a.line]+a.from,r[a.line]+a.to));return{text:i,ranges:o}}static parse(e){let t=[],i=[],r=[],s;for(let l of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(l);){let o=s[1]?+s[1]:null,a=s[2]||s[3]||"",c=-1;for(let h=0;h=c&&O.field++}r.push(new qA(c,i.length,s.index,s.index+a.length)),l=l.slice(0,s.index)+a+l.slice(s.index+s[0].length)}for(let o;o=/\\([{}])/.exec(l);){l=l.slice(0,o.index)+o[1]+l.slice(o.index+o[0].length);for(let a of r)a.line==i.length&&a.from>o.index&&(a.from--,a.to--)}i.push(l)}return new gp(i,r)}}let LA=Ze.widget({widget:new class extends Nr{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),IA=Ze.mark({class:"cm-snippetField"});class io{constructor(e,t){this.ranges=e,this.active=t,this.deco=Ze.set(e.map(i=>(i.from==i.to?LA:IA).range(i.from,i.to)))}map(e){let t=[];for(let i of this.ranges){let r=i.map(e);if(!r)return null;t.push(r)}return new io(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const Wa=Ie.define({map(n,e){return n&&n.map(e)}}),NA=Ie.define(),Sa=pi.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(Wa))return t.value;if(t.is(NA)&&n)return new io(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>Oe.decorations.from(n,e=>e?e.deco:Ze.none)});function mp(n,e){return te.create(n.filter(t=>t.field==e).map(t=>te.range(t.from,t.to)))}function BA(n){let e=gp.parse(n);return(t,i,r,s)=>{let{text:l,ranges:o}=e.instantiate(t.state,r),a={changes:{from:r,to:s,insert:St.of(l)},scrollIntoView:!0,annotations:i?kw.of(i):void 0};if(o.length&&(a.selection=mp(o,0)),o.length>1){let c=new io(o,0),h=a.effects=[Wa.of(c)];t.state.field(Sa,!1)===void 0&&h.push(Ie.appendConfig.of([Sa,KA,JA,Ww]))}t.dispatch(t.state.update(a))}}function Cw(n){return({state:e,dispatch:t})=>{let i=e.field(Sa,!1);if(!i||n<0&&i.active==0)return!1;let r=i.active+n,s=n>0&&!i.ranges.some(l=>l.field==r+n);return t(e.update({selection:mp(i.ranges,r),effects:Wa.of(s?null:new io(i.ranges,r)),scrollIntoView:!0})),!0}}const jA=({state:n,dispatch:e})=>n.field(Sa,!1)?(e(n.update({effects:Wa.of(null)})),!0):!1,FA=Cw(1),GA=Cw(-1),HA=[{key:"Tab",run:FA,shift:GA},{key:"Escape",run:jA}],D0=ye.define({combine(n){return n.length?n[0]:HA}}),KA=il.highest(va.compute([D0],n=>n.facet(D0)));function Hi(n,e){return Object.assign(Object.assign({},e),{apply:BA(n)})}const JA=Oe.domEventHandlers({mousedown(n,e){let t=e.state.field(Sa,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let r=t.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==t.active?!1:(e.dispatch({selection:mp(t.ranges,r.field),effects:Wa.of(t.ranges.some(s=>s.field>r.field)?new io(t.ranges,r.field):null),scrollIntoView:!0}),!0)}}),ba={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Fs=Ie.define({map(n,e){let t=e.mapPos(n,-1,_i.TrackAfter);return t??void 0}}),Sp=new class extends Hs{};Sp.startSide=1;Sp.endSide=-1;const Tw=pi.define({create(){return mt.empty},update(n,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:i=>i>=t.from&&i<=t.to})}n=n.map(e.changes);for(let t of e.effects)t.is(Fs)&&(n=n.update({add:[Sp.range(t.value,t.value+1)]}));return n}});function eX(){return[iX,Tw]}const yO="()[]{}<>";function Zw(n){for(let e=0;e{if((tX?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let r=n.state.selection.main;if(i.length>2||i.length==2&&Rn(Qi(i,0))==1||e!=r.from||t!=r.to)return!1;let s=sX(n.state,i);return s?(n.dispatch(s),!0):!1}),nX=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=Rw(n,n.selection.main.head).brackets||ba.brackets,r=null,s=n.changeByRange(l=>{if(l.empty){let o=lX(n.doc,l.head);for(let a of i)if(a==o&&mu(n.doc,l.head)==Zw(Qi(a,0)))return{changes:{from:l.head-a.length,to:l.head+a.length},range:te.cursor(l.head-a.length)}}return{range:r=l}});return r||e(n.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},rX=[{key:"Backspace",run:nX}];function sX(n,e){let t=Rw(n,n.selection.main.head),i=t.brackets||ba.brackets;for(let r of i){let s=Zw(Qi(r,0));if(e==r)return s==r?fX(n,r,i.indexOf(r+r+r)>-1,t):oX(n,r,s,t.before||ba.before);if(e==s&&Aw(n,n.selection.main.from))return aX(n,r,s)}return null}function Aw(n,e){let t=!1;return n.field(Tw).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function mu(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Rn(Qi(t,0)))}function lX(n,e){let t=n.sliceString(e-2,e);return Rn(Qi(t,0))==t.length?t:t.slice(1)}function oX(n,e,t,i){let r=null,s=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:t,from:l.to}],effects:Fs.of(l.to+e.length),range:te.range(l.anchor+e.length,l.head+e.length)};let o=mu(n.doc,l.head);return!o||/\s/.test(o)||i.indexOf(o)>-1?{changes:{insert:e+t,from:l.head},effects:Fs.of(l.head+e.length),range:te.cursor(l.head+e.length)}:{range:r=l}});return r?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function aX(n,e,t){let i=null,r=n.changeByRange(s=>s.empty&&mu(n.doc,s.head)==t?{changes:{from:s.head,to:s.head+t.length,insert:t},range:te.cursor(s.head+t.length)}:i={range:s});return i?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function fX(n,e,t,i){let r=i.stringPrefixes||ba.stringPrefixes,s=null,l=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:e,from:o.to}],effects:Fs.of(o.to+e.length),range:te.range(o.anchor+e.length,o.head+e.length)};let a=o.head,c=mu(n.doc,a),h;if(c==e){if(V0(n,a))return{changes:{insert:e+e,from:a},effects:Fs.of(a+e.length),range:te.cursor(a+e.length)};if(Aw(n,a)){let p=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+p.length,insert:p},range:te.cursor(a+p.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(h=q0(n,a-2*e.length,r))>-1&&V0(n,h))return{changes:{insert:e+e+e+e,from:a},effects:Fs.of(a+e.length),range:te.cursor(a+e.length)};if(n.charCategorizer(a)(c)!=It.Word&&q0(n,a,r)>-1&&!cX(n,a,e,r))return{changes:{insert:e+e,from:a},effects:Fs.of(a+e.length),range:te.cursor(a+e.length)}}return{range:s=o}});return s?null:n.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function V0(n,e){let t=ei(n).resolveInner(e+1);return t.parent&&t.from==e}function cX(n,e,t,i){let r=ei(n).resolveInner(e,-1),s=i.reduce((l,o)=>Math.max(l,o.length),0);for(let l=0;l<5;l++){let o=n.sliceDoc(r.from,Math.min(r.to,r.from+t.length+s)),a=o.indexOf(t);if(!a||a>-1&&i.indexOf(o.slice(0,a))>-1){let h=r.firstChild;for(;h&&h.from==r.from&&h.to-h.from>t.length+a;){if(n.sliceDoc(h.to-t.length,h.to)==t)return!1;h=h.firstChild}return!0}let c=r.to==e&&r.parent;if(!c)break;r=c}return!1}function q0(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=It.Word)return e;for(let r of t){let s=e-r.length;if(n.sliceDoc(s,e)==r&&i(n.sliceDoc(s-1,s))!=It.Word)return s}return-1}function uX(n={}){return[pn,Ei.of(n),VA,hX,Ww]}const Xw=[{key:"Ctrl-Space",run:UA},{key:"Escape",run:EA},{key:"ArrowDown",run:sc(!0)},{key:"ArrowUp",run:sc(!1)},{key:"PageDown",run:sc(!0,"page")},{key:"PageUp",run:sc(!1,"page")},{key:"Enter",run:YA}],hX=il.highest(va.computeN([Ei],n=>n.facet(Ei).defaultKeymap?[Xw]:[]));class OX{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class Is{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let r=e,s=i.facet(Ew).markerFilter;s&&(r=s(r));let l=Ze.set(r.map(o=>o.from==o.to||o.from==o.to-1&&i.doc.lineAt(o.from).to==o.from?Ze.widget({widget:new vX(o),diagnostic:o}).range(o.from):Ze.mark({attributes:{class:"cm-lintRange cm-lintRange-"+o.severity+(o.markClass?" "+o.markClass:"")},diagnostic:o}).range(o.from,o.to)),!0);return new Is(l,t,Nl(l))}}function Nl(n,e=null,t=0){let i=null;return n.between(t,1e9,(r,s,{spec:l})=>{if(!(e&&l.diagnostic!=e))return i=new OX(r,s,l.diagnostic),!1}),i}function dX(n,e){let t=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(i=>i.is(Yw))||n.changes.touchesRange(t.from,t.to))}function pX(n,e){return n.field(gn,!1)?e:e.concat(Ie.appendConfig.of(kX))}const Yw=Ie.define(),bp=Ie.define(),Uw=Ie.define(),gn=pi.define({create(){return new Is(Ze.none,null,null)},update(n,e){if(e.docChanged){let t=n.diagnostics.map(e.changes),i=null;if(n.selected){let r=e.changes.mapPos(n.selected.from,1);i=Nl(t,n.selected.diagnostic,r)||Nl(t,null,r)}n=new Is(t,n.panel,i)}for(let t of e.effects)t.is(Yw)?n=Is.init(t.value,n.panel,e.state):t.is(bp)?n=new Is(n.diagnostics,t.value?Su.open:null,n.selected):t.is(Uw)&&(n=new Is(n.diagnostics,n.panel,t.value));return n},provide:n=>[ua.from(n,e=>e.panel),Oe.decorations.from(n,e=>e.diagnostics)]}),gX=Ze.mark({class:"cm-lintRange cm-lintRange-active"});function mX(n,e,t){let{diagnostics:i}=n.state.field(gn),r=[],s=2e8,l=0;i.between(e-(t<0?1:0),e+(t>0?1:0),(a,c,{spec:h})=>{e>=a&&e<=c&&(a==c||(e>a||t>0)&&(ezw(n,t,!1)))}const bX=n=>{let e=n.state.field(gn,!1);(!e||!e.panel)&&n.dispatch({effects:pX(n.state,[bp.of(!0)])});let t=ca(n,Su.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},L0=n=>{let e=n.state.field(gn,!1);return!e||!e.panel?!1:(n.dispatch({effects:bp.of(!1)}),!0)},$X=n=>{let e=n.state.field(gn,!1);if(!e)return!1;let t=n.state.selection.main,i=e.diagnostics.iter(t.to+1);return!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)},yX=[{key:"Mod-Shift-m",run:bX,preventDefault:!0},{key:"F8",run:$X}],Ew=ye.define({combine(n){return Object.assign({sources:n.map(e=>e.source)},yr(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t}))}});function Mw(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;is.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function zw(n,e,t){var i;let r=t?Mw(e.actions):[];return Ut("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Ut("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(i=e.actions)===null||i===void 0?void 0:i.map((s,l)=>{let o=!1,a=p=>{if(p.preventDefault(),o)return;o=!0;let g=Nl(n.state.field(gn).diagnostics,e);g&&s.apply(n,g.from,g.to)},{name:c}=s,h=r[l]?c.indexOf(r[l]):-1,O=h<0?c:[c.slice(0,h),Ut("u",c.slice(h,h+1)),c.slice(h+1)];return Ut("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${c}${h<0?"":` (access key "${r[l]})"`}.`},O)}),e.source&&Ut("div",{class:"cm-diagnosticSource"},e.source))}class vX extends Nr{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Ut("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class I0{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=zw(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Su{constructor(e){this.view=e,this.items=[];let t=r=>{if(r.keyCode==27)L0(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],l=Mw(s.actions);for(let o=0;o{for(let s=0;sL0(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(gn).selected;if(!e)return-1;for(let t=0;t{let c=-1,h;for(let O=i;Oi&&(this.items.splice(i,c-i),r=!0)),t&&h.diagnostic==t.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),s=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),i++});i({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:o})=>{let a=o.height/this.list.offsetHeight;l.topo.bottom&&(this.list.scrollTop+=(l.bottom-o.bottom)/a)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(gn),i=Nl(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:Uw.of(i)})}static open(e){return new Su(e)}}function wX(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(n)}')`}function lc(n){return wX(``,'width="6" height="3"')}const QX=Oe.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:lc("#d11")},".cm-lintRange-warning":{backgroundImage:lc("orange")},".cm-lintRange-info":{backgroundImage:lc("#999")},".cm-lintRange-hint":{backgroundImage:lc("#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}}}),kX=[gn,Oe.decorations.compute([gn],n=>{let{selected:e,panel:t}=n.field(gn);return!e||!t||e.from==e.to?Ze.none:Ze.set([gX.range(e.from,e.to)])}),h3(mX,{hideOn:dX}),QX],_X=[w3(),_3(),q5(),LZ(),SZ(),Z5(),U5(),Ot.allowMultipleSelections.of(!0),sZ(),Wv(vZ,{fallback:!0}),WZ(),eX(),uX(),t3(),r3(),F5(),HR(),va.of([...rX,...IR,...gA,...JZ,...dZ,...Xw,...yX])],yi=({variant:n,settings:e,styles:t})=>{const i=Oe.theme({"&":{backgroundColor:e.background,color:e.foreground},".cm-content":{caretColor:e.caret},".cm-cursor, .cm-dropCursor":{borderLeftColor:e.caret},"&.cm-focused .cm-selectionBackgroundm .cm-selectionBackground, .cm-content ::selection":{backgroundColor:e.selection},".cm-activeLine":{backgroundColor:e.lineHighlight},".cm-gutters":{backgroundColor:e.gutterBackground,color:e.gutterForeground},".cm-activeLineGutter":{backgroundColor:e.lineHighlight}},{dark:n==="dark"}),r=_a.define(t);return[i,Wv(r)]};yi({variant:"dark",settings:{background:"#200020",foreground:"#D0D0FF",caret:"#7070FF",selection:"#80000080",gutterBackground:"#200020",gutterForeground:"#C080C0",lineHighlight:"#80000040"},styles:[{tag:b.comment,color:"#404080"},{tag:[b.string,b.regexp],color:"#999999"},{tag:b.number,color:"#7090B0"},{tag:[b.bool,b.null],color:"#8080A0"},{tag:[b.punctuation,b.derefOperator],color:"#805080"},{tag:b.keyword,color:"#60B0FF"},{tag:b.definitionKeyword,color:"#B0FFF0"},{tag:b.moduleKeyword,color:"#60B0FF"},{tag:b.operator,color:"#A0A0FF"},{tag:[b.variableName,b.self],color:"#008080"},{tag:b.operatorKeyword,color:"#A0A0FF"},{tag:b.controlKeyword,color:"#80A0FF"},{tag:b.className,color:"#70E080"},{tag:[b.function(b.propertyName),b.propertyName],color:"#50A0A0"},{tag:b.tagName,color:"#009090"},{tag:b.modifier,color:"#B0FFF0"},{tag:[b.squareBracket,b.attributeName],color:"#D0D0FF"}]});yi({variant:"light",settings:{background:"#fcfcfc",foreground:"#5c6166",caret:"#ffaa33",selection:"#036dd626",gutterBackground:"#fcfcfc",gutterForeground:"#8a919966",lineHighlight:"#8a91991a"},styles:[{tag:b.comment,color:"#787b8099"},{tag:b.string,color:"#86b300"},{tag:b.regexp,color:"#4cbf99"},{tag:[b.number,b.bool,b.null],color:"#ffaa33"},{tag:b.variableName,color:"#5c6166"},{tag:[b.definitionKeyword,b.modifier],color:"#fa8d3e"},{tag:[b.keyword,b.special(b.brace)],color:"#fa8d3e"},{tag:b.operator,color:"#ed9366"},{tag:b.separator,color:"#5c6166b3"},{tag:b.punctuation,color:"#5c6166"},{tag:[b.definition(b.propertyName),b.function(b.variableName)],color:"#f2ae49"},{tag:[b.className,b.definition(b.typeName)],color:"#22a4e6"},{tag:[b.tagName,b.typeName,b.self,b.labelName],color:"#55b4d4"},{tag:b.angleBracket,color:"#55b4d480"},{tag:b.attributeName,color:"#f2ae49"}]});yi({variant:"dark",settings:{background:"#15191EFA",foreground:"#EEF2F7",caret:"#C4C4C4",selection:"#90B2D557",gutterBackground:"#15191EFA",gutterForeground:"#aaaaaa95",lineHighlight:"#57575712"},styles:[{tag:b.comment,color:"#6E6E6E"},{tag:[b.string,b.regexp,b.special(b.brace)],color:"#5C81B3"},{tag:b.number,color:"#C1E1B8"},{tag:b.bool,color:"#53667D"},{tag:[b.definitionKeyword,b.modifier,b.function(b.propertyName)],color:"#A3D295",fontWeight:"bold"},{tag:[b.keyword,b.moduleKeyword,b.operatorKeyword,b.operator],color:"#697A8E",fontWeight:"bold"},{tag:[b.variableName,b.attributeName],color:"#708E67"},{tag:[b.function(b.variableName),b.definition(b.propertyName),b.derefOperator],color:"#fff"},{tag:b.tagName,color:"#A3D295"}]});yi({variant:"dark",settings:{background:"#2e241d",foreground:"#BAAE9E",caret:"#A7A7A7",selection:"#DDF0FF33",gutterBackground:"#28211C",gutterForeground:"#BAAE9E90",lineHighlight:"#FFFFFF08"},styles:[{tag:b.comment,color:"#666666"},{tag:[b.string,b.special(b.brace)],color:"#54BE0D"},{tag:b.regexp,color:"#E9C062"},{tag:b.number,color:"#CF6A4C"},{tag:[b.keyword,b.operator],color:"#5EA6EA"},{tag:b.variableName,color:"#7587A6"},{tag:[b.definitionKeyword,b.modifier],color:"#F9EE98"},{tag:[b.propertyName,b.function(b.variableName)],color:"#937121"},{tag:[b.typeName,b.angleBracket,b.tagName],color:"#9B859D"}]});yi({variant:"dark",settings:{background:"#3b2627",foreground:"#E6E1C4",caret:"#E6E1C4",selection:"#16120E",gutterBackground:"#3b2627",gutterForeground:"#E6E1C490",lineHighlight:"#1F1611"},styles:[{tag:b.comment,color:"#6B4E32"},{tag:[b.keyword,b.operator,b.derefOperator],color:"#EF5D32"},{tag:b.className,color:"#EFAC32",fontWeight:"bold"},{tag:[b.typeName,b.propertyName,b.function(b.variableName),b.definition(b.variableName)],color:"#EFAC32"},{tag:b.definition(b.typeName),color:"#EFAC32",fontWeight:"bold"},{tag:b.labelName,color:"#EFAC32",fontWeight:"bold"},{tag:[b.number,b.bool],color:"#6C99BB"},{tag:[b.variableName,b.self],color:"#7DAF9C"},{tag:[b.string,b.special(b.brace),b.regexp],color:"#D9D762"},{tag:[b.angleBracket,b.tagName,b.attributeName],color:"#EFCB43"}]});yi({variant:"dark",settings:{background:"#000205",foreground:"#FFFFFF",caret:"#E60065",selection:"#E60C6559",gutterBackground:"#000205",gutterForeground:"#ffffff90",lineHighlight:"#4DD7FC1A"},styles:[{tag:b.comment,color:"#404040"},{tag:[b.string,b.special(b.brace),b.regexp],color:"#00D8FF"},{tag:b.number,color:"#E62286"},{tag:[b.variableName,b.attributeName,b.self],color:"#E62286",fontWeight:"bold"},{tag:b.function(b.variableName),color:"#fff",fontWeight:"bold"}]});yi({variant:"light",settings:{background:"#fff",foreground:"#000",caret:"#000",selection:"#BDD5FC",gutterBackground:"#fff",gutterForeground:"#00000070",lineHighlight:"#FFFBD1"},styles:[{tag:b.comment,color:"#BCC8BA"},{tag:[b.string,b.special(b.brace),b.regexp],color:"#5D90CD"},{tag:[b.number,b.bool,b.null],color:"#46A609"},{tag:b.keyword,color:"#AF956F"},{tag:[b.definitionKeyword,b.modifier],color:"#C52727"},{tag:[b.angleBracket,b.tagName,b.attributeName],color:"#606060"},{tag:b.self,color:"#000"}]});yi({variant:"dark",settings:{background:"#00254b",foreground:"#FFFFFF",caret:"#FFFFFF",selection:"#B36539BF",gutterBackground:"#00254b",gutterForeground:"#FFFFFF70",lineHighlight:"#00000059"},styles:[{tag:b.comment,color:"#0088FF"},{tag:b.string,color:"#3AD900"},{tag:b.regexp,color:"#80FFC2"},{tag:[b.number,b.bool,b.null],color:"#FF628C"},{tag:[b.definitionKeyword,b.modifier],color:"#FFEE80"},{tag:b.variableName,color:"#CCCCCC"},{tag:b.self,color:"#FF80E1"},{tag:[b.className,b.definition(b.propertyName),b.function(b.variableName),b.definition(b.typeName),b.labelName],color:"#FFDD00"},{tag:[b.keyword,b.operator],color:"#FF9D00"},{tag:[b.propertyName,b.typeName],color:"#80FFBB"},{tag:b.special(b.brace),color:"#EDEF7D"},{tag:b.attributeName,color:"#9EFFFF"},{tag:b.derefOperator,color:"#fff"}]});yi({variant:"dark",settings:{background:"#060521",foreground:"#E0E0E0",caret:"#FFFFFFA6",selection:"#122BBB",gutterBackground:"#060521",gutterForeground:"#E0E0E090",lineHighlight:"#FFFFFF0F"},styles:[{tag:b.comment,color:"#AEAEAE"},{tag:[b.string,b.special(b.brace),b.regexp],color:"#8DFF8E"},{tag:[b.className,b.definition(b.propertyName),b.function(b.variableName),b.function(b.definition(b.variableName)),b.definition(b.typeName)],color:"#A3EBFF"},{tag:[b.number,b.bool,b.null],color:"#62E9BD"},{tag:[b.keyword,b.operator],color:"#2BF1DC"},{tag:[b.definitionKeyword,b.modifier],color:"#F8FBB1"},{tag:[b.variableName,b.self],color:"#B683CA"},{tag:[b.angleBracket,b.tagName,b.typeName,b.propertyName],color:"#60A4F1"},{tag:b.derefOperator,color:"#E0E0E0"},{tag:b.attributeName,color:"#7BACCA"}]});yi({variant:"dark",settings:{background:"#2d2f3f",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"#44475a",gutterBackground:"#282a36",gutterForeground:"rgb(144, 145, 148)",lineHighlight:"#44475a"},styles:[{tag:b.comment,color:"#6272a4"},{tag:[b.string,b.special(b.brace)],color:"#f1fa8c"},{tag:[b.number,b.self,b.bool,b.null],color:"#bd93f9"},{tag:[b.keyword,b.operator],color:"#ff79c6"},{tag:[b.definitionKeyword,b.typeName],color:"#8be9fd"},{tag:b.definition(b.typeName),color:"#f8f8f2"},{tag:[b.className,b.definition(b.propertyName),b.function(b.variableName),b.attributeName],color:"#50fa7b"}]});yi({variant:"light",settings:{background:"#FFFFFF",foreground:"#000000",caret:"#000000",selection:"#80C7FF",gutterBackground:"#FFFFFF",gutterForeground:"#00000070",lineHighlight:"#C1E2F8"},styles:[{tag:b.comment,color:"#AAAAAA"},{tag:[b.keyword,b.operator,b.typeName,b.tagName,b.propertyName],color:"#2F6F9F",fontWeight:"bold"},{tag:[b.attributeName,b.definition(b.propertyName)],color:"#4F9FD0"},{tag:[b.className,b.string,b.special(b.brace)],color:"#CF4F5F"},{tag:b.number,color:"#CF4F5F",fontWeight:"bold"},{tag:b.variableName,fontWeight:"bold"}]});yi({variant:"light",settings:{background:"#f2f1f8",foreground:"#0c006b",caret:"#5c49e9",selection:"#d5d1f2",gutterBackground:"#f2f1f8",gutterForeground:"#0c006b70",lineHighlight:"#e1def3"},styles:[{tag:b.comment,color:"#9995b7"},{tag:b.keyword,color:"#ff5792",fontWeight:"bold"},{tag:[b.definitionKeyword,b.modifier],color:"#ff5792"},{tag:[b.className,b.tagName,b.definition(b.typeName)],color:"#0094f0"},{tag:[b.number,b.bool,b.null,b.special(b.brace)],color:"#5842ff"},{tag:[b.definition(b.propertyName),b.function(b.variableName)],color:"#0095a8"},{tag:b.typeName,color:"#b3694d"},{tag:[b.propertyName,b.variableName],color:"#fa8900"},{tag:b.operator,color:"#ff5792"},{tag:b.self,color:"#e64100"},{tag:[b.string,b.regexp],color:"#00b368"},{tag:[b.paren,b.bracket],color:"#0431fa"},{tag:b.labelName,color:"#00bdd6"},{tag:b.attributeName,color:"#e64100"},{tag:b.angleBracket,color:"#9995b7"}]});yi({variant:"light",settings:{background:"#faf4ed",foreground:"#575279",caret:"#575279",selection:"#6e6a8614",gutterBackground:"#faf4ed",gutterForeground:"#57527970",lineHighlight:"#6e6a860d"},styles:[{tag:b.comment,color:"#9893a5"},{tag:[b.bool,b.null],color:"#286983"},{tag:b.number,color:"#d7827e"},{tag:b.className,color:"#d7827e"},{tag:[b.angleBracket,b.tagName,b.typeName],color:"#56949f"},{tag:b.attributeName,color:"#907aa9"},{tag:b.punctuation,color:"#797593"},{tag:[b.keyword,b.modifier],color:"#286983"},{tag:[b.string,b.regexp],color:"#ea9d34"},{tag:b.variableName,color:"#d7827e"}]});yi({variant:"light",settings:{background:"#FFFFFF",foreground:"#000000",caret:"#000000",selection:"#FFFD0054",gutterBackground:"#FFFFFF",gutterForeground:"#00000070",lineHighlight:"#00000008"},styles:[{tag:b.comment,color:"#CFCFCF"},{tag:[b.number,b.bool,b.null],color:"#E66C29"},{tag:[b.className,b.definition(b.propertyName),b.function(b.variableName),b.labelName,b.definition(b.typeName)],color:"#2EB43B"},{tag:b.keyword,color:"#D8B229"},{tag:b.operator,color:"#4EA44E",fontWeight:"bold"},{tag:[b.definitionKeyword,b.modifier],color:"#925A47"},{tag:b.string,color:"#704D3D"},{tag:b.typeName,color:"#2F8996"},{tag:[b.variableName,b.propertyName],color:"#77ACB0"},{tag:b.self,color:"#77ACB0",fontWeight:"bold"},{tag:b.regexp,color:"#E3965E"},{tag:[b.tagName,b.angleBracket],color:"#BAA827"},{tag:b.attributeName,color:"#B06520"},{tag:b.derefOperator,color:"#000"}]});yi({variant:"light",settings:{background:"#fef7e5",foreground:"#586E75",caret:"#000000",selection:"#073642",gutterBackground:"#fef7e5",gutterForeground:"#586E7580",lineHighlight:"#EEE8D5"},styles:[{tag:b.comment,color:"#93A1A1"},{tag:b.string,color:"#2AA198"},{tag:b.regexp,color:"#D30102"},{tag:b.number,color:"#D33682"},{tag:b.variableName,color:"#268BD2"},{tag:[b.keyword,b.operator,b.punctuation],color:"#859900"},{tag:[b.definitionKeyword,b.modifier],color:"#073642",fontWeight:"bold"},{tag:[b.className,b.self,b.definition(b.propertyName)],color:"#268BD2"},{tag:b.function(b.variableName),color:"#268BD2"},{tag:[b.bool,b.null],color:"#B58900"},{tag:b.tagName,color:"#268BD2",fontWeight:"bold"},{tag:b.angleBracket,color:"#93A1A1"},{tag:b.attributeName,color:"#93A1A1"},{tag:b.typeName,color:"#859900"}]});yi({variant:"light",settings:{background:"#FFFFFF",foreground:"#4D4D4C",caret:"#AEAFAD",selection:"#D6D6D6",gutterBackground:"#FFFFFF",gutterForeground:"#4D4D4C80",lineHighlight:"#EFEFEF"},styles:[{tag:b.comment,color:"#8E908C"},{tag:[b.variableName,b.self,b.propertyName,b.attributeName,b.regexp],color:"#C82829"},{tag:[b.number,b.bool,b.null],color:"#F5871F"},{tag:[b.className,b.typeName,b.definition(b.typeName)],color:"#C99E00"},{tag:[b.string,b.special(b.brace)],color:"#718C00"},{tag:b.operator,color:"#3E999F"},{tag:[b.definition(b.propertyName),b.function(b.variableName)],color:"#4271AE"},{tag:b.keyword,color:"#8959A8"},{tag:b.derefOperator,color:"#4D4D4C"}]});const PX=Hl({String:b.string,Number:b.number,"True False":b.bool,PropertyName:b.propertyName,Null:b.null,",":b.separator,"[ ]":b.squareBracket,"{ }":b.brace}),xX=xs.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[PX],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~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#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!]~$zOh~~$}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~&yOg~~'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}),WX=Ws.define({name:"json",parser:xX.configure({props:[Kl.add({Object:Yl({except:/^\s*\}/}),Array:Yl({except:/^\s*\]/})}),Jl.add({"Object Array":hr})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function CX(){return new Qa(WX)}const TX=54,ZX=1,RX=55,AX=2,XX=56,YX=3,N0=4,UX=5,Gc=6,Dw=7,Vw=8,qw=9,Lw=10,EX=11,MX=12,zX=13,vO=57,DX=14,B0=58,Iw=20,VX=22,Nw=23,qX=24,Zd=26,Bw=27,LX=28,IX=31,NX=34,BX=36,jX=37,FX=0,GX=1,HX={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},KX={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},j0={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 JX(n){return n==45||n==46||n==58||n>=65&&n<=90||n==95||n>=97&&n<=122||n>=161}function jw(n){return n==9||n==10||n==13||n==32}let F0=null,G0=null,H0=0;function Rd(n,e){let t=n.pos+e;if(H0==t&&G0==n)return F0;let i=n.peek(e);for(;jw(i);)i=n.peek(++e);let r="";for(;JX(i);)r+=String.fromCharCode(i),i=n.peek(++e);return G0=n,H0=t,F0=r?r.toLowerCase():i==e7||i==t7?void 0:null}const Fw=60,Hc=62,$p=47,e7=63,t7=33,i7=45;function K0(n,e){this.name=n,this.parent=e,this.hash=e?e.hash:0;for(let t=0;t-1?new K0(Rd(i,1)||"",n):n},reduce(n,e){return e==Iw&&n?n.parent:n},reuse(n,e,t,i){let r=e.type.id;return r==Gc||r==BX?new K0(Rd(i,1)||"",n):n},hash(n){return n?n.hash:0},strict:!1}),s7=new vr((n,e)=>{if(n.next!=Fw){n.next<0&&e.context&&n.acceptToken(vO);return}n.advance();let t=n.next==$p;t&&n.advance();let i=Rd(n,0);if(i===void 0)return;if(!i)return n.acceptToken(t?DX:Gc);let r=e.context?e.context.name:null;if(t){if(i==r)return n.acceptToken(EX);if(r&&KX[r])return n.acceptToken(vO,-2);if(e.dialectEnabled(FX))return n.acceptToken(MX);for(let s=e.context;s;s=s.parent)if(s.name==i)return;n.acceptToken(zX)}else{if(i=="script")return n.acceptToken(Dw);if(i=="style")return n.acceptToken(Vw);if(i=="textarea")return n.acceptToken(qw);if(HX.hasOwnProperty(i))return n.acceptToken(Lw);r&&j0[r]&&j0[r][i]?n.acceptToken(vO,-1):n.acceptToken(Gc)}},{contextual:!0}),l7=new vr(n=>{for(let e=0,t=0;;t++){if(n.next<0){t&&n.acceptToken(B0);break}if(n.next==i7)e++;else if(n.next==Hc&&e>=2){t>=3&&n.acceptToken(B0,-2);break}else e=0;n.advance()}});function o7(n){for(;n;n=n.parent)if(n.name=="svg"||n.name=="math")return!0;return!1}const a7=new vr((n,e)=>{if(n.next==$p&&n.peek(1)==Hc){let t=e.dialectEnabled(GX)||o7(e.context);n.acceptToken(t?UX:N0,2)}else n.next==Hc&&n.acceptToken(N0,1)});function yp(n,e,t){let i=2+n.length;return new vr(r=>{for(let s=0,l=0,o=0;;o++){if(r.next<0){o&&r.acceptToken(e);break}if(s==0&&r.next==Fw||s==1&&r.next==$p||s>=2&&sl?r.acceptToken(e,-l):r.acceptToken(t,-(l-2));break}else if((r.next==10||r.next==13)&&o){r.acceptToken(e,1);break}else s=l=0;r.advance()}})}const f7=yp("script",TX,ZX),c7=yp("style",RX,AX),u7=yp("textarea",XX,YX),h7=Hl({"Text RawText":b.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":b.angleBracket,TagName:b.tagName,"MismatchedCloseTag/TagName":[b.tagName,b.invalid],AttributeName:b.attributeName,"AttributeValue UnquotedAttributeValue":b.attributeValue,Is:b.definitionOperator,"EntityReference CharacterReference":b.character,Comment:b.blockComment,ProcessingInst:b.processingInstruction,DoctypeDecl:b.documentMeta}),O7=xs.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[OOO`'#Da'#DaO'WO!rO,59[O'_Q#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'dO$fO,59oOOO`,59o,59oO'lQ#|O,59qO'qQ#|O,59rOOO`-E7W-E7WO'vQ&rO'#CsOOQW'#DZ'#DZO(UQ&rO1G.wOOOa1G.w1G.wO(^Q&rO1G/QOOOb1G/Q1G/QO(fQ&rO1G/TOOOd1G/T1G/TO(nQ&rO1G/WOOO`1G/W1G/WOOO`1G/Y1G/YO(yQ&rO1G/YOOOa-E7[-E7[O)RQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)WQ#tO'#C|OOOd-E7^-E7^O)]Q#tO'#DPOOO`-E7_-E7_O)bQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O)gQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rOOO`7+$t7+$tO)rQ#|O,59eO)wQ#|O,59hO)|Q#|O,59kOOO`1G/X1G/XO*RO7[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jQmWR![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:r7,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"]],propSources:[h7],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5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v*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let c=o.type.id;if(c==LX)return wO(o,a,t);if(c==IX)return wO(o,a,i);if(c==NX)return wO(o,a,r);if(c==Iw&&s.length){let h=o.node,O=h.firstChild,p=O&&J0(O,a),g;if(p){for(let m of s)if(m.tag==p&&(!m.attrs||m.attrs(g||(g=Gw(h,a))))){let $=h.lastChild,y=$.type.id==jX?$.from:h.to;if(y>O.to)return{parser:m.parser,overlay:[{from:O.to,to:y}]}}}}if(l&&c==Nw){let h=o.node,O;if(O=h.firstChild){let p=l[a.read(O.from,O.to)];if(p)for(let g of p){if(g.tagName&&g.tagName!=J0(h.parent,a))continue;let m=h.lastChild;if(m.type.id==Zd){let $=m.from+1,y=m.lastChild,k=m.to-(y&&y.isError?0:1);if(k>$)return{parser:g.parser,overlay:[{from:$,to:k}]}}else if(m.type.id==Bw)return{parser:g.parser,overlay:[{from:m.from,to:m.to}]}}}}return null})}const d7=96,eS=1,p7=97,g7=98,tS=2,Kw=[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],m7=58,S7=40,Jw=95,b7=91,bc=45,$7=46,y7=35,v7=37,w7=38,Q7=92,k7=10;function Kc(n){return n>=65&&n<=90||n>=97&&n<=122||n>=161}function _7(n){return n>=48&&n<=57}const P7=new vr((n,e)=>{for(let t=!1,i=0,r=0;;r++){let{next:s}=n;if(Kc(s)||s==bc||s==Jw||t&&_7(s))!t&&(s!=bc||r>0)&&(t=!0),i===r&&s==bc&&i++,n.advance();else if(s==Q7&&n.peek(1)!=k7)n.advance(),n.next>-1&&n.advance(),t=!0;else{t&&n.acceptToken(s==S7?p7:i==2&&e.canShift(tS)?tS:g7);break}}}),x7=new vr(n=>{if(Kw.includes(n.peek(-1))){let{next:e}=n;(Kc(e)||e==Jw||e==y7||e==$7||e==b7||e==m7||e==bc||e==w7)&&n.acceptToken(d7)}}),W7=new vr(n=>{if(!Kw.includes(n.peek(-1))){let{next:e}=n;if(e==v7&&(n.advance(),n.acceptToken(eS)),Kc(e)){do n.advance();while(Kc(n.next));n.acceptToken(eS)}}}),C7=Hl({"AtKeyword import charset namespace keyframes media supports":b.definitionKeyword,"from to selector":b.keyword,NamespaceName:b.namespace,KeyframeName:b.labelName,KeyframeRangeName:b.operatorKeyword,TagName:b.tagName,ClassName:b.className,PseudoClassName:b.constant(b.className),IdName:b.labelName,"FeatureName PropertyName":b.propertyName,AttributeName:b.attributeName,NumberLiteral:b.number,KeywordQuery:b.keyword,UnaryQueryOp:b.operatorKeyword,"CallTag ValueName":b.atom,VariableName:b.variableName,Callee:b.operatorKeyword,Unit:b.unit,"UniversalSelector NestingSelector":b.definitionOperator,MatchOp:b.compareOperator,"ChildOp SiblingOp, LogicOp":b.logicOperator,BinOp:b.arithmeticOperator,Important:b.modifier,Comment:b.blockComment,ColorLiteral:b.color,"ParenthesizedContent StringLiteral":b.string,":":b.punctuation,"PseudoOp #":b.derefOperator,"; ,":b.separator,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace}),T7={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},Z7={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},R7={__proto__:null,not:128,only:128},A7=xs.deserialize({version:14,states:"9bQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DPO$vQ[O'#DTOOQP'#Ej'#EjO${QdO'#DeO%gQ[O'#DrO${QdO'#DtO%xQ[O'#DvO&TQ[O'#DyO&]Q[O'#EPO&kQ[O'#EROOQS'#Ei'#EiOOQS'#EU'#EUQYQ[OOO&rQXO'#CdO'gQWO'#DaO'lQWO'#EpO'wQ[O'#EpQOQWOOP(RO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CoSzSOy%^z;'S%^;'S;=`%o<%lO%^bDQU|QOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS|Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[!YQo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bFfSxQOy%^z;'S%^;'S;=`%o<%lO%^lFwSv[Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!`Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!RUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!Q^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!PQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[x7,W7,P7,1,2,3,4,new Xc("m~RRYZ[z{a~~g~aO#Z~~dP!P!Qg~lO#[~~",28,102)],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:97,get:n=>T7[n]||-1},{term:56,get:n=>Z7[n]||-1},{term:98,get:n=>R7[n]||-1}],tokenPrec:1169});let QO=null;function kO(){if(!QO&&typeof document=="object"&&document.body){let{style:n}=document.body,e=[],t=new Set;for(let i in n)i!="cssText"&&i!="cssFloat"&&typeof n[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(i)||(e.push(i),t.add(i)));QO=e.sort().map(i=>({type:"property",label:i}))}return QO||[]}const iS=["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(n=>({type:"class",label:n})),nS=["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(n=>({type:"keyword",label:n})).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(n=>({type:"constant",label:n}))),X7=["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(n=>({type:"type",label:n})),cs=/^(\w[\w-]*|-\w[\w-]*|)$/,Y7=/^-(-[\w-]*)?$/;function U7(n,e){var t;if((n.name=="("||n.type.isError)&&(n=n.parent||n),n.name!="ArgList")return!1;let i=(t=n.parent)===null||t===void 0?void 0:t.firstChild;return(i==null?void 0:i.name)!="Callee"?!1:e.sliceString(i.from,i.to)=="var"}const rS=new uv,E7=["Declaration"];function M7(n){for(let e=n;;){if(e.type.isTop)return e;if(!(e=e.parent))return n}}function eQ(n,e,t){if(e.to-e.from>4096){let i=rS.get(e);if(i)return i;let r=[],s=new Set,l=e.cursor(Et.IncludeAnonymous);if(l.firstChild())do for(let o of eQ(n,l.node,t))s.has(o.label)||(s.add(o.label),r.push(o));while(l.nextSibling());return rS.set(e,r),r}else{let i=[],r=new Set;return e.cursor().iterate(s=>{var l;if(t(s)&&s.matchContext(E7)&&((l=s.node.nextSibling)===null||l===void 0?void 0:l.name)==":"){let o=n.sliceString(s.from,s.to);r.has(o)||(r.add(o),i.push({label:o,type:"variable"}))}}),i}}const z7=n=>e=>{let{state:t,pos:i}=e,r=ei(t).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:kO(),validFor:cs};if(r.name=="ValueName")return{from:r.from,options:nS,validFor:cs};if(r.name=="PseudoClassName")return{from:r.from,options:iS,validFor:cs};if(n(r)||(e.explicit||s)&&U7(r,t.doc))return{from:n(r)||s?r.from:i,options:eQ(t.doc,M7(r),n),validFor:Y7};if(r.name=="TagName"){for(let{parent:a}=r;a;a=a.parent)if(a.name=="Block")return{from:r.from,options:kO(),validFor:cs};return{from:r.from,options:X7,validFor:cs}}if(!e.explicit)return null;let l=r.resolve(i),o=l.childBefore(i);return o&&o.name==":"&&l.name=="PseudoClassSelector"?{from:i,options:iS,validFor:cs}:o&&o.name==":"&&l.name=="Declaration"||l.name=="ArgList"?{from:i,options:nS,validFor:cs}:l.name=="Block"||l.name=="Styles"?{from:i,options:kO(),validFor:cs}:null},D7=z7(n=>n.name=="VariableName"),Jc=Ws.define({name:"css",parser:A7.configure({props:[Kl.add({Declaration:Yl()}),Jl.add({"Block KeyframeList":hr})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function V7(){return new Qa(Jc,Jc.data.of({autocomplete:D7}))}const q7=304,sS=1,L7=2,I7=305,N7=307,B7=308,j7=3,F7=4,G7=[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],tQ=125,H7=59,lS=47,K7=42,J7=43,eY=45,tY=new dv({start:!1,shift(n,e){return e==j7||e==F7||e==N7?n:e==B7},strict:!1}),iY=new vr((n,e)=>{let{next:t}=n;(t==tQ||t==-1||e.context)&&n.acceptToken(I7)},{contextual:!0,fallback:!0}),nY=new vr((n,e)=>{let{next:t}=n,i;G7.indexOf(t)>-1||t==lS&&((i=n.peek(1))==lS||i==K7)||t!=tQ&&t!=H7&&t!=-1&&!e.context&&n.acceptToken(q7)},{contextual:!0}),rY=new vr((n,e)=>{let{next:t}=n;if((t==J7||t==eY)&&(n.advance(),t==n.next)){n.advance();let i=!e.context&&e.canShift(sS);n.acceptToken(i?sS:L7)}},{contextual:!0}),sY=Hl({"get set async static":b.modifier,"for while do if else switch try catch finally return throw break continue default case":b.controlKeyword,"in of await yield void typeof delete instanceof":b.operatorKeyword,"let var const using function class extends":b.definitionKeyword,"import export from":b.moduleKeyword,"with debugger as new":b.keyword,TemplateString:b.special(b.string),super:b.atom,BooleanLiteral:b.bool,this:b.self,null:b.null,Star:b.modifier,VariableName:b.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":b.function(b.variableName),VariableDefinition:b.definition(b.variableName),Label:b.labelName,PropertyName:b.propertyName,PrivatePropertyName:b.special(b.propertyName),"CallExpression/MemberExpression/PropertyName":b.function(b.propertyName),"FunctionDeclaration/VariableDefinition":b.function(b.definition(b.variableName)),"ClassDeclaration/VariableDefinition":b.definition(b.className),PropertyDefinition:b.definition(b.propertyName),PrivatePropertyDefinition:b.definition(b.special(b.propertyName)),UpdateOp:b.updateOperator,"LineComment Hashbang":b.lineComment,BlockComment:b.blockComment,Number:b.number,String:b.string,Escape:b.escape,ArithOp:b.arithmeticOperator,LogicOp:b.logicOperator,BitOp:b.bitwiseOperator,CompareOp:b.compareOperator,RegExp:b.regexp,Equals:b.definitionOperator,Arrow:b.function(b.punctuation),": Spread":b.punctuation,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace,"InterpolationStart InterpolationEnd":b.special(b.brace),".":b.derefOperator,", ;":b.separator,"@":b.meta,TypeName:b.typeName,TypeDefinition:b.definition(b.typeName),"type enum interface implements namespace module declare":b.definitionKeyword,"abstract global Privacy readonly override":b.modifier,"is keyof unique infer":b.operatorKeyword,JSXAttributeValue:b.attributeValue,JSXText:b.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":b.angleBracket,"JSXIdentifier JSXNameSpacedName":b.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":b.attributeName,"JSXBuiltin/JSXIdentifier":b.standard(b.tagName)}),lY={__proto__:null,export:16,as:21,from:29,default:32,async:37,function:38,extends:48,this:52,true:60,false:60,null:72,void:76,typeof:80,super:98,new:132,delete:148,yield:157,await:161,class:166,public:223,private:223,protected:223,readonly:225,instanceof:244,satisfies:247,in:248,const:250,import:282,keyof:337,unique:341,infer:347,is:383,abstract:403,implements:405,type:407,let:410,var:412,using:415,interface:421,enum:425,namespace:431,module:433,declare:437,global:441,for:460,of:469,while:472,with:476,do:480,if:484,else:486,switch:490,case:496,try:502,catch:506,finally:510,return:514,throw:518,break:522,continue:526,debugger:530},oY={__proto__:null,async:119,get:121,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]:dQ3b:VQ4T0PQ4]0aQ5n:eQ5t2]Q5y2cQ6V2wQ6W:fQ6]:hQ6^:oQ7U4pQ7s5lQ7w5uQ8Q:pQ8U:uQ8V:vQ8{7yQ9Z8hQ9b8yQ9s#RR;V;cR#ZWR'Q!eY!tQ'V-S0z4uS&|!e,zQ'b!rS'l!u!xS'n!y4wS,w&}'US-c'c'dQ-e'eQ2Q-QR2`-dR(p#wR(s#xQ!fQT-R'V-S]!qQ!r'V-S0z4uQ#o]R'`9rT#jZ%^S#iZ%^S%dm,^U(]#g#h#kS-w(^(_Q-{(`Q0R*}Q2e-xU2f-y-z-|S5{2g2hR7z5|`#]W#V#Y%a'y(S*z-rr#fZm#g#h#k%^(^(_(`*}-x-y-z-|2g2h5|Q1a,^Q1w,tQ5j1oQ7r5kT:}'O*{T#`W%aS#_W%aS'z#V(SS(P#Y*zS,y'O*{T-m'y-rT'T!e%bQ$kfR)o$pT)d$k)eR3`.pT*T$x*VR*]${Q0V+VQ2j.TQ4x0|Q6Q2nQ7^4{Q7}6PQ8j7]Q8|7|Q9]8lQ9e9OQ9j9^R9m9fnqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&c!VR,V&`tmOXst!U!V!Z#c%f&`&i&k&l&n,b,g1g1jR,^&fT%em,^R0v+vR,U&^Q%||R+n%}R+d%wT&g!W&jT&h!W&jT1i,g1j",nodeNames:"⚠ ArithOp ArithOp LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > TypeParamList 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 : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression 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 const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate 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:367,context:tY,nodeProps:[["group",-26,7,15,17,63,200,204,208,209,211,214,217,227,229,235,237,239,241,244,250,256,258,260,262,264,266,267,"Statement",-32,11,12,26,29,30,36,46,49,50,52,57,65,73,77,79,81,82,104,105,114,115,132,135,137,138,139,140,142,143,163,164,166,"Expression",-23,25,27,31,35,37,39,167,169,171,172,174,175,176,178,179,180,182,183,184,194,196,198,199,"Type",-3,85,97,103,"ClassItem"],["openedBy",32,"InterpolationStart",51,"[",55,"{",70,"(",144,"JSXStartTag",156,"JSXStartTag JSXStartCloseTag"],["closedBy",34,"InterpolationEnd",45,"]",56,"}",71,")",145,"JSXSelfCloseEndTag JSXEndTag",161,"JSXEndTag"]],propSources:[sY],skippedNodes:[0,3,4,270],repeatNodeCount:33,tokenData:"$Fl(CSR!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#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Nu!`!a$#a!a!b$(n!b!c$,m!c!}Er!}#O$-w#O#P$/R#P#Q$4j#Q#R$5t#R#SEr#S#T$7R#T#o$8]#o#p$s#r#s$@P#s$f%Z$f$g+g$g#BYEr#BY#BZ$AZ#BZ$ISEr$IS$I_$AZ$I_$I|Er$I|$I}$Df$I}$JO$Df$JO$JTEr$JT$JU$AZ$JU$KVEr$KV$KW$AZ$KW&FUEr&FU&FV$AZ&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AZ?HUOEr(n%d_$e&j'yp'|!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$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$e&j'|!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU'|!bOY'}Zw'}x#O'}#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Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ'|!b!SSOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb'|!b!SSOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX'|!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$e&j'|!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#lY[n]||-1},{term:330,get:n=>oY[n]||-1},{term:68,get:n=>aY[n]||-1}],tokenPrec:12868}),iQ=[Hi("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Hi("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Hi("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Hi("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Hi("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Hi(`try { + opacity: ${a-h*y}`}}const OT=n=>({}),J1=n=>({});function e0(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,k,W;const Z=n[6].default,A=Ri(Z,n,n[5],null),C=n[6].footer,U=Ri(C,n,n[5],J1),D=U||dT(n);return{c(){e=_("form"),t=_("div"),i=I(),r=_("div"),s=_("header"),l=_("p"),o=pe(n[0]),a=I(),c=_("button"),h=I(),O=_("section"),A&&A.c(),p=I(),g=_("footer"),D&&D.c(),v(t,"class","modal-background"),v(l,"class","modal-card-title"),v(c,"type","button"),v(c,"class","delete"),v(c,"aria-label","close"),v(s,"class","modal-card-head"),v(O,"class","modal-card-body"),v(g,"class","modal-card-foot"),v(r,"class","modal-card"),v(e,"tabindex","0"),v(e,"class","modal is-active")},m(z,j){Y(z,e,j),Q(e,t),Q(e,i),Q(e,r),Q(r,s),Q(s,l),Q(l,o),Q(s,a),Q(s,c),Q(r,h),Q(r,O),A&&A.m(O,null),Q(r,p),Q(r,g),D&&D.m(g,null),n[7](e),y=!0,k||(W=[le(t,"click",n[4]),le(c,"click",n[4]),le(e,"submit",b$(n[8]))],k=!0)},p(z,j){(!y||j&1)&&Ne(o,z[0]),A&&A.p&&(!y||j&32)&&Xi(A,Z,z,z[5],y?Ai(Z,z[5],j,null):Yi(z[5]),null),U&&U.p&&(!y||j&32)&&Xi(U,C,z,z[5],y?Ai(C,z[5],j,OT):Yi(z[5]),J1)},i(z){y||(V(A,z),V(D,z),z&&Kn(()=>{y&&(m||(m=kl(r,Tc,{y:-200,duration:200},!0)),m.run(1))}),z&&Kn(()=>{y&&($||($=kl(e,K1,{duration:200},!0)),$.run(1))}),y=!0)},o(z){B(A,z),B(D,z),z&&(m||(m=kl(r,Tc,{y:-200,duration:200},!1)),m.run(0)),z&&($||($=kl(e,K1,{duration:200},!1)),$.run(0)),y=!1},d(z){z&&X(e),A&&A.d(z),D&&D.d(z),z&&m&&m.end(),n[7](null),z&&$&&$.end(),k=!1,Ft(W)}}}function dT(n){let e,t,i;return{c(){e=_("button"),e.textContent="Cancel",v(e,"class","button")},m(r,s){Y(r,e,s),t||(i=le(e,"click",n[4]),t=!0)},p:_e,d(r){r&&X(e),t=!1,i()}}}function pT(n){let e,t,i=n[1]&&e0(n);return{c(){i&&i.c(),e=Gt()},m(r,s){i&&i.m(r,s),Y(r,e,s),t=!0},p(r,[s]){r[1]?i?(i.p(r,s),s&2&&V(i,1)):(i=e0(r),i.c(),V(i,1),i.m(e.parentNode,e)):i&&(Je(),B(i,1,1,()=>{i=null}),et())},i(r){t||(V(i),t=!0)},o(r){B(i),t=!1},d(r){r&&X(e),i&&i.d(r)}}}function gT(n,e,t){let{$$slots:i={},$$scope:r}=e,{title:s}=e,{active:l=!1}=e;const o=nn();let a;async function c(g){g&&(await Gn(),a&&a.focus(),o("activate"))}function h(){o("cancel")}function O(g){Mt[g?"unshift":"push"](()=>{a=g,t(2,a)})}const p=()=>o("submit");return n.$$set=g=>{"title"in g&&t(0,s=g.title),"active"in g&&t(1,l=g.active),"$$scope"in g&&t(5,r=g.$$scope)},n.$$.update=()=>{n.$$.dirty&2&&c(l)},[s,l,a,o,h,r,i,O,p]}class _s extends $i{constructor(e){super(),bi(this,e,gT,pT,Oi,{title:0,active:1})}}const av=1024;let mT=0;class An{constructor(e,t){this.from=e,this.to=t}}class at{constructor(e={}){this.id=mT++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Ni.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}at.closedBy=new at({deserialize:n=>n.split(" ")});at.openedBy=new at({deserialize:n=>n.split(" ")});at.group=new at({deserialize:n=>n.split(" ")});at.contextHash=new at({perNode:!0});at.lookAhead=new at({perNode:!0});at.mounted=new at({perNode:!0});class Oa{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}static get(e){return e&&e.props&&e.props[at.mounted.id]}}const ST=Object.create(null);class Ni{constructor(e,t,i,r=0){this.name=e,this.props=t,this.id=i,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):ST,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new Ni(e.name||"",t,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(at.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let r of i.split(" "))t[r]=e[i];return i=>{for(let r=i.prop(at.group),s=-1;s<(r?r.length:0);s++){let l=t[s<0?i.name:r[s]];if(l)return l}}}}Ni.none=new Ni("",Object.create(null),0,8);class ep{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(l|Et.IncludeAnonymous);;){let c=!1;if(a.from<=s&&a.to>=r&&(!o&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&i&&(o||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:np(Ni.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,r)=>new jt(this.type,t,i,r,this.propValues),e.makeTree||((t,i,r)=>new jt(Ni.none,t,i,r)))}static build(e){return vT(e)}}jt.empty=new jt(Ni.none,[],[],0);class tp{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new tp(this.buffer,this.index)}}class Ps{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return Ni.none}toString(){let e=[];for(let t=0;t0));a=l[a+3]);return o}slice(e,t,i){let r=this.buffer,s=new Uint16Array(t-e),l=0;for(let o=e,a=0;o=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function da(n,e,t,i){for(var r;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?o.length:-1;e!=c;e+=t){let h=o[e],O=a[e]+l.from;if(fv(r,i,O,O+h.length)){if(h instanceof Ps){if(s&Et.ExcludeBuffers)continue;let p=h.findChild(0,h.buffer.length,t,i-O,r);if(p>-1)return new pr(new bT(l,h,e,O),null,p)}else if(s&Et.IncludeAnonymous||!h.type.isAnonymous||ip(h)){let p;if(!(s&Et.IgnoreMounts)&&(p=Oa.get(h))&&!p.overlay)return new Mi(p.tree,O,e,l);let g=new Mi(h,O,e,l);return s&Et.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(t<0?h.children.length-1:0,t,i,r)}}}if(s&Et.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+t:e=t<0?-1:l._parent._tree.children.length,l=l._parent,!l))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let r;if(!(i&Et.IgnoreOverlays)&&(r=Oa.get(this._tree))&&r.overlay){let s=e-this.from;for(let{from:l,to:o}of r.overlay)if((t>0?l<=s:l=s:o>s))return new Mi(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function i0(n,e,t,i){let r=n.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(;!r.type.is(t);)if(!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function bd(n,e,t=e.length-1){for(let i=n.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class bT{constructor(e,t,i,r){this.parent=e,this.buffer=t,this.index=i,this.start=r}}class pr extends cv{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,i);return s<0?null:new pr(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&Et.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new pr(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new pr(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new pr(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let l=i.buffer[this.index+1];e.push(i.slice(r,s,l)),t.push(0)}return new jt(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function uv(n){if(!n.length)return null;let e=0,t=n[0];for(let s=1;st.from||l.to=e){let o=new Mi(l.tree,l.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(da(o,e,t,!1))}}return r?uv(r):i}class Zc{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Mi)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof Mi?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&Et.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Et.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Et.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let s=t+e,l=e<0?-1:i._tree.children.length;s!=l;s+=e){let o=i._tree.children[s];if(this.mode&Et.IncludeAnonymous||o instanceof Ps||!o.type.isAnonymous||ip(o))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let l=e;l;l=l._parent)if(l.index==r){if(r==this.index)return l;t=l,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return bd(this.node,e,r);let l=i[t.buffer[this.stack[s]]];if(!l.isAnonymous){if(e[r]&&e[r]!=l.name)return!1;r--}}return!0}}function ip(n){return n.children.some(e=>e instanceof Ps||!e.type.isAnonymous||ip(e))}function vT(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:r=av,reused:s=[],minRepeatType:l=i.types.length}=n,o=Array.isArray(t)?new tp(t,t.length):t,a=i.types,c=0,h=0;function O(C,U,D,z,j,N){let{id:G,start:E,end:re,size:ae}=o,ve=h;for(;ae<0;)if(o.next(),ae==-1){let Pe=s[G];D.push(Pe),z.push(E-C);return}else if(ae==-3){c=G;return}else if(ae==-4){h=G;return}else throw new RangeError(`Unrecognized record size: ${ae}`);let Se=a[G],ge,Ue,Le=E-C;if(re-E<=r&&(Ue=y(o.pos-U,j))){let Pe=new Uint16Array(Ue.size-Ue.skip),We=o.pos-Ue.size,lt=Pe.length;for(;o.pos>We;)lt=k(Ue.start,Pe,lt);ge=new Ps(Pe,re-Ue.start,i),Le=Ue.start-C}else{let Pe=o.pos-ae;o.next();let We=[],lt=[],Vt=G>=l?G:-1,Qt=0,pt=re;for(;o.pos>Pe;)Vt>=0&&o.id==Vt&&o.size>=0?(o.end<=pt-r&&(m(We,lt,E,Qt,o.end,pt,Vt,ve),Qt=We.length,pt=o.end),o.next()):N>2500?p(E,Pe,We,lt):O(E,Pe,We,lt,Vt,N+1);if(Vt>=0&&Qt>0&&Qt-1&&Qt>0){let qt=g(Se);ge=np(Se,We,lt,0,We.length,0,re-E,qt,qt)}else ge=$(Se,We,lt,re-E,ve-re)}D.push(ge),z.push(Le)}function p(C,U,D,z){let j=[],N=0,G=-1;for(;o.pos>U;){let{id:E,start:re,end:ae,size:ve}=o;if(ve>4)o.next();else{if(G>-1&&re=0;ae-=3)E[ve++]=j[ae],E[ve++]=j[ae+1]-re,E[ve++]=j[ae+2]-re,E[ve++]=ve;D.push(new Ps(E,j[2]-re,i)),z.push(re-C)}}function g(C){return(U,D,z)=>{let j=0,N=U.length-1,G,E;if(N>=0&&(G=U[N])instanceof jt){if(!N&&G.type==C&&G.length==z)return G;(E=G.prop(at.lookAhead))&&(j=D[N]+G.length+E)}return $(C,U,D,z,j)}}function m(C,U,D,z,j,N,G,E){let re=[],ae=[];for(;C.length>z;)re.push(C.pop()),ae.push(U.pop()+D-j);C.push($(i.types[G],re,ae,N-j,E-N)),U.push(j-D)}function $(C,U,D,z,j=0,N){if(c){let G=[at.contextHash,c];N=N?[G].concat(N):[G]}if(j>25){let G=[at.lookAhead,j];N=N?[G].concat(N):[G]}return new jt(C,U,D,z,N)}function y(C,U){let D=o.fork(),z=0,j=0,N=0,G=D.end-r,E={size:0,start:0,skip:0};e:for(let re=D.pos-C;D.pos>re;){let ae=D.size;if(D.id==U&&ae>=0){E.size=z,E.start=j,E.skip=N,N+=4,z+=4,D.next();continue}let ve=D.pos-ae;if(ae<0||ve=l?4:0,ge=D.start;for(D.next();D.pos>ve;){if(D.size<0)if(D.size==-3)Se+=4;else break e;else D.id>=l&&(Se+=4);D.next()}j=ge,z+=ae,N+=Se}return(U<0||z==C)&&(E.size=z,E.start=j,E.skip=N),E.size>4?E:void 0}function k(C,U,D){let{id:z,start:j,end:N,size:G}=o;if(o.next(),G>=0&&z4){let re=o.pos-(G-4);for(;o.pos>re;)D=k(C,U,D)}U[--D]=E,U[--D]=N-C,U[--D]=j-C,U[--D]=z}else G==-3?c=z:G==-4&&(h=z);return D}let W=[],Z=[];for(;o.pos>0;)O(n.start||0,n.bufferStart||0,W,Z,-1,0);let A=(e=n.length)!==null&&e!==void 0?e:W.length?Z[0]+W[0].length:0;return new jt(a[n.topID],W.reverse(),Z.reverse(),A)}const n0=new WeakMap;function mc(n,e){if(!n.isAnonymous||e instanceof Ps||e.type!=n)return 1;let t=n0.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof jt)){t=1;break}t+=mc(n,i)}n0.set(e,t)}return t}function np(n,e,t,i,r,s,l,o,a){let c=0;for(let m=i;m=h)break;U+=D}if(Z==A+1){if(U>h){let D=m[A];g(D.children,D.positions,0,D.children.length,$[A]+W);continue}O.push(m[A])}else{let D=$[Z-1]+m[Z-1].length-C;O.push(np(n,m,$,A,Z,C,D,null,a))}p.push(C+W-s)}}return g(e,t,i,r,0),(o||a)(O,p,l)}class hv{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof pr?this.setBuffer(e.context.buffer,e.index,t):e instanceof Mi&&this.map.set(e.tree,t)}get(e){return e instanceof pr?this.getBuffer(e.context.buffer,e.index):e instanceof Mi?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Vr{constructor(e,t,i,r,s=!1,l=!1){this.from=e,this.to=t,this.tree=i,this.offset=r,this.open=(s?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let r=[new Vr(0,e.length,e,0,!1,i)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,i=128){if(!t.length)return e;let r=[],s=1,l=e.length?e[0]:null;for(let o=0,a=0,c=0;;o++){let h=o=i)for(;l&&l.from=p.from||O<=p.to||c){let g=Math.max(p.from,a)-c,m=Math.min(p.to,O)-c;p=g>=m?null:new Vr(g,m,p.tree,p.offset+c,o>0,!!h)}if(p&&r.push(p),l.to>O)break;l=snew An(r.from,r.to)):[new An(0,0)]:[new An(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let r=this.startParse(e,t,i);for(;;){let s=r.advance();if(s)return s}}}class wT{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function QT(n){return(e,t,i,r)=>new _T(e,n,t,i,r)}class r0{constructor(e,t,i,r,s){this.parser=e,this.parse=t,this.overlay=i,this.target=r,this.from=s}}function s0(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class kT{constructor(e,t,i,r,s,l,o){this.parser=e,this.predicate=t,this.mounts=i,this.index=r,this.start=s,this.target=l,this.prev=o,this.depth=0,this.ranges=[]}}const $d=new at({perNode:!0});class _T{constructor(e,t,i,r,s){this.nest=t,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new jt(i.type,i.children,i.positions,i.length,i.propValues.concat([[$d,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[at.mounted.id]=new Oa(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)o=!1;else if(e.hasNode(r)){if(t){let c=t.mounts.find(h=>h.frag.from<=r.from&&h.frag.to>=r.to&&h.mount.overlay);if(c)for(let h of c.mount.overlay){let O=h.from+c.pos,p=h.to+c.pos;O>=r.from&&p<=r.to&&!t.ranges.some(g=>g.fromO)&&t.ranges.push({from:O,to:p})}}o=!1}else if(i&&(l=PT(i.ranges,r.from,r.to)))o=l!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew An(O.from-r.from,O.to-r.from)):null,r.tree,h.length?h[0].from:r.from)),s.overlay?h.length&&(i={ranges:h,depth:0,prev:i}):o=!1}}else t&&(a=t.predicate(r))&&(a===!0&&(a=new An(r.from,r.to)),a.fromnew An(h.from-t.start,h.to-t.start)),t.target,c[0].from))),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function PT(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function l0(n,e,t,i,r,s){if(e=e.to);i++);let l=r.children[i],o=l.buffer,a=[i];function c(h,O,p,g,m,$){let y=t[$],k=[],W=[];l0(l,h,y,k,W,g);let Z=o[y+1],A=o[y+2];a.push(k.length);let C=$?c(y+4,o[y+3],l.set.types[o[y]],Z,A-Z,$-1):e.toTree();return k.push(C),W.push(Z-g),l0(l,o[y+3],O,k,W,g),new jt(p,k,W,m)}r.children[i]=c(0,o.length,Ni.none,0,l.length,t.length-1);for(let h of a){let O=n.tree.children[h],p=n.tree.positions[h];n.yield(new Mi(O,p+n.from,h,n._tree))}}class o0{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(Et.IncludeAnonymous|Et.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from=e&&t.enter(i,1,Et.IgnoreOverlays|Et.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof jt)t=t.children[0];else break}return!1}}let WT=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop($d))!==null&&t!==void 0?t:i.to,this.inner=new o0(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop($d))!==null&&e!==void 0?e:t.to,this.inner=new o0(t.tree,-t.offset)}}findMounts(e,t){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let l=(i=s.tree)===null||i===void 0?void 0:i.prop(at.mounted);if(l&&l.parser==t)for(let o=this.fragI;o=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:l})}}}return r}};function a0(n,e){let t=null,i=e;for(let r=1,s=0;r=o)break;a.to<=l||(t||(i=t=e.slice()),a.fromo&&t.splice(s+1,0,new An(o,a.to))):a.to>o?t[s--]=new An(o,a.to):t.splice(s--,1))}}return i}function CT(n,e,t,i){let r=0,s=0,l=!1,o=!1,a=-1e9,c=[];for(;;){let h=r==n.length?1e9:l?n[r].to:n[r].from,O=s==e.length?1e9:o?e[s].to:e[s].from;if(l!=o){let p=Math.max(a,t),g=Math.min(h,O,i);pnew An(p.from+i,p.to+i)),O=CT(e,h,a,c);for(let p=0,g=a;;p++){let m=p==O.length,$=m?c:O[p].from;if($>g&&t.push(new Vr(g,$,r.tree,-l,s.from>=g||s.openStart,s.to<=$||s.openEnd)),m)break;g=O[p].to}}else t.push(new Vr(a,c,r.tree,-l,s.from>=l||s.openStart,s.to<=o||s.openEnd))}return t}var c0={};class Rc{constructor(e,t,i,r,s,l,o,a,c,h=0,O){this.p=e,this.stack=t,this.state=i,this.reducePos=r,this.pos=s,this.score=l,this.buffer=o,this.bufferBase=a,this.curContext=c,this.lookAhead=h,this.parent=O}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let r=e.parser.context;return new Rc(e,[],t,i,i,0,[],0,r?new u0(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,r=e&65535,{parser:s}=this.p,l=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(r,c)}storeNode(e,t,i,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&l.buffer[o-4]==0&&l.buffer[o-1]>-1){if(t==i)return;if(l.buffer[o-2]>=t){l.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,t,i,r);else{let l=this.buffer.length;if(l>0&&this.buffer[l-4]!=0){let o=!1;for(let a=l;a>0&&this.buffer[a-2]>i;a-=4)if(this.buffer[a-1]>=0){o=!0;break}if(o)for(;l>0&&this.buffer[l-2]>i;)this.buffer[l]=this.buffer[l-4],this.buffer[l+1]=this.buffer[l-3],this.buffer[l+2]=this.buffer[l-2],this.buffer[l+3]=this.buffer[l-1],l-=4,r>4&&(r-=4)}this.buffer[l]=e,this.buffer[l+1]=t,this.buffer[l+2]=i,this.buffer[l+3]=r}}shift(e,t,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,r,4);else{let s=e,{parser:l}=this.p;(r>this.pos||t<=l.maxNode)&&(this.pos=r,l.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,i),this.shiftContext(t,i),t<=l.maxNode&&this.buffer.push(t,i,r,4)}}apply(e,t,i,r){e&65536?this.reduce(e):this.shift(e,t,i,r)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new Rc(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new TT(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if(!(i&65536))return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,l;sa&1&&o==l)||r.push(t[s],l)}t=r}let i=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let l=this.findForcedReduction();if(l==null)return!1;t=l}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,l=>{if(!(l&393216))if(l&65536){let o=(l>>19)-s;if(o>1){let a=l&65535,c=this.stack.length-o*3;if(c>=0&&e.getGoto(this.stack[c],a,!1)>=0)return o<<19|65536|a}}else{let o=i(l,s+1);if(o!=null)return o}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class u0{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class TT{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class Ac{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Ac(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Ac(this.stack,this.pos,this.index)}}function No(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let i=0,r=0;i=92&&l--,l>=34&&l--;let a=l-32;if(a>=46&&(a-=46,o=!0),s+=a,o)break;s*=46}t?t[r++]=s:t=new e(s)}return t}class Sc{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const h0=new Sc;class ZT{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=h0,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,r=this.rangeIndex,s=this.pos+e;for(;si.to:s>=i.to;){if(r==this.ranges.length-1)return null;let l=this.ranges[++r];s+=l.from-i.to,i=l}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,r;if(t>=0&&t=this.chunk2Pos&&io.to&&(this.chunk2=this.chunk2.slice(0,o.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=h0,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return i}}class Xl{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;dv(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}Xl.prototype.contextual=Xl.prototype.fallback=Xl.prototype.extend=!1;class Xc{constructor(e,t,i){this.precTable=t,this.elseToken=i,this.data=typeof e=="string"?No(e):e}token(e,t){let i=e.pos,r=0;for(;;){let s=e.next<0,l=e.resolveOffset(1,1);if(dv(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,l==null)break;e.reset(l,e.token)}r&&(e.reset(i,e.token),e.acceptToken(this.elseToken,r))}}Xc.prototype.contextual=Xl.prototype.fallback=Xl.prototype.extend=!1;class vr{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function dv(n,e,t,i,r,s){let l=0,o=1<0){let m=n[g];if(a.allows(m)&&(e.token.value==-1||e.token.value==m||RT(m,e.token.value,r,s))){e.acceptToken(m);break}}let h=e.next,O=0,p=n[l+2];if(e.next<0&&p>O&&n[c+p*3-3]==65535){l=n[c+p*3-1];continue e}for(;O>1,m=c+g+(g<<1),$=n[m],y=n[m+1]||65536;if(h<$)p=g;else if(h>=y)O=g+1;else{l=n[m+2],e.advance();continue e}}break}}function O0(n,e,t){for(let i=e,r;(r=n[i])!=65535;i++)if(r==t)return i-e;return-1}function RT(n,e,t,i){let r=O0(t,i,e);return r<0||O0(t,i,n)e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}class AT{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?d0(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?d0(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=l,null;if(s instanceof jt){if(l==e){if(l=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(l),this.index.push(0))}else this.index[t]++,this.nextStart=l+s.length}}}class XT{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new Sc)}getActions(e){let t=0,i=null,{parser:r}=e.p,{tokenizers:s}=r,l=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,a=0;for(let c=0;cO.end+25&&(a=Math.max(O.lookAhead,a)),O.value!=0)){let p=t;if(O.extended>-1&&(t=this.addActions(e,O.extended,O.end,t)),t=this.addActions(e,O.value,O.end,t),!h.extend&&(i=O,t>p))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!i&&e.pos==this.stream.end&&(i=new Sc,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Sc,{pos:i,p:r}=e;return t.start=i,t.end=Math.min(i+1,r.stream.end),t.value=i==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,i){let r=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(r,e),i),e.value>-1){let{parser:s}=i.p;for(let l=0;l=0&&i.p.parser.dialect.allows(o>>1)){o&1?e.extended=o>>1:e.value=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,i,r){for(let s=0;se.bufferLength*4?new AT(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[l]=e;for(;l.forceReduce()&&l.stack.length&&l.stack[l.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let l=0;lt)i.push(o);else{if(this.advanceStack(o,i,e))continue;{r||(r=[],s=[]),r.push(o);let a=this.tokens.getMainToken(o);s.push(a.value,a.end)}}break}}if(!i.length){let l=r&&ET(r);if(l)return un&&console.log("Finish with "+this.stackID(l)),this.stackToTree(l);if(this.parser.strict)throw un&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let l=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(l)return un&&console.log("Force-finish "+this.stackID(l)),this.stackToTree(l.forceAll())}if(this.recovering){let l=this.recovering==1?1:this.recovering*3;if(i.length>l)for(i.sort((o,a)=>a.score-o.score);i.length>l;)i.pop();i.some(o=>o.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let l=0;l500&&c.buffer.length>500)if((o.score-c.score||o.buffer.length-c.buffer.length)>0)i.splice(a--,1);else{i.splice(l--,1);continue e}}}i.length>12&&i.splice(12,i.length-12)}this.minStackPos=i[0].pos;for(let l=1;l ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,h=c?e.curContext.hash:0;for(let O=this.fragments.nodeAt(r);O;){let p=this.parser.nodeSet.types[O.type.id]==O.type?s.getGoto(e.state,O.type.id):-1;if(p>-1&&O.length&&(!c||(O.prop(at.contextHash)||0)==h))return e.useNode(O,p),un&&console.log(l+this.stackID(e)+` (via reuse of ${s.getName(O.type.id)})`),!0;if(!(O instanceof jt)||O.children.length==0||O.positions[0]>0)break;let g=O.children[0];if(g instanceof jt&&O.positions[0]==0)O=g;else break}}let o=s.stateSlot(e.state,4);if(o>0)return e.reduce(o),un&&console.log(l+this.stackID(e)+` (via always-reduce ${s.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let c=0;cr?t.push(m):i.push(m)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return p0(e,t),!0}}runRecovery(e,t,i){let r=null,s=!1;for(let l=0;l ":"";if(o.deadEnd&&(s||(s=!0,o.restart(),un&&console.log(h+this.stackID(o)+" (restarted)"),this.advanceFully(o,i))))continue;let O=o.split(),p=h;for(let g=0;O.forceReduce()&&g<10&&(un&&console.log(p+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,i));g++)un&&(p=this.stackID(O)+" -> ");for(let g of o.recoverByInsert(a))un&&console.log(h+this.stackID(g)+" (via recover-insert)"),this.advanceFully(g,i);this.stream.end>o.pos?(c==o.pos&&(c++,a=0),o.recoverByDelete(a,c),un&&console.log(h+this.stackID(o)+` (via recover-delete ${this.parser.getName(a)})`),p0(o,i)):(!r||r.scoren;class pv{constructor(e){this.start=e.start,this.shift=e.shift||cO,this.reduce=e.reduce||cO,this.reuse=e.reuse||cO,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class xs extends Ov{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let o=0;oe.topRules[o][1]),r=[];for(let o=0;o=0)s(h,a,o[c++]);else{let O=o[c+-h];for(let p=-h;p>0;p--)s(o[c++],a,O);c++}}}this.nodeSet=new ep(t.map((o,a)=>Ni.define({name:a>=this.minRepeatTerm?void 0:o,id:a,props:r[a],top:i.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=av;let l=No(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new Xl(l,o):o),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let r=new YT(this,e,t,i);for(let s of this.wrappers)r=s(r,e,t,i);return r}getGoto(e,t,i=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let l=r[s++],o=l&1,a=r[s++];if(o&&i)return a;for(let c=s+(l>>1);s0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),r=i?t(i):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Mr(this.data,s+2);else break;r=t(Mr(this.data,s+1))}return r}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Mr(this.data,i+2);else break;if(!(this.data[i+2]&1)){let r=this.data[i+1];t.some((s,l)=>l&1&&s==r)||t.push(this.data[i],r)}}return t}configure(e){let t=Object.assign(Object.create(xs.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(s=>s.from==i);return r?r.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=e.specializers.find(o=>o.from==i.external);if(!s)return i;let l=Object.assign(Object.assign({},i),{external:s.to});return t.specializers[r]=g0(l),l})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let s of e.split(" ")){let l=t.indexOf(s);l>=0&&(i[l]=!0)}let r=null;for(let s=0;si)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scoren.external(t,i)<<1|e}return n.get}const MT={__proto__:null,annotation:12,array:20,var:24,par:26,opt:28,ann:32,bool:34,float:36,int:38,string:40,_:50,true:62,false:64,infinity:68,"∅":74,in:92,where:94,if:98,then:100,elseif:102,else:104,endif:106,xor:110,subset:112,superset:114,union:116,diff:118,symdiff:120,intersect:122,div:124,mod:126,default:128,let:132,constraint:140,not:144,"¬":146,any:170,of:172,set:176,tuple:180,record:184,op:190,enum:198,function:202,solve:206,satisfy:208,maximize:210,minimize:212,include:216,output:220,predicate:224,test:226,type:230},zT=xs.deserialize({version:14,states:"!0jQ]QPOOOOQO'#F]'#F]O&XQPO'#CvO&`QPO'#CxOOQO'#C}'#C}O&gQPO'#DSO&nOQO'#DTO$kQPO'#DWOOQO'#Fc'#FcO*}QPO'#CgO+eQPO'#DrO$kQPO'#DuO$kQPO'#DuO/qQPO'#FbOOQO'#Fb'#FbOOQO'#Cg'#CgOOQO'#F`'#F`OOQO'#F['#F[Q/xQPO'#EtQ]QPOOOOQO'#Ck'#CkOOQO'#Ct'#CtOOQO'#Cz'#CzOOQO'#DQ'#DQO$kQPO'#D^O/}QPO'#DsO0UQPO'#DoO0ZQPO'#CgO0wQPO'#CgO1hQPO'#E`O1|QPO'#CeO2RQPO'#EVO2WQPO'#EXO2]QPO'#EZO2bQPO'#E^O2gQPO'#C`O2gQPO'#EbO2oQPO'#EdO3uQPO'#EfO4TQPO'#EkO4YQPO'#EmO2gQPO'#EoO2gQPO'#ErO4aQPO'#CwO4qQPO,59bOOQO,59b,59bO4{QPO,59bO5TQPO'#FbO7`QPO,59tO7pQPO,59dO7xQPO,59dOOQO,59d,59dO8PQPO,59nO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q!xQ$s!}S$y#T&kQ%]#_Q%^#`S%b#f'X^%c#g%d'U'W'd(n(uU%g#k%j'ZQ%l#nQ%v#}Q%w$PQ&U$kQ&^$oQ&_$rQ&a$sQ&h$wQ&y%WQ&{%YQ&|%ZQ'Q%_Q'`%oU'i%}'l(wQ'n&QQ'o&RQ'v&YQ(P&`Q(Q&bQ(R&cQ(h&zQ(k'PQ(l'RQ(m'SQ(y'sQ)S'|Q)T(OQ)e(iQ)m(xQ)o(zQ)p(|Q)q)RQ*Q)fQ*R)gQ*U)nQ*X)rQ*`*PQ*b*VQ*e*oQ*f*pQ*g*qQ*h*rQ*i*sQ*j*tQ*k*uQ*l*vS*m*d*wQ*n*xQ+S*{Q+T+ZQ+U*|Q+V*}Q+W+OQ+X+PR+Y+Q",nodeNames:"⚠ LineComment BlockComment SourceFile Annotation Identifier Keyword QuotedIdentifier Parameter ArrayType Keyword TypeBase Keyword Keyword Keyword PrimitiveType Keyword Keyword Keyword Keyword Keyword TypeInstId TypeInstEnumId Absent Anonymous Keyword ArrayLiteral2d ArrayLiteral2dRow ArrayLiteral ArrayLiteralMember BooleanLiteral Keyword Keyword Infinity Keyword Number EmptySet Keyword SetLiteral StringLiteral Interpolation TupleLiteral RecordLiteral RecordMember ArrayComprehension Generator Keyword Keyword IfThenElse Keyword Keyword Keyword Keyword Keyword InfixOperator Keyword Keyword Keyword Keyword Keyword Keyword Keyword Keyword Keyword Keyword LetExpression Keyword LetItems Declaration Constraint Keyword PrefixOperator Keyword Keyword PostfixOperator SetComprehension Call Application GeneratorCall GeneratorCallGenerators ParenthesisedExpression IndexedAccess TupleAccess Number RecordAccess Keyword Keyword SetType Keyword TupleType Keyword RecordType Keyword RecordTypeField OperationType Keyword AnyType Assignment Enumeration Keyword FunctionItem Keyword Goal Keyword Keyword Keyword Keyword Include Keyword Output Keyword Predicate Keyword Keyword TypeAlias Keyword",maxTerm:210,skippedNodes:[0,1,2],repeatNodeCount:19,tokenData:"!8_~R!oOX&SXY&qYZ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!3QU$pP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!3kU%VP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!4UU%TP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!4oU$wP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!5YU$zP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!5sU$}P$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!6^U%PP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!6wU%QP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!7bU$qP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!7{U$gP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&S",tokenizers:[0,1,2],topRules:{SourceFile:[0,3]},specialized:[{term:5,get:n=>MT[n]||-1}],tokenPrec:0});let DT=0;class Zn{constructor(e,t,i,r){this.name=e,this.set=t,this.base=i,this.modified=r,this.id=DT++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof Zn&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let r=new Zn(i,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new Yc(e);return i=>i.modified.indexOf(t)>-1?i:Yc.get(i.base||i,i.modified.concat(t).sort((r,s)=>r.id-s.id))}}let VT=0;class Yc{constructor(e){this.name=e,this.instances=[],this.id=VT++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(o=>o.base==e&&qT(t,o.modified));if(i)return i;let r=[],s=new Zn(e.name,r,e,t);for(let o of t)o.instances.push(s);let l=LT(t);for(let o of e.set)if(!o.modified.length)for(let a of l)r.push(Yc.get(o,a));return s}}function qT(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function LT(n){let e=[[]];for(let t=0;ti.length-t.length)}function Hl(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let r of t.split(" "))if(r){let s=[],l=2,o=r;for(let O=0;;){if(o=="..."&&O>0&&O+3==r.length){l=1;break}let p=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!p)throw new RangeError("Invalid path: "+r);if(s.push(p[0]=="*"?"":p[0][0]=='"'?JSON.parse(p[0]):p[0]),O+=p[0].length,O==r.length)break;let g=r[O++];if(O==r.length&&g=="!"){l=0;break}if(g!="/")throw new RangeError("Invalid path: "+r);o=r.slice(O)}let a=s.length-1,c=s[a];if(!c)throw new RangeError("Invalid path: "+r);let h=new Uc(i,l,a>0?s.slice(0,a):null);e[c]=h.sort(e[c])}}return gv.add(e)}const gv=new at;class Uc{constructor(e,t,i,r){this.tags=e,this.mode=t,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let l=r;for(let o of s)for(let a of o.set){let c=t[a.id];if(c){l=l?l+" "+c:c;break}}return l},scope:i}}function IT(n,e){let t=null;for(let i of n){let r=i.style(e);r&&(t=t?t+" "+r:r)}return t}function NT(n,e,t,i=0,r=n.length){let s=new BT(i,Array.isArray(e)?e:[e],t);s.highlightRange(n.cursor(),i,r,"",s.highlighters),s.flush(r)}class BT{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,r,s){let{type:l,from:o,to:a}=e;if(o>=i||a<=t)return;l.isTop&&(s=this.highlighters.filter(g=>!g.scope||g.scope(l)));let c=r,h=jT(e)||Uc.empty,O=IT(s,h.tags);if(O&&(c&&(c+=" "),c+=O,h.mode==1&&(r+=(r?" ":"")+O)),this.startSpan(Math.max(t,o),c),h.opaque)return;let p=e.tree&&e.tree.prop(at.mounted);if(p&&p.overlay){let g=e.node.enter(p.overlay[0].from+o,1),m=this.highlighters.filter(y=>!y.scope||y.scope(p.tree.type)),$=e.firstChild();for(let y=0,k=o;;y++){let W=y=Z||!e.nextSibling())););if(!W||Z>i)break;k=W.to+o,k>t&&(this.highlightRange(g.cursor(),Math.max(t,W.from+o),Math.min(i,k),"",m),this.startSpan(Math.min(i,k),c))}$&&e.parent()}else if(e.firstChild()){p&&(r="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,r,s),this.startSpan(Math.min(i,e.to),c)}while(e.nextSibling());e.parent()}}}function jT(n){let e=n.type.prop(gv);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const de=Zn.define,Jf=de(),hs=de(),m0=de(hs),S0=de(hs),Os=de(),ec=de(Os),uO=de(Os),ur=de(),qs=de(ur),fr=de(),cr=de(),yd=de(),Xo=de(yd),tc=de(),b={comment:Jf,lineComment:de(Jf),blockComment:de(Jf),docComment:de(Jf),name:hs,variableName:de(hs),typeName:m0,tagName:de(m0),propertyName:S0,attributeName:de(S0),className:de(hs),labelName:de(hs),namespace:de(hs),macroName:de(hs),literal:Os,string:ec,docString:de(ec),character:de(ec),attributeValue:de(ec),number:uO,integer:de(uO),float:de(uO),bool:de(Os),regexp:de(Os),escape:de(Os),color:de(Os),url:de(Os),keyword:fr,self:de(fr),null:de(fr),atom:de(fr),unit:de(fr),modifier:de(fr),operatorKeyword:de(fr),controlKeyword:de(fr),definitionKeyword:de(fr),moduleKeyword:de(fr),operator:cr,derefOperator:de(cr),arithmeticOperator:de(cr),logicOperator:de(cr),bitwiseOperator:de(cr),compareOperator:de(cr),updateOperator:de(cr),definitionOperator:de(cr),typeOperator:de(cr),controlOperator:de(cr),punctuation:yd,separator:de(yd),bracket:Xo,angleBracket:de(Xo),squareBracket:de(Xo),paren:de(Xo),brace:de(Xo),content:ur,heading:qs,heading1:de(qs),heading2:de(qs),heading3:de(qs),heading4:de(qs),heading5:de(qs),heading6:de(qs),contentSeparator:de(ur),list:de(ur),quote:de(ur),emphasis:de(ur),strong:de(ur),link:de(ur),monospace:de(ur),strikethrough:de(ur),inserted:de(),deleted:de(),changed:de(),invalid:de(),meta:tc,documentMeta:de(tc),annotation:de(tc),processingInstruction:de(tc),definition:Zn.defineModifier("definition"),constant:Zn.defineModifier("constant"),function:Zn.defineModifier("function"),standard:Zn.defineModifier("standard"),local:Zn.defineModifier("local"),special:Zn.defineModifier("special")};for(let n in b){let e=b[n];e instanceof Zn&&(e.name=n)}mv([{tag:b.link,class:"tok-link"},{tag:b.heading,class:"tok-heading"},{tag:b.emphasis,class:"tok-emphasis"},{tag:b.strong,class:"tok-strong"},{tag:b.keyword,class:"tok-keyword"},{tag:b.atom,class:"tok-atom"},{tag:b.bool,class:"tok-bool"},{tag:b.url,class:"tok-url"},{tag:b.labelName,class:"tok-labelName"},{tag:b.inserted,class:"tok-inserted"},{tag:b.deleted,class:"tok-deleted"},{tag:b.literal,class:"tok-literal"},{tag:b.string,class:"tok-string"},{tag:b.number,class:"tok-number"},{tag:[b.regexp,b.escape,b.special(b.string)],class:"tok-string2"},{tag:b.variableName,class:"tok-variableName"},{tag:b.local(b.variableName),class:"tok-variableName tok-local"},{tag:b.definition(b.variableName),class:"tok-variableName tok-definition"},{tag:b.special(b.variableName),class:"tok-variableName2"},{tag:b.definition(b.propertyName),class:"tok-propertyName tok-definition"},{tag:b.typeName,class:"tok-typeName"},{tag:b.namespace,class:"tok-namespace"},{tag:b.className,class:"tok-className"},{tag:b.macroName,class:"tok-macroName"},{tag:b.propertyName,class:"tok-propertyName"},{tag:b.operator,class:"tok-operator"},{tag:b.comment,class:"tok-comment"},{tag:b.meta,class:"tok-meta"},{tag:b.invalid,class:"tok-invalid"},{tag:b.punctuation,class:"tok-punctuation"}]);var hO;const Pl=new at;function Sv(n){return ye.define({combine:n?e=>e.concat(n):void 0})}const rp=new at;class Hn{constructor(e,t,i=[],r=""){this.data=e,this.name=r,Ot.prototype.hasOwnProperty("tree")||Object.defineProperty(Ot.prototype,"tree",{get(){return ei(this)}}),this.parser=t,this.extension=[Cs.of(this),Ot.languageData.of((s,l,o)=>{let a=b0(s,l,o),c=a.type.prop(Pl);if(!c)return[];let h=s.facet(c),O=a.type.prop(rp);if(O){let p=a.resolve(l-a.from,o);for(let g of O)if(g.test(p,s)){let m=s.facet(g.facet);return g.type=="replace"?m:m.concat(h)}}return h})].concat(i)}isActiveAt(e,t,i=-1){return b0(e,t,i).type.prop(Pl)==this.data}findRegions(e){let t=e.facet(Cs);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],r=(s,l)=>{if(s.prop(Pl)==this.data){i.push({from:l,to:l+s.length});return}let o=s.prop(at.mounted);if(o){if(o.tree.prop(Pl)==this.data){if(o.overlay)for(let a of o.overlay)i.push({from:a.from+l,to:a.to+l});else i.push({from:l,to:l+s.length});return}else if(o.overlay){let a=i.length;if(r(o.tree,o.overlay[0].from+l),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new Ws(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ei(n){let e=n.field(Hn.state,!1);return e?e.tree:jt.empty}class FT{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Yo=null;class Ec{constructor(e,t,i=[],r,s,l,o,a){this.parser=e,this.state=t,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=l,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Ec(e,t,[],jt.empty,0,i,[],null)}startParse(){return this.parser.startParse(new FT(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=jt.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Vr.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Yo;Yo=this;try{return e()}finally{Yo=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=$0(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:r,treeLen:s,viewport:l,skipped:o}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,h,O,p)=>a.push({fromA:c,toA:h,fromB:O,toB:p})),i=Vr.applyChanges(i,a),r=jt.empty,s=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){o=[];for(let c of this.skipped){let h=e.mapPos(c.from,1),O=e.mapPos(c.to,-1);he.from&&(this.fragments=$0(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Ov{createParse(t,i,r){let s=r[0].from,l=r[r.length-1].to;return{parsedPos:s,advance(){let a=Yo;if(a){for(let c of r)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=l,new jt(Ni.none,[],[],l-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Yo}}function $0(n,e,t){return Vr.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Ll{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new Ll(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Ec.create(e.facet(Cs).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new Ll(i)}}Hn.state=pi.define({create:Ll.init,update(n,e){for(let t of e.effects)if(t.is(Hn.setState))return t.value;return e.startState.facet(Cs)!=e.state.facet(Cs)?Ll.init(e.state):n.apply(e)}});let bv=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(bv=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const OO=typeof navigator<"u"&&(!((hO=navigator.scheduling)===null||hO===void 0)&&hO.isInputPending)?()=>navigator.scheduling.isInputPending():null,GT=oi.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Hn.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Hn.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=bv(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndr+1e3,a=s.context.work(()=>OO&&OO()||Date.now()>l,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Hn.setState.of(new Ll(s.context))})),this.chunkBudget>0&&!(a&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>en(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Cs=ye.define({combine(n){return n.length?n[0]:null},enables:n=>[Hn.state,GT,Oe.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Qa{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const HT=ye.define(),cu=ye.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Mc(n){let e=n.facet(cu);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function pa(n,e){let t="",i=n.tabSize,r=n.facet(cu)[0];if(r==" "){for(;e>=i;)t+=" ",e-=i;r=" "}for(let s=0;s=e?KT(n,t,e):null}class uu{constructor(e,t={}){this.state=e,this.options=t,this.unit=Mc(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:"",from:e}:(t<0?r-1&&(s+=l-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,t=e.length){return Gl(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let l=s(r);if(l>-1)return l}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Kl=new at;function KT(n,e,t){let i=e.resolveStack(t),r=i.node.enterUnfinishedNodesBefore(t);if(r!=i.node){let s=[];for(let l=r;l!=i.node;l=l.parent)s.push(l);for(let l=s.length-1;l>=0;l--)i={node:s[l],next:i}}return $v(i,n,t)}function $v(n,e,t){for(let i=n;i;i=i.next){let r=eZ(i.node);if(r)return r(lp.create(e,t,i))}return 0}function JT(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function eZ(n){let e=n.type.prop(Kl);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(at.closedBy))){let r=n.lastChild,s=r&&i.indexOf(r.name)>-1;return l=>yv(l,!0,1,void 0,s&&!JT(l)?r.from:void 0)}return n.parent==null?tZ:null}function tZ(){return 0}class lp extends uu{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new lp(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(iZ(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return $v(this.context.next,this.base,this.pos)}}function iZ(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function nZ(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let r=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),l=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let o=t.to;;){let a=e.childAfter(o);if(!a||a==i)return null;if(!a.type.isSkipped)return a.fromyv(i,e,t,n)}function yv(n,e,t,i,r){let s=n.textAfter,l=s.match(/^\s*/)[0].length,o=i&&s.slice(l,l+i.length)==i||r==n.pos+l,a=e?nZ(n):null;return a?o?n.column(a.from):n.column(a.to):n.baseIndent+(o?0:n.unit*t)}const rZ=n=>n.baseIndent;function Yl({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const sZ=200;function lZ(){return Ot.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,r=t.lineAt(i);if(i>r.from+sZ)return n;let s=t.sliceString(r.from,i);if(!e.some(c=>c.test(s)))return n;let{state:l}=n,o=-1,a=[];for(let{head:c}of l.selection.ranges){let h=l.doc.lineAt(c);if(h.from==o)continue;o=h.from;let O=sp(l,h.from);if(O==null)continue;let p=/^\s*/.exec(h.text)[0],g=pa(l,O);p!=g&&a.push({from:h.from,to:h.from+p.length,insert:g})}return a.length?[n,{changes:a,sequential:!0}]:n})}const oZ=ye.define(),Jl=new at;function hr(n){let e=n.firstChild,t=n.lastChild;return e&&e.tot)continue;if(s&&o.from=e&&c.to>t&&(s=c)}}return s}function fZ(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function zc(n,e,t){for(let i of n.facet(oZ)){let r=i(n,e,t);if(r)return r}return aZ(n,e,t)}function vv(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const hu=Ie.define({map:vv}),ka=Ie.define({map:vv});function wv(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const tl=pi.define({create(){return Ze.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)if(t.is(hu)&&!cZ(n,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(_v),r=i?Ze.replace({widget:new mZ(i(e.state,t.value))}):y0;n=n.update({add:[r.range(t.value.from,t.value.to)]})}else t.is(ka)&&(n=n.update({filter:(i,r)=>t.value.from!=i||t.value.to!=r,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:i}=e.selection.main;n.between(i,i,(r,s)=>{ri&&(t=!0)}),t&&(n=n.update({filterFrom:i,filterTo:i,filter:(r,s)=>s<=i||r>=i}))}return n},provide:n=>Oe.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,r)=>{t.push(i,r)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!r||r.from>s)&&(r={from:s,to:l})}),r}function cZ(n,e,t){let i=!1;return n.between(e,e,(r,s)=>{r==e&&s==t&&(i=!0)}),i}function Qv(n,e){return n.field(tl,!1)?e:e.concat(Ie.appendConfig.of(Pv()))}const uZ=n=>{for(let e of wv(n)){let t=zc(n.state,e.from,e.to);if(t)return n.dispatch({effects:Qv(n.state,[hu.of(t),kv(n,t)])}),!0}return!1},hZ=n=>{if(!n.state.field(tl,!1))return!1;let e=[];for(let t of wv(n)){let i=Dc(n.state,t.from,t.to);i&&e.push(ka.of(i),kv(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function kv(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,r=n.state.doc.lineAt(e.to).number;return Oe.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${n.state.phrase("to")} ${r}.`)}const OZ=n=>{let{state:e}=n,t=[];for(let i=0;i{let e=n.state.field(tl,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,r)=>{t.push(ka.of({from:i,to:r}))}),n.dispatch({effects:t}),!0},pZ=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:uZ},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:hZ},{key:"Ctrl-Alt-[",run:OZ},{key:"Ctrl-Alt-]",run:dZ}],gZ={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},_v=ye.define({combine(n){return yr(n,gZ)}});function Pv(n){return[tl,$Z]}function xv(n,e){let{state:t}=n,i=t.facet(_v),r=l=>{let o=n.lineBlockAt(n.posAtDOM(l.target)),a=Dc(n.state,o.from,o.to);a&&n.dispatch({effects:ka.of(a)}),l.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,r,e);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const y0=Ze.replace({widget:new class extends Nr{toDOM(n){return xv(n,null)}}});class mZ extends Nr{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return xv(e,this.value)}}const SZ={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class dO extends Lr{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function bZ(n={}){let e=Object.assign(Object.assign({},SZ),n),t=new dO(e,!0),i=new dO(e,!1),r=oi.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(Cs)!=l.state.facet(Cs)||l.startState.field(tl,!1)!=l.state.field(tl,!1)||ei(l.startState)!=ei(l.state)||e.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let o=new vs;for(let a of l.viewportLineBlocks){let c=Dc(l.state,a.from,a.to)?i:zc(l.state,a.from,a.to)?t:null;c&&o.add(a.from,a.from,c)}return o.finish()}}),{domEventHandlers:s}=e;return[r,m3({class:"cm-foldGutter",markers(l){var o;return((o=l.plugin(r))===null||o===void 0?void 0:o.markers)||mt.empty},initialSpacer(){return new dO(e,!1)},domEventHandlers:Object.assign(Object.assign({},s),{click:(l,o,a)=>{if(s.click&&s.click(l,o,a))return!0;let c=Dc(l.state,o.from,o.to);if(c)return l.dispatch({effects:ka.of(c)}),!0;let h=zc(l.state,o.from,o.to);return h?(l.dispatch({effects:hu.of(h)}),!0):!1}})}),Pv()]}const $Z=Oe.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 _a{constructor(e,t){this.specs=e;let i;function r(o){let a=ws.newName();return(i||(i=Object.create(null)))["."+a]=o,a}const s=typeof t.all=="string"?t.all:t.all?r(t.all):void 0,l=t.scope;this.scope=l instanceof Hn?o=>o.prop(Pl)==l.data:l?o=>o==l:void 0,this.style=mv(e.map(o=>({tag:o.tag,class:o.class||r(Object.assign({},o,{tag:null}))})),{all:s}).style,this.module=i?new ws(i):null,this.themeType=t.themeType}static define(e,t){return new _a(e,t||{})}}const vd=ye.define(),Wv=ye.define({combine(n){return n.length?[n[0]]:null}});function pO(n){let e=n.facet(vd);return e.length?e:n.facet(Wv)}function Cv(n,e){let t=[vZ],i;return n instanceof _a&&(n.module&&t.push(Oe.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(Wv.of(n)):i?t.push(vd.computeN([Oe.darkTheme],r=>r.facet(Oe.darkTheme)==(i=="dark")?[n]:[])):t.push(vd.of(n)),t}class yZ{constructor(e){this.markCache=Object.create(null),this.tree=ei(e.state),this.decorations=this.buildDeco(e,pO(e.state))}update(e){let t=ei(e.state),i=pO(e.state),r=i!=pO(e.startState);t.length{i.add(l,o,this.markCache[a]||(this.markCache[a]=Ze.mark({class:a})))},r,s);return i.finish()}}const vZ=il.high(oi.fromClass(yZ,{decorations:n=>n.decorations})),wZ=_a.define([{tag:b.meta,color:"#404740"},{tag:b.link,textDecoration:"underline"},{tag:b.heading,textDecoration:"underline",fontWeight:"bold"},{tag:b.emphasis,fontStyle:"italic"},{tag:b.strong,fontWeight:"bold"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.keyword,color:"#708"},{tag:[b.atom,b.bool,b.url,b.contentSeparator,b.labelName],color:"#219"},{tag:[b.literal,b.inserted],color:"#164"},{tag:[b.string,b.deleted],color:"#a11"},{tag:[b.regexp,b.escape,b.special(b.string)],color:"#e40"},{tag:b.definition(b.variableName),color:"#00f"},{tag:b.local(b.variableName),color:"#30a"},{tag:[b.typeName,b.namespace],color:"#085"},{tag:b.className,color:"#167"},{tag:[b.special(b.variableName),b.macroName],color:"#256"},{tag:b.definition(b.propertyName),color:"#00c"},{tag:b.comment,color:"#940"},{tag:b.invalid,color:"#f00"}]),QZ=Oe.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Tv=1e4,Zv="()[]{}",Rv=ye.define({combine(n){return yr(n,{afterCursor:!0,brackets:Zv,maxScanDistance:Tv,renderMatch:PZ})}}),kZ=Ze.mark({class:"cm-matchingBracket"}),_Z=Ze.mark({class:"cm-nonmatchingBracket"});function PZ(n){let e=[],t=n.matched?kZ:_Z;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const xZ=pi.define({create(){return Ze.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(Rv);for(let r of e.state.selection.ranges){if(!r.empty)continue;let s=gr(e.state,r.head,-1,i)||r.head>0&&gr(e.state,r.head-1,1,i)||i.afterCursor&&(gr(e.state,r.head,1,i)||r.headOe.decorations.from(n)}),WZ=[xZ,QZ];function CZ(n={}){return[Rv.of(n),WZ]}const Av=new at;function wd(n,e,t){let i=n.prop(e<0?at.openedBy:at.closedBy);if(i)return i;if(n.name.length==1){let r=t.indexOf(n.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function Qd(n){let e=n.type.prop(Av);return e?e(n.node):n}function gr(n,e,t,i={}){let r=i.maxScanDistance||Tv,s=i.brackets||Zv,l=ei(n),o=l.resolveInner(e,t);for(let a=o;a;a=a.parent){let c=wd(a.type,t,s);if(c&&a.from0?e>=h.from&&eh.from&&e<=h.to))return TZ(n,e,t,a,h,c,s)}}return ZZ(n,e,t,l,o.type,r,s)}function TZ(n,e,t,i,r,s,l){let o=i.parent,a={from:r.from,to:r.to},c=0,h=o==null?void 0:o.cursor();if(h&&(t<0?h.childBefore(i.from):h.childAfter(i.to)))do if(t<0?h.to<=i.from:h.from>=i.to){if(c==0&&s.indexOf(h.type.name)>-1&&h.from0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},h=n.doc.iterRange(e,t>0?n.doc.length:0),O=0;for(let p=0;!h.next().done&&p<=s;){let g=h.value;t<0&&(p+=g.length);let m=e+p*t;for(let $=t>0?0:g.length-1,y=t>0?g.length:-1;$!=y;$+=t){let k=l.indexOf(g[$]);if(!(k<0||i.resolveInner(m+$,1).type!=r))if(k%2==0==t>0)O++;else{if(O==1)return{start:c,end:{from:m+$,to:m+$+1},matched:k>>1==a>>1};O--}}t>0&&(p+=g.length)}return h.done?{start:c,matched:!1}:null}const RZ=Object.create(null),v0=[Ni.none],w0=[],AZ=Object.create(null);for(let[n,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"]])AZ[n]=XZ(RZ,e);function gO(n,e){w0.indexOf(n)>-1||(w0.push(n),console.warn(e))}function XZ(n,e){let t=[];for(let s of e.split(" ")){let l=[];for(let o of s.split(".")){let a=n[o]||b[o];a?typeof a=="function"?l.length?l=l.map(a):gO(o,`Modifier ${o} used at start of tag`):l.length?gO(o,`Tag ${o} used as modifier`):l=Array.isArray(a)?a:[a]:gO(o,`Unknown highlighting tag ${o}`)}for(let o of l)t.push(o)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),r=Ni.define({id:v0.length,name:i,props:[Hl({[i]:t})]});return v0.push(r),r.id}const YZ=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=ap(n.state,t.from);return i.line?UZ(n):i.block?MZ(n):!1};function op(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let r=n(e,t);return r?(i(t.update(r)),!0):!1}}const UZ=op(VZ,0),EZ=op(Xv,0),MZ=op((n,e)=>Xv(n,e,DZ(e)),0);function ap(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const Uo=50;function zZ(n,{open:e,close:t},i,r){let s=n.sliceDoc(i-Uo,i),l=n.sliceDoc(r,r+Uo),o=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(l)[0].length,c=s.length-o;if(s.slice(c-e.length,c)==e&&l.slice(a,a+t.length)==t)return{open:{pos:i-o,margin:o&&1},close:{pos:r+a,margin:a&&1}};let h,O;r-i<=2*Uo?h=O=n.sliceDoc(i,r):(h=n.sliceDoc(i,i+Uo),O=n.sliceDoc(r-Uo,r));let p=/^\s*/.exec(h)[0].length,g=/\s*$/.exec(O)[0].length,m=O.length-g-t.length;return h.slice(p,p+e.length)==e&&O.slice(m,m+t.length)==t?{open:{pos:i+p+e.length,margin:/\s/.test(h.charAt(p+e.length))?1:0},close:{pos:r-g-t.length,margin:/\s/.test(O.charAt(m-1))?1:0}}:null}function DZ(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),r=t.to<=i.to?i:n.doc.lineAt(t.to),s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function Xv(n,e,t=e.selection.ranges){let i=t.map(s=>ap(e,s.from).block);if(!i.every(s=>s))return null;let r=t.map((s,l)=>zZ(e,i[l],s.from,s.to));if(n!=2&&!r.every(s=>s))return{changes:e.changes(t.map((s,l)=>r[l]?[]:[{from:s.from,insert:i[l].open+" "},{from:s.to,insert:" "+i[l].close}]))};if(n!=1&&r.some(s=>s)){let s=[];for(let l=0,o;lr&&(s==l||l>O.from)){r=O.from;let p=/^\s*/.exec(O.text)[0].length,g=p==O.length,m=O.text.slice(p,p+c.length)==c?p:-1;ps.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:o,token:a,indent:c,empty:h,single:O}of i)(O||!h)&&s.push({from:o.from+c,insert:a+" "});let l=e.changes(s);return{changes:l,selection:e.selection.map(l,1)}}else if(n!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:l,comment:o,token:a}of i)if(o>=0){let c=l.from+o,h=c+a.length;l.text[h-l.from]==" "&&h++,s.push({from:c,to:h})}return{changes:s}}return null}const kd=Ir.define(),qZ=Ir.define(),LZ=ye.define(),Yv=ye.define({combine(n){return yr(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,r)=>e(i,r)||t(i,r)})}}),Uv=pi.define({create(){return mr.empty},update(n,e){let t=e.state.facet(Yv),i=e.annotation(kd);if(i){let a=tn.fromTransaction(e,i.selection),c=i.side,h=c==0?n.undone:n.done;return a?h=Vc(h,h.length,t.minDepth,a):h=zv(h,e.startState.selection),new mr(c==0?i.rest:h,c==0?h:i.rest)}let r=e.annotation(qZ);if((r=="full"||r=="before")&&(n=n.isolate()),e.annotation(hi.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let s=tn.fromTransaction(e),l=e.annotation(hi.time),o=e.annotation(hi.userEvent);return s?n=n.addChanges(s,l,o,t,e):e.selection&&(n=n.addSelection(e.startState.selection,l,o,t.newGroupDelay)),(r=="full"||r=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new mr(n.done.map(tn.fromJSON),n.undone.map(tn.fromJSON))}});function IZ(n={}){return[Uv,Yv.of(n),Oe.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Ev:e.inputType=="historyRedo"?_d:null;return i?(e.preventDefault(),i(t)):!1}})]}function Ou(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let r=t.field(Uv,!1);if(!r)return!1;let s=r.pop(n,t,e);return s?(i(s),!0):!1}}const Ev=Ou(0,!1),_d=Ou(1,!1),NZ=Ou(0,!0),BZ=Ou(1,!0);class tn{constructor(e,t,i,r,s){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new tn(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new tn(e.changes&&ui.fromJSON(e.changes),[],e.mapped&&Sr.fromJSON(e.mapped),e.startSelection&&te.fromJSON(e.startSelection),e.selectionsAfter.map(te.fromJSON))}static fromTransaction(e,t){let i=Xn;for(let r of e.startState.facet(LZ)){let s=r(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new tn(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Xn)}static selection(e){return new tn(void 0,Xn,void 0,void 0,e)}}function Vc(n,e,t,i){let r=e+1>t+20?e-t-1:0,s=n.slice(r,e);return s.push(i),s}function jZ(n,e){let t=[],i=!1;return n.iterChangedRanges((r,s)=>t.push(r,s)),e.iterChangedRanges((r,s,l,o)=>{for(let a=0;a=c&&l<=h&&(i=!0)}}),i}function FZ(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function Mv(n,e){return n.length?e.length?n.concat(e):n:e}const Xn=[],GZ=200;function zv(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-GZ));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),Vc(n,n.length-1,1e9,t.setSelAfter(i)))}else return[tn.selection([e])]}function HZ(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function mO(n,e){if(!n.length)return n;let t=n.length,i=Xn;for(;t;){let r=KZ(n[t-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=n.slice(0,t);return s[t-1]=r,s}else e=r.mapped,t--,i=r.selectionsAfter}return i.length?[tn.selection(i)]:Xn}function KZ(n,e,t){let i=Mv(n.selectionsAfter.length?n.selectionsAfter.map(o=>o.map(e)):Xn,t);if(!n.changes)return tn.selection(i);let r=n.changes.map(e),s=e.mapDesc(n.changes,!0),l=n.mapped?n.mapped.composeDesc(s):s;return new tn(r,Ie.mapEffects(n.effects,e),l,n.startSelection.map(s),i)}const JZ=/^(input\.type|delete)($|\.)/;class mr{constructor(e,t,i=0,r=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new mr(this.done,this.undone):this}addChanges(e,t,i,r,s){let l=this.done,o=l[l.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!i||JZ.test(i))&&(!o.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):du(t,e))}function zi(n){return n.textDirectionAt(n.state.selection.main.head)==Bt.LTR}const Vv=n=>Dv(n,!zi(n)),qv=n=>Dv(n,zi(n));function Lv(n,e){return tr(n,t=>t.empty?n.moveByGroup(t,e):du(t,e))}const tR=n=>Lv(n,!zi(n)),iR=n=>Lv(n,zi(n));function nR(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function pu(n,e,t){let i=ei(n).resolveInner(e.head),r=t?at.closedBy:at.openedBy;for(let a=e.head;;){let c=t?i.childAfter(a):i.childBefore(a);if(!c)break;nR(n,c,r)?i=c:a=t?c.to:c.from}let s=i.type.prop(r),l,o;return s&&(l=t?gr(n,i.from,1):gr(n,i.to,-1))&&l.matched?o=t?l.end.to:l.end.from:o=t?i.to:i.from,te.cursor(o,t?-1:1)}const rR=n=>tr(n,e=>pu(n.state,e,!zi(n))),sR=n=>tr(n,e=>pu(n.state,e,zi(n)));function Iv(n,e){return tr(n,t=>{if(!t.empty)return du(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const Nv=n=>Iv(n,!1),Bv=n=>Iv(n,!0);function jv(n){let e=n.scrollDOM.clientHeightl.empty?n.moveVertically(l,e,t.height):du(l,e));if(r.eq(i.selection))return!1;let s;if(t.selfScroll){let l=n.coordsAtPos(i.selection.main.head),o=n.scrollDOM.getBoundingClientRect(),a=o.top+t.marginTop,c=o.bottom-t.marginBottom;l&&l.top>a&&l.bottomFv(n,!1),Pd=n=>Fv(n,!0);function Ts(n,e,t){let i=n.lineBlockAt(e.head),r=n.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?i.to:i.from)&&(r=n.moveToLineBoundary(e,t,!1)),!t&&r.head==i.from&&i.length){let s=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=te.cursor(i.from+s))}return r}const lR=n=>tr(n,e=>Ts(n,e,!0)),oR=n=>tr(n,e=>Ts(n,e,!1)),aR=n=>tr(n,e=>Ts(n,e,!zi(n))),fR=n=>tr(n,e=>Ts(n,e,zi(n))),cR=n=>tr(n,e=>te.cursor(n.lineBlockAt(e.head).from,1)),uR=n=>tr(n,e=>te.cursor(n.lineBlockAt(e.head).to,-1));function hR(n,e,t){let i=!1,r=eo(n.selection,s=>{let l=gr(n,s.head,-1)||gr(n,s.head,1)||s.head>0&&gr(n,s.head-1,1)||s.headhR(n,e);function En(n,e){let t=eo(n.state.selection,i=>{let r=e(i);return te.range(i.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(wr(n.state,t)),!0)}function Gv(n,e){return En(n,t=>n.moveByChar(t,e))}const Hv=n=>Gv(n,!zi(n)),Kv=n=>Gv(n,zi(n));function Jv(n,e){return En(n,t=>n.moveByGroup(t,e))}const dR=n=>Jv(n,!zi(n)),pR=n=>Jv(n,zi(n)),gR=n=>En(n,e=>pu(n.state,e,!zi(n))),mR=n=>En(n,e=>pu(n.state,e,zi(n)));function ew(n,e){return En(n,t=>n.moveVertically(t,e))}const tw=n=>ew(n,!1),iw=n=>ew(n,!0);function nw(n,e){return En(n,t=>n.moveVertically(t,e,jv(n).height))}const k0=n=>nw(n,!1),_0=n=>nw(n,!0),SR=n=>En(n,e=>Ts(n,e,!0)),bR=n=>En(n,e=>Ts(n,e,!1)),$R=n=>En(n,e=>Ts(n,e,!zi(n))),yR=n=>En(n,e=>Ts(n,e,zi(n))),vR=n=>En(n,e=>te.cursor(n.lineBlockAt(e.head).from)),wR=n=>En(n,e=>te.cursor(n.lineBlockAt(e.head).to)),P0=({state:n,dispatch:e})=>(e(wr(n,{anchor:0})),!0),x0=({state:n,dispatch:e})=>(e(wr(n,{anchor:n.doc.length})),!0),W0=({state:n,dispatch:e})=>(e(wr(n,{anchor:n.selection.main.anchor,head:0})),!0),C0=({state:n,dispatch:e})=>(e(wr(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),QR=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),kR=({state:n,dispatch:e})=>{let t=gu(n).map(({from:i,to:r})=>te.range(i,Math.min(r+1,n.doc.length)));return e(n.update({selection:te.create(t),userEvent:"select"})),!0},_R=({state:n,dispatch:e})=>{let t=eo(n.selection,i=>{let r=ei(n),s=r.resolveStack(i.from,1);if(i.empty){let l=r.resolveStack(i.from,-1);l.node.from>=s.node.from&&l.node.to<=s.node.to&&(s=l)}for(let l=s;l;l=l.next){let{node:o}=l;if((o.from=i.to||o.to>i.to&&o.from<=i.from)&&l.next)return te.range(o.to,o.from)}return i});return t.eq(n.selection)?!1:(e(wr(n,t)),!0)},PR=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=te.create([t.main]):t.main.empty||(i=te.create([te.cursor(t.main.head)])),i?(e(wr(n,i)),!0):!1};function Pa(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,r=i.changeByRange(s=>{let{from:l,to:o}=s;if(l==o){let a=e(s);al&&(t="delete.forward",a=ic(n,a,!0)),l=Math.min(l,a),o=Math.max(o,a)}else l=ic(n,l,!1),o=ic(n,o,!0);return l==o?{range:s}:{changes:{from:l,to:o},range:te.cursor(l,lr(n)))i.between(e,e,(r,s)=>{re&&(e=t?s:r)});return e}const rw=(n,e,t)=>Pa(n,i=>{let r=i.from,{state:s}=n,l=s.doc.lineAt(r),o,a;if(t&&!e&&r>l.from&&rrw(n,!1,!0),sw=n=>rw(n,!0,!1),lw=(n,e)=>Pa(n,t=>{let i=t.head,{state:r}=n,s=r.doc.lineAt(i),l=r.charCategorizer(i);for(let o=null;;){if(i==(e?s.to:s.from)){i==t.head&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let a=Pi(s.text,i-s.from,e)+s.from,c=s.text.slice(Math.min(i,a)-s.from,Math.max(i,a)-s.from),h=l(c);if(o!=null&&h!=o)break;(c!=" "||i!=t.head)&&(o=h),i=a}return i}),ow=n=>lw(n,!1),xR=n=>lw(n,!0),WR=n=>Pa(n,e=>{let t=n.lineBlockAt(e.head).to;return e.headPa(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),TR=n=>Pa(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:St.of(["",""])},range:te.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},RR=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let r=i.from,s=n.doc.lineAt(r),l=r==s.from?r-1:Pi(s.text,r-s.from,!1)+s.from,o=r==s.to?r+1:Pi(s.text,r-s.from,!0)+s.from;return{changes:{from:l,to:o,insert:n.doc.slice(r,o).append(n.doc.slice(l,r))},range:te.cursor(o)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function gu(n){let e=[],t=-1;for(let i of n.selection.ranges){let r=n.doc.lineAt(i.from),s=n.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=n.doc.lineAt(i.to-1)),t>=r.number){let l=e[e.length-1];l.to=s.to,l.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});t=s.number+1}return e}function aw(n,e,t){if(n.readOnly)return!1;let i=[],r=[];for(let s of gu(n)){if(t?s.to==n.doc.length:s.from==0)continue;let l=n.doc.lineAt(t?s.to+1:s.from-1),o=l.length+1;if(t){i.push({from:s.to,to:l.to},{from:s.from,insert:l.text+n.lineBreak});for(let a of s.ranges)r.push(te.range(Math.min(n.doc.length,a.anchor+o),Math.min(n.doc.length,a.head+o)))}else{i.push({from:l.from,to:s.from},{from:s.to,insert:n.lineBreak+l.text});for(let a of s.ranges)r.push(te.range(a.anchor-o,a.head-o))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:te.create(r,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const AR=({state:n,dispatch:e})=>aw(n,e,!1),XR=({state:n,dispatch:e})=>aw(n,e,!0);function fw(n,e,t){if(n.readOnly)return!1;let i=[];for(let r of gu(n))t?i.push({from:r.from,insert:n.doc.slice(r.from,r.to)+n.lineBreak}):i.push({from:r.to,insert:n.lineBreak+n.doc.slice(r.from,r.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const YR=({state:n,dispatch:e})=>fw(n,e,!1),UR=({state:n,dispatch:e})=>fw(n,e,!0),ER=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(gu(e).map(({from:r,to:s})=>(r>0?r--:s{let s;if(n.lineWrapping){let l=n.lineBlockAt(r.head),o=n.coordsAtPos(r.head,r.assoc||1);o&&(s=l.bottom+n.documentTop-o.bottom+n.defaultLineHeight/2)}return n.moveVertically(r,!0,s)}).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function MR(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=ei(n).resolveInner(e),i=t.childBefore(e),r=t.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(at.closedBy))&&s.indexOf(r.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(r.from).from&&!/\S/.test(n.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const T0=cw(!1),zR=cw(!0);function cw(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:s,to:l}=r,o=e.doc.lineAt(s),a=!n&&s==l&&MR(e,s);n&&(s=l=(l<=o.to?o:e.doc.lineAt(l)).to);let c=new uu(e,{simulateBreak:s,simulateDoubleBreak:!!a}),h=sp(c,s);for(h==null&&(h=Gl(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));lo.from&&s{let r=[];for(let l=i.from;l<=i.to;){let o=n.doc.lineAt(l);o.number>t&&(i.empty||i.to>o.from)&&(e(o,r,i),t=o.number),l=o.to+1}let s=n.changes(r);return{changes:r,range:te.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const DR=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new uu(n,{overrideIndentation:s=>{let l=t[s];return l??-1}}),r=fp(n,(s,l,o)=>{let a=sp(i,s.from);if(a==null)return;/\S/.test(s.text)||(a=0);let c=/^\s*/.exec(s.text)[0],h=pa(n,a);(c!=h||o.fromn.readOnly?!1:(e(n.update(fp(n,(t,i)=>{i.push({from:t.from,insert:n.facet(cu)})}),{userEvent:"input.indent"})),!0),hw=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(fp(n,(t,i)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let s=Gl(r,n.tabSize),l=0,o=pa(n,Math.max(0,s-Mc(n)));for(;l(n.setTabFocusMode(),!0),qR=[{key:"Ctrl-b",run:Vv,shift:Hv,preventDefault:!0},{key:"Ctrl-f",run:qv,shift:Kv},{key:"Ctrl-p",run:Nv,shift:tw},{key:"Ctrl-n",run:Bv,shift:iw},{key:"Ctrl-a",run:cR,shift:vR},{key:"Ctrl-e",run:uR,shift:wR},{key:"Ctrl-d",run:sw},{key:"Ctrl-h",run:xd},{key:"Ctrl-k",run:WR},{key:"Ctrl-Alt-h",run:ow},{key:"Ctrl-o",run:ZR},{key:"Ctrl-t",run:RR},{key:"Ctrl-v",run:Pd}],LR=[{key:"ArrowLeft",run:Vv,shift:Hv,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:tR,shift:dR,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:aR,shift:$R,preventDefault:!0},{key:"ArrowRight",run:qv,shift:Kv,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:iR,shift:pR,preventDefault:!0},{mac:"Cmd-ArrowRight",run:fR,shift:yR,preventDefault:!0},{key:"ArrowUp",run:Nv,shift:tw,preventDefault:!0},{mac:"Cmd-ArrowUp",run:P0,shift:W0},{mac:"Ctrl-ArrowUp",run:Q0,shift:k0},{key:"ArrowDown",run:Bv,shift:iw,preventDefault:!0},{mac:"Cmd-ArrowDown",run:x0,shift:C0},{mac:"Ctrl-ArrowDown",run:Pd,shift:_0},{key:"PageUp",run:Q0,shift:k0},{key:"PageDown",run:Pd,shift:_0},{key:"Home",run:oR,shift:bR,preventDefault:!0},{key:"Mod-Home",run:P0,shift:W0},{key:"End",run:lR,shift:SR,preventDefault:!0},{key:"Mod-End",run:x0,shift:C0},{key:"Enter",run:T0,shift:T0},{key:"Mod-a",run:QR},{key:"Backspace",run:xd,shift:xd},{key:"Delete",run:sw},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ow},{key:"Mod-Delete",mac:"Alt-Delete",run:xR},{mac:"Mod-Backspace",run:CR},{mac:"Mod-Delete",run:TR}].concat(qR.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),IR=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:rR,shift:gR},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:sR,shift:mR},{key:"Alt-ArrowUp",run:AR},{key:"Shift-Alt-ArrowUp",run:YR},{key:"Alt-ArrowDown",run:XR},{key:"Shift-Alt-ArrowDown",run:UR},{key:"Escape",run:PR},{key:"Mod-Enter",run:zR},{key:"Alt-l",mac:"Ctrl-l",run:kR},{key:"Mod-i",run:_R,preventDefault:!0},{key:"Mod-[",run:hw},{key:"Mod-]",run:uw},{key:"Mod-Alt-\\",run:DR},{key:"Shift-Mod-k",run:ER},{key:"Shift-Mod-\\",run:OR},{key:"Mod-/",run:YZ},{key:"Alt-A",run:EZ},{key:"Ctrl-m",mac:"Shift-Alt-m",run:VR}].concat(LR);function Ut(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i];typeof r=="string"?n.setAttribute(i,r):r!=null&&(n[i]=r)}e++}for(;en.normalize("NFKD"):n=>n;class Il{constructor(e,t,i=0,r=e.length,s,l){this.test=l,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,r),this.bufferStart=i,this.normalize=s?o=>s(Z0(o)):Z0,this.query=this.normalize(t)}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 Qi(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Ed(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Rn(e);let r=this.normalize(t);for(let s=0,l=i;;s++){let o=r.charCodeAt(s),a=this.match(o,l);if(s==r.length-1){if(a)return this.value=a,this;break}l==i&&sthis.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 e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,r=i+t[0].length;if(this.matchPos=qc(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,r,t)))return this.value={from:i,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||r.to<=t){let o=new Ul(t,e.sliceString(t,i));return SO.set(e,o),o}if(r.from==t&&r.to==i)return r;let{text:s,from:l}=r;return l>t&&(s=e.sliceString(t,l)+s,l=t),r.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,r=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,t)))return this.value={from:i,to:r,match:t},this.matchPos=qc(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ul.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(pw.prototype[Symbol.iterator]=gw.prototype[Symbol.iterator]=function(){return this});function NR(n){try{return new RegExp(n,cp),!0}catch{return!1}}function qc(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function Wd(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=Ut("input",{class:"cm-textfield",name:"line",value:e}),i=Ut("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:Lc.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),r())},onsubmit:s=>{s.preventDefault(),r()}},Ut("label",n.state.phrase("Go to line"),": ",t)," ",Ut("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function r(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!s)return;let{state:l}=n,o=l.doc.lineAt(l.selection.main.head),[,a,c,h,O]=s,p=h?+h.slice(1):0,g=c?+c:o.number;if(c&&O){let y=g/100;a&&(y=y*(a=="-"?-1:1)+o.number/l.doc.lines),g=Math.round(l.doc.lines*y)}else c&&a&&(g=g*(a=="-"?-1:1)+o.number);let m=l.doc.line(Math.max(1,Math.min(l.doc.lines,g))),$=te.cursor(m.from+Math.max(0,Math.min(p,m.length)));n.dispatch({effects:[Lc.of(!1),Oe.scrollIntoView($.from,{y:"center"})],selection:$}),n.focus()}return{dom:i}}const Lc=Ie.define(),R0=pi.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(Lc)&&(n=t.value);return n},provide:n=>ua.from(n,e=>e?Wd:null)}),BR=n=>{let e=ca(n,Wd);if(!e){let t=[Lc.of(!0)];n.state.field(R0,!1)==null&&t.push(Ie.appendConfig.of([R0,jR])),n.dispatch({effects:t}),e=ca(n,Wd)}return e&&e.dom.querySelector("input").select(),!0},jR=Oe.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),FR={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},GR=ye.define({combine(n){return yr(n,FR,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function HR(n){return[iA,tA]}const KR=Ze.mark({class:"cm-selectionMatch"}),JR=Ze.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function A0(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=It.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=It.Word)}function eA(n,e,t,i){return n(e.sliceDoc(t,t+1))==It.Word&&n(e.sliceDoc(i-1,i))==It.Word}const tA=oi.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(GR),{state:t}=n,i=t.selection;if(i.ranges.length>1)return Ze.none;let r=i.main,s,l=null;if(r.empty){if(!e.highlightWordAroundCursor)return Ze.none;let a=t.wordAt(r.head);if(!a)return Ze.none;l=t.charCategorizer(r.head),s=t.sliceDoc(a.from,a.to)}else{let a=r.to-r.from;if(a200)return Ze.none;if(e.wholeWords){if(s=t.sliceDoc(r.from,r.to),l=t.charCategorizer(r.head),!(A0(l,t,r.from,r.to)&&eA(l,t,r.from,r.to)))return Ze.none}else if(s=t.sliceDoc(r.from,r.to).trim(),!s)return Ze.none}let o=[];for(let a of n.visibleRanges){let c=new Il(t.doc,s,a.from,a.to);for(;!c.next().done;){let{from:h,to:O}=c.value;if((!l||A0(l,t,h,O))&&(r.empty&&h<=r.from&&O>=r.to?o.push(JR.range(h,O)):(h>=r.to||O<=r.from)&&o.push(KR.range(h,O)),o.length>e.maxMatches))return Ze.none}}return Ze.set(o)}},{decorations:n=>n.decorations}),iA=Oe.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),nA=({state:n,dispatch:e})=>{let{selection:t}=n,i=te.create(t.ranges.map(r=>n.wordAt(r.head)||te.cursor(r.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function rA(n,e){let{main:t,ranges:i}=n.selection,r=n.wordAt(t.head),s=r&&r.from==t.from&&r.to==t.to;for(let l=!1,o=new Il(n.doc,e,i[i.length-1].to);;)if(o.next(),o.done){if(l)return null;o=new Il(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),l=!0}else{if(l&&i.some(a=>a.from==o.value.from))continue;if(s){let a=n.wordAt(o.value.from);if(!a||a.from!=o.value.from||a.to!=o.value.to)continue}return o.value}}const sA=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(s=>s.from===s.to))return nA({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(s=>n.sliceDoc(s.from,s.to)!=i))return!1;let r=rA(n,i);return r?(e(n.update({selection:n.selection.addRange(te.range(r.from,r.to),!1),effects:Oe.scrollIntoView(r.to)})),!0):!1},to=ye.define({combine(n){return yr(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new mA(e),scrollToMatch:e=>Oe.scrollIntoView(e)})}});class mw{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||NR(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` +`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new fA(this):new oA(this)}getCursor(e,t=0,i){let r=e.doc?e:Ot.create({doc:e});return i==null&&(i=r.doc.length),this.regexp?Ql(this,r,t,i):wl(this,r,t,i)}}class Sw{constructor(e){this.spec=e}}function wl(n,e,t,i){return new Il(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:r=>r.toLowerCase(),n.wholeWord?lA(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function lA(n,e){return(t,i,r,s)=>((s>t||s+r.length=t)return null;r.push(i.value)}return r}highlight(e,t,i,r){let s=wl(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function Ql(n,e,t,i){return new pw(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?aA(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function Ic(n,e){return n.slice(Pi(n,e,!1),e)}function Nc(n,e){return n.slice(e,Pi(n,e))}function aA(n){return(e,t,i)=>!i[0].length||(n(Ic(i.input,i.index))!=It.Word||n(Nc(i.input,i.index))!=It.Word)&&(n(Nc(i.input,i.index+i[0].length))!=It.Word||n(Ic(i.input,i.index+i[0].length))!=It.Word)}class fA extends Sw{nextMatch(e,t,i){let r=Ql(this.spec,e,i,e.doc.length).next();return r.done&&(r=Ql(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,i){for(let r=1;;r++){let s=Math.max(t,i-r*1e4),l=Ql(this.spec,e,s,i),o=null;for(;!l.next().done;)o=l.value;if(o&&(s==t||o.from>s+10))return o;if(s==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i=t)return null;r.push(i.value)}return r}highlight(e,t,i,r){let s=Ql(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const ga=Ie.define(),up=Ie.define(),$s=pi.define({create(n){return new bO(Cd(n).create(),null)},update(n,e){for(let t of e.effects)t.is(ga)?n=new bO(t.value.create(),n.panel):t.is(up)&&(n=new bO(n.query,t.value?hp:null));return n},provide:n=>ua.from(n,e=>e.panel)});class bO{constructor(e,t){this.query=e,this.panel=t}}const cA=Ze.mark({class:"cm-searchMatch"}),uA=Ze.mark({class:"cm-searchMatch cm-searchMatch-selected"}),hA=oi.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field($s))}update(n){let e=n.state.field($s);(e!=n.startState.field($s)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Ze.none;let{view:t}=this,i=new vs;for(let r=0,s=t.visibleRanges,l=s.length;rs[r+1].from-2*250;)a=s[++r].to;n.highlight(t.state,o,a,(c,h)=>{let O=t.state.selection.ranges.some(p=>p.from==c&&p.to==h);i.add(c,h,O?uA:cA)})}return i.finish()}},{decorations:n=>n.decorations});function xa(n){return e=>{let t=e.state.field($s,!1);return t&&t.query.spec.valid?n(e,t):yw(e)}}const Bc=xa((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let r=te.single(i.from,i.to),s=n.state.facet(to);return n.dispatch({selection:r,effects:[Op(n,i),s.scrollToMatch(r.main,n)],userEvent:"select.search"}),$w(n),!0}),jc=xa((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,r=e.prevMatch(t,i,i);if(!r)return!1;let s=te.single(r.from,r.to),l=n.state.facet(to);return n.dispatch({selection:s,effects:[Op(n,r),l.scrollToMatch(s.main,n)],userEvent:"select.search"}),$w(n),!0}),OA=xa((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:te.create(t.map(i=>te.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),dA=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:r}=t.main,s=[],l=0;for(let o=new Il(n.doc,n.sliceDoc(i,r));!o.next().done;){if(s.length>1e3)return!1;o.value.from==i&&(l=s.length),s.push(te.range(o.value.from,o.value.to))}return e(n.update({selection:te.create(s,l),userEvent:"select.search.matches"})),!0},X0=xa((n,{query:e})=>{let{state:t}=n,{from:i,to:r}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,i,i);if(!s)return!1;let l=[],o,a,c=[];if(s.from==i&&s.to==r&&(a=t.toText(e.getReplacement(s)),l.push({from:s.from,to:s.to,insert:a}),s=e.nextMatch(t,s.from,s.to),c.push(Oe.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),s){let h=l.length==0||l[0].from>=s.to?0:s.to-s.from-a.length;o=te.single(s.from-h,s.to-h),c.push(Op(n,s)),c.push(t.facet(to).scrollToMatch(o.main,n))}return n.dispatch({changes:l,selection:o,effects:c,userEvent:"input.replace"}),!0}),pA=xa((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(r=>{let{from:s,to:l}=r;return{from:s,to:l,insert:e.getReplacement(r)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:Oe.announce.of(i),userEvent:"input.replace.all"}),!0});function hp(n){return n.state.facet(to).createPanel(n)}function Cd(n,e){var t,i,r,s,l;let o=n.selection.main,a=o.empty||o.to>o.from+100?"":n.sliceDoc(o.from,o.to);if(e&&!a)return e;let c=n.facet(to);return new mw({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:c.caseSensitive,literal:(r=e==null?void 0:e.literal)!==null&&r!==void 0?r:c.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:c.regexp,wholeWord:(l=e==null?void 0:e.wholeWord)!==null&&l!==void 0?l:c.wholeWord})}function bw(n){let e=ca(n,hp);return e&&e.dom.querySelector("[main-field]")}function $w(n){let e=bw(n);e&&e==n.root.activeElement&&e.select()}const yw=n=>{let e=n.state.field($s,!1);if(e&&e.panel){let t=bw(n);if(t&&t!=n.root.activeElement){let i=Cd(n.state,e.query.spec);i.valid&&n.dispatch({effects:ga.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[up.of(!0),e?ga.of(Cd(n.state,e.query.spec)):Ie.appendConfig.of(bA)]});return!0},vw=n=>{let e=n.state.field($s,!1);if(!e||!e.panel)return!1;let t=ca(n,hp);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:up.of(!1)}),!0},gA=[{key:"Mod-f",run:yw,scope:"editor search-panel"},{key:"F3",run:Bc,shift:jc,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Bc,shift:jc,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:vw,scope:"editor search-panel"},{key:"Mod-Shift-l",run:dA},{key:"Alt-g",run:BR},{key:"Mod-d",run:sA,preventDefault:!0}];class mA{constructor(e){this.view=e;let t=this.query=e.state.field($s).query.spec;this.commit=this.commit.bind(this),this.searchField=Ut("input",{value:t.search,placeholder:hn(e,"Find"),"aria-label":hn(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ut("input",{value:t.replace,placeholder:hn(e,"Replace"),"aria-label":hn(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ut("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Ut("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Ut("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(r,s,l){return Ut("button",{class:"cm-button",name:r,onclick:s,type:"button"},l)}this.dom=Ut("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>Bc(e),[hn(e,"next")]),i("prev",()=>jc(e),[hn(e,"previous")]),i("select",()=>OA(e),[hn(e,"all")]),Ut("label",null,[this.caseField,hn(e,"match case")]),Ut("label",null,[this.reField,hn(e,"regexp")]),Ut("label",null,[this.wordField,hn(e,"by word")]),...e.state.readOnly?[]:[Ut("br"),this.replaceField,i("replace",()=>X0(e),[hn(e,"replace")]),i("replaceAll",()=>pA(e),[hn(e,"replace all")])],Ut("button",{name:"close",onclick:()=>vw(e),"aria-label":hn(e,"close"),type:"button"},["×"])])}commit(){let e=new mw({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:ga.of(e)}))}keydown(e){P5(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?jc:Bc)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),X0(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(ga)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(to).top}}function hn(n,e){return n.state.phrase(e)}const nc=30,rc=/[\s\.,:;?!]/;function Op(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),r=n.state.doc.lineAt(t).to,s=Math.max(i.from,e-nc),l=Math.min(r,t+nc),o=n.state.sliceDoc(s,l);if(s!=i.from){for(let a=0;ao.length-nc;a--)if(!rc.test(o[a-1])&&rc.test(o[a])){o=o.slice(0,a);break}}return Oe.announce.of(`${n.state.phrase("current match")}. ${o} ${n.state.phrase("on line")} ${i.number}.`)}const SA=Oe.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"}}),bA=[$s,il.low(hA),SA];class ww{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=ei(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),r=t.text.slice(i-t.from,this.pos-t.from),s=r.search(kw(e,!1));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function Y0(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function $A(n){let e=Object.create(null),t=Object.create(null);for(let{label:r}of n){e[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[t,i]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:$A(e);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:t}:null}}function yA(n,e){return t=>{for(let i=ei(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class U0{constructor(e,t,i,r){this.completion=e,this.source=t,this.match=i,this.score=r}}function ys(n){return n.selection.main.from}function kw(n,e){var t;let{source:i}=n,r=e&&i[0]!="^",s=i[i.length-1]!="$";return!r&&!s?n:new RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const _w=Ir.define();function vA(n,e,t,i){let{main:r}=n.selection,s=t-r.from,l=i-r.from;return Object.assign(Object.assign({},n.changeByRange(o=>o!=r&&t!=i&&n.sliceDoc(o.from+s,o.from+l)!=n.sliceDoc(t,i)?{range:o}:{changes:{from:o.from+s,to:i==r.from?o.to:o.from+l,insert:e},range:te.cursor(o.from+s+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const E0=new WeakMap;function wA(n){if(!Array.isArray(n))return n;let e=E0.get(n);return e||E0.set(n,e=Qw(n)),e}const dp=Ie.define(),ma=Ie.define();class QA{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&C<=57||C>=97&&C<=122?2:C>=65&&C<=90?1:0:(U=Ed(C))!=U.toLowerCase()?1:U!=U.toUpperCase()?2:0;(!W||D==1&&y||A==0&&D!=0)&&(t[O]==C||i[O]==C&&(p=!0)?l[O++]=W:l.length&&(k=!1)),A=D,W+=Rn(C)}return O==a&&l[0]==0&&k?this.result(-100+(p?-200:0),l,e):g==a&&m==0?this.ret(-200-e.length+($==e.length?0:-100),[0,$]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):g==a?this.ret(-900-e.length,[m,$]):O==a?this.result(-100+(p?-200:0)+-700+(k?0:-1100),l,e):t.length==2?!1:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,i){let r=[],s=0;for(let l of t){let o=l+(this.astral?Rn(Qi(i,l)):1);s&&r[s-1]==l?r[s-1]=o:(r[s++]=l,r[s++]=o)}return this.ret(e-i.length,r)}}const Ei=ye.define({combine(n){return yr(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:kA,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>M0(e(i),t(i)),optionClass:(e,t)=>i=>M0(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})}});function M0(n,e){return n?e?n+" "+e:n:e}function kA(n,e,t,i,r,s){let l=n.textDirection==Bt.RTL,o=l,a=!1,c="top",h,O,p=e.left-r.left,g=r.right-e.right,m=i.right-i.left,$=i.bottom-i.top;if(o&&p=$||W>e.top?h=t.bottom-e.top:(c="bottom",h=e.bottom-t.top)}let y=(e.bottom-e.top)/s.offsetHeight,k=(e.right-e.left)/s.offsetWidth;return{style:`${c}: ${h/y}px; max-width: ${O/k}px`,class:"cm-completionInfo-"+(a?l?"left-narrow":"right-narrow":o?"left":"right")}}function _A(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,r,s){let l=document.createElement("span");l.className="cm-completionLabel";let o=t.displayLabel||t.label,a=0;for(let c=0;ca&&l.appendChild(document.createTextNode(o.slice(a,h)));let p=l.appendChild(document.createElement("span"));p.appendChild(document.createTextNode(o.slice(h,O))),p.className="cm-completionMatchedText",a=O}return at.position-i.position).map(t=>t.render)}function $O(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let r=Math.floor(e/t);return{from:r*t,to:(r+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class PA{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:s,selected:l}=r.open,o=e.state.facet(Ei);this.optionContent=_A(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=$O(s.length,l,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:c}=e.state.field(t).open;for(let h=a.target,O;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(O=/-(\d+)$/.exec(h.id))&&+O[1]{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(Ei).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:ma.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=r){let{options:s,selected:l,disabled:o}=i.open;(!r.open||r.open.options!=s)&&(this.range=$O(s.length,l,e.state.facet(Ei).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),o!=((t=r.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=$O(t.options.length,t.selected,this.view.state.facet(Ei).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:r}=i;if(!r)return;let s=typeof r=="string"?document.createTextNode(r):r(i);if(!s)return;"then"in s?s.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,i)}).catch(l=>en(this.view.state,l,"completion info")):this.addInfoPane(s,i)}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:s}=e;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&WA(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.space;if(!s){let l=this.dom.ownerDocument.defaultView||window;s={left:0,top:0,right:l.innerWidth,bottom:l.innerHeight}}return r.top>Math.min(s.bottom,t.bottom)-10||r.bottomi.from||i.from==0))if(s=p,typeof c!="string"&&c.header)r.appendChild(c.header(c));else{let g=r.appendChild(document.createElement("completion-section"));g.textContent=p}}const h=r.appendChild(document.createElement("li"));h.id=t+"-"+l,h.setAttribute("role","option");let O=this.optionClass(o);O&&(h.className=O);for(let p of this.optionContent){let g=p(o,this.view.state,this.view,a);g&&h.appendChild(g)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.tonew PA(t,n,e)}function WA(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),r=t.height/n.offsetHeight;i.topt.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/r)}function z0(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function CA(n,e){let t=[],i=null,r=a=>{t.push(a);let{section:c}=a.completion;if(c){i||(i=[]);let h=typeof c=="string"?c:c.name;i.some(O=>O.name==h)||i.push(typeof c=="string"?{name:h}:c)}};for(let a of n)if(a.hasResult()){let c=a.result.getMatch;if(a.result.filter===!1)for(let h of a.result.options)r(new U0(h,a.source,c?c(h):[],1e9-t.length));else{let h=new QA(e.sliceDoc(a.from,a.to));for(let O of a.result.options)if(h.match(O.label)){let p=O.displayLabel?c?c(O,h.matched):[]:h.matched;r(new U0(O,a.source,p,h.score+(O.boost||0)))}}}if(i){let a=Object.create(null),c=0,h=(O,p)=>{var g,m;return((g=O.rank)!==null&&g!==void 0?g:1e9)-((m=p.rank)!==null&&m!==void 0?m:1e9)||(O.nameh.score-c.score||o(c.completion,h.completion))){let c=a.completion;!l||l.label!=c.label||l.detail!=c.detail||l.type!=null&&c.type!=null&&l.type!=c.type||l.apply!=c.apply||l.boost!=c.boost?s.push(a):z0(a.completion)>z0(l)&&(s[s.length-1]=a),l=a.completion}return s}class xl{constructor(e,t,i,r,s,l){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=l}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new xl(this.options,D0(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,r,s){let l=CA(e,t);if(!l.length)return r&&e.some(a=>a.state==1)?new xl(r.options,r.attrs,r.tooltip,r.timestamp,r.selected,!0):null;let o=t.facet(Ei).selectOnOpen?0:-1;if(r&&r.selected!=o&&r.selected!=-1){let a=r.options[r.selected].completion;for(let c=0;cc.hasResult()?Math.min(a,c.from):a,1e8),create:XA,above:s.aboveCursor},r?r.timestamp:Date.now(),o,!1)}map(e){return new xl(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Fc{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new Fc(RA,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(Ei),s=(i.override||t.languageDataAt("autocomplete",ys(t)).map(wA)).map(o=>(this.active.find(c=>c.source==o)||new Ji(o,this.active.some(c=>c.state!=0)?1:0)).update(e,i));s.length==this.active.length&&s.every((o,a)=>o==this.active[a])&&(s=this.active);let l=this.open;l&&e.docChanged&&(l=l.map(e.changes)),e.selection||s.some(o=>o.hasResult()&&e.changes.touchesRange(o.from,o.to))||!TA(s,this.active)?l=xl.build(s,t,this.id,l,i):l&&l.disabled&&!s.some(o=>o.state==1)&&(l=null),!l&&s.every(o=>o.state!=1)&&s.some(o=>o.hasResult())&&(s=s.map(o=>o.hasResult()?new Ji(o.source,0):o));for(let o of e.effects)o.is(xw)&&(l=l&&l.setSelected(o.value,this.id));return s==this.active&&l==this.open?this:new Fc(s,this.id,l)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:ZA}}function TA(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const RA=[];function Td(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class Ji{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=Td(e),r=this;i?r=r.handleUserEvent(e,i,t):e.docChanged?r=r.handleChange(e):e.selection&&r.state!=0&&(r=new Ji(r.source,0));for(let s of e.effects)if(s.is(dp))r=new Ji(r.source,1,s.value?ys(e.state):-1);else if(s.is(ma))r=new Ji(r.source,0);else if(s.is(Pw))for(let l of s.value)l.source==r.source&&(r=l);return r}handleUserEvent(e,t,i){return t=="delete"||!i.activateOnTyping?this.map(e.changes):new Ji(this.source,1)}handleChange(e){return e.changes.touchesRange(ys(e.startState))?new Ji(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Ji(this.source,this.state,e.mapPos(this.explicitPos))}}class El extends Ji{constructor(e,t,i,r,s){super(e,2,t),this.result=i,this.from=r,this.to=s}hasResult(){return!0}handleUserEvent(e,t,i){var r;let s=e.changes.mapPos(this.from),l=e.changes.mapPos(this.to,1),o=ys(e.state);if((this.explicitPos<0?o<=s:ol||t=="delete"&&ys(e.startState)==this.from)return new Ji(this.source,t=="input"&&i.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),c;return AA(this.result.validFor,e.state,s,l)?new El(this.source,a,this.result,s,l):this.result.update&&(c=this.result.update(this.result,s,l,new ww(e.state,o,a>=0)))?new El(this.source,a,c,c.from,(r=c.to)!==null&&r!==void 0?r:ys(e.state)):new Ji(this.source,1,a)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Ji(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new El(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function AA(n,e,t,i){if(!n)return!1;let r=e.sliceDoc(t,i);return typeof n=="function"?n(r,t,i,e):kw(n,!0).test(r)}const Pw=Ie.define({map(n,e){return n.map(t=>t.map(e))}}),xw=Ie.define(),pn=pi.define({create(){return Fc.start()},update(n,e){return n.update(e)},provide:n=>[Kd.from(n,e=>e.tooltip),Oe.contentAttributes.from(n,e=>e.attrs)]});function Ww(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(pn).active.find(r=>r.source==e.source);return i instanceof El?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},vA(n.state,t,i.from,i.to)),{annotations:_w.of(e.completion)})):t(n,e.completion,i.from,i.to),!0):!1}const XA=xA(pn,Ww);function sc(n,e="option"){return t=>{let i=t.state.field(pn,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+r*(n?1:-1):n?0:l-1;return o<0?o=e=="page"?0:l-1:o>=l&&(o=e=="page"?l-1:0),t.dispatch({effects:xw.of(o)}),!0}}const YA=n=>{let e=n.state.field(pn,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(pn,!1)?(n.dispatch({effects:dp.of(!0)}),!0):!1,EA=n=>{let e=n.state.field(pn,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:ma.of(null)}),!0)};class MA{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const zA=50,DA=1e3,VA=oi.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of n.state.field(pn).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(pn);if(!n.selectionSet&&!n.docChanged&&n.startState.field(pn)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!Td(i));for(let i=0;izA&&Date.now()-r.time>DA){for(let s of r.context.abortListeners)try{s()}catch(l){en(this.view.state,l)}r.context.abortListeners=null,this.running.splice(i--,1)}else r.updates.push(...n.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(r=>r.active.source==i.source))?setTimeout(()=>this.startUpdate(),50):-1,this.composing!=0)for(let i of n.transactions)Td(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:n}=this.view,e=n.field(pn);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=ys(e),i=new ww(e,t,n.explicitPos==t),r=new MA(n,i);this.running.push(r),Promise.resolve(n.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:ma.of(null)}),en(this.view.state,s)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ei).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Ei);for(let i=0;il.source==r.active.source);if(s&&s.state==1)if(r.done==null){let l=new Ji(r.active.source,0);for(let o of r.updates)l=l.update(o,t);l.state!=1&&e.push(l)}else this.startQuery(s)}e.length&&this.view.dispatch({effects:Pw.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(pn,!1);if(e&&e.tooltip&&this.view.state.facet(Ei).closeOnBlur){let t=e.open&&jy(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&this.view.dispatch({effects:ma.of(null)})}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:dp.of(!1)}),20),this.composing=0}}}),Cw=Oe.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"},".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 qA{constructor(e,t,i,r){this.field=e,this.line=t,this.from=i,this.to=r}}class pp{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,_i.TrackDel),i=e.mapPos(this.to,1,_i.TrackDel);return t==null||i==null?null:new pp(this.field,t,i)}}class gp{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],r=[t],s=e.doc.lineAt(t),l=/^\s*/.exec(s.text)[0];for(let a of this.lines){if(i.length){let c=l,h=/^\t*/.exec(a)[0].length;for(let O=0;Onew pp(a.field,r[a.line]+a.from,r[a.line]+a.to));return{text:i,ranges:o}}static parse(e){let t=[],i=[],r=[],s;for(let l of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(l);){let o=s[1]?+s[1]:null,a=s[2]||s[3]||"",c=-1;for(let h=0;h=c&&O.field++}r.push(new qA(c,i.length,s.index,s.index+a.length)),l=l.slice(0,s.index)+a+l.slice(s.index+s[0].length)}for(let o;o=/\\([{}])/.exec(l);){l=l.slice(0,o.index)+o[1]+l.slice(o.index+o[0].length);for(let a of r)a.line==i.length&&a.from>o.index&&(a.from--,a.to--)}i.push(l)}return new gp(i,r)}}let LA=Ze.widget({widget:new class extends Nr{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),IA=Ze.mark({class:"cm-snippetField"});class io{constructor(e,t){this.ranges=e,this.active=t,this.deco=Ze.set(e.map(i=>(i.from==i.to?LA:IA).range(i.from,i.to)))}map(e){let t=[];for(let i of this.ranges){let r=i.map(e);if(!r)return null;t.push(r)}return new io(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const Wa=Ie.define({map(n,e){return n&&n.map(e)}}),NA=Ie.define(),Sa=pi.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(Wa))return t.value;if(t.is(NA)&&n)return new io(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>Oe.decorations.from(n,e=>e?e.deco:Ze.none)});function mp(n,e){return te.create(n.filter(t=>t.field==e).map(t=>te.range(t.from,t.to)))}function BA(n){let e=gp.parse(n);return(t,i,r,s)=>{let{text:l,ranges:o}=e.instantiate(t.state,r),a={changes:{from:r,to:s,insert:St.of(l)},scrollIntoView:!0,annotations:i?_w.of(i):void 0};if(o.length&&(a.selection=mp(o,0)),o.length>1){let c=new io(o,0),h=a.effects=[Wa.of(c)];t.state.field(Sa,!1)===void 0&&h.push(Ie.appendConfig.of([Sa,KA,JA,Cw]))}t.dispatch(t.state.update(a))}}function Tw(n){return({state:e,dispatch:t})=>{let i=e.field(Sa,!1);if(!i||n<0&&i.active==0)return!1;let r=i.active+n,s=n>0&&!i.ranges.some(l=>l.field==r+n);return t(e.update({selection:mp(i.ranges,r),effects:Wa.of(s?null:new io(i.ranges,r)),scrollIntoView:!0})),!0}}const jA=({state:n,dispatch:e})=>n.field(Sa,!1)?(e(n.update({effects:Wa.of(null)})),!0):!1,FA=Tw(1),GA=Tw(-1),HA=[{key:"Tab",run:FA,shift:GA},{key:"Escape",run:jA}],V0=ye.define({combine(n){return n.length?n[0]:HA}}),KA=il.highest(va.compute([V0],n=>n.facet(V0)));function Hi(n,e){return Object.assign(Object.assign({},e),{apply:BA(n)})}const JA=Oe.domEventHandlers({mousedown(n,e){let t=e.state.field(Sa,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let r=t.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==t.active?!1:(e.dispatch({selection:mp(t.ranges,r.field),effects:Wa.of(t.ranges.some(s=>s.field>r.field)?new io(t.ranges,r.field):null),scrollIntoView:!0}),!0)}}),ba={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Fs=Ie.define({map(n,e){let t=e.mapPos(n,-1,_i.TrackAfter);return t??void 0}}),Sp=new class extends Hs{};Sp.startSide=1;Sp.endSide=-1;const Zw=pi.define({create(){return mt.empty},update(n,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:i=>i>=t.from&&i<=t.to})}n=n.map(e.changes);for(let t of e.effects)t.is(Fs)&&(n=n.update({add:[Sp.range(t.value,t.value+1)]}));return n}});function eX(){return[iX,Zw]}const yO="()[]{}<>";function Rw(n){for(let e=0;e{if((tX?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let r=n.state.selection.main;if(i.length>2||i.length==2&&Rn(Qi(i,0))==1||e!=r.from||t!=r.to)return!1;let s=sX(n.state,i);return s?(n.dispatch(s),!0):!1}),nX=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=Aw(n,n.selection.main.head).brackets||ba.brackets,r=null,s=n.changeByRange(l=>{if(l.empty){let o=lX(n.doc,l.head);for(let a of i)if(a==o&&mu(n.doc,l.head)==Rw(Qi(a,0)))return{changes:{from:l.head-a.length,to:l.head+a.length},range:te.cursor(l.head-a.length)}}return{range:r=l}});return r||e(n.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},rX=[{key:"Backspace",run:nX}];function sX(n,e){let t=Aw(n,n.selection.main.head),i=t.brackets||ba.brackets;for(let r of i){let s=Rw(Qi(r,0));if(e==r)return s==r?fX(n,r,i.indexOf(r+r+r)>-1,t):oX(n,r,s,t.before||ba.before);if(e==s&&Xw(n,n.selection.main.from))return aX(n,r,s)}return null}function Xw(n,e){let t=!1;return n.field(Zw).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function mu(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Rn(Qi(t,0)))}function lX(n,e){let t=n.sliceString(e-2,e);return Rn(Qi(t,0))==t.length?t:t.slice(1)}function oX(n,e,t,i){let r=null,s=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:t,from:l.to}],effects:Fs.of(l.to+e.length),range:te.range(l.anchor+e.length,l.head+e.length)};let o=mu(n.doc,l.head);return!o||/\s/.test(o)||i.indexOf(o)>-1?{changes:{insert:e+t,from:l.head},effects:Fs.of(l.head+e.length),range:te.cursor(l.head+e.length)}:{range:r=l}});return r?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function aX(n,e,t){let i=null,r=n.changeByRange(s=>s.empty&&mu(n.doc,s.head)==t?{changes:{from:s.head,to:s.head+t.length,insert:t},range:te.cursor(s.head+t.length)}:i={range:s});return i?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function fX(n,e,t,i){let r=i.stringPrefixes||ba.stringPrefixes,s=null,l=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:e,from:o.to}],effects:Fs.of(o.to+e.length),range:te.range(o.anchor+e.length,o.head+e.length)};let a=o.head,c=mu(n.doc,a),h;if(c==e){if(q0(n,a))return{changes:{insert:e+e,from:a},effects:Fs.of(a+e.length),range:te.cursor(a+e.length)};if(Xw(n,a)){let p=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+p.length,insert:p},range:te.cursor(a+p.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(h=L0(n,a-2*e.length,r))>-1&&q0(n,h))return{changes:{insert:e+e+e+e,from:a},effects:Fs.of(a+e.length),range:te.cursor(a+e.length)};if(n.charCategorizer(a)(c)!=It.Word&&L0(n,a,r)>-1&&!cX(n,a,e,r))return{changes:{insert:e+e,from:a},effects:Fs.of(a+e.length),range:te.cursor(a+e.length)}}return{range:s=o}});return s?null:n.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function q0(n,e){let t=ei(n).resolveInner(e+1);return t.parent&&t.from==e}function cX(n,e,t,i){let r=ei(n).resolveInner(e,-1),s=i.reduce((l,o)=>Math.max(l,o.length),0);for(let l=0;l<5;l++){let o=n.sliceDoc(r.from,Math.min(r.to,r.from+t.length+s)),a=o.indexOf(t);if(!a||a>-1&&i.indexOf(o.slice(0,a))>-1){let h=r.firstChild;for(;h&&h.from==r.from&&h.to-h.from>t.length+a;){if(n.sliceDoc(h.to-t.length,h.to)==t)return!1;h=h.firstChild}return!0}let c=r.to==e&&r.parent;if(!c)break;r=c}return!1}function L0(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=It.Word)return e;for(let r of t){let s=e-r.length;if(n.sliceDoc(s,e)==r&&i(n.sliceDoc(s-1,s))!=It.Word)return s}return-1}function uX(n={}){return[pn,Ei.of(n),VA,hX,Cw]}const Yw=[{key:"Ctrl-Space",run:UA},{key:"Escape",run:EA},{key:"ArrowDown",run:sc(!0)},{key:"ArrowUp",run:sc(!1)},{key:"PageDown",run:sc(!0,"page")},{key:"PageUp",run:sc(!1,"page")},{key:"Enter",run:YA}],hX=il.highest(va.computeN([Ei],n=>n.facet(Ei).defaultKeymap?[Yw]:[]));class OX{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class Is{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let r=e,s=i.facet(Mw).markerFilter;s&&(r=s(r));let l=Ze.set(r.map(o=>o.from==o.to||o.from==o.to-1&&i.doc.lineAt(o.from).to==o.from?Ze.widget({widget:new vX(o),diagnostic:o}).range(o.from):Ze.mark({attributes:{class:"cm-lintRange cm-lintRange-"+o.severity+(o.markClass?" "+o.markClass:"")},diagnostic:o}).range(o.from,o.to)),!0);return new Is(l,t,Nl(l))}}function Nl(n,e=null,t=0){let i=null;return n.between(t,1e9,(r,s,{spec:l})=>{if(!(e&&l.diagnostic!=e))return i=new OX(r,s,l.diagnostic),!1}),i}function dX(n,e){let t=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(i=>i.is(Uw))||n.changes.touchesRange(t.from,t.to))}function pX(n,e){return n.field(gn,!1)?e:e.concat(Ie.appendConfig.of(kX))}const Uw=Ie.define(),bp=Ie.define(),Ew=Ie.define(),gn=pi.define({create(){return new Is(Ze.none,null,null)},update(n,e){if(e.docChanged){let t=n.diagnostics.map(e.changes),i=null;if(n.selected){let r=e.changes.mapPos(n.selected.from,1);i=Nl(t,n.selected.diagnostic,r)||Nl(t,null,r)}n=new Is(t,n.panel,i)}for(let t of e.effects)t.is(Uw)?n=Is.init(t.value,n.panel,e.state):t.is(bp)?n=new Is(n.diagnostics,t.value?Su.open:null,n.selected):t.is(Ew)&&(n=new Is(n.diagnostics,n.panel,t.value));return n},provide:n=>[ua.from(n,e=>e.panel),Oe.decorations.from(n,e=>e.diagnostics)]}),gX=Ze.mark({class:"cm-lintRange cm-lintRange-active"});function mX(n,e,t){let{diagnostics:i}=n.state.field(gn),r=[],s=2e8,l=0;i.between(e-(t<0?1:0),e+(t>0?1:0),(a,c,{spec:h})=>{e>=a&&e<=c&&(a==c||(e>a||t>0)&&(eDw(n,t,!1)))}const bX=n=>{let e=n.state.field(gn,!1);(!e||!e.panel)&&n.dispatch({effects:pX(n.state,[bp.of(!0)])});let t=ca(n,Su.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},I0=n=>{let e=n.state.field(gn,!1);return!e||!e.panel?!1:(n.dispatch({effects:bp.of(!1)}),!0)},$X=n=>{let e=n.state.field(gn,!1);if(!e)return!1;let t=n.state.selection.main,i=e.diagnostics.iter(t.to+1);return!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)},yX=[{key:"Mod-Shift-m",run:bX,preventDefault:!0},{key:"F8",run:$X}],Mw=ye.define({combine(n){return Object.assign({sources:n.map(e=>e.source)},yr(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t}))}});function zw(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;is.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function Dw(n,e,t){var i;let r=t?zw(e.actions):[];return Ut("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Ut("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(i=e.actions)===null||i===void 0?void 0:i.map((s,l)=>{let o=!1,a=p=>{if(p.preventDefault(),o)return;o=!0;let g=Nl(n.state.field(gn).diagnostics,e);g&&s.apply(n,g.from,g.to)},{name:c}=s,h=r[l]?c.indexOf(r[l]):-1,O=h<0?c:[c.slice(0,h),Ut("u",c.slice(h,h+1)),c.slice(h+1)];return Ut("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${c}${h<0?"":` (access key "${r[l]})"`}.`},O)}),e.source&&Ut("div",{class:"cm-diagnosticSource"},e.source))}class vX extends Nr{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Ut("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class N0{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Dw(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Su{constructor(e){this.view=e,this.items=[];let t=r=>{if(r.keyCode==27)I0(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],l=zw(s.actions);for(let o=0;o{for(let s=0;sI0(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(gn).selected;if(!e)return-1;for(let t=0;t{let c=-1,h;for(let O=i;Oi&&(this.items.splice(i,c-i),r=!0)),t&&h.diagnostic==t.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),s=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),i++});i({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:o})=>{let a=o.height/this.list.offsetHeight;l.topo.bottom&&(this.list.scrollTop+=(l.bottom-o.bottom)/a)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(gn),i=Nl(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:Ew.of(i)})}static open(e){return new Su(e)}}function wX(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(n)}')`}function lc(n){return wX(``,'width="6" height="3"')}const QX=Oe.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:lc("#d11")},".cm-lintRange-warning":{backgroundImage:lc("orange")},".cm-lintRange-info":{backgroundImage:lc("#999")},".cm-lintRange-hint":{backgroundImage:lc("#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}}}),kX=[gn,Oe.decorations.compute([gn],n=>{let{selected:e,panel:t}=n.field(gn);return!e||!t||e.from==e.to?Ze.none:Ze.set([gX.range(e.from,e.to)])}),O3(mX,{hideOn:dX}),QX],_X=[Q3(),P3(),L5(),IZ(),bZ(),R5(),E5(),Ot.allowMultipleSelections.of(!0),lZ(),Cv(wZ,{fallback:!0}),CZ(),eX(),uX(),i3(),s3(),G5(),HR(),va.of([...rX,...IR,...gA,...eR,...pZ,...Yw,...yX])],yi=({variant:n,settings:e,styles:t})=>{const i=Oe.theme({"&":{backgroundColor:e.background,color:e.foreground},".cm-content":{caretColor:e.caret},".cm-cursor, .cm-dropCursor":{borderLeftColor:e.caret},"&.cm-focused .cm-selectionBackgroundm .cm-selectionBackground, .cm-content ::selection":{backgroundColor:e.selection},".cm-activeLine":{backgroundColor:e.lineHighlight},".cm-gutters":{backgroundColor:e.gutterBackground,color:e.gutterForeground},".cm-activeLineGutter":{backgroundColor:e.lineHighlight}},{dark:n==="dark"}),r=_a.define(t);return[i,Cv(r)]};yi({variant:"dark",settings:{background:"#200020",foreground:"#D0D0FF",caret:"#7070FF",selection:"#80000080",gutterBackground:"#200020",gutterForeground:"#C080C0",lineHighlight:"#80000040"},styles:[{tag:b.comment,color:"#404080"},{tag:[b.string,b.regexp],color:"#999999"},{tag:b.number,color:"#7090B0"},{tag:[b.bool,b.null],color:"#8080A0"},{tag:[b.punctuation,b.derefOperator],color:"#805080"},{tag:b.keyword,color:"#60B0FF"},{tag:b.definitionKeyword,color:"#B0FFF0"},{tag:b.moduleKeyword,color:"#60B0FF"},{tag:b.operator,color:"#A0A0FF"},{tag:[b.variableName,b.self],color:"#008080"},{tag:b.operatorKeyword,color:"#A0A0FF"},{tag:b.controlKeyword,color:"#80A0FF"},{tag:b.className,color:"#70E080"},{tag:[b.function(b.propertyName),b.propertyName],color:"#50A0A0"},{tag:b.tagName,color:"#009090"},{tag:b.modifier,color:"#B0FFF0"},{tag:[b.squareBracket,b.attributeName],color:"#D0D0FF"}]});yi({variant:"light",settings:{background:"#fcfcfc",foreground:"#5c6166",caret:"#ffaa33",selection:"#036dd626",gutterBackground:"#fcfcfc",gutterForeground:"#8a919966",lineHighlight:"#8a91991a"},styles:[{tag:b.comment,color:"#787b8099"},{tag:b.string,color:"#86b300"},{tag:b.regexp,color:"#4cbf99"},{tag:[b.number,b.bool,b.null],color:"#ffaa33"},{tag:b.variableName,color:"#5c6166"},{tag:[b.definitionKeyword,b.modifier],color:"#fa8d3e"},{tag:[b.keyword,b.special(b.brace)],color:"#fa8d3e"},{tag:b.operator,color:"#ed9366"},{tag:b.separator,color:"#5c6166b3"},{tag:b.punctuation,color:"#5c6166"},{tag:[b.definition(b.propertyName),b.function(b.variableName)],color:"#f2ae49"},{tag:[b.className,b.definition(b.typeName)],color:"#22a4e6"},{tag:[b.tagName,b.typeName,b.self,b.labelName],color:"#55b4d4"},{tag:b.angleBracket,color:"#55b4d480"},{tag:b.attributeName,color:"#f2ae49"}]});yi({variant:"dark",settings:{background:"#15191EFA",foreground:"#EEF2F7",caret:"#C4C4C4",selection:"#90B2D557",gutterBackground:"#15191EFA",gutterForeground:"#aaaaaa95",lineHighlight:"#57575712"},styles:[{tag:b.comment,color:"#6E6E6E"},{tag:[b.string,b.regexp,b.special(b.brace)],color:"#5C81B3"},{tag:b.number,color:"#C1E1B8"},{tag:b.bool,color:"#53667D"},{tag:[b.definitionKeyword,b.modifier,b.function(b.propertyName)],color:"#A3D295",fontWeight:"bold"},{tag:[b.keyword,b.moduleKeyword,b.operatorKeyword,b.operator],color:"#697A8E",fontWeight:"bold"},{tag:[b.variableName,b.attributeName],color:"#708E67"},{tag:[b.function(b.variableName),b.definition(b.propertyName),b.derefOperator],color:"#fff"},{tag:b.tagName,color:"#A3D295"}]});yi({variant:"dark",settings:{background:"#2e241d",foreground:"#BAAE9E",caret:"#A7A7A7",selection:"#DDF0FF33",gutterBackground:"#28211C",gutterForeground:"#BAAE9E90",lineHighlight:"#FFFFFF08"},styles:[{tag:b.comment,color:"#666666"},{tag:[b.string,b.special(b.brace)],color:"#54BE0D"},{tag:b.regexp,color:"#E9C062"},{tag:b.number,color:"#CF6A4C"},{tag:[b.keyword,b.operator],color:"#5EA6EA"},{tag:b.variableName,color:"#7587A6"},{tag:[b.definitionKeyword,b.modifier],color:"#F9EE98"},{tag:[b.propertyName,b.function(b.variableName)],color:"#937121"},{tag:[b.typeName,b.angleBracket,b.tagName],color:"#9B859D"}]});yi({variant:"dark",settings:{background:"#3b2627",foreground:"#E6E1C4",caret:"#E6E1C4",selection:"#16120E",gutterBackground:"#3b2627",gutterForeground:"#E6E1C490",lineHighlight:"#1F1611"},styles:[{tag:b.comment,color:"#6B4E32"},{tag:[b.keyword,b.operator,b.derefOperator],color:"#EF5D32"},{tag:b.className,color:"#EFAC32",fontWeight:"bold"},{tag:[b.typeName,b.propertyName,b.function(b.variableName),b.definition(b.variableName)],color:"#EFAC32"},{tag:b.definition(b.typeName),color:"#EFAC32",fontWeight:"bold"},{tag:b.labelName,color:"#EFAC32",fontWeight:"bold"},{tag:[b.number,b.bool],color:"#6C99BB"},{tag:[b.variableName,b.self],color:"#7DAF9C"},{tag:[b.string,b.special(b.brace),b.regexp],color:"#D9D762"},{tag:[b.angleBracket,b.tagName,b.attributeName],color:"#EFCB43"}]});yi({variant:"dark",settings:{background:"#000205",foreground:"#FFFFFF",caret:"#E60065",selection:"#E60C6559",gutterBackground:"#000205",gutterForeground:"#ffffff90",lineHighlight:"#4DD7FC1A"},styles:[{tag:b.comment,color:"#404040"},{tag:[b.string,b.special(b.brace),b.regexp],color:"#00D8FF"},{tag:b.number,color:"#E62286"},{tag:[b.variableName,b.attributeName,b.self],color:"#E62286",fontWeight:"bold"},{tag:b.function(b.variableName),color:"#fff",fontWeight:"bold"}]});yi({variant:"light",settings:{background:"#fff",foreground:"#000",caret:"#000",selection:"#BDD5FC",gutterBackground:"#fff",gutterForeground:"#00000070",lineHighlight:"#FFFBD1"},styles:[{tag:b.comment,color:"#BCC8BA"},{tag:[b.string,b.special(b.brace),b.regexp],color:"#5D90CD"},{tag:[b.number,b.bool,b.null],color:"#46A609"},{tag:b.keyword,color:"#AF956F"},{tag:[b.definitionKeyword,b.modifier],color:"#C52727"},{tag:[b.angleBracket,b.tagName,b.attributeName],color:"#606060"},{tag:b.self,color:"#000"}]});yi({variant:"dark",settings:{background:"#00254b",foreground:"#FFFFFF",caret:"#FFFFFF",selection:"#B36539BF",gutterBackground:"#00254b",gutterForeground:"#FFFFFF70",lineHighlight:"#00000059"},styles:[{tag:b.comment,color:"#0088FF"},{tag:b.string,color:"#3AD900"},{tag:b.regexp,color:"#80FFC2"},{tag:[b.number,b.bool,b.null],color:"#FF628C"},{tag:[b.definitionKeyword,b.modifier],color:"#FFEE80"},{tag:b.variableName,color:"#CCCCCC"},{tag:b.self,color:"#FF80E1"},{tag:[b.className,b.definition(b.propertyName),b.function(b.variableName),b.definition(b.typeName),b.labelName],color:"#FFDD00"},{tag:[b.keyword,b.operator],color:"#FF9D00"},{tag:[b.propertyName,b.typeName],color:"#80FFBB"},{tag:b.special(b.brace),color:"#EDEF7D"},{tag:b.attributeName,color:"#9EFFFF"},{tag:b.derefOperator,color:"#fff"}]});yi({variant:"dark",settings:{background:"#060521",foreground:"#E0E0E0",caret:"#FFFFFFA6",selection:"#122BBB",gutterBackground:"#060521",gutterForeground:"#E0E0E090",lineHighlight:"#FFFFFF0F"},styles:[{tag:b.comment,color:"#AEAEAE"},{tag:[b.string,b.special(b.brace),b.regexp],color:"#8DFF8E"},{tag:[b.className,b.definition(b.propertyName),b.function(b.variableName),b.function(b.definition(b.variableName)),b.definition(b.typeName)],color:"#A3EBFF"},{tag:[b.number,b.bool,b.null],color:"#62E9BD"},{tag:[b.keyword,b.operator],color:"#2BF1DC"},{tag:[b.definitionKeyword,b.modifier],color:"#F8FBB1"},{tag:[b.variableName,b.self],color:"#B683CA"},{tag:[b.angleBracket,b.tagName,b.typeName,b.propertyName],color:"#60A4F1"},{tag:b.derefOperator,color:"#E0E0E0"},{tag:b.attributeName,color:"#7BACCA"}]});yi({variant:"dark",settings:{background:"#2d2f3f",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"#44475a",gutterBackground:"#282a36",gutterForeground:"rgb(144, 145, 148)",lineHighlight:"#44475a"},styles:[{tag:b.comment,color:"#6272a4"},{tag:[b.string,b.special(b.brace)],color:"#f1fa8c"},{tag:[b.number,b.self,b.bool,b.null],color:"#bd93f9"},{tag:[b.keyword,b.operator],color:"#ff79c6"},{tag:[b.definitionKeyword,b.typeName],color:"#8be9fd"},{tag:b.definition(b.typeName),color:"#f8f8f2"},{tag:[b.className,b.definition(b.propertyName),b.function(b.variableName),b.attributeName],color:"#50fa7b"}]});yi({variant:"light",settings:{background:"#FFFFFF",foreground:"#000000",caret:"#000000",selection:"#80C7FF",gutterBackground:"#FFFFFF",gutterForeground:"#00000070",lineHighlight:"#C1E2F8"},styles:[{tag:b.comment,color:"#AAAAAA"},{tag:[b.keyword,b.operator,b.typeName,b.tagName,b.propertyName],color:"#2F6F9F",fontWeight:"bold"},{tag:[b.attributeName,b.definition(b.propertyName)],color:"#4F9FD0"},{tag:[b.className,b.string,b.special(b.brace)],color:"#CF4F5F"},{tag:b.number,color:"#CF4F5F",fontWeight:"bold"},{tag:b.variableName,fontWeight:"bold"}]});yi({variant:"light",settings:{background:"#f2f1f8",foreground:"#0c006b",caret:"#5c49e9",selection:"#d5d1f2",gutterBackground:"#f2f1f8",gutterForeground:"#0c006b70",lineHighlight:"#e1def3"},styles:[{tag:b.comment,color:"#9995b7"},{tag:b.keyword,color:"#ff5792",fontWeight:"bold"},{tag:[b.definitionKeyword,b.modifier],color:"#ff5792"},{tag:[b.className,b.tagName,b.definition(b.typeName)],color:"#0094f0"},{tag:[b.number,b.bool,b.null,b.special(b.brace)],color:"#5842ff"},{tag:[b.definition(b.propertyName),b.function(b.variableName)],color:"#0095a8"},{tag:b.typeName,color:"#b3694d"},{tag:[b.propertyName,b.variableName],color:"#fa8900"},{tag:b.operator,color:"#ff5792"},{tag:b.self,color:"#e64100"},{tag:[b.string,b.regexp],color:"#00b368"},{tag:[b.paren,b.bracket],color:"#0431fa"},{tag:b.labelName,color:"#00bdd6"},{tag:b.attributeName,color:"#e64100"},{tag:b.angleBracket,color:"#9995b7"}]});yi({variant:"light",settings:{background:"#faf4ed",foreground:"#575279",caret:"#575279",selection:"#6e6a8614",gutterBackground:"#faf4ed",gutterForeground:"#57527970",lineHighlight:"#6e6a860d"},styles:[{tag:b.comment,color:"#9893a5"},{tag:[b.bool,b.null],color:"#286983"},{tag:b.number,color:"#d7827e"},{tag:b.className,color:"#d7827e"},{tag:[b.angleBracket,b.tagName,b.typeName],color:"#56949f"},{tag:b.attributeName,color:"#907aa9"},{tag:b.punctuation,color:"#797593"},{tag:[b.keyword,b.modifier],color:"#286983"},{tag:[b.string,b.regexp],color:"#ea9d34"},{tag:b.variableName,color:"#d7827e"}]});yi({variant:"light",settings:{background:"#FFFFFF",foreground:"#000000",caret:"#000000",selection:"#FFFD0054",gutterBackground:"#FFFFFF",gutterForeground:"#00000070",lineHighlight:"#00000008"},styles:[{tag:b.comment,color:"#CFCFCF"},{tag:[b.number,b.bool,b.null],color:"#E66C29"},{tag:[b.className,b.definition(b.propertyName),b.function(b.variableName),b.labelName,b.definition(b.typeName)],color:"#2EB43B"},{tag:b.keyword,color:"#D8B229"},{tag:b.operator,color:"#4EA44E",fontWeight:"bold"},{tag:[b.definitionKeyword,b.modifier],color:"#925A47"},{tag:b.string,color:"#704D3D"},{tag:b.typeName,color:"#2F8996"},{tag:[b.variableName,b.propertyName],color:"#77ACB0"},{tag:b.self,color:"#77ACB0",fontWeight:"bold"},{tag:b.regexp,color:"#E3965E"},{tag:[b.tagName,b.angleBracket],color:"#BAA827"},{tag:b.attributeName,color:"#B06520"},{tag:b.derefOperator,color:"#000"}]});yi({variant:"light",settings:{background:"#fef7e5",foreground:"#586E75",caret:"#000000",selection:"#073642",gutterBackground:"#fef7e5",gutterForeground:"#586E7580",lineHighlight:"#EEE8D5"},styles:[{tag:b.comment,color:"#93A1A1"},{tag:b.string,color:"#2AA198"},{tag:b.regexp,color:"#D30102"},{tag:b.number,color:"#D33682"},{tag:b.variableName,color:"#268BD2"},{tag:[b.keyword,b.operator,b.punctuation],color:"#859900"},{tag:[b.definitionKeyword,b.modifier],color:"#073642",fontWeight:"bold"},{tag:[b.className,b.self,b.definition(b.propertyName)],color:"#268BD2"},{tag:b.function(b.variableName),color:"#268BD2"},{tag:[b.bool,b.null],color:"#B58900"},{tag:b.tagName,color:"#268BD2",fontWeight:"bold"},{tag:b.angleBracket,color:"#93A1A1"},{tag:b.attributeName,color:"#93A1A1"},{tag:b.typeName,color:"#859900"}]});yi({variant:"light",settings:{background:"#FFFFFF",foreground:"#4D4D4C",caret:"#AEAFAD",selection:"#D6D6D6",gutterBackground:"#FFFFFF",gutterForeground:"#4D4D4C80",lineHighlight:"#EFEFEF"},styles:[{tag:b.comment,color:"#8E908C"},{tag:[b.variableName,b.self,b.propertyName,b.attributeName,b.regexp],color:"#C82829"},{tag:[b.number,b.bool,b.null],color:"#F5871F"},{tag:[b.className,b.typeName,b.definition(b.typeName)],color:"#C99E00"},{tag:[b.string,b.special(b.brace)],color:"#718C00"},{tag:b.operator,color:"#3E999F"},{tag:[b.definition(b.propertyName),b.function(b.variableName)],color:"#4271AE"},{tag:b.keyword,color:"#8959A8"},{tag:b.derefOperator,color:"#4D4D4C"}]});const PX=Hl({String:b.string,Number:b.number,"True False":b.bool,PropertyName:b.propertyName,Null:b.null,",":b.separator,"[ ]":b.squareBracket,"{ }":b.brace}),xX=xs.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[PX],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~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#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!]~$zOh~~$}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~&yOg~~'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}),WX=Ws.define({name:"json",parser:xX.configure({props:[Kl.add({Object:Yl({except:/^\s*\}/}),Array:Yl({except:/^\s*\]/})}),Jl.add({"Object Array":hr})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function CX(){return new Qa(WX)}const TX=54,ZX=1,RX=55,AX=2,XX=56,YX=3,B0=4,UX=5,Gc=6,Vw=7,qw=8,Lw=9,Iw=10,EX=11,MX=12,zX=13,vO=57,DX=14,j0=58,Nw=20,VX=22,Bw=23,qX=24,Zd=26,jw=27,LX=28,IX=31,NX=34,BX=36,jX=37,FX=0,GX=1,HX={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},KX={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},F0={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 JX(n){return n==45||n==46||n==58||n>=65&&n<=90||n==95||n>=97&&n<=122||n>=161}function Fw(n){return n==9||n==10||n==13||n==32}let G0=null,H0=null,K0=0;function Rd(n,e){let t=n.pos+e;if(K0==t&&H0==n)return G0;let i=n.peek(e);for(;Fw(i);)i=n.peek(++e);let r="";for(;JX(i);)r+=String.fromCharCode(i),i=n.peek(++e);return H0=n,K0=t,G0=r?r.toLowerCase():i==e7||i==t7?void 0:null}const Gw=60,Hc=62,$p=47,e7=63,t7=33,i7=45;function J0(n,e){this.name=n,this.parent=e,this.hash=e?e.hash:0;for(let t=0;t-1?new J0(Rd(i,1)||"",n):n},reduce(n,e){return e==Nw&&n?n.parent:n},reuse(n,e,t,i){let r=e.type.id;return r==Gc||r==BX?new J0(Rd(i,1)||"",n):n},hash(n){return n?n.hash:0},strict:!1}),s7=new vr((n,e)=>{if(n.next!=Gw){n.next<0&&e.context&&n.acceptToken(vO);return}n.advance();let t=n.next==$p;t&&n.advance();let i=Rd(n,0);if(i===void 0)return;if(!i)return n.acceptToken(t?DX:Gc);let r=e.context?e.context.name:null;if(t){if(i==r)return n.acceptToken(EX);if(r&&KX[r])return n.acceptToken(vO,-2);if(e.dialectEnabled(FX))return n.acceptToken(MX);for(let s=e.context;s;s=s.parent)if(s.name==i)return;n.acceptToken(zX)}else{if(i=="script")return n.acceptToken(Vw);if(i=="style")return n.acceptToken(qw);if(i=="textarea")return n.acceptToken(Lw);if(HX.hasOwnProperty(i))return n.acceptToken(Iw);r&&F0[r]&&F0[r][i]?n.acceptToken(vO,-1):n.acceptToken(Gc)}},{contextual:!0}),l7=new vr(n=>{for(let e=0,t=0;;t++){if(n.next<0){t&&n.acceptToken(j0);break}if(n.next==i7)e++;else if(n.next==Hc&&e>=2){t>=3&&n.acceptToken(j0,-2);break}else e=0;n.advance()}});function o7(n){for(;n;n=n.parent)if(n.name=="svg"||n.name=="math")return!0;return!1}const a7=new vr((n,e)=>{if(n.next==$p&&n.peek(1)==Hc){let t=e.dialectEnabled(GX)||o7(e.context);n.acceptToken(t?UX:B0,2)}else n.next==Hc&&n.acceptToken(B0,1)});function yp(n,e,t){let i=2+n.length;return new vr(r=>{for(let s=0,l=0,o=0;;o++){if(r.next<0){o&&r.acceptToken(e);break}if(s==0&&r.next==Gw||s==1&&r.next==$p||s>=2&&sl?r.acceptToken(e,-l):r.acceptToken(t,-(l-2));break}else if((r.next==10||r.next==13)&&o){r.acceptToken(e,1);break}else s=l=0;r.advance()}})}const f7=yp("script",TX,ZX),c7=yp("style",RX,AX),u7=yp("textarea",XX,YX),h7=Hl({"Text RawText":b.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":b.angleBracket,TagName:b.tagName,"MismatchedCloseTag/TagName":[b.tagName,b.invalid],AttributeName:b.attributeName,"AttributeValue UnquotedAttributeValue":b.attributeValue,Is:b.definitionOperator,"EntityReference CharacterReference":b.character,Comment:b.blockComment,ProcessingInst:b.processingInstruction,DoctypeDecl:b.documentMeta}),O7=xs.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[OOO`'#Da'#DaO'WO!rO,59[O'_Q#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'dO$fO,59oOOO`,59o,59oO'lQ#|O,59qO'qQ#|O,59rOOO`-E7W-E7WO'vQ&rO'#CsOOQW'#DZ'#DZO(UQ&rO1G.wOOOa1G.w1G.wO(^Q&rO1G/QOOOb1G/Q1G/QO(fQ&rO1G/TOOOd1G/T1G/TO(nQ&rO1G/WOOO`1G/W1G/WOOO`1G/Y1G/YO(yQ&rO1G/YOOOa-E7[-E7[O)RQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)WQ#tO'#C|OOOd-E7^-E7^O)]Q#tO'#DPOOO`-E7_-E7_O)bQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`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{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!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:r7,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"]],propSources:[h7],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWO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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!{let c=o.type.id;if(c==LX)return wO(o,a,t);if(c==IX)return wO(o,a,i);if(c==NX)return wO(o,a,r);if(c==Nw&&s.length){let h=o.node,O=h.firstChild,p=O&&eS(O,a),g;if(p){for(let m of s)if(m.tag==p&&(!m.attrs||m.attrs(g||(g=Hw(h,a))))){let $=h.lastChild,y=$.type.id==jX?$.from:h.to;if(y>O.to)return{parser:m.parser,overlay:[{from:O.to,to:y}]}}}}if(l&&c==Bw){let h=o.node,O;if(O=h.firstChild){let p=l[a.read(O.from,O.to)];if(p)for(let g of p){if(g.tagName&&g.tagName!=eS(h.parent,a))continue;let m=h.lastChild;if(m.type.id==Zd){let $=m.from+1,y=m.lastChild,k=m.to-(y&&y.isError?0:1);if(k>$)return{parser:g.parser,overlay:[{from:$,to:k}]}}else if(m.type.id==jw)return{parser:g.parser,overlay:[{from:m.from,to:m.to}]}}}}return null})}const d7=96,tS=1,p7=97,g7=98,iS=2,Jw=[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],m7=58,S7=40,eQ=95,b7=91,bc=45,$7=46,y7=35,v7=37,w7=38,Q7=92,k7=10;function Kc(n){return n>=65&&n<=90||n>=97&&n<=122||n>=161}function _7(n){return n>=48&&n<=57}const P7=new vr((n,e)=>{for(let t=!1,i=0,r=0;;r++){let{next:s}=n;if(Kc(s)||s==bc||s==eQ||t&&_7(s))!t&&(s!=bc||r>0)&&(t=!0),i===r&&s==bc&&i++,n.advance();else if(s==Q7&&n.peek(1)!=k7)n.advance(),n.next>-1&&n.advance(),t=!0;else{t&&n.acceptToken(s==S7?p7:i==2&&e.canShift(iS)?iS:g7);break}}}),x7=new vr(n=>{if(Jw.includes(n.peek(-1))){let{next:e}=n;(Kc(e)||e==eQ||e==y7||e==$7||e==b7||e==m7||e==bc||e==w7)&&n.acceptToken(d7)}}),W7=new vr(n=>{if(!Jw.includes(n.peek(-1))){let{next:e}=n;if(e==v7&&(n.advance(),n.acceptToken(tS)),Kc(e)){do n.advance();while(Kc(n.next));n.acceptToken(tS)}}}),C7=Hl({"AtKeyword import charset namespace keyframes media supports":b.definitionKeyword,"from to selector":b.keyword,NamespaceName:b.namespace,KeyframeName:b.labelName,KeyframeRangeName:b.operatorKeyword,TagName:b.tagName,ClassName:b.className,PseudoClassName:b.constant(b.className),IdName:b.labelName,"FeatureName PropertyName":b.propertyName,AttributeName:b.attributeName,NumberLiteral:b.number,KeywordQuery:b.keyword,UnaryQueryOp:b.operatorKeyword,"CallTag ValueName":b.atom,VariableName:b.variableName,Callee:b.operatorKeyword,Unit:b.unit,"UniversalSelector NestingSelector":b.definitionOperator,MatchOp:b.compareOperator,"ChildOp SiblingOp, LogicOp":b.logicOperator,BinOp:b.arithmeticOperator,Important:b.modifier,Comment:b.blockComment,ColorLiteral:b.color,"ParenthesizedContent StringLiteral":b.string,":":b.punctuation,"PseudoOp #":b.derefOperator,"; ,":b.separator,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace}),T7={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},Z7={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},R7={__proto__:null,not:128,only:128},A7=xs.deserialize({version:14,states:"9bQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DPO$vQ[O'#DTOOQP'#Ej'#EjO${QdO'#DeO%gQ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h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!W^Oy%^z;'S%^;'S;=`%o<%lO%^dCoSzSOy%^z;'S%^;'S;=`%o<%lO%^bDQU|QOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS|Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[!YQo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bFfSxQOy%^z;'S%^;'S;=`%o<%lO%^lFwSv[Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!`Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!RUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!Q^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!PQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[x7,W7,P7,1,2,3,4,new Xc("m~RRYZ[z{a~~g~aO#Z~~dP!P!Qg~lO#[~~",28,102)],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:97,get:n=>T7[n]||-1},{term:56,get:n=>Z7[n]||-1},{term:98,get:n=>R7[n]||-1}],tokenPrec:1169});let QO=null;function kO(){if(!QO&&typeof document=="object"&&document.body){let{style:n}=document.body,e=[],t=new Set;for(let i in n)i!="cssText"&&i!="cssFloat"&&typeof n[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(i)||(e.push(i),t.add(i)));QO=e.sort().map(i=>({type:"property",label:i}))}return QO||[]}const nS=["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(n=>({type:"class",label:n})),rS=["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(n=>({type:"keyword",label:n})).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(n=>({type:"constant",label:n}))),X7=["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(n=>({type:"type",label:n})),cs=/^(\w[\w-]*|-\w[\w-]*|)$/,Y7=/^-(-[\w-]*)?$/;function U7(n,e){var t;if((n.name=="("||n.type.isError)&&(n=n.parent||n),n.name!="ArgList")return!1;let i=(t=n.parent)===null||t===void 0?void 0:t.firstChild;return(i==null?void 0:i.name)!="Callee"?!1:e.sliceString(i.from,i.to)=="var"}const sS=new hv,E7=["Declaration"];function M7(n){for(let e=n;;){if(e.type.isTop)return e;if(!(e=e.parent))return n}}function tQ(n,e,t){if(e.to-e.from>4096){let i=sS.get(e);if(i)return i;let r=[],s=new Set,l=e.cursor(Et.IncludeAnonymous);if(l.firstChild())do for(let o of tQ(n,l.node,t))s.has(o.label)||(s.add(o.label),r.push(o));while(l.nextSibling());return sS.set(e,r),r}else{let i=[],r=new Set;return e.cursor().iterate(s=>{var l;if(t(s)&&s.matchContext(E7)&&((l=s.node.nextSibling)===null||l===void 0?void 0:l.name)==":"){let o=n.sliceString(s.from,s.to);r.has(o)||(r.add(o),i.push({label:o,type:"variable"}))}}),i}}const z7=n=>e=>{let{state:t,pos:i}=e,r=ei(t).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:kO(),validFor:cs};if(r.name=="ValueName")return{from:r.from,options:rS,validFor:cs};if(r.name=="PseudoClassName")return{from:r.from,options:nS,validFor:cs};if(n(r)||(e.explicit||s)&&U7(r,t.doc))return{from:n(r)||s?r.from:i,options:tQ(t.doc,M7(r),n),validFor:Y7};if(r.name=="TagName"){for(let{parent:a}=r;a;a=a.parent)if(a.name=="Block")return{from:r.from,options:kO(),validFor:cs};return{from:r.from,options:X7,validFor:cs}}if(!e.explicit)return null;let l=r.resolve(i),o=l.childBefore(i);return o&&o.name==":"&&l.name=="PseudoClassSelector"?{from:i,options:nS,validFor:cs}:o&&o.name==":"&&l.name=="Declaration"||l.name=="ArgList"?{from:i,options:rS,validFor:cs}:l.name=="Block"||l.name=="Styles"?{from:i,options:kO(),validFor:cs}:null},D7=z7(n=>n.name=="VariableName"),Jc=Ws.define({name:"css",parser:A7.configure({props:[Kl.add({Declaration:Yl()}),Jl.add({"Block KeyframeList":hr})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function V7(){return new Qa(Jc,Jc.data.of({autocomplete:D7}))}const q7=304,lS=1,L7=2,I7=305,N7=307,B7=308,j7=3,F7=4,G7=[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],iQ=125,H7=59,oS=47,K7=42,J7=43,eY=45,tY=new pv({start:!1,shift(n,e){return e==j7||e==F7||e==N7?n:e==B7},strict:!1}),iY=new vr((n,e)=>{let{next:t}=n;(t==iQ||t==-1||e.context)&&n.acceptToken(I7)},{contextual:!0,fallback:!0}),nY=new vr((n,e)=>{let{next:t}=n,i;G7.indexOf(t)>-1||t==oS&&((i=n.peek(1))==oS||i==K7)||t!=iQ&&t!=H7&&t!=-1&&!e.context&&n.acceptToken(q7)},{contextual:!0}),rY=new vr((n,e)=>{let{next:t}=n;if((t==J7||t==eY)&&(n.advance(),t==n.next)){n.advance();let i=!e.context&&e.canShift(lS);n.acceptToken(i?lS:L7)}},{contextual:!0}),sY=Hl({"get set async static":b.modifier,"for while do if else switch try catch finally return throw break continue default case":b.controlKeyword,"in of await yield void typeof delete instanceof":b.operatorKeyword,"let var const using function class extends":b.definitionKeyword,"import export from":b.moduleKeyword,"with debugger as new":b.keyword,TemplateString:b.special(b.string),super:b.atom,BooleanLiteral:b.bool,this:b.self,null:b.null,Star:b.modifier,VariableName:b.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":b.function(b.variableName),VariableDefinition:b.definition(b.variableName),Label:b.labelName,PropertyName:b.propertyName,PrivatePropertyName:b.special(b.propertyName),"CallExpression/MemberExpression/PropertyName":b.function(b.propertyName),"FunctionDeclaration/VariableDefinition":b.function(b.definition(b.variableName)),"ClassDeclaration/VariableDefinition":b.definition(b.className),PropertyDefinition:b.definition(b.propertyName),PrivatePropertyDefinition:b.definition(b.special(b.propertyName)),UpdateOp:b.updateOperator,"LineComment Hashbang":b.lineComment,BlockComment:b.blockComment,Number:b.number,String:b.string,Escape:b.escape,ArithOp:b.arithmeticOperator,LogicOp:b.logicOperator,BitOp:b.bitwiseOperator,CompareOp:b.compareOperator,RegExp:b.regexp,Equals:b.definitionOperator,Arrow:b.function(b.punctuation),": Spread":b.punctuation,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace,"InterpolationStart InterpolationEnd":b.special(b.brace),".":b.derefOperator,", ;":b.separator,"@":b.meta,TypeName:b.typeName,TypeDefinition:b.definition(b.typeName),"type enum interface implements namespace module declare":b.definitionKeyword,"abstract global Privacy readonly override":b.modifier,"is keyof unique infer":b.operatorKeyword,JSXAttributeValue:b.attributeValue,JSXText:b.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":b.angleBracket,"JSXIdentifier JSXNameSpacedName":b.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":b.attributeName,"JSXBuiltin/JSXIdentifier":b.standard(b.tagName)}),lY={__proto__:null,export:16,as:21,from:29,default:32,async:37,function:38,extends:48,this:52,true:60,false:60,null:72,void:76,typeof:80,super:98,new:132,delete:148,yield:157,await:161,class:166,public:223,private:223,protected:223,readonly:225,instanceof:244,satisfies:247,in:248,const:250,import:282,keyof:337,unique:341,infer:347,is:383,abstract:403,implements:405,type:407,let:410,var:412,using:415,interface:421,enum:425,namespace:431,module:433,declare:437,global:441,for:460,of:469,while:472,with:476,do:480,if:484,else:486,switch:490,case:496,try:502,catch:506,finally:510,return:514,throw:518,break:522,continue:526,debugger:530},oY={__proto__:null,async:119,get:121,set:123,declare:183,public:185,private:185,protected:185,static:187,abstract:189,override:191,readonly:197,accessor:199,new:387},aY={__proto__:null,"<":139},fY=xs.deserialize({version:14,states:"$6zO%TQUOOO%[QUOOO'_QWOOP(lOSOOO*zQ(CjO'#CgO+ROpO'#ChO+aO!bO'#ChO+oO07`O'#D[O.QQUO'#DbO.bQUO'#DmO%[QUO'#DwO0fQUO'#EPOOQ(CY'#EX'#EXO1PQSO'#EUOOQO'#Ej'#EjOOQO'#Id'#IdO1XQSO'#GlO1dQSO'#EiO1iQSO'#EiO3kQ(CjO'#JeO6[Q(CjO'#JfO6xQSO'#FXO6}Q#tO'#FpOOQ(CY'#Fa'#FaO7YO&jO'#FaO7hQ,UO'#FwO9OQSO'#FvOOQ(CY'#Jf'#JfOOQ(CW'#Je'#JeO9TQSO'#GpOOQQ'#KQ'#KQO9`QSO'#IQO9eQ(C[O'#IROOQQ'#JR'#JROOQQ'#IV'#IVQ`QUOOO`QUOOO%[QUO'#DoO9mQUO'#D{O9tQUO'#D}O9ZQSO'#GlO9{Q,UO'#CmO:ZQSO'#EhO:fQSO'#EsO:kQ,UO'#F`O;YQSO'#GlOOQO'#KR'#KRO;_QSO'#KRO;mQSO'#GtO;mQSO'#GuO;mQSO'#GwO9ZQSO'#GzO]QSO'#HZO>eQSO'#HaO>eQSO'#HcO`QUO'#HeO>eQSO'#HgO>eQSO'#HjO>jQSO'#HpO>oQ(C]O'#HvO%[QUO'#HxO>zQ(C]O'#HzO?VQ(C]O'#H|O9eQ(C[O'#IOO?bQ(CjO'#CgO@dQWO'#DgQOQSOOO%[QUO'#D}O@zQSO'#EQO9{Q,UO'#EhOAVQSO'#EhOAbQ`O'#F`OOQQ'#Ce'#CeOOQ(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k9uQ.l9xQ.{)uQ/}*xQ1v,sQ1y,vQ2Z-`Q2b-tQ2v.bQ2{9yQ2|9zQ2}9{Q3O9|Q3P9}Q3Q:OQ3R:PQ3S:QQ3T:RQ3U:SQ3V:TQ3W:UQ3X.iQ3[:ZQ3]:dQ3b:VQ4T0PQ4]0aQ5n:eQ5t2]Q5y2cQ6V2wQ6W:fQ6]:hQ6^:oQ7U4pQ7s5lQ7w5uQ8Q:pQ8U:uQ8V:vQ8{7yQ9Z8hQ9b8yQ9s#RR;V;cR#ZWR'Q!eY!tQ'V-S0z4uS&|!e,zQ'b!rS'l!u!xS'n!y4wS,w&}'US-c'c'dQ-e'eQ2Q-QR2`-dR(p#wR(s#xQ!fQT-R'V-S]!qQ!r'V-S0z4uQ#o]R'`9rT#jZ%^S#iZ%^S%dm,^U(]#g#h#kS-w(^(_Q-{(`Q0R*}Q2e-xU2f-y-z-|S5{2g2hR7z5|`#]W#V#Y%a'y(S*z-rr#fZm#g#h#k%^(^(_(`*}-x-y-z-|2g2h5|Q1a,^Q1w,tQ5j1oQ7r5kT:}'O*{T#`W%aS#_W%aS'z#V(SS(P#Y*zS,y'O*{T-m'y-rT'T!e%bQ$kfR)o$pT)d$k)eR3`.pT*T$x*VR*]${Q0V+VQ2j.TQ4x0|Q6Q2nQ7^4{Q7}6PQ8j7]Q8|7|Q9]8lQ9e9OQ9j9^R9m9fnqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&c!VR,V&`tmOXst!U!V!Z#c%f&`&i&k&l&n,b,g1g1jR,^&fT%em,^R0v+vR,U&^Q%||R+n%}R+d%wT&g!W&jT&h!W&jT1i,g1j",nodeNames:"⚠ ArithOp ArithOp LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > TypeParamList 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 : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression 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 const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate 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:367,context:tY,nodeProps:[["group",-26,7,15,17,63,200,204,208,209,211,214,217,227,229,235,237,239,241,244,250,256,258,260,262,264,266,267,"Statement",-32,11,12,26,29,30,36,46,49,50,52,57,65,73,77,79,81,82,104,105,114,115,132,135,137,138,139,140,142,143,163,164,166,"Expression",-23,25,27,31,35,37,39,167,169,171,172,174,175,176,178,179,180,182,183,184,194,196,198,199,"Type",-3,85,97,103,"ClassItem"],["openedBy",32,"InterpolationStart",51,"[",55,"{",70,"(",144,"JSXStartTag",156,"JSXStartTag JSXStartCloseTag"],["closedBy",34,"InterpolationEnd",45,"]",56,"}",71,")",145,"JSXSelfCloseEndTag JSXEndTag",161,"JSXEndTag"]],propSources:[sY],skippedNodes:[0,3,4,270],repeatNodeCount:33,tokenData:"$Fl(CSR!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#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Nu!`!a$#a!a!b$(n!b!c$,m!c!}Er!}#O$-w#O#P$/R#P#Q$4j#Q#R$5t#R#SEr#S#T$7R#T#o$8]#o#p$s#r#s$@P#s$f%Z$f$g+g$g#BYEr#BY#BZ$AZ#BZ$ISEr$IS$I_$AZ$I_$I|Er$I|$I}$Df$I}$JO$Df$JO$JTEr$JT$JU$AZ$JU$KVEr$KV$KW$AZ$KW&FUEr&FU&FV$AZ&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AZ?HUOEr(n%d_$e&j'yp'|!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$e&jO!^&c!_#o&c#p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n}",{label:"function",detail:"definition",type:"keyword"}),Hi("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Hi("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Hi("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Hi("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Hi(`try { \${} } catch (\${error}) { \${} @@ -26,17 +26,17 @@ var rC=Object.defineProperty;var sC=(n,e,t)=>e in n?rC(n,e,{enumerable:!0,config constructor(\${params}) { \${} } -}`,{label:"class",detail:"definition",type:"keyword"}),Hi('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Hi('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],cY=iQ.concat([Hi("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Hi("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Hi("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),oS=new uv,nQ=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Eo(n){return(e,t)=>{let i=e.node.getChild("VariableDefinition");return i&&t(i,n),!0}}const uY=["FunctionDeclaration"],hY={FunctionDeclaration:Eo("function"),ClassDeclaration:Eo("class"),ClassExpression:()=>!0,EnumDeclaration:Eo("constant"),TypeAliasDeclaration:Eo("type"),NamespaceDeclaration:Eo("namespace"),VariableDefinition(n,e){n.matchContext(uY)||e(n,"variable")},TypeDefinition(n,e){e(n,"type")},__proto__:null};function rQ(n,e){let t=oS.get(e);if(t)return t;let i=[],r=!0;function s(l,o){let a=n.sliceString(l.from,l.to);i.push({label:a,type:o})}return e.cursor(Et.IncludeAnonymous).iterate(l=>{if(r)r=!1;else if(l.name){let o=hY[l.name];if(o&&o(l,s)||nQ.has(l.name))return!1}else if(l.to-l.from>8192){for(let o of rQ(n,l.node))i.push(o);return!1}}),oS.set(e,i),i}const aS=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,sQ=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function OY(n){let e=ei(n.state).resolveInner(n.pos,-1);if(sQ.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&aS.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let i=[];for(let r=e;r;r=r.parent)nQ.has(r.name)&&(i=i.concat(rQ(n.state.doc,r)));return{options:i,from:t?e.from:n.pos,validFor:aS}}const br=Ws.define({name:"javascript",parser:fY.configure({props:[Kl.add({IfStatement:Yl({except:/^\s*({|else\b)/}),TryStatement:Yl({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:nZ,SwitchBody:n=>{let e=n.textAfter,t=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return n.baseIndent+(t?0:i?1:2)*n.unit},Block:us({closing:"}"}),ArrowFunction:n=>n.baseIndent+n.unit,"TemplateString BlockComment":()=>null,"Statement Property":Yl({except:/^{/}),JSXElement(n){let e=/^\s*<\//.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},JSXEscape(n){let e=/\s*\}/.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},"JSXOpenTag JSXSelfClosingTag"(n){return n.column(n.node.from)+n.unit}}),Jl.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":hr,BlockComment(n){return{from:n.from+2,to:n.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),lQ={test:n=>/^JSX/.test(n.name),facet:mv({commentTokens:{block:{open:"{/*",close:"*/}"}}})},oQ=br.configure({dialect:"ts"},"typescript"),aQ=br.configure({dialect:"jsx",props:[rp.add(n=>n.isTop?[lQ]:void 0)]}),fQ=br.configure({dialect:"jsx ts",props:[rp.add(n=>n.isTop?[lQ]:void 0)]},"typescript");let cQ=n=>({label:n,type:"keyword"});const uQ="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(cQ),dY=uQ.concat(["declare","implements","private","protected","public"].map(cQ));function pY(n={}){let e=n.jsx?n.typescript?fQ:aQ:n.typescript?oQ:br,t=n.typescript?cY.concat(dY):iQ.concat(uQ);return new Qa(e,[br.data.of({autocomplete:yA(sQ,ww(t))}),br.data.of({autocomplete:OY}),n.jsx?SY:[]])}function gY(n){for(;;){if(n.name=="JSXOpenTag"||n.name=="JSXSelfClosingTag"||n.name=="JSXFragmentTag")return n;if(n.name=="JSXEscape"||!n.parent)return null;n=n.parent}}function fS(n,e,t=n.length){for(let i=e==null?void 0:e.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return n.sliceString(i.from,Math.min(i.to,t));return""}const mY=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),SY=Oe.inputHandler.of((n,e,t,i,r)=>{if((mY?n.composing:n.compositionStarted)||n.state.readOnly||e!=t||i!=">"&&i!="/"||!br.isActiveAt(n.state,e,-1))return!1;let s=r(),{state:l}=s,o=l.changeByRange(a=>{var c;let{head:h}=a,O=ei(l).resolveInner(h-1,-1),p;if(O.name=="JSXStartTag"&&(O=O.parent),!(l.doc.sliceString(h-1,h)!=i||O.name=="JSXAttributeValue"&&O.to>h)){if(i==">"&&O.name=="JSXFragmentTag")return{range:a,changes:{from:h,insert:""}};if(i=="/"&&O.name=="JSXStartCloseTag"){let g=O.parent,m=g.parent;if(m&&g.from==h-2&&((p=fS(l.doc,m.firstChild,h))||((c=m.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let $=`${p}>`;return{range:te.cursor(h+$.length,-1),changes:{from:h,insert:$}}}}else if(i==">"){let g=gY(O);if(g&&!/^\/?>|^<\//.test(l.doc.sliceString(h,h+2))&&(p=fS(l.doc,g,h)))return{range:a,changes:{from:h,insert:``}}}}return{range:a}});return o.changes.empty?!1:(n.dispatch([s,l.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Mo=["_blank","_self","_top","_parent"],_O=["ascii","utf-8","utf-16","latin1","latin1"],PO=["get","post","put","delete"],xO=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],On=["true","false"],Te={},bY={a:{attrs:{href:null,ping:null,type:null,media:null,target:Mo,hreflang:null}},abbr:Te,address:Te,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Te,aside:Te,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Te,base:{attrs:{href:null,target:Mo}},bdi:Te,bdo:Te,blockquote:{attrs:{cite:null}},body:Te,br:Te,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:xO,formmethod:PO,formnovalidate:["novalidate"],formtarget:Mo,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Te,center:Te,cite:Te,code:Te,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:Te,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Te,div:Te,dl:Te,dt:Te,em:Te,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Te,figure:Te,footer:Te,form:{attrs:{action:null,name:null,"accept-charset":_O,autocomplete:["on","off"],enctype:xO,method:PO,novalidate:["novalidate"],target:Mo}},h1:Te,h2:Te,h3:Te,h4:Te,h5:Te,h6:Te,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Te,hgroup:Te,hr:Te,html:{attrs:{manifest:null}},i:Te,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:xO,formmethod:PO,formnovalidate:["novalidate"],formtarget:Mo,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:Te,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Te,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:Te,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:_O,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:Te,noscript:Te,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:Te,param:{attrs:{name:null,value:null}},pre:Te,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Te,rt:Te,ruby:Te,samp:Te,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:_O}},section:Te,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Te,source:{attrs:{src:null,type:null,media:null}},span:Te,strong:Te,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Te,summary:Te,sup:Te,table:Te,tbody:Te,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Te,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:Te,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Te,time:{attrs:{datetime:null}},title:Te,tr:Te,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Te,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:Te},hQ={accesskey:null,class:null,contenteditable:On,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:On,autocorrect:On,autocapitalize:On,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":On,"aria-autocomplete":["inline","list","both","none"],"aria-busy":On,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":On,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":On,"aria-hidden":On,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":On,"aria-multiselectable":On,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":On,"aria-relevant":null,"aria-required":On,"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},OQ="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(n=>"on"+n);for(let n of OQ)hQ[n]=null;class eu{constructor(e,t){this.tags=Object.assign(Object.assign({},bY),e),this.globalAttrs=Object.assign(Object.assign({},hQ),t),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}eu.default=new eu;function Bl(n,e,t=n.length){if(!e)return"";let i=e.firstChild,r=i&&i.getChild("TagName");return r?n.sliceString(r.from,Math.min(r.to,t)):""}function jl(n,e=!1){for(;n;n=n.parent)if(n.name=="Element")if(e)e=!1;else return n;return null}function dQ(n,e,t){let i=t.tags[Bl(n,jl(e))];return(i==null?void 0:i.children)||t.allTags}function vp(n,e){let t=[];for(let i=jl(e);i&&!i.type.isTop;i=jl(i.parent)){let r=Bl(n,i);if(r&&i.lastChild.name=="CloseTag")break;r&&t.indexOf(r)<0&&(e.name=="EndTag"||e.from>=i.firstChild.to)&&t.push(r)}return t}const pQ=/^[:\-\.\w\u00b7-\uffff]*$/;function cS(n,e,t,i,r){let s=/\s*>/.test(n.sliceDoc(r,r+5))?"":">",l=jl(t,!0);return{from:i,to:r,options:dQ(n.doc,l,e).map(o=>({label:o,type:"type"})).concat(vp(n.doc,t).map((o,a)=>({label:"/"+o,apply:"/"+o+s,type:"type",boost:99-a}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function uS(n,e,t,i){let r=/\s*>/.test(n.sliceDoc(i,i+5))?"":">";return{from:t,to:i,options:vp(n.doc,e).map((s,l)=>({label:s,apply:s+r,type:"type",boost:99-l})),validFor:pQ}}function $Y(n,e,t,i){let r=[],s=0;for(let l of dQ(n.doc,t,e))r.push({label:"<"+l,type:"type"});for(let l of vp(n.doc,t))r.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function yY(n,e,t,i,r){let s=jl(t),l=s?e.tags[Bl(n.doc,s)]:null,o=l&&l.attrs?Object.keys(l.attrs):[],a=l&&l.globalAttrs===!1?o:o.length?o.concat(e.globalAttrNames):e.globalAttrNames;return{from:i,to:r,options:a.map(c=>({label:c,type:"property"})),validFor:pQ}}function vY(n,e,t,i,r){var s;let l=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),o=[],a;if(l){let c=n.sliceDoc(l.from,l.to),h=e.globalAttrs[c];if(!h){let O=jl(t),p=O?e.tags[Bl(n.doc,O)]:null;h=(p==null?void 0:p.attrs)&&p.attrs[c]}if(h){let O=n.sliceDoc(i,r).toLowerCase(),p='"',g='"';/^['"]/.test(O)?(a=O[0]=='"'?/^[^"]*$/:/^[^']*$/,p="",g=n.sliceDoc(r,r+1)==O[0]?"":O[0],O=O.slice(1),i++):a=/^[^\s<>='"]*$/;for(let m of h)o.push({label:m,apply:p+m+g,type:"constant"})}}return{from:i,to:r,options:o,validFor:a}}function wY(n,e){let{state:t,pos:i}=e,r=ei(t).resolveInner(i,-1),s=r.resolve(i);for(let l=i,o;s==r&&(o=r.childBefore(l));){let a=o.lastChild;if(!a||!a.type.isError||a.fromwY(i,r)}const kY=br.parser.configure({top:"SingleExpression"}),gQ=[{tag:"script",attrs:n=>n.type=="text/typescript"||n.lang=="ts",parser:oQ.parser},{tag:"script",attrs:n=>n.type=="text/babel"||n.type=="text/jsx",parser:aQ.parser},{tag:"script",attrs:n=>n.type=="text/typescript-jsx",parser:fQ.parser},{tag:"script",attrs(n){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(n.type)},parser:kY},{tag:"script",attrs(n){return!n.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(n.type)},parser:br.parser},{tag:"style",attrs(n){return(!n.lang||n.lang=="css")&&(!n.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(n.type))},parser:Jc.parser}],mQ=[{name:"style",parser:Jc.parser.configure({top:"Styles"})}].concat(OQ.map(n=>({name:n,parser:br.parser}))),SQ=Ws.define({name:"html",parser:O7.configure({props:[Kl.add({Element(n){let e=/^(\s*)(<\/)?/.exec(n.textAfter);return n.node.to<=n.pos+e[0].length?n.continue():n.lineIndent(n.node.from)+(e[2]?0:n.unit)},"OpenTag CloseTag SelfClosingTag"(n){return n.column(n.node.from)+n.unit},Document(n){if(n.pos+/\s*/.exec(n.textAfter)[0].lengthn.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),$c=SQ.configure({wrap:Hw(gQ,mQ)});function _Y(n={}){let e="",t;n.matchClosingTags===!1&&(e="noMatch"),n.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(n.nestedLanguages&&n.nestedLanguages.length||n.nestedAttributes&&n.nestedAttributes.length)&&(t=Hw((n.nestedLanguages||[]).concat(gQ),(n.nestedAttributes||[]).concat(mQ)));let i=t?SQ.configure({wrap:t,dialect:e}):e?$c.configure({dialect:e}):$c;return new Qa(i,[$c.data.of({autocomplete:QY(n)}),n.autoCloseTags!==!1?PY:[],pY().support,V7().support])}const hS=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),PY=Oe.inputHandler.of((n,e,t,i,r)=>{if(n.composing||n.state.readOnly||e!=t||i!=">"&&i!="/"||!$c.isActiveAt(n.state,e,-1))return!1;let s=r(),{state:l}=s,o=l.changeByRange(a=>{var c,h,O;let p=l.doc.sliceString(a.from-1,a.to)==i,{head:g}=a,m=ei(l).resolveInner(g,-1),$;if(p&&i==">"&&m.name=="EndTag"){let y=m.parent;if(((h=(c=y.parent)===null||c===void 0?void 0:c.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&($=Bl(l.doc,y.parent,g))&&!hS.has($)){let k=g+(l.doc.sliceString(g,g+1)===">"?1:0),W=``;return{range:a,changes:{from:g,to:k,insert:W}}}}else if(p&&i=="/"&&m.name=="IncompleteCloseTag"){let y=m.parent;if(m.from==g-2&&((O=y.lastChild)===null||O===void 0?void 0:O.name)!="CloseTag"&&($=Bl(l.doc,y,g))&&!hS.has($)){let k=g+(l.doc.sliceString(g,g+1)===">"?1:0),W=`${$}>`;return{range:te.cursor(g+W.length,-1),changes:{from:g,to:k,insert:W}}}}return{range:a}});return o.changes.empty?!1:(n.dispatch([s,l.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var zo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function N8(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var tu={exports:{}};/** +}`,{label:"class",detail:"definition",type:"keyword"}),Hi('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Hi('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],cY=nQ.concat([Hi("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Hi("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Hi("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),aS=new hv,rQ=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Eo(n){return(e,t)=>{let i=e.node.getChild("VariableDefinition");return i&&t(i,n),!0}}const uY=["FunctionDeclaration"],hY={FunctionDeclaration:Eo("function"),ClassDeclaration:Eo("class"),ClassExpression:()=>!0,EnumDeclaration:Eo("constant"),TypeAliasDeclaration:Eo("type"),NamespaceDeclaration:Eo("namespace"),VariableDefinition(n,e){n.matchContext(uY)||e(n,"variable")},TypeDefinition(n,e){e(n,"type")},__proto__:null};function sQ(n,e){let t=aS.get(e);if(t)return t;let i=[],r=!0;function s(l,o){let a=n.sliceString(l.from,l.to);i.push({label:a,type:o})}return e.cursor(Et.IncludeAnonymous).iterate(l=>{if(r)r=!1;else if(l.name){let o=hY[l.name];if(o&&o(l,s)||rQ.has(l.name))return!1}else if(l.to-l.from>8192){for(let o of sQ(n,l.node))i.push(o);return!1}}),aS.set(e,i),i}const fS=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,lQ=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function OY(n){let e=ei(n.state).resolveInner(n.pos,-1);if(lQ.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&fS.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let i=[];for(let r=e;r;r=r.parent)rQ.has(r.name)&&(i=i.concat(sQ(n.state.doc,r)));return{options:i,from:t?e.from:n.pos,validFor:fS}}const br=Ws.define({name:"javascript",parser:fY.configure({props:[Kl.add({IfStatement:Yl({except:/^\s*({|else\b)/}),TryStatement:Yl({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:rZ,SwitchBody:n=>{let e=n.textAfter,t=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return n.baseIndent+(t?0:i?1:2)*n.unit},Block:us({closing:"}"}),ArrowFunction:n=>n.baseIndent+n.unit,"TemplateString BlockComment":()=>null,"Statement Property":Yl({except:/^{/}),JSXElement(n){let e=/^\s*<\//.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},JSXEscape(n){let e=/\s*\}/.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},"JSXOpenTag JSXSelfClosingTag"(n){return n.column(n.node.from)+n.unit}}),Jl.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":hr,BlockComment(n){return{from:n.from+2,to:n.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),oQ={test:n=>/^JSX/.test(n.name),facet:Sv({commentTokens:{block:{open:"{/*",close:"*/}"}}})},aQ=br.configure({dialect:"ts"},"typescript"),fQ=br.configure({dialect:"jsx",props:[rp.add(n=>n.isTop?[oQ]:void 0)]}),cQ=br.configure({dialect:"jsx ts",props:[rp.add(n=>n.isTop?[oQ]:void 0)]},"typescript");let uQ=n=>({label:n,type:"keyword"});const hQ="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(uQ),dY=hQ.concat(["declare","implements","private","protected","public"].map(uQ));function pY(n={}){let e=n.jsx?n.typescript?cQ:fQ:n.typescript?aQ:br,t=n.typescript?cY.concat(dY):nQ.concat(hQ);return new Qa(e,[br.data.of({autocomplete:yA(lQ,Qw(t))}),br.data.of({autocomplete:OY}),n.jsx?SY:[]])}function gY(n){for(;;){if(n.name=="JSXOpenTag"||n.name=="JSXSelfClosingTag"||n.name=="JSXFragmentTag")return n;if(n.name=="JSXEscape"||!n.parent)return null;n=n.parent}}function cS(n,e,t=n.length){for(let i=e==null?void 0:e.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return n.sliceString(i.from,Math.min(i.to,t));return""}const mY=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),SY=Oe.inputHandler.of((n,e,t,i,r)=>{if((mY?n.composing:n.compositionStarted)||n.state.readOnly||e!=t||i!=">"&&i!="/"||!br.isActiveAt(n.state,e,-1))return!1;let s=r(),{state:l}=s,o=l.changeByRange(a=>{var c;let{head:h}=a,O=ei(l).resolveInner(h-1,-1),p;if(O.name=="JSXStartTag"&&(O=O.parent),!(l.doc.sliceString(h-1,h)!=i||O.name=="JSXAttributeValue"&&O.to>h)){if(i==">"&&O.name=="JSXFragmentTag")return{range:a,changes:{from:h,insert:""}};if(i=="/"&&O.name=="JSXStartCloseTag"){let g=O.parent,m=g.parent;if(m&&g.from==h-2&&((p=cS(l.doc,m.firstChild,h))||((c=m.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let $=`${p}>`;return{range:te.cursor(h+$.length,-1),changes:{from:h,insert:$}}}}else if(i==">"){let g=gY(O);if(g&&!/^\/?>|^<\//.test(l.doc.sliceString(h,h+2))&&(p=cS(l.doc,g,h)))return{range:a,changes:{from:h,insert:``}}}}return{range:a}});return o.changes.empty?!1:(n.dispatch([s,l.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Mo=["_blank","_self","_top","_parent"],_O=["ascii","utf-8","utf-16","latin1","latin1"],PO=["get","post","put","delete"],xO=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],On=["true","false"],Te={},bY={a:{attrs:{href:null,ping:null,type:null,media:null,target:Mo,hreflang:null}},abbr:Te,address:Te,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Te,aside:Te,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Te,base:{attrs:{href:null,target:Mo}},bdi:Te,bdo:Te,blockquote:{attrs:{cite:null}},body:Te,br:Te,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:xO,formmethod:PO,formnovalidate:["novalidate"],formtarget:Mo,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Te,center:Te,cite:Te,code:Te,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:Te,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Te,div:Te,dl:Te,dt:Te,em:Te,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Te,figure:Te,footer:Te,form:{attrs:{action:null,name:null,"accept-charset":_O,autocomplete:["on","off"],enctype:xO,method:PO,novalidate:["novalidate"],target:Mo}},h1:Te,h2:Te,h3:Te,h4:Te,h5:Te,h6:Te,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Te,hgroup:Te,hr:Te,html:{attrs:{manifest:null}},i:Te,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:xO,formmethod:PO,formnovalidate:["novalidate"],formtarget:Mo,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:Te,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Te,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:Te,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:_O,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:Te,noscript:Te,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:Te,param:{attrs:{name:null,value:null}},pre:Te,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Te,rt:Te,ruby:Te,samp:Te,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:_O}},section:Te,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Te,source:{attrs:{src:null,type:null,media:null}},span:Te,strong:Te,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Te,summary:Te,sup:Te,table:Te,tbody:Te,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Te,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:Te,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Te,time:{attrs:{datetime:null}},title:Te,tr:Te,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Te,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:Te},OQ={accesskey:null,class:null,contenteditable:On,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:On,autocorrect:On,autocapitalize:On,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":On,"aria-autocomplete":["inline","list","both","none"],"aria-busy":On,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":On,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":On,"aria-hidden":On,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":On,"aria-multiselectable":On,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":On,"aria-relevant":null,"aria-required":On,"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},dQ="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(n=>"on"+n);for(let n of dQ)OQ[n]=null;class eu{constructor(e,t){this.tags=Object.assign(Object.assign({},bY),e),this.globalAttrs=Object.assign(Object.assign({},OQ),t),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}eu.default=new eu;function Bl(n,e,t=n.length){if(!e)return"";let i=e.firstChild,r=i&&i.getChild("TagName");return r?n.sliceString(r.from,Math.min(r.to,t)):""}function jl(n,e=!1){for(;n;n=n.parent)if(n.name=="Element")if(e)e=!1;else return n;return null}function pQ(n,e,t){let i=t.tags[Bl(n,jl(e))];return(i==null?void 0:i.children)||t.allTags}function vp(n,e){let t=[];for(let i=jl(e);i&&!i.type.isTop;i=jl(i.parent)){let r=Bl(n,i);if(r&&i.lastChild.name=="CloseTag")break;r&&t.indexOf(r)<0&&(e.name=="EndTag"||e.from>=i.firstChild.to)&&t.push(r)}return t}const gQ=/^[:\-\.\w\u00b7-\uffff]*$/;function uS(n,e,t,i,r){let s=/\s*>/.test(n.sliceDoc(r,r+5))?"":">",l=jl(t,!0);return{from:i,to:r,options:pQ(n.doc,l,e).map(o=>({label:o,type:"type"})).concat(vp(n.doc,t).map((o,a)=>({label:"/"+o,apply:"/"+o+s,type:"type",boost:99-a}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function hS(n,e,t,i){let r=/\s*>/.test(n.sliceDoc(i,i+5))?"":">";return{from:t,to:i,options:vp(n.doc,e).map((s,l)=>({label:s,apply:s+r,type:"type",boost:99-l})),validFor:gQ}}function $Y(n,e,t,i){let r=[],s=0;for(let l of pQ(n.doc,t,e))r.push({label:"<"+l,type:"type"});for(let l of vp(n.doc,t))r.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function yY(n,e,t,i,r){let s=jl(t),l=s?e.tags[Bl(n.doc,s)]:null,o=l&&l.attrs?Object.keys(l.attrs):[],a=l&&l.globalAttrs===!1?o:o.length?o.concat(e.globalAttrNames):e.globalAttrNames;return{from:i,to:r,options:a.map(c=>({label:c,type:"property"})),validFor:gQ}}function vY(n,e,t,i,r){var s;let l=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),o=[],a;if(l){let c=n.sliceDoc(l.from,l.to),h=e.globalAttrs[c];if(!h){let O=jl(t),p=O?e.tags[Bl(n.doc,O)]:null;h=(p==null?void 0:p.attrs)&&p.attrs[c]}if(h){let O=n.sliceDoc(i,r).toLowerCase(),p='"',g='"';/^['"]/.test(O)?(a=O[0]=='"'?/^[^"]*$/:/^[^']*$/,p="",g=n.sliceDoc(r,r+1)==O[0]?"":O[0],O=O.slice(1),i++):a=/^[^\s<>='"]*$/;for(let m of h)o.push({label:m,apply:p+m+g,type:"constant"})}}return{from:i,to:r,options:o,validFor:a}}function wY(n,e){let{state:t,pos:i}=e,r=ei(t).resolveInner(i,-1),s=r.resolve(i);for(let l=i,o;s==r&&(o=r.childBefore(l));){let a=o.lastChild;if(!a||!a.type.isError||a.fromwY(i,r)}const kY=br.parser.configure({top:"SingleExpression"}),mQ=[{tag:"script",attrs:n=>n.type=="text/typescript"||n.lang=="ts",parser:aQ.parser},{tag:"script",attrs:n=>n.type=="text/babel"||n.type=="text/jsx",parser:fQ.parser},{tag:"script",attrs:n=>n.type=="text/typescript-jsx",parser:cQ.parser},{tag:"script",attrs(n){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(n.type)},parser:kY},{tag:"script",attrs(n){return!n.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(n.type)},parser:br.parser},{tag:"style",attrs(n){return(!n.lang||n.lang=="css")&&(!n.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(n.type))},parser:Jc.parser}],SQ=[{name:"style",parser:Jc.parser.configure({top:"Styles"})}].concat(dQ.map(n=>({name:n,parser:br.parser}))),bQ=Ws.define({name:"html",parser:O7.configure({props:[Kl.add({Element(n){let e=/^(\s*)(<\/)?/.exec(n.textAfter);return n.node.to<=n.pos+e[0].length?n.continue():n.lineIndent(n.node.from)+(e[2]?0:n.unit)},"OpenTag CloseTag SelfClosingTag"(n){return n.column(n.node.from)+n.unit},Document(n){if(n.pos+/\s*/.exec(n.textAfter)[0].lengthn.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),$c=bQ.configure({wrap:Kw(mQ,SQ)});function _Y(n={}){let e="",t;n.matchClosingTags===!1&&(e="noMatch"),n.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(n.nestedLanguages&&n.nestedLanguages.length||n.nestedAttributes&&n.nestedAttributes.length)&&(t=Kw((n.nestedLanguages||[]).concat(mQ),(n.nestedAttributes||[]).concat(SQ)));let i=t?bQ.configure({wrap:t,dialect:e}):e?$c.configure({dialect:e}):$c;return new Qa(i,[$c.data.of({autocomplete:QY(n)}),n.autoCloseTags!==!1?PY:[],pY().support,V7().support])}const OS=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),PY=Oe.inputHandler.of((n,e,t,i,r)=>{if(n.composing||n.state.readOnly||e!=t||i!=">"&&i!="/"||!$c.isActiveAt(n.state,e,-1))return!1;let s=r(),{state:l}=s,o=l.changeByRange(a=>{var c,h,O;let p=l.doc.sliceString(a.from-1,a.to)==i,{head:g}=a,m=ei(l).resolveInner(g,-1),$;if(p&&i==">"&&m.name=="EndTag"){let y=m.parent;if(((h=(c=y.parent)===null||c===void 0?void 0:c.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&($=Bl(l.doc,y.parent,g))&&!OS.has($)){let k=g+(l.doc.sliceString(g,g+1)===">"?1:0),W=``;return{range:a,changes:{from:g,to:k,insert:W}}}}else if(p&&i=="/"&&m.name=="IncompleteCloseTag"){let y=m.parent;if(m.from==g-2&&((O=y.lastChild)===null||O===void 0?void 0:O.name)!="CloseTag"&&($=Bl(l.doc,y,g))&&!OS.has($)){let k=g+(l.doc.sliceString(g,g+1)===">"?1:0),W=`${$}>`;return{range:te.cursor(g+W.length,-1),changes:{from:g,to:k,insert:W}}}}return{range:a}});return o.changes.empty?!1:(n.dispatch([s,l.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var zo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function N8(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var tu={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */tu.exports;(function(n,e){(function(){var t,i="4.17.21",r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",o="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",c=500,h="__lodash_placeholder__",O=1,p=2,g=4,m=1,$=2,y=1,k=2,W=4,Z=8,A=16,C=32,U=64,D=128,z=256,j=512,N=30,G="...",E=800,re=16,ae=1,ve=2,Se=3,ge=1/0,Ue=9007199254740991,Le=17976931348623157e292,Pe=NaN,We=4294967295,lt=We-1,Vt=We>>>1,Qt=[["ary",D],["bind",y],["bindKey",k],["curry",Z],["curryRight",A],["flip",j],["partial",C],["partialRight",U],["rearg",z]],pt="[object Arguments]",qt="[object Array]",$e="[object AsyncFunction]",oe="[object Boolean]",H="[object Date]",ue="[object DOMException]",ce="[object Error]",Ee="[object Function]",tt="[object GeneratorFunction]",ft="[object Map]",Be="[object Number]",Yt="[object Null]",ut="[object Object]",Mn="[object Promise]",kt="[object Proxy]",xt="[object RegExp]",bt="[object Set]",je="[object String]",fe="[object Symbol]",Fe="[object Undefined]",He="[object WeakMap]",gi="[object WeakSet]",Wt="[object ArrayBuffer]",gt="[object DataView]",zn="[object Float32Array]",ai="[object Float64Array]",Ht="[object Int8Array]",mn="[object Int16Array]",Ct="[object Int32Array]",De="[object Uint8Array]",Sn="[object Uint8ClampedArray]",ri="[object Uint16Array]",Kt="[object Uint32Array]",bn=/\b__p \+= '';/g,ir=/\b(__p \+=) '' \+/g,Br=/(__e\(.*?\)|\b__t\)) \+\n'';/g,zt=/&(?:amp|lt|gt|quot|#39);/g,Zs=/[&<>"']/g,Rs=RegExp(zt.source),no=RegExp(Zs.source),jr=/<%-([\s\S]+?)%>/g,xi=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,ke=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rn=/^\w*$/,Fr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dn=/[\\^$.*+?()[\]{}|]/g,Qr=RegExp(Dn.source),nr=/^\s+/,As=/\s/,rr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,_t=/\{\n\/\* \[wrapped with (.+)\] \*/,kr=/,? & /,Gr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ro=/[()=,{}\[\]\/\s]/,so=/\\(\\)?/g,Ca=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_r=/\w*$/,Pr=/^[-+]0x[0-9a-f]+$/i,lo=/^0b[01]+$/i,nl=/^\[object .+?Constructor\]$/,bu=/^0o[0-7]+$/i,Ta=/^(?:0|[1-9]\d*)$/,Za=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xr=/($^)/,Ra=/['\n\r\u2028\u2029\\]/g,rl="\\ud800-\\udfff",$u="\\u0300-\\u036f",yu="\\ufe20-\\ufe2f",$n="\\u20d0-\\u20ff",Hr=$u+yu+$n,Kr="\\u2700-\\u27bf",oo="a-z\\xdf-\\xf6\\xf8-\\xff",vu="\\xac\\xb1\\xd7\\xf7",wu="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Qu="\\u2000-\\u206f",ku=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Aa="A-Z\\xc0-\\xd6\\xd8-\\xde",Xa="\\ufe0e\\ufe0f",Ya=vu+wu+Qu+ku,ao="['’]",_u="["+rl+"]",Ua="["+Ya+"]",sl="["+Hr+"]",Ea="\\d+",Pu="["+Kr+"]",Ma="["+oo+"]",za="[^"+rl+Ya+Ea+Kr+oo+Aa+"]",fo="\\ud83c[\\udffb-\\udfff]",xu="(?:"+sl+"|"+fo+")",Da="[^"+rl+"]",co="(?:\\ud83c[\\udde6-\\uddff]){2}",uo="[\\ud800-\\udbff][\\udc00-\\udfff]",Jr="["+Aa+"]",Va="\\u200d",qa="(?:"+Ma+"|"+za+")",Wu="(?:"+Jr+"|"+za+")",La="(?:"+ao+"(?:d|ll|m|re|s|t|ve))?",Ia="(?:"+ao+"(?:D|LL|M|RE|S|T|VE))?",Na=xu+"?",Ba="["+Xa+"]?",Cu="(?:"+Va+"(?:"+[Da,co,uo].join("|")+")"+Ba+Na+")*",Tu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Zu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ja=Ba+Na+Cu,Ru="(?:"+[Pu,co,uo].join("|")+")"+ja,Au="(?:"+[Da+sl+"?",sl,co,uo,_u].join("|")+")",Xu=RegExp(ao,"g"),Yu=RegExp(sl,"g"),ho=RegExp(fo+"(?="+fo+")|"+Au+ja,"g"),Uu=RegExp([Jr+"?"+Ma+"+"+La+"(?="+[Ua,Jr,"$"].join("|")+")",Wu+"+"+Ia+"(?="+[Ua,Jr+qa,"$"].join("|")+")",Jr+"?"+qa+"+"+La,Jr+"+"+Ia,Zu,Tu,Ea,Ru].join("|"),"g"),Eu=RegExp("["+Va+rl+Hr+Xa+"]"),Mu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,zu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Du=-1,Tt={};Tt[zn]=Tt[ai]=Tt[Ht]=Tt[mn]=Tt[Ct]=Tt[De]=Tt[Sn]=Tt[ri]=Tt[Kt]=!0,Tt[pt]=Tt[qt]=Tt[Wt]=Tt[oe]=Tt[gt]=Tt[H]=Tt[ce]=Tt[Ee]=Tt[ft]=Tt[Be]=Tt[ut]=Tt[xt]=Tt[bt]=Tt[je]=Tt[He]=!1;var Pt={};Pt[pt]=Pt[qt]=Pt[Wt]=Pt[gt]=Pt[oe]=Pt[H]=Pt[zn]=Pt[ai]=Pt[Ht]=Pt[mn]=Pt[Ct]=Pt[ft]=Pt[Be]=Pt[ut]=Pt[xt]=Pt[bt]=Pt[je]=Pt[fe]=Pt[De]=Pt[Sn]=Pt[ri]=Pt[Kt]=!0,Pt[ce]=Pt[Ee]=Pt[He]=!1;var Vu={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"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Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},qu={"&":"&","<":"<",">":">",'"':""","'":"'"},R={"&":"&","<":"<",">":">",""":'"',"'":"'"},he={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},be=parseFloat,xe=parseInt,Me=typeof zo=="object"&&zo&&zo.Object===Object&&zo,it=typeof self=="object"&&self&&self.Object===Object&&self,Re=Me||it||Function("return this")(),mi=e&&!e.nodeType&&e,Zt=mi&&!0&&n&&!n.nodeType&&n,es=Zt&&Zt.exports===mi,Oo=es&&Me.process,yn=function(){try{var q=Zt&&Zt.require&&Zt.require("util").types;return q||Oo&&Oo.binding&&Oo.binding("util")}catch{}}(),Qp=yn&&yn.isArrayBuffer,kp=yn&&yn.isDate,_p=yn&&yn.isMap,Pp=yn&&yn.isRegExp,xp=yn&&yn.isSet,Wp=yn&&yn.isTypedArray;function sn(q,K,F){switch(F.length){case 0:return q.call(K);case 1:return q.call(K,F[0]);case 2:return q.call(K,F[0],F[1]);case 3:return q.call(K,F[0],F[1],F[2])}return q.apply(K,F)}function PQ(q,K,F,we){for(var Ge=-1,$t=q==null?0:q.length;++Ge<$t;){var fi=q[Ge];K(we,fi,F(fi),q)}return we}function vn(q,K){for(var F=-1,we=q==null?0:q.length;++F-1}function Lu(q,K,F){for(var we=-1,Ge=q==null?0:q.length;++we-1;);return F}function Up(q,K){for(var F=q.length;F--&&ll(K,q[F],0)>-1;);return F}function YQ(q,K){for(var F=q.length,we=0;F--;)q[F]===K&&++we;return we}var UQ=ju(Vu),EQ=ju(qu);function MQ(q){return"\\"+he[q]}function zQ(q,K){return q==null?t:q[K]}function ol(q){return Eu.test(q)}function DQ(q){return Mu.test(q)}function VQ(q){for(var K,F=[];!(K=q.next()).done;)F.push(K.value);return F}function Ku(q){var K=-1,F=Array(q.size);return q.forEach(function(we,Ge){F[++K]=[Ge,we]}),F}function Ep(q,K){return function(F){return q(K(F))}}function ns(q,K){for(var F=-1,we=q.length,Ge=0,$t=[];++F-1}function W2(f,u){var d=this.__data__,S=Of(d,f);return S<0?(++this.size,d.push([f,u])):d[S][1]=u,this}Wr.prototype.clear=k2,Wr.prototype.delete=_2,Wr.prototype.get=P2,Wr.prototype.has=x2,Wr.prototype.set=W2;function Cr(f){var u=-1,d=f==null?0:f.length;for(this.clear();++u=u?f:u)),f}function kn(f,u,d,S,w,x){var T,M=u&O,L=u&p,ee=u&g;if(d&&(T=w?d(f,S,w,x):d(f)),T!==t)return T;if(!Nt(f))return f;var ie=Ke(f);if(ie){if(T=Rk(f),!M)return Bi(f,T)}else{var se=Ci(f),me=se==Ee||se==tt;if(fs(f))return $g(f,M);if(se==ut||se==pt||me&&!w){if(T=L||me?{}:Mg(f),!M)return L?vk(f,I2(T,f)):yk(f,Gp(T,f))}else{if(!Pt[se])return w?f:{};T=Ak(f,se,M)}}x||(x=new qn);var Ce=x.get(f);if(Ce)return Ce;x.set(f,T),dm(f)?f.forEach(function(qe){T.add(kn(qe,u,d,qe,f,x))}):hm(f)&&f.forEach(function(qe,ct){T.set(ct,kn(qe,u,d,ct,f,x))});var Ve=ee?L?Qh:wh:L?Fi:Si,rt=ie?t:Ve(f);return vn(rt||f,function(qe,ct){rt&&(ct=qe,qe=f[ct]),yo(T,ct,kn(qe,u,d,ct,f,x))}),T}function N2(f){var u=Si(f);return function(d){return Hp(d,f,u)}}function Hp(f,u,d){var S=d.length;if(f==null)return!S;for(f=Rt(f);S--;){var w=d[S],x=u[w],T=f[w];if(T===t&&!(w in f)||!x(T))return!1}return!0}function Kp(f,u,d){if(typeof f!="function")throw new wn(l);return xo(function(){f.apply(t,d)},u)}function vo(f,u,d,S){var w=-1,x=Fa,T=!0,M=f.length,L=[],ee=u.length;if(!M)return L;d&&(u=Lt(u,ln(d))),S?(x=Lu,T=!1):u.length>=r&&(x=po,T=!1,u=new Us(u));e:for(;++ww?0:w+d),S=S===t||S>w?w:nt(S),S<0&&(S+=w),S=d>S?0:gm(S);d0&&d(M)?u>1?vi(M,u-1,d,S,w):is(w,M):S||(w[w.length]=M)}return w}var sh=_g(),tg=_g(!0);function sr(f,u){return f&&sh(f,u,Si)}function lh(f,u){return f&&tg(f,u,Si)}function pf(f,u){return ts(u,function(d){return Xr(f[d])})}function Ms(f,u){u=os(u,f);for(var d=0,S=u.length;f!=null&&du}function F2(f,u){return f!=null&&vt.call(f,u)}function G2(f,u){return f!=null&&u in Rt(f)}function H2(f,u,d){return f>=Wi(u,d)&&f=120&&ie.length>=120)?new Us(T&&ie):t}ie=f[0];var se=-1,me=M[0];e:for(;++se-1;)M!==f&&lf.call(M,L,1),lf.call(f,L,1);return f}function hg(f,u){for(var d=f?u.length:0,S=d-1;d--;){var w=u[d];if(d==S||w!==x){var x=w;Ar(w)?lf.call(f,w,1):gh(f,w)}}return f}function Oh(f,u){return f+ff(Np()*(u-f+1))}function ck(f,u,d,S){for(var w=-1,x=ci(af((u-f)/(d||1)),0),T=F(x);x--;)T[S?x:++w]=f,f+=d;return T}function dh(f,u){var d="";if(!f||u<1||u>Ue)return d;do u%2&&(d+=f),u=ff(u/2),u&&(f+=f);while(u);return d}function ot(f,u){return Th(Vg(f,u,Gi),f+"")}function uk(f){return Fp(Sl(f))}function hk(f,u){var d=Sl(f);return _f(d,Es(u,0,d.length))}function ko(f,u,d,S){if(!Nt(f))return f;u=os(u,f);for(var w=-1,x=u.length,T=x-1,M=f;M!=null&&++ww?0:w+u),d=d>w?w:d,d<0&&(d+=w),w=u>d?0:d-u>>>0,u>>>=0;for(var x=F(w);++S>>1,T=f[x];T!==null&&!an(T)&&(d?T<=u:T=r){var ee=u?null:_k(f);if(ee)return Ha(ee);T=!1,w=po,L=new Us}else L=u?[]:M;e:for(;++S=S?f:_n(f,u,d)}var bg=n2||function(f){return Re.clearTimeout(f)};function $g(f,u){if(u)return f.slice();var d=f.length,S=Dp?Dp(d):new f.constructor(d);return f.copy(S),S}function $h(f){var u=new f.constructor(f.byteLength);return new rf(u).set(new rf(f)),u}function mk(f,u){var d=u?$h(f.buffer):f.buffer;return new f.constructor(d,f.byteOffset,f.byteLength)}function Sk(f){var u=new f.constructor(f.source,_r.exec(f));return u.lastIndex=f.lastIndex,u}function bk(f){return $o?Rt($o.call(f)):{}}function yg(f,u){var d=u?$h(f.buffer):f.buffer;return new f.constructor(d,f.byteOffset,f.length)}function vg(f,u){if(f!==u){var d=f!==t,S=f===null,w=f===f,x=an(f),T=u!==t,M=u===null,L=u===u,ee=an(u);if(!M&&!ee&&!x&&f>u||x&&T&&L&&!M&&!ee||S&&T&&L||!d&&L||!w)return 1;if(!S&&!x&&!ee&&f=M)return L;var ee=d[S];return L*(ee=="desc"?-1:1)}}return f.index-u.index}function wg(f,u,d,S){for(var w=-1,x=f.length,T=d.length,M=-1,L=u.length,ee=ci(x-T,0),ie=F(L+ee),se=!S;++M1?d[w-1]:t,T=w>2?d[2]:t;for(x=f.length>3&&typeof x=="function"?(w--,x):t,T&&Vi(d[0],d[1],T)&&(x=w<3?t:x,w=1),u=Rt(u);++S-1?w[x?u[T]:T]:t}}function Wg(f){return Rr(function(u){var d=u.length,S=d,w=Qn.prototype.thru;for(f&&u.reverse();S--;){var x=u[S];if(typeof x!="function")throw new wn(l);if(w&&!T&&Qf(x)=="wrapper")var T=new Qn([],!0)}for(S=T?S:d;++S1&&dt.reverse(),ie&&LM))return!1;var ee=x.get(f),ie=x.get(u);if(ee&&ie)return ee==u&&ie==f;var se=-1,me=!0,Ce=d&$?new Us:t;for(x.set(f,u),x.set(u,f);++se1?"& ":"")+u[S],u=u.join(d>2?", ":" "),f.replace(rr,`{ + */tu.exports;(function(n,e){(function(){var t,i="4.17.21",r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",o="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",c=500,h="__lodash_placeholder__",O=1,p=2,g=4,m=1,$=2,y=1,k=2,W=4,Z=8,A=16,C=32,U=64,D=128,z=256,j=512,N=30,G="...",E=800,re=16,ae=1,ve=2,Se=3,ge=1/0,Ue=9007199254740991,Le=17976931348623157e292,Pe=NaN,We=4294967295,lt=We-1,Vt=We>>>1,Qt=[["ary",D],["bind",y],["bindKey",k],["curry",Z],["curryRight",A],["flip",j],["partial",C],["partialRight",U],["rearg",z]],pt="[object Arguments]",qt="[object Array]",$e="[object AsyncFunction]",oe="[object Boolean]",H="[object Date]",ue="[object DOMException]",ce="[object Error]",Ee="[object Function]",tt="[object GeneratorFunction]",ft="[object Map]",Be="[object Number]",Yt="[object Null]",ut="[object Object]",Mn="[object Promise]",kt="[object Proxy]",xt="[object RegExp]",bt="[object Set]",je="[object String]",fe="[object Symbol]",Fe="[object Undefined]",He="[object WeakMap]",gi="[object WeakSet]",Wt="[object ArrayBuffer]",gt="[object DataView]",zn="[object Float32Array]",ai="[object Float64Array]",Ht="[object Int8Array]",mn="[object Int16Array]",Ct="[object Int32Array]",De="[object Uint8Array]",Sn="[object Uint8ClampedArray]",ri="[object Uint16Array]",Kt="[object Uint32Array]",bn=/\b__p \+= '';/g,ir=/\b(__p \+=) '' \+/g,Br=/(__e\(.*?\)|\b__t\)) \+\n'';/g,zt=/&(?:amp|lt|gt|quot|#39);/g,Zs=/[&<>"']/g,Rs=RegExp(zt.source),no=RegExp(Zs.source),jr=/<%-([\s\S]+?)%>/g,xi=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,ke=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rn=/^\w*$/,Fr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dn=/[\\^$.*+?()[\]{}|]/g,Qr=RegExp(Dn.source),nr=/^\s+/,As=/\s/,rr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,_t=/\{\n\/\* \[wrapped with (.+)\] \*/,kr=/,? & /,Gr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ro=/[()=,{}\[\]\/\s]/,so=/\\(\\)?/g,Ca=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_r=/\w*$/,Pr=/^[-+]0x[0-9a-f]+$/i,lo=/^0b[01]+$/i,nl=/^\[object .+?Constructor\]$/,bu=/^0o[0-7]+$/i,Ta=/^(?:0|[1-9]\d*)$/,Za=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xr=/($^)/,Ra=/['\n\r\u2028\u2029\\]/g,rl="\\ud800-\\udfff",$u="\\u0300-\\u036f",yu="\\ufe20-\\ufe2f",$n="\\u20d0-\\u20ff",Hr=$u+yu+$n,Kr="\\u2700-\\u27bf",oo="a-z\\xdf-\\xf6\\xf8-\\xff",vu="\\xac\\xb1\\xd7\\xf7",wu="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Qu="\\u2000-\\u206f",ku=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Aa="A-Z\\xc0-\\xd6\\xd8-\\xde",Xa="\\ufe0e\\ufe0f",Ya=vu+wu+Qu+ku,ao="['’]",_u="["+rl+"]",Ua="["+Ya+"]",sl="["+Hr+"]",Ea="\\d+",Pu="["+Kr+"]",Ma="["+oo+"]",za="[^"+rl+Ya+Ea+Kr+oo+Aa+"]",fo="\\ud83c[\\udffb-\\udfff]",xu="(?:"+sl+"|"+fo+")",Da="[^"+rl+"]",co="(?:\\ud83c[\\udde6-\\uddff]){2}",uo="[\\ud800-\\udbff][\\udc00-\\udfff]",Jr="["+Aa+"]",Va="\\u200d",qa="(?:"+Ma+"|"+za+")",Wu="(?:"+Jr+"|"+za+")",La="(?:"+ao+"(?:d|ll|m|re|s|t|ve))?",Ia="(?:"+ao+"(?:D|LL|M|RE|S|T|VE))?",Na=xu+"?",Ba="["+Xa+"]?",Cu="(?:"+Va+"(?:"+[Da,co,uo].join("|")+")"+Ba+Na+")*",Tu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Zu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ja=Ba+Na+Cu,Ru="(?:"+[Pu,co,uo].join("|")+")"+ja,Au="(?:"+[Da+sl+"?",sl,co,uo,_u].join("|")+")",Xu=RegExp(ao,"g"),Yu=RegExp(sl,"g"),ho=RegExp(fo+"(?="+fo+")|"+Au+ja,"g"),Uu=RegExp([Jr+"?"+Ma+"+"+La+"(?="+[Ua,Jr,"$"].join("|")+")",Wu+"+"+Ia+"(?="+[Ua,Jr+qa,"$"].join("|")+")",Jr+"?"+qa+"+"+La,Jr+"+"+Ia,Zu,Tu,Ea,Ru].join("|"),"g"),Eu=RegExp("["+Va+rl+Hr+Xa+"]"),Mu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,zu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Du=-1,Tt={};Tt[zn]=Tt[ai]=Tt[Ht]=Tt[mn]=Tt[Ct]=Tt[De]=Tt[Sn]=Tt[ri]=Tt[Kt]=!0,Tt[pt]=Tt[qt]=Tt[Wt]=Tt[oe]=Tt[gt]=Tt[H]=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"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},qu={"&":"&","<":"<",">":">",'"':""","'":"'"},R={"&":"&","<":"<",">":">",""":'"',"'":"'"},he={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},be=parseFloat,xe=parseInt,Me=typeof zo=="object"&&zo&&zo.Object===Object&&zo,it=typeof self=="object"&&self&&self.Object===Object&&self,Re=Me||it||Function("return this")(),mi=e&&!e.nodeType&&e,Zt=mi&&!0&&n&&!n.nodeType&&n,es=Zt&&Zt.exports===mi,Oo=es&&Me.process,yn=function(){try{var q=Zt&&Zt.require&&Zt.require("util").types;return q||Oo&&Oo.binding&&Oo.binding("util")}catch{}}(),Qp=yn&&yn.isArrayBuffer,kp=yn&&yn.isDate,_p=yn&&yn.isMap,Pp=yn&&yn.isRegExp,xp=yn&&yn.isSet,Wp=yn&&yn.isTypedArray;function sn(q,K,F){switch(F.length){case 0:return q.call(K);case 1:return q.call(K,F[0]);case 2:return q.call(K,F[0],F[1]);case 3:return q.call(K,F[0],F[1],F[2])}return q.apply(K,F)}function xQ(q,K,F,we){for(var Ge=-1,$t=q==null?0:q.length;++Ge<$t;){var fi=q[Ge];K(we,fi,F(fi),q)}return we}function vn(q,K){for(var F=-1,we=q==null?0:q.length;++F-1}function Lu(q,K,F){for(var we=-1,Ge=q==null?0:q.length;++we-1;);return F}function Up(q,K){for(var F=q.length;F--&&ll(K,q[F],0)>-1;);return F}function UQ(q,K){for(var F=q.length,we=0;F--;)q[F]===K&&++we;return we}var EQ=ju(Vu),MQ=ju(qu);function zQ(q){return"\\"+he[q]}function DQ(q,K){return q==null?t:q[K]}function ol(q){return Eu.test(q)}function VQ(q){return Mu.test(q)}function qQ(q){for(var K,F=[];!(K=q.next()).done;)F.push(K.value);return F}function Ku(q){var K=-1,F=Array(q.size);return q.forEach(function(we,Ge){F[++K]=[Ge,we]}),F}function Ep(q,K){return function(F){return q(K(F))}}function ns(q,K){for(var F=-1,we=q.length,Ge=0,$t=[];++F-1}function C2(f,u){var d=this.__data__,S=Of(d,f);return S<0?(++this.size,d.push([f,u])):d[S][1]=u,this}Wr.prototype.clear=_2,Wr.prototype.delete=P2,Wr.prototype.get=x2,Wr.prototype.has=W2,Wr.prototype.set=C2;function Cr(f){var u=-1,d=f==null?0:f.length;for(this.clear();++u=u?f:u)),f}function kn(f,u,d,S,w,x){var T,M=u&O,L=u&p,ee=u&g;if(d&&(T=w?d(f,S,w,x):d(f)),T!==t)return T;if(!Nt(f))return f;var ie=Ke(f);if(ie){if(T=Ak(f),!M)return Bi(f,T)}else{var se=Ci(f),me=se==Ee||se==tt;if(fs(f))return $g(f,M);if(se==ut||se==pt||me&&!w){if(T=L||me?{}:Mg(f),!M)return L?wk(f,N2(T,f)):vk(f,Gp(T,f))}else{if(!Pt[se])return w?f:{};T=Xk(f,se,M)}}x||(x=new qn);var Ce=x.get(f);if(Ce)return Ce;x.set(f,T),dm(f)?f.forEach(function(qe){T.add(kn(qe,u,d,qe,f,x))}):hm(f)&&f.forEach(function(qe,ct){T.set(ct,kn(qe,u,d,ct,f,x))});var Ve=ee?L?Qh:wh:L?Fi:Si,rt=ie?t:Ve(f);return vn(rt||f,function(qe,ct){rt&&(ct=qe,qe=f[ct]),yo(T,ct,kn(qe,u,d,ct,f,x))}),T}function B2(f){var u=Si(f);return function(d){return Hp(d,f,u)}}function Hp(f,u,d){var S=d.length;if(f==null)return!S;for(f=Rt(f);S--;){var w=d[S],x=u[w],T=f[w];if(T===t&&!(w in f)||!x(T))return!1}return!0}function Kp(f,u,d){if(typeof f!="function")throw new wn(l);return xo(function(){f.apply(t,d)},u)}function vo(f,u,d,S){var w=-1,x=Fa,T=!0,M=f.length,L=[],ee=u.length;if(!M)return L;d&&(u=Lt(u,ln(d))),S?(x=Lu,T=!1):u.length>=r&&(x=po,T=!1,u=new Us(u));e:for(;++ww?0:w+d),S=S===t||S>w?w:nt(S),S<0&&(S+=w),S=d>S?0:gm(S);d0&&d(M)?u>1?vi(M,u-1,d,S,w):is(w,M):S||(w[w.length]=M)}return w}var sh=_g(),tg=_g(!0);function sr(f,u){return f&&sh(f,u,Si)}function lh(f,u){return f&&tg(f,u,Si)}function pf(f,u){return ts(u,function(d){return Xr(f[d])})}function Ms(f,u){u=os(u,f);for(var d=0,S=u.length;f!=null&&du}function G2(f,u){return f!=null&&vt.call(f,u)}function H2(f,u){return f!=null&&u in Rt(f)}function K2(f,u,d){return f>=Wi(u,d)&&f=120&&ie.length>=120)?new Us(T&&ie):t}ie=f[0];var se=-1,me=M[0];e:for(;++se-1;)M!==f&&lf.call(M,L,1),lf.call(f,L,1);return f}function hg(f,u){for(var d=f?u.length:0,S=d-1;d--;){var w=u[d];if(d==S||w!==x){var x=w;Ar(w)?lf.call(f,w,1):gh(f,w)}}return f}function Oh(f,u){return f+ff(Np()*(u-f+1))}function uk(f,u,d,S){for(var w=-1,x=ci(af((u-f)/(d||1)),0),T=F(x);x--;)T[S?x:++w]=f,f+=d;return T}function dh(f,u){var d="";if(!f||u<1||u>Ue)return d;do u%2&&(d+=f),u=ff(u/2),u&&(f+=f);while(u);return d}function ot(f,u){return Th(Vg(f,u,Gi),f+"")}function hk(f){return Fp(Sl(f))}function Ok(f,u){var d=Sl(f);return _f(d,Es(u,0,d.length))}function ko(f,u,d,S){if(!Nt(f))return f;u=os(u,f);for(var w=-1,x=u.length,T=x-1,M=f;M!=null&&++ww?0:w+u),d=d>w?w:d,d<0&&(d+=w),w=u>d?0:d-u>>>0,u>>>=0;for(var x=F(w);++S>>1,T=f[x];T!==null&&!an(T)&&(d?T<=u:T=r){var ee=u?null:Pk(f);if(ee)return Ha(ee);T=!1,w=po,L=new Us}else L=u?[]:M;e:for(;++S=S?f:_n(f,u,d)}var bg=r2||function(f){return Re.clearTimeout(f)};function $g(f,u){if(u)return f.slice();var d=f.length,S=Dp?Dp(d):new f.constructor(d);return f.copy(S),S}function $h(f){var u=new f.constructor(f.byteLength);return new rf(u).set(new rf(f)),u}function Sk(f,u){var d=u?$h(f.buffer):f.buffer;return new f.constructor(d,f.byteOffset,f.byteLength)}function bk(f){var u=new f.constructor(f.source,_r.exec(f));return u.lastIndex=f.lastIndex,u}function $k(f){return $o?Rt($o.call(f)):{}}function yg(f,u){var d=u?$h(f.buffer):f.buffer;return new f.constructor(d,f.byteOffset,f.length)}function vg(f,u){if(f!==u){var d=f!==t,S=f===null,w=f===f,x=an(f),T=u!==t,M=u===null,L=u===u,ee=an(u);if(!M&&!ee&&!x&&f>u||x&&T&&L&&!M&&!ee||S&&T&&L||!d&&L||!w)return 1;if(!S&&!x&&!ee&&f=M)return L;var ee=d[S];return L*(ee=="desc"?-1:1)}}return f.index-u.index}function wg(f,u,d,S){for(var w=-1,x=f.length,T=d.length,M=-1,L=u.length,ee=ci(x-T,0),ie=F(L+ee),se=!S;++M1?d[w-1]:t,T=w>2?d[2]:t;for(x=f.length>3&&typeof x=="function"?(w--,x):t,T&&Vi(d[0],d[1],T)&&(x=w<3?t:x,w=1),u=Rt(u);++S-1?w[x?u[T]:T]:t}}function Wg(f){return Rr(function(u){var d=u.length,S=d,w=Qn.prototype.thru;for(f&&u.reverse();S--;){var x=u[S];if(typeof x!="function")throw new wn(l);if(w&&!T&&Qf(x)=="wrapper")var T=new Qn([],!0)}for(S=T?S:d;++S1&&dt.reverse(),ie&&LM))return!1;var ee=x.get(f),ie=x.get(u);if(ee&&ie)return ee==u&&ie==f;var se=-1,me=!0,Ce=d&$?new Us:t;for(x.set(f,u),x.set(u,f);++se1?"& ":"")+u[S],u=u.join(d>2?", ":" "),f.replace(rr,`{ /* [wrapped with `+u+`] */ -`)}function Yk(f){return Ke(f)||Vs(f)||!!(Lp&&f&&f[Lp])}function Ar(f,u){var d=typeof f;return u=u??Ue,!!u&&(d=="number"||d!="symbol"&&Ta.test(f))&&f>-1&&f%1==0&&f0){if(++u>=E)return arguments[0]}else u=0;return f.apply(t,arguments)}}function _f(f,u){var d=-1,S=f.length,w=S-1;for(u=u===t?S:u;++d1?f[u-1]:t;return d=typeof d=="function"?(f.pop(),d):t,em(f,d)});function tm(f){var u=P(f);return u.__chain__=!0,u}function B_(f,u){return u(f),f}function Pf(f,u){return u(f)}var j_=Rr(function(f){var u=f.length,d=u?f[0]:0,S=this.__wrapped__,w=function(x){return rh(x,f)};return u>1||this.__actions__.length||!(S instanceof ht)||!Ar(d)?this.thru(w):(S=S.slice(d,+d+(u?1:0)),S.__actions__.push({func:Pf,args:[w],thisArg:t}),new Qn(S,this.__chain__).thru(function(x){return u&&!x.length&&x.push(t),x}))});function F_(){return tm(this)}function G_(){return new Qn(this.value(),this.__chain__)}function H_(){this.__values__===t&&(this.__values__=pm(this.value()));var f=this.__index__>=this.__values__.length,u=f?t:this.__values__[this.__index__++];return{done:f,value:u}}function K_(){return this}function J_(f){for(var u,d=this;d instanceof hf;){var S=jg(d);S.__index__=0,S.__values__=t,u?w.__wrapped__=S:u=S;var w=S;d=d.__wrapped__}return w.__wrapped__=f,u}function eP(){var f=this.__wrapped__;if(f instanceof ht){var u=f;return this.__actions__.length&&(u=new ht(this)),u=u.reverse(),u.__actions__.push({func:Pf,args:[Zh],thisArg:t}),new Qn(u,this.__chain__)}return this.thru(Zh)}function tP(){return mg(this.__wrapped__,this.__actions__)}var iP=bf(function(f,u,d){vt.call(f,d)?++f[d]:Tr(f,d,1)});function nP(f,u,d){var S=Ke(f)?Cp:B2;return d&&Vi(f,u,d)&&(u=t),S(f,ze(u,3))}function rP(f,u){var d=Ke(f)?ts:eg;return d(f,ze(u,3))}var sP=xg(Fg),lP=xg(Gg);function oP(f,u){return vi(xf(f,u),1)}function aP(f,u){return vi(xf(f,u),ge)}function fP(f,u,d){return d=d===t?1:nt(d),vi(xf(f,u),d)}function im(f,u){var d=Ke(f)?vn:ss;return d(f,ze(u,3))}function nm(f,u){var d=Ke(f)?xQ:Jp;return d(f,ze(u,3))}var cP=bf(function(f,u,d){vt.call(f,d)?f[d].push(u):Tr(f,d,[u])});function uP(f,u,d,S){f=ji(f)?f:Sl(f),d=d&&!S?nt(d):0;var w=f.length;return d<0&&(d=ci(w+d,0)),Rf(f)?d<=w&&f.indexOf(u,d)>-1:!!w&&ll(f,u,d)>-1}var hP=ot(function(f,u,d){var S=-1,w=typeof u=="function",x=ji(f)?F(f.length):[];return ss(f,function(T){x[++S]=w?sn(u,T,d):wo(T,u,d)}),x}),OP=bf(function(f,u,d){Tr(f,d,u)});function xf(f,u){var d=Ke(f)?Lt:lg;return d(f,ze(u,3))}function dP(f,u,d,S){return f==null?[]:(Ke(u)||(u=u==null?[]:[u]),d=S?t:d,Ke(d)||(d=d==null?[]:[d]),cg(f,u,d))}var pP=bf(function(f,u,d){f[d?0:1].push(u)},function(){return[[],[]]});function gP(f,u,d){var S=Ke(f)?Iu:Ap,w=arguments.length<3;return S(f,ze(u,4),d,w,ss)}function mP(f,u,d){var S=Ke(f)?WQ:Ap,w=arguments.length<3;return S(f,ze(u,4),d,w,Jp)}function SP(f,u){var d=Ke(f)?ts:eg;return d(f,Tf(ze(u,3)))}function bP(f){var u=Ke(f)?Fp:uk;return u(f)}function $P(f,u,d){(d?Vi(f,u,d):u===t)?u=1:u=nt(u);var S=Ke(f)?V2:hk;return S(f,u)}function yP(f){var u=Ke(f)?q2:dk;return u(f)}function vP(f){if(f==null)return 0;if(ji(f))return Rf(f)?al(f):f.length;var u=Ci(f);return u==ft||u==bt?f.size:ch(f).length}function wP(f,u,d){var S=Ke(f)?Nu:pk;return d&&Vi(f,u,d)&&(u=t),S(f,ze(u,3))}var QP=ot(function(f,u){if(f==null)return[];var d=u.length;return d>1&&Vi(f,u[0],u[1])?u=[]:d>2&&Vi(u[0],u[1],u[2])&&(u=[u[0]]),cg(f,vi(u,1),[])}),Wf=r2||function(){return Re.Date.now()};function kP(f,u){if(typeof u!="function")throw new wn(l);return f=nt(f),function(){if(--f<1)return u.apply(this,arguments)}}function rm(f,u,d){return u=d?t:u,u=f&&u==null?f.length:u,Zr(f,D,t,t,t,t,u)}function sm(f,u){var d;if(typeof u!="function")throw new wn(l);return f=nt(f),function(){return--f>0&&(d=u.apply(this,arguments)),f<=1&&(u=t),d}}var Ah=ot(function(f,u,d){var S=y;if(d.length){var w=ns(d,gl(Ah));S|=C}return Zr(f,S,u,d,w)}),lm=ot(function(f,u,d){var S=y|k;if(d.length){var w=ns(d,gl(lm));S|=C}return Zr(u,S,f,d,w)});function om(f,u,d){u=d?t:u;var S=Zr(f,Z,t,t,t,t,t,u);return S.placeholder=om.placeholder,S}function am(f,u,d){u=d?t:u;var S=Zr(f,A,t,t,t,t,t,u);return S.placeholder=am.placeholder,S}function fm(f,u,d){var S,w,x,T,M,L,ee=0,ie=!1,se=!1,me=!0;if(typeof f!="function")throw new wn(l);u=xn(u)||0,Nt(d)&&(ie=!!d.leading,se="maxWait"in d,x=se?ci(xn(d.maxWait)||0,u):x,me="trailing"in d?!!d.trailing:me);function Ce(ii){var In=S,Ur=w;return S=w=t,ee=ii,T=f.apply(Ur,In),T}function Ve(ii){return ee=ii,M=xo(ct,u),ie?Ce(ii):T}function rt(ii){var In=ii-L,Ur=ii-ee,xm=u-In;return se?Wi(xm,x-Ur):xm}function qe(ii){var In=ii-L,Ur=ii-ee;return L===t||In>=u||In<0||se&&Ur>=x}function ct(){var ii=Wf();if(qe(ii))return dt(ii);M=xo(ct,rt(ii))}function dt(ii){return M=t,me&&S?Ce(ii):(S=w=t,T)}function fn(){M!==t&&bg(M),ee=0,S=L=w=M=t}function qi(){return M===t?T:dt(Wf())}function cn(){var ii=Wf(),In=qe(ii);if(S=arguments,w=this,L=ii,In){if(M===t)return Ve(L);if(se)return bg(M),M=xo(ct,u),Ce(L)}return M===t&&(M=xo(ct,u)),T}return cn.cancel=fn,cn.flush=qi,cn}var _P=ot(function(f,u){return Kp(f,1,u)}),PP=ot(function(f,u,d){return Kp(f,xn(u)||0,d)});function xP(f){return Zr(f,j)}function Cf(f,u){if(typeof f!="function"||u!=null&&typeof u!="function")throw new wn(l);var d=function(){var S=arguments,w=u?u.apply(this,S):S[0],x=d.cache;if(x.has(w))return x.get(w);var T=f.apply(this,S);return d.cache=x.set(w,T)||x,T};return d.cache=new(Cf.Cache||Cr),d}Cf.Cache=Cr;function Tf(f){if(typeof f!="function")throw new wn(l);return function(){var u=arguments;switch(u.length){case 0:return!f.call(this);case 1:return!f.call(this,u[0]);case 2:return!f.call(this,u[0],u[1]);case 3:return!f.call(this,u[0],u[1],u[2])}return!f.apply(this,u)}}function WP(f){return sm(2,f)}var CP=gk(function(f,u){u=u.length==1&&Ke(u[0])?Lt(u[0],ln(ze())):Lt(vi(u,1),ln(ze()));var d=u.length;return ot(function(S){for(var w=-1,x=Wi(S.length,d);++w=u}),Vs=ng(function(){return arguments}())?ng:function(f){return Jt(f)&&vt.call(f,"callee")&&!qp.call(f,"callee")},Ke=F.isArray,IP=Qp?ln(Qp):J2;function ji(f){return f!=null&&Zf(f.length)&&!Xr(f)}function ti(f){return Jt(f)&&ji(f)}function NP(f){return f===!0||f===!1||Jt(f)&&Di(f)==oe}var fs=l2||Nh,BP=kp?ln(kp):ek;function jP(f){return Jt(f)&&f.nodeType===1&&!Wo(f)}function FP(f){if(f==null)return!0;if(ji(f)&&(Ke(f)||typeof f=="string"||typeof f.splice=="function"||fs(f)||ml(f)||Vs(f)))return!f.length;var u=Ci(f);if(u==ft||u==bt)return!f.size;if(Po(f))return!ch(f).length;for(var d in f)if(vt.call(f,d))return!1;return!0}function GP(f,u){return Qo(f,u)}function HP(f,u,d){d=typeof d=="function"?d:t;var S=d?d(f,u):t;return S===t?Qo(f,u,t,d):!!S}function Yh(f){if(!Jt(f))return!1;var u=Di(f);return u==ce||u==ue||typeof f.message=="string"&&typeof f.name=="string"&&!Wo(f)}function KP(f){return typeof f=="number"&&Ip(f)}function Xr(f){if(!Nt(f))return!1;var u=Di(f);return u==Ee||u==tt||u==$e||u==kt}function um(f){return typeof f=="number"&&f==nt(f)}function Zf(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=Ue}function Nt(f){var u=typeof f;return f!=null&&(u=="object"||u=="function")}function Jt(f){return f!=null&&typeof f=="object"}var hm=_p?ln(_p):ik;function JP(f,u){return f===u||fh(f,u,_h(u))}function ex(f,u,d){return d=typeof d=="function"?d:t,fh(f,u,_h(u),d)}function tx(f){return Om(f)&&f!=+f}function ix(f){if(Mk(f))throw new Ge(s);return rg(f)}function nx(f){return f===null}function rx(f){return f==null}function Om(f){return typeof f=="number"||Jt(f)&&Di(f)==Be}function Wo(f){if(!Jt(f)||Di(f)!=ut)return!1;var u=sf(f);if(u===null)return!0;var d=vt.call(u,"constructor")&&u.constructor;return typeof d=="function"&&d instanceof d&&ef.call(d)==e2}var Uh=Pp?ln(Pp):nk;function sx(f){return um(f)&&f>=-Ue&&f<=Ue}var dm=xp?ln(xp):rk;function Rf(f){return typeof f=="string"||!Ke(f)&&Jt(f)&&Di(f)==je}function an(f){return typeof f=="symbol"||Jt(f)&&Di(f)==fe}var ml=Wp?ln(Wp):sk;function lx(f){return f===t}function ox(f){return Jt(f)&&Ci(f)==He}function ax(f){return Jt(f)&&Di(f)==gi}var fx=wf(uh),cx=wf(function(f,u){return f<=u});function pm(f){if(!f)return[];if(ji(f))return Rf(f)?Vn(f):Bi(f);if(go&&f[go])return VQ(f[go]());var u=Ci(f),d=u==ft?Ku:u==bt?Ha:Sl;return d(f)}function Yr(f){if(!f)return f===0?f:0;if(f=xn(f),f===ge||f===-ge){var u=f<0?-1:1;return u*Le}return f===f?f:0}function nt(f){var u=Yr(f),d=u%1;return u===u?d?u-d:u:0}function gm(f){return f?Es(nt(f),0,We):0}function xn(f){if(typeof f=="number")return f;if(an(f))return Pe;if(Nt(f)){var u=typeof f.valueOf=="function"?f.valueOf():f;f=Nt(u)?u+"":u}if(typeof f!="string")return f===0?f:+f;f=Xp(f);var d=lo.test(f);return d||bu.test(f)?xe(f.slice(2),d?2:8):Pr.test(f)?Pe:+f}function mm(f){return lr(f,Fi(f))}function ux(f){return f?Es(nt(f),-Ue,Ue):f===0?f:0}function yt(f){return f==null?"":on(f)}var hx=dl(function(f,u){if(Po(u)||ji(u)){lr(u,Si(u),f);return}for(var d in u)vt.call(u,d)&&yo(f,d,u[d])}),Sm=dl(function(f,u){lr(u,Fi(u),f)}),Af=dl(function(f,u,d,S){lr(u,Fi(u),f,S)}),Ox=dl(function(f,u,d,S){lr(u,Si(u),f,S)}),dx=Rr(rh);function px(f,u){var d=Ol(f);return u==null?d:Gp(d,u)}var gx=ot(function(f,u){f=Rt(f);var d=-1,S=u.length,w=S>2?u[2]:t;for(w&&Vi(u[0],u[1],w)&&(S=1);++d1),x}),lr(f,Qh(f),d),S&&(d=kn(d,O|p|g,Pk));for(var w=u.length;w--;)gh(d,u[w]);return d});function Ax(f,u){return $m(f,Tf(ze(u)))}var Xx=Rr(function(f,u){return f==null?{}:ak(f,u)});function $m(f,u){if(f==null)return{};var d=Lt(Qh(f),function(S){return[S]});return u=ze(u),ug(f,d,function(S,w){return u(S,w[0])})}function Yx(f,u,d){u=os(u,f);var S=-1,w=u.length;for(w||(w=1,f=t);++Su){var S=f;f=u,u=S}if(d||f%1||u%1){var w=Np();return Wi(f+w*(u-f+be("1e-"+((w+"").length-1))),u)}return Oh(f,u)}var Bx=pl(function(f,u,d){return u=u.toLowerCase(),f+(d?wm(u):u)});function wm(f){return zh(yt(f).toLowerCase())}function Qm(f){return f=yt(f),f&&f.replace(Za,UQ).replace(Yu,"")}function jx(f,u,d){f=yt(f),u=on(u);var S=f.length;d=d===t?S:Es(nt(d),0,S);var w=d;return d-=u.length,d>=0&&f.slice(d,w)==u}function Fx(f){return f=yt(f),f&&no.test(f)?f.replace(Zs,EQ):f}function Gx(f){return f=yt(f),f&&Qr.test(f)?f.replace(Dn,"\\$&"):f}var Hx=pl(function(f,u,d){return f+(d?"-":"")+u.toLowerCase()}),Kx=pl(function(f,u,d){return f+(d?" ":"")+u.toLowerCase()}),Jx=Pg("toLowerCase");function eW(f,u,d){f=yt(f),u=nt(u);var S=u?al(f):0;if(!u||S>=u)return f;var w=(u-S)/2;return vf(ff(w),d)+f+vf(af(w),d)}function tW(f,u,d){f=yt(f),u=nt(u);var S=u?al(f):0;return u&&S>>0,d?(f=yt(f),f&&(typeof u=="string"||u!=null&&!Uh(u))&&(u=on(u),!u&&ol(f))?as(Vn(f),0,d):f.split(u,d)):[]}var aW=pl(function(f,u,d){return f+(d?" ":"")+zh(u)});function fW(f,u,d){return f=yt(f),d=d==null?0:Es(nt(d),0,f.length),u=on(u),f.slice(d,d+u.length)==u}function cW(f,u,d){var S=P.templateSettings;d&&Vi(f,u,d)&&(u=t),f=yt(f),u=Af({},u,S,Ag);var w=Af({},u.imports,S.imports,Ag),x=Si(w),T=Hu(w,x),M,L,ee=0,ie=u.interpolate||xr,se="__p += '",me=Ju((u.escape||xr).source+"|"+ie.source+"|"+(ie===J?Ca:xr).source+"|"+(u.evaluate||xr).source+"|$","g"),Ce="//# sourceURL="+(vt.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Du+"]")+` -`;f.replace(me,function(qe,ct,dt,fn,qi,cn){return dt||(dt=fn),se+=f.slice(ee,cn).replace(Ra,MQ),ct&&(M=!0,se+=`' + +`)}function Uk(f){return Ke(f)||Vs(f)||!!(Lp&&f&&f[Lp])}function Ar(f,u){var d=typeof f;return u=u??Ue,!!u&&(d=="number"||d!="symbol"&&Ta.test(f))&&f>-1&&f%1==0&&f0){if(++u>=E)return arguments[0]}else u=0;return f.apply(t,arguments)}}function _f(f,u){var d=-1,S=f.length,w=S-1;for(u=u===t?S:u;++d1?f[u-1]:t;return d=typeof d=="function"?(f.pop(),d):t,em(f,d)});function tm(f){var u=P(f);return u.__chain__=!0,u}function j_(f,u){return u(f),f}function Pf(f,u){return u(f)}var F_=Rr(function(f){var u=f.length,d=u?f[0]:0,S=this.__wrapped__,w=function(x){return rh(x,f)};return u>1||this.__actions__.length||!(S instanceof ht)||!Ar(d)?this.thru(w):(S=S.slice(d,+d+(u?1:0)),S.__actions__.push({func:Pf,args:[w],thisArg:t}),new Qn(S,this.__chain__).thru(function(x){return u&&!x.length&&x.push(t),x}))});function G_(){return tm(this)}function H_(){return new Qn(this.value(),this.__chain__)}function K_(){this.__values__===t&&(this.__values__=pm(this.value()));var f=this.__index__>=this.__values__.length,u=f?t:this.__values__[this.__index__++];return{done:f,value:u}}function J_(){return this}function eP(f){for(var u,d=this;d instanceof hf;){var S=jg(d);S.__index__=0,S.__values__=t,u?w.__wrapped__=S:u=S;var w=S;d=d.__wrapped__}return w.__wrapped__=f,u}function tP(){var f=this.__wrapped__;if(f instanceof ht){var u=f;return this.__actions__.length&&(u=new ht(this)),u=u.reverse(),u.__actions__.push({func:Pf,args:[Zh],thisArg:t}),new Qn(u,this.__chain__)}return this.thru(Zh)}function iP(){return mg(this.__wrapped__,this.__actions__)}var nP=bf(function(f,u,d){vt.call(f,d)?++f[d]:Tr(f,d,1)});function rP(f,u,d){var S=Ke(f)?Cp:j2;return d&&Vi(f,u,d)&&(u=t),S(f,ze(u,3))}function sP(f,u){var d=Ke(f)?ts:eg;return d(f,ze(u,3))}var lP=xg(Fg),oP=xg(Gg);function aP(f,u){return vi(xf(f,u),1)}function fP(f,u){return vi(xf(f,u),ge)}function cP(f,u,d){return d=d===t?1:nt(d),vi(xf(f,u),d)}function im(f,u){var d=Ke(f)?vn:ss;return d(f,ze(u,3))}function nm(f,u){var d=Ke(f)?WQ:Jp;return d(f,ze(u,3))}var uP=bf(function(f,u,d){vt.call(f,d)?f[d].push(u):Tr(f,d,[u])});function hP(f,u,d,S){f=ji(f)?f:Sl(f),d=d&&!S?nt(d):0;var w=f.length;return d<0&&(d=ci(w+d,0)),Rf(f)?d<=w&&f.indexOf(u,d)>-1:!!w&&ll(f,u,d)>-1}var OP=ot(function(f,u,d){var S=-1,w=typeof u=="function",x=ji(f)?F(f.length):[];return ss(f,function(T){x[++S]=w?sn(u,T,d):wo(T,u,d)}),x}),dP=bf(function(f,u,d){Tr(f,d,u)});function xf(f,u){var d=Ke(f)?Lt:lg;return d(f,ze(u,3))}function pP(f,u,d,S){return f==null?[]:(Ke(u)||(u=u==null?[]:[u]),d=S?t:d,Ke(d)||(d=d==null?[]:[d]),cg(f,u,d))}var gP=bf(function(f,u,d){f[d?0:1].push(u)},function(){return[[],[]]});function mP(f,u,d){var S=Ke(f)?Iu:Ap,w=arguments.length<3;return S(f,ze(u,4),d,w,ss)}function SP(f,u,d){var S=Ke(f)?CQ:Ap,w=arguments.length<3;return S(f,ze(u,4),d,w,Jp)}function bP(f,u){var d=Ke(f)?ts:eg;return d(f,Tf(ze(u,3)))}function $P(f){var u=Ke(f)?Fp:hk;return u(f)}function yP(f,u,d){(d?Vi(f,u,d):u===t)?u=1:u=nt(u);var S=Ke(f)?q2:Ok;return S(f,u)}function vP(f){var u=Ke(f)?L2:pk;return u(f)}function wP(f){if(f==null)return 0;if(ji(f))return Rf(f)?al(f):f.length;var u=Ci(f);return u==ft||u==bt?f.size:ch(f).length}function QP(f,u,d){var S=Ke(f)?Nu:gk;return d&&Vi(f,u,d)&&(u=t),S(f,ze(u,3))}var kP=ot(function(f,u){if(f==null)return[];var d=u.length;return d>1&&Vi(f,u[0],u[1])?u=[]:d>2&&Vi(u[0],u[1],u[2])&&(u=[u[0]]),cg(f,vi(u,1),[])}),Wf=s2||function(){return Re.Date.now()};function _P(f,u){if(typeof u!="function")throw new wn(l);return f=nt(f),function(){if(--f<1)return u.apply(this,arguments)}}function rm(f,u,d){return u=d?t:u,u=f&&u==null?f.length:u,Zr(f,D,t,t,t,t,u)}function sm(f,u){var d;if(typeof u!="function")throw new wn(l);return f=nt(f),function(){return--f>0&&(d=u.apply(this,arguments)),f<=1&&(u=t),d}}var Ah=ot(function(f,u,d){var S=y;if(d.length){var w=ns(d,gl(Ah));S|=C}return Zr(f,S,u,d,w)}),lm=ot(function(f,u,d){var S=y|k;if(d.length){var w=ns(d,gl(lm));S|=C}return Zr(u,S,f,d,w)});function om(f,u,d){u=d?t:u;var S=Zr(f,Z,t,t,t,t,t,u);return S.placeholder=om.placeholder,S}function am(f,u,d){u=d?t:u;var S=Zr(f,A,t,t,t,t,t,u);return S.placeholder=am.placeholder,S}function fm(f,u,d){var S,w,x,T,M,L,ee=0,ie=!1,se=!1,me=!0;if(typeof f!="function")throw new wn(l);u=xn(u)||0,Nt(d)&&(ie=!!d.leading,se="maxWait"in d,x=se?ci(xn(d.maxWait)||0,u):x,me="trailing"in d?!!d.trailing:me);function Ce(ii){var In=S,Ur=w;return S=w=t,ee=ii,T=f.apply(Ur,In),T}function Ve(ii){return ee=ii,M=xo(ct,u),ie?Ce(ii):T}function rt(ii){var In=ii-L,Ur=ii-ee,xm=u-In;return se?Wi(xm,x-Ur):xm}function qe(ii){var In=ii-L,Ur=ii-ee;return L===t||In>=u||In<0||se&&Ur>=x}function ct(){var ii=Wf();if(qe(ii))return dt(ii);M=xo(ct,rt(ii))}function dt(ii){return M=t,me&&S?Ce(ii):(S=w=t,T)}function fn(){M!==t&&bg(M),ee=0,S=L=w=M=t}function qi(){return M===t?T:dt(Wf())}function cn(){var ii=Wf(),In=qe(ii);if(S=arguments,w=this,L=ii,In){if(M===t)return Ve(L);if(se)return bg(M),M=xo(ct,u),Ce(L)}return M===t&&(M=xo(ct,u)),T}return cn.cancel=fn,cn.flush=qi,cn}var PP=ot(function(f,u){return Kp(f,1,u)}),xP=ot(function(f,u,d){return Kp(f,xn(u)||0,d)});function WP(f){return Zr(f,j)}function Cf(f,u){if(typeof f!="function"||u!=null&&typeof u!="function")throw new wn(l);var d=function(){var S=arguments,w=u?u.apply(this,S):S[0],x=d.cache;if(x.has(w))return x.get(w);var T=f.apply(this,S);return d.cache=x.set(w,T)||x,T};return d.cache=new(Cf.Cache||Cr),d}Cf.Cache=Cr;function Tf(f){if(typeof f!="function")throw new wn(l);return function(){var u=arguments;switch(u.length){case 0:return!f.call(this);case 1:return!f.call(this,u[0]);case 2:return!f.call(this,u[0],u[1]);case 3:return!f.call(this,u[0],u[1],u[2])}return!f.apply(this,u)}}function CP(f){return sm(2,f)}var TP=mk(function(f,u){u=u.length==1&&Ke(u[0])?Lt(u[0],ln(ze())):Lt(vi(u,1),ln(ze()));var d=u.length;return ot(function(S){for(var w=-1,x=Wi(S.length,d);++w=u}),Vs=ng(function(){return arguments}())?ng:function(f){return Jt(f)&&vt.call(f,"callee")&&!qp.call(f,"callee")},Ke=F.isArray,NP=Qp?ln(Qp):ek;function ji(f){return f!=null&&Zf(f.length)&&!Xr(f)}function ti(f){return Jt(f)&&ji(f)}function BP(f){return f===!0||f===!1||Jt(f)&&Di(f)==oe}var fs=o2||Nh,jP=kp?ln(kp):tk;function FP(f){return Jt(f)&&f.nodeType===1&&!Wo(f)}function GP(f){if(f==null)return!0;if(ji(f)&&(Ke(f)||typeof f=="string"||typeof f.splice=="function"||fs(f)||ml(f)||Vs(f)))return!f.length;var u=Ci(f);if(u==ft||u==bt)return!f.size;if(Po(f))return!ch(f).length;for(var d in f)if(vt.call(f,d))return!1;return!0}function HP(f,u){return Qo(f,u)}function KP(f,u,d){d=typeof d=="function"?d:t;var S=d?d(f,u):t;return S===t?Qo(f,u,t,d):!!S}function Yh(f){if(!Jt(f))return!1;var u=Di(f);return u==ce||u==ue||typeof f.message=="string"&&typeof f.name=="string"&&!Wo(f)}function JP(f){return typeof f=="number"&&Ip(f)}function Xr(f){if(!Nt(f))return!1;var u=Di(f);return u==Ee||u==tt||u==$e||u==kt}function um(f){return typeof f=="number"&&f==nt(f)}function Zf(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=Ue}function Nt(f){var u=typeof f;return f!=null&&(u=="object"||u=="function")}function Jt(f){return f!=null&&typeof f=="object"}var hm=_p?ln(_p):nk;function ex(f,u){return f===u||fh(f,u,_h(u))}function tx(f,u,d){return d=typeof d=="function"?d:t,fh(f,u,_h(u),d)}function ix(f){return Om(f)&&f!=+f}function nx(f){if(zk(f))throw new Ge(s);return rg(f)}function rx(f){return f===null}function sx(f){return f==null}function Om(f){return typeof f=="number"||Jt(f)&&Di(f)==Be}function Wo(f){if(!Jt(f)||Di(f)!=ut)return!1;var u=sf(f);if(u===null)return!0;var d=vt.call(u,"constructor")&&u.constructor;return typeof d=="function"&&d instanceof d&&ef.call(d)==t2}var Uh=Pp?ln(Pp):rk;function lx(f){return um(f)&&f>=-Ue&&f<=Ue}var dm=xp?ln(xp):sk;function Rf(f){return typeof f=="string"||!Ke(f)&&Jt(f)&&Di(f)==je}function an(f){return typeof f=="symbol"||Jt(f)&&Di(f)==fe}var ml=Wp?ln(Wp):lk;function ox(f){return f===t}function ax(f){return Jt(f)&&Ci(f)==He}function fx(f){return Jt(f)&&Di(f)==gi}var cx=wf(uh),ux=wf(function(f,u){return f<=u});function pm(f){if(!f)return[];if(ji(f))return Rf(f)?Vn(f):Bi(f);if(go&&f[go])return qQ(f[go]());var u=Ci(f),d=u==ft?Ku:u==bt?Ha:Sl;return d(f)}function Yr(f){if(!f)return f===0?f:0;if(f=xn(f),f===ge||f===-ge){var u=f<0?-1:1;return u*Le}return f===f?f:0}function nt(f){var u=Yr(f),d=u%1;return u===u?d?u-d:u:0}function gm(f){return f?Es(nt(f),0,We):0}function xn(f){if(typeof f=="number")return f;if(an(f))return Pe;if(Nt(f)){var u=typeof f.valueOf=="function"?f.valueOf():f;f=Nt(u)?u+"":u}if(typeof f!="string")return f===0?f:+f;f=Xp(f);var d=lo.test(f);return d||bu.test(f)?xe(f.slice(2),d?2:8):Pr.test(f)?Pe:+f}function mm(f){return lr(f,Fi(f))}function hx(f){return f?Es(nt(f),-Ue,Ue):f===0?f:0}function yt(f){return f==null?"":on(f)}var Ox=dl(function(f,u){if(Po(u)||ji(u)){lr(u,Si(u),f);return}for(var d in u)vt.call(u,d)&&yo(f,d,u[d])}),Sm=dl(function(f,u){lr(u,Fi(u),f)}),Af=dl(function(f,u,d,S){lr(u,Fi(u),f,S)}),dx=dl(function(f,u,d,S){lr(u,Si(u),f,S)}),px=Rr(rh);function gx(f,u){var d=Ol(f);return u==null?d:Gp(d,u)}var mx=ot(function(f,u){f=Rt(f);var d=-1,S=u.length,w=S>2?u[2]:t;for(w&&Vi(u[0],u[1],w)&&(S=1);++d1),x}),lr(f,Qh(f),d),S&&(d=kn(d,O|p|g,xk));for(var w=u.length;w--;)gh(d,u[w]);return d});function Xx(f,u){return $m(f,Tf(ze(u)))}var Yx=Rr(function(f,u){return f==null?{}:fk(f,u)});function $m(f,u){if(f==null)return{};var d=Lt(Qh(f),function(S){return[S]});return u=ze(u),ug(f,d,function(S,w){return u(S,w[0])})}function Ux(f,u,d){u=os(u,f);var S=-1,w=u.length;for(w||(w=1,f=t);++Su){var S=f;f=u,u=S}if(d||f%1||u%1){var w=Np();return Wi(f+w*(u-f+be("1e-"+((w+"").length-1))),u)}return Oh(f,u)}var jx=pl(function(f,u,d){return u=u.toLowerCase(),f+(d?wm(u):u)});function wm(f){return zh(yt(f).toLowerCase())}function Qm(f){return f=yt(f),f&&f.replace(Za,EQ).replace(Yu,"")}function Fx(f,u,d){f=yt(f),u=on(u);var S=f.length;d=d===t?S:Es(nt(d),0,S);var w=d;return d-=u.length,d>=0&&f.slice(d,w)==u}function Gx(f){return f=yt(f),f&&no.test(f)?f.replace(Zs,MQ):f}function Hx(f){return f=yt(f),f&&Qr.test(f)?f.replace(Dn,"\\$&"):f}var Kx=pl(function(f,u,d){return f+(d?"-":"")+u.toLowerCase()}),Jx=pl(function(f,u,d){return f+(d?" ":"")+u.toLowerCase()}),eW=Pg("toLowerCase");function tW(f,u,d){f=yt(f),u=nt(u);var S=u?al(f):0;if(!u||S>=u)return f;var w=(u-S)/2;return vf(ff(w),d)+f+vf(af(w),d)}function iW(f,u,d){f=yt(f),u=nt(u);var S=u?al(f):0;return u&&S>>0,d?(f=yt(f),f&&(typeof u=="string"||u!=null&&!Uh(u))&&(u=on(u),!u&&ol(f))?as(Vn(f),0,d):f.split(u,d)):[]}var fW=pl(function(f,u,d){return f+(d?" ":"")+zh(u)});function cW(f,u,d){return f=yt(f),d=d==null?0:Es(nt(d),0,f.length),u=on(u),f.slice(d,d+u.length)==u}function uW(f,u,d){var S=P.templateSettings;d&&Vi(f,u,d)&&(u=t),f=yt(f),u=Af({},u,S,Ag);var w=Af({},u.imports,S.imports,Ag),x=Si(w),T=Hu(w,x),M,L,ee=0,ie=u.interpolate||xr,se="__p += '",me=Ju((u.escape||xr).source+"|"+ie.source+"|"+(ie===J?Ca:xr).source+"|"+(u.evaluate||xr).source+"|$","g"),Ce="//# sourceURL="+(vt.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Du+"]")+` +`;f.replace(me,function(qe,ct,dt,fn,qi,cn){return dt||(dt=fn),se+=f.slice(ee,cn).replace(Ra,zQ),ct&&(M=!0,se+=`' + __e(`+ct+`) + '`),qi&&(L=!0,se+=`'; `+qi+`; @@ -52,7 +52,7 @@ __p += '`),dt&&(se+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+se+`return __p -}`;var rt=_m(function(){return $t(x,Ce+"return "+se).apply(t,T)});if(rt.source=se,Yh(rt))throw rt;return rt}function uW(f){return yt(f).toLowerCase()}function hW(f){return yt(f).toUpperCase()}function OW(f,u,d){if(f=yt(f),f&&(d||u===t))return Xp(f);if(!f||!(u=on(u)))return f;var S=Vn(f),w=Vn(u),x=Yp(S,w),T=Up(S,w)+1;return as(S,x,T).join("")}function dW(f,u,d){if(f=yt(f),f&&(d||u===t))return f.slice(0,Mp(f)+1);if(!f||!(u=on(u)))return f;var S=Vn(f),w=Up(S,Vn(u))+1;return as(S,0,w).join("")}function pW(f,u,d){if(f=yt(f),f&&(d||u===t))return f.replace(nr,"");if(!f||!(u=on(u)))return f;var S=Vn(f),w=Yp(S,Vn(u));return as(S,w).join("")}function gW(f,u){var d=N,S=G;if(Nt(u)){var w="separator"in u?u.separator:w;d="length"in u?nt(u.length):d,S="omission"in u?on(u.omission):S}f=yt(f);var x=f.length;if(ol(f)){var T=Vn(f);x=T.length}if(d>=x)return f;var M=d-al(S);if(M<1)return S;var L=T?as(T,0,M).join(""):f.slice(0,M);if(w===t)return L+S;if(T&&(M+=L.length-M),Uh(w)){if(f.slice(M).search(w)){var ee,ie=L;for(w.global||(w=Ju(w.source,yt(_r.exec(w))+"g")),w.lastIndex=0;ee=w.exec(ie);)var se=ee.index;L=L.slice(0,se===t?M:se)}}else if(f.indexOf(on(w),M)!=M){var me=L.lastIndexOf(w);me>-1&&(L=L.slice(0,me))}return L+S}function mW(f){return f=yt(f),f&&Rs.test(f)?f.replace(zt,NQ):f}var SW=pl(function(f,u,d){return f+(d?" ":"")+u.toUpperCase()}),zh=Pg("toUpperCase");function km(f,u,d){return f=yt(f),u=d?t:u,u===t?DQ(f)?FQ(f):ZQ(f):f.match(u)||[]}var _m=ot(function(f,u){try{return sn(f,t,u)}catch(d){return Yh(d)?d:new Ge(d)}}),bW=Rr(function(f,u){return vn(u,function(d){d=or(d),Tr(f,d,Ah(f[d],f))}),f});function $W(f){var u=f==null?0:f.length,d=ze();return f=u?Lt(f,function(S){if(typeof S[1]!="function")throw new wn(l);return[d(S[0]),S[1]]}):[],ot(function(S){for(var w=-1;++wUe)return[];var d=We,S=Wi(f,We);u=ze(u),f-=We;for(var w=Gu(S,u);++d0||u<0)?new ht(d):(f<0?d=d.takeRight(-f):f&&(d=d.drop(f)),u!==t&&(u=nt(u),d=u<0?d.dropRight(-u):d.take(u-f)),d)},ht.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},ht.prototype.toArray=function(){return this.take(We)},sr(ht.prototype,function(f,u){var d=/^(?:filter|find|map|reject)|While$/.test(u),S=/^(?:head|last)$/.test(u),w=P[S?"take"+(u=="last"?"Right":""):u],x=S||/^find/.test(u);w&&(P.prototype[u]=function(){var T=this.__wrapped__,M=S?[1]:arguments,L=T instanceof ht,ee=M[0],ie=L||Ke(T),se=function(ct){var dt=w.apply(P,is([ct],M));return S&&me?dt[0]:dt};ie&&d&&typeof ee=="function"&&ee.length!=1&&(L=ie=!1);var me=this.__chain__,Ce=!!this.__actions__.length,Ve=x&&!me,rt=L&&!Ce;if(!x&&ie){T=rt?T:new ht(this);var qe=f.apply(T,M);return qe.__actions__.push({func:Pf,args:[se],thisArg:t}),new Qn(qe,me)}return Ve&&rt?f.apply(this,M):(qe=this.thru(se),Ve?S?qe.value()[0]:qe.value():qe)})}),vn(["pop","push","shift","sort","splice","unshift"],function(f){var u=Ka[f],d=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",S=/^(?:pop|shift)$/.test(f);P.prototype[f]=function(){var w=arguments;if(S&&!this.__chain__){var x=this.value();return u.apply(Ke(x)?x:[],w)}return this[d](function(T){return u.apply(Ke(T)?T:[],w)})}}),sr(ht.prototype,function(f,u){var d=P[u];if(d){var S=d.name+"";vt.call(hl,S)||(hl[S]=[]),hl[S].push({name:u,func:d})}}),hl[$f(t,k).name]=[{name:"wrapper",func:t}],ht.prototype.clone=m2,ht.prototype.reverse=S2,ht.prototype.value=b2,P.prototype.at=j_,P.prototype.chain=F_,P.prototype.commit=G_,P.prototype.next=H_,P.prototype.plant=J_,P.prototype.reverse=eP,P.prototype.toJSON=P.prototype.valueOf=P.prototype.value=tP,P.prototype.first=P.prototype.head,go&&(P.prototype[go]=K_),P},fl=GQ();Zt?((Zt.exports=fl)._=fl,mi._=fl):Re._=fl}).call(zo)})(tu,tu.exports);var xY=tu.exports;const WY=Ws.define({parser:MT.configure({props:[Kl.add({ParenthesisedExpression:us({closing:")",align:!1}),Application:us({closing:")",align:!1}),GeneratorCallGenerators:us({closing:")",align:!1}),LetItems:us({closing:"}",align:!1}),ArrayLiteral:us({closing:"]",align:!1}),ArrayLiteral2d:us({closing:"|]",align:!1}),SetLiteral:us({closing:"}",align:!1})}),Jl.add({ParenthesisedExpression:hr,Application:hr,GeneratorCallGenerators:hr,LetItems:hr,ArrayLiteral:hr,ArrayLiteral2d:hr,SetLiteral:hr}),Hl({Keyword:b.keyword,"Identifier QuotedIdentifier":b.variableName,"Call/Identifier Call/QuotedIdentifier GeneratorCall/Identifier GeneratorCall/QuotedIdentifier":b.name,Absent:b.null,Anonymous:b.null,BooleanLiteral:b.bool,Number:b.number,Infinity:b.number,StringLiteral:b.string,LineComment:b.comment,BlockComment:b.comment,"( )":b.paren,"{ }":b.paren,"[ ]":b.paren})]}),languageData:{commentTokens:{line:"%"}}});function OS(){return new Qa(WY)}const bQ=yi({variant:"light",settings:{background:"#fff",foreground:"#000",caret:"#000",selection:"#036dd626",gutterBackground:"#fcfcfc",gutterForeground:"#999",lineHighlight:"#90909020"},styles:[{tag:b.comment,color:"slategray"},{tag:b.string,color:"#690"},{tag:[b.number,b.bool,b.null],color:"#905"},{tag:b.variableName,color:"#000000"},{tag:b.name,color:"#07a"},{tag:[b.keyword],color:"#07a"}]}),$Q=yi({variant:"dark",settings:{background:"var(--bulma-scheme-main-bis)",foreground:"#F6F6F6",caret:"#EEE",selection:"#036dd626",gutterBackground:"var(--bulma-scheme-main-ter)",gutterForeground:"var(--bulma-text)",lineHighlight:"#90909014"},styles:[{tag:b.comment,color:"slategray"},{tag:b.string,color:"#e09177"},{tag:[b.number,b.bool,b.null],color:"#a9e07e"},{tag:b.variableName,color:"#FFFFFF"},{tag:b.name,color:"#e6cf77"},{tag:[b.keyword],color:"#54a2e3"}]}),wp=new Fl,Ns=new Fl,CY=Ns.reconfigure(Oe.editable.of(!1)),TY=Ns.reconfigure(Oe.editable.of(!0)),ZY=wp.reconfigure(bQ),RY=wp.reconfigure($Q);function oc(n,e,t,i=!1){const r=[_X,va.of([{key:"Tab",preventDefault:!0,run:({state:s,dispatch:l})=>s.selection.ranges.some(o=>!o.empty)?cw({state:s,dispatch:l}):(l(s.update(s.replaceSelection(" "),{scrollIntoView:!0,userEvent:"input"})),!0)},{key:"Shift-Tab",preventDefault:!0,run:uw}]),wp.of(t?$Q:bQ),Oe.theme({"&":{height:"100%"},"&.cm-editor.cm-focused":{outline:"none"},".cm-content, .cm-gutter":{minHeight:"100%"},"&.cm-focused .cm-selectionBackground":{backgroundColor:"#036dd638"}})];return n===".json"||n===".mpc"?[...r,Ns.of(Oe.editable.of(!i)),CX()]:n===".mzc"?[...r,Ns.of(Oe.editable.of(!1))]:n===".dzn"?[...r,Ns.of(Oe.editable.of(!i)),OS()]:n===".html"?[...r,Ns.of(Oe.editable.of(!i)),_Y()]:[...r,Ns.of(Oe.editable.of(!i)),OS(),Oe.updateListener.of(xY.debounce(e,250))]}function dS(n,e,t){const i=n.slice();return i[4]=e[t],i}function pS(n,e,t){const i=n.slice();return i[7]=e[t],i}function gS(n,e,t){const i=n.slice();return i[10]=e[t],i[12]=t,i}function AY(n){let e,t,i=iu(n[0].location)+"",r,s,l,o,a,c,h;return{c(){e=_("pre"),t=_("a"),r=pe(i),l=pe(":"),o=I(),a=_("br"),v(t,"class",s="mzn-link mzn-"+n[0].type+" svelte-w513p9"),v(e,"class","svelte-w513p9")},m(O,p){Y(O,e,p),Q(e,t),Q(t,r),Q(e,l),Y(O,o,p),Y(O,a,p),c||(h=le(t,"click",n[3]),c=!0)},p(O,p){p&1&&i!==(i=iu(O[0].location)+"")&&Ne(r,i),p&1&&s!==(s="mzn-link mzn-"+O[0].type+" svelte-w513p9")&&v(t,"class",s)},d(O){O&&(X(e),X(o),X(a)),c=!1,h()}}}function XY(n){let e,t=st(n[0].stack),i=[];for(let r=0;rr("goto",{location:o.location}),l=()=>r("goto",{location:i.location});return n.$$set=o=>{"msg"in o&&t(0,i=o.msg)},[i,r,s,l]}class yQ extends $i{constructor(e){super(),bi(this,e,DY,zY,Oi,{msg:0})}}function wS(n,e,t){const i=n.slice();return i[40]=e[t],i}function QS(n,e,t){const i=n.slice();return i[43]=e[t],i}function kS(n,e,t){const i=n.slice();return i[52]=e[t],i}function _S(n,e,t){const i=n.slice();return i[49]=e[t],i}function PS(n,e,t){const i=n.slice();return i[46]=e[t],i}const VY=n=>({}),xS=n=>({});function WS(n,e,t){const i=n.slice();return i[46]=e[t],i}function CS(n){let e,t,i,r,s,l,o,a,c,h,O,p,g;function m(z,j){return z[13].length===0?LY:qY}let $=m(n),y=$(n),k=st(n[14]),W=[];for(let z=0;z{o=null}),et()),c[2]?a?(a.p(c,h),h[0]&4&&V(a,1)):(a=MS(c),a.c(),V(a,1),a.m(e,null)):a&&(Je(),B(a,1,1,()=>{a=null}),et())},i(c){r||(V(l,c),V(o),V(a),r=!0)},o(c){B(l,c),B(o),B(a),r=!1},d(c){c&&X(e),l&&l.d(c),o&&o.d(),a&&a.d()}}}function ES(n){let e,t,i,r,s,l,o;return r=new wt({props:{icon:eT}}),{c(){e=_("p"),t=_("button"),i=_("span"),Ye(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-small"),v(t,"title","Clear output on each run"),ne(t,"is-primary",n[0]),ne(t,"is-light",!n[0]),v(e,"class","control")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),Ae(r,i,null),s=!0,l||(o=le(t,"click",n[33]),l=!0)},p(a,c){(!s||c[0]&1)&&ne(t,"is-primary",a[0]),(!s||c[0]&1)&&ne(t,"is-light",!a[0])},i(a){s||(V(r.$$.fragment,a),s=!0)},o(a){B(r.$$.fragment,a),s=!1},d(a){a&&X(e),Xe(r),l=!1,o()}}}function MS(n){let e,t,i,r,s,l,o;return r=new wt({props:{icon:ev}}),{c(){e=_("p"),t=_("button"),i=_("span"),Ye(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-small is-danger"),v(t,"title","Clear output"),v(e,"class","control")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),Ae(r,i,null),s=!0,l||(o=le(t,"click",n[34]),l=!0)},p:_e,i(a){s||(V(r.$$.fragment,a),s=!0)},o(a){B(r.$$.fragment,a),s=!1},d(a){a&&X(e),Xe(r),l=!1,o()}}}function IY(n){let e;return{c(){e=pe("Running")},m(t,i){Y(t,e,i)},d(t){t&&X(e)}}}function NY(n){let e;return{c(){e=pe("Compiling")},m(t,i){Y(t,e,i)},d(t){t&&X(e)}}}function BY(n){let e,t,i,r=nu(n[43].runTime)+"",s,l,o=n[43].code&&zS(n);return{c(){o&&o.c(),e=I(),t=_("pre"),i=pe("Finished in "),s=pe(r),l=pe("."),v(t,"class","mzn-runtime")},m(a,c){o&&o.m(a,c),Y(a,e,c),Y(a,t,c),Q(t,i),Q(t,s),Q(t,l)},p(a,c){a[43].code?o?o.p(a,c):(o=zS(a),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),c[0]&2&&r!==(r=nu(a[43].runTime)+"")&&Ne(s,r)},i:_e,o:_e,d(a){a&&(X(e),X(t)),o&&o.d(a)}}}function jY(n){let e,t,i=(n[43].type==="error"&&n[12]||n[43].type==="warning"&&n[11])&&DS(n);return{c(){i&&i.c(),e=Gt()},m(r,s){i&&i.m(r,s),Y(r,e,s),t=!0},p(r,s){r[43].type==="error"&&r[12]||r[43].type==="warning"&&r[11]?i?(i.p(r,s),s[0]&6146&&V(i,1)):(i=DS(r),i.c(),V(i,1),i.m(e.parentNode,e)):i&&(Je(),B(i,1,1,()=>{i=null}),et())},i(r){t||(V(i),t=!0)},o(r){B(i),t=!1},d(r){r&&X(e),i&&i.d(r)}}}function FY(n){let e,t=n[23][n[43].status]+"",i,r,s;return{c(){e=_("pre"),i=pe(t),r=I(),s=_("br")},m(l,o){Y(l,e,o),Q(e,i),Y(l,r,o),Y(l,s,o)},p(l,o){o[0]&2&&t!==(t=l[23][l[43].status]+"")&&Ne(i,t)},i:_e,o:_e,d(l){l&&(X(e),X(r),X(s))}}}function GY(n){let e,t,i;return{c(){e=_("pre"),e.textContent="Stopped.",t=I(),i=_("br"),v(e,"class","mzn-runtime")},m(r,s){Y(r,e,s),Y(r,t,s),Y(r,i,s)},p:_e,i:_e,o:_e,d(r){r&&(X(e),X(t),X(i))}}}function HY(n){let e,t=n[8]&&VS(n);return{c(){t&&t.c(),e=Gt()},m(i,r){t&&t.m(i,r),Y(i,e,r)},p(i,r){i[8]?t?t.p(i,r):(t=VS(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:_e,o:_e,d(i){i&&X(e),t&&t.d(i)}}}function KY(n){let e,t=n[9]&&LS(n);return{c(){t&&t.c(),e=Gt()},m(i,r){t&&t.m(i,r),Y(i,e,r)},p(i,r){i[9]?t?t.p(i,r):(t=LS(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:_e,o:_e,d(i){i&&X(e),t&&t.d(i)}}}function JY(n){let e,t=n[43].comment+"",i;return{c(){e=_("pre"),i=pe(t),v(e,"class","mzn-comment")},m(r,s){Y(r,e,s),Q(e,i)},p(r,s){s[0]&2&&t!==(t=r[43].comment+"")&&Ne(i,t)},i:_e,o:_e,d(r){r&&X(e)}}}function e9(n){let e=n[13].indexOf(n[43].section)===-1&&!n[43].section.startsWith("mzn_vis_"),t,i=e&&IS(n);return{c(){i&&i.c(),t=Gt()},m(r,s){i&&i.m(r,s),Y(r,t,s)},p(r,s){s[0]&8194&&(e=r[13].indexOf(r[43].section)===-1&&!r[43].section.startsWith("mzn_vis_")),e?i?i.p(r,s):(i=IS(r),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},i:_e,o:_e,d(r){r&&X(t),i&&i.d(r)}}}function t9(n){let e,t=n[10]&&NS(n);return{c(){t&&t.c(),e=Gt()},m(i,r){t&&t.m(i,r),Y(i,e,r)},p(i,r){i[10]?t?t.p(i,r):(t=NS(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:_e,o:_e,d(i){i&&X(e),t&&t.d(i)}}}function i9(n){let e,t,i,r,s,l,o,a=st(JS(n[43],n[13])),c=[];for(let O=0;OB(c[O],1,1,()=>{c[O]=null});return{c(){e=_("span"),t=_("pre"),t.textContent="% Solution checker report:",i=I(),r=_("br"),s=I();for(let O=0;O%%%mzn-stat-end',i=I(),r=_("br")},m(o,a){for(let c=0;c{i=null}),et())},i(r){t||(V(i),t=!0)},o(r){B(i),t=!1},d(r){r&&X(e),i&&i.d(r)}}}function o9(n){let e,t=n[49].message+"",i;return{c(){e=_("pre"),i=pe(t)},m(r,s){Y(r,e,s),Q(e,i)},p(r,s){s[0]&8194&&t!==(t=r[49].message+"")&&Ne(i,t)},i:_e,o:_e,d(r){r&&X(e)}}}function BS(n){let e,t;return e=new yQ({props:{msg:n[49]}}),e.$on("goto",n[35]),{c(){Ye(e.$$.fragment)},m(i,r){Ae(e,i,r),t=!0},p(i,r){const s={};r[0]&8194&&(s.msg=i[49]),e.$set(s)},i(i){t||(V(e.$$.fragment,i),t=!0)},o(i){B(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function jS(n){let e,t,i,r;const s=[o9,l9],l=[];function o(a,c){return a[49].type==="text"?0:a[49].type==="error"||a[49].type==="warning"?1:-1}return~(e=o(n))&&(t=l[e]=s[e](n)),{c(){t&&t.c(),i=Gt()},m(a,c){~e&&l[e].m(a,c),Y(a,i,c),r=!0},p(a,c){let h=e;e=o(a),e===h?~e&&l[e].p(a,c):(t&&(Je(),B(l[h],1,1,()=>{l[h]=null}),et()),~e?(t=l[e],t?t.p(a,c):(t=l[e]=s[e](a),t.c()),V(t,1),t.m(i.parentNode,i)):t=null)},i(a){r||(V(t),r=!0)},o(a){B(t),r=!1},d(a){a&&X(i),~e&&l[e].d(a)}}}function FS(n){let e;function t(s,l){if(typeof s[43].output[s[46]]!="string")return f9;if(s[46]!=="raw")return a9}let i=t(n),r=i&&i(n);return{c(){r&&r.c(),e=Gt()},m(s,l){r&&r.m(s,l),Y(s,e,l)},p(s,l){i===(i=t(s))&&r?r.p(s,l):(r&&r.d(1),r=i&&i(s),r&&(r.c(),r.m(e.parentNode,e)))},d(s){s&&X(e),r&&r.d(s)}}}function a9(n){let e,t=n[43].output[n[46]]+"",i;return{c(){e=_("pre"),i=pe(t)},m(r,s){Y(r,e,s),Q(e,i)},p(r,s){s[0]&2&&t!==(t=r[43].output[r[46]]+"")&&Ne(i,t)},d(r){r&&X(e)}}}function f9(n){let e,t=JSON.stringify(n[43].output[n[46]],null,2)+"",i,r,s;return{c(){e=_("pre"),i=pe(t),r=I(),s=_("br")},m(l,o){Y(l,e,o),Q(e,i),Y(l,r,o),Y(l,s,o)},p(l,o){o[0]&2&&t!==(t=JSON.stringify(l[43].output[l[46]],null,2)+"")&&Ne(i,t)},d(l){l&&(X(e),X(r),X(s))}}}function GS(n){let e=n[13].indexOf(n[46])===-1&&!n[46].startsWith("mzn_vis_"),t,i=e&&FS(n);return{c(){i&&i.c(),t=Gt()},m(r,s){i&&i.m(r,s),Y(r,t,s)},p(r,s){s[0]&8194&&(e=r[13].indexOf(r[46])===-1&&!r[46].startsWith("mzn_vis_")),e?i?i.p(r,s):(i=FS(r),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(r){r&&X(t),i&&i.d(r)}}}function HS(n){let e,t,i,r;const s=[n9,i9,t9,e9,JY,KY,HY,GY,FY,jY,BY],l=[];function o(a,c){return a[43].type==="solution"?0:a[43].type==="checker"?1:a[43].type==="time"?2:a[43].type==="trace"?3:a[43].type==="comment"?4:a[43].type==="stderr"?5:a[43].type==="statistics"?6:a[43].type==="cancel"?7:a[43].type==="status"?8:a[43].type==="error"||a[43].type==="warning"?9:a[43].type==="exit"?10:-1}return~(e=o(n))&&(t=l[e]=s[e](n)),{c(){t&&t.c(),i=Gt()},m(a,c){~e&&l[e].m(a,c),Y(a,i,c),r=!0},p(a,c){let h=e;e=o(a),e===h?~e&&l[e].p(a,c):(t&&(Je(),B(l[h],1,1,()=>{l[h]=null}),et()),~e?(t=l[e],t?t.p(a,c):(t=l[e]=s[e](a),t.c()),V(t,1),t.m(i.parentNode,i)):t=null)},i(a){r||(V(t),r=!0)},o(a){B(t),r=!1},d(a){a&&X(i),~e&&l[e].d(a)}}}function KS(n){let e,t,i,r=n[40].files.join(", ")+"",s,l,o,a,c;function h(y,k){return y[40].isCompile?NY:IY}let O=h(n),p=O(n),g=st(n[40].output),m=[];for(let y=0;yB(m[y],1,1,()=>{m[y]=null});return{c(){e=_("details"),t=_("summary"),p.c(),i=I(),s=pe(r),l=I(),o=_("div");for(let y=0;yB(O[g],1,1,()=>{O[g]=null});return{c(){e=_("div"),t=_("div"),a&&a.c(),i=I(),c&&c.c(),r=I(),s=_("div"),l=_("div");for(let g=0;g{c=null}),et()),(!o||m[0]&48)&&ne(t,"is-empty",!g[4]&&!g[5]),(!o||m[0]&64)&&ne(t,"is-tab",g[6]),m[0]&8404738){h=st(g[1]);let $;for($=0;$0&&(s+=`${e}h `),(e>0||t>0)&&(s+=`${t}m `),(e>0||t>0||i>0)&&(s+=`${i}s `),e==0&&t==0&&(i>0&&(s+=" "),s+=`${r}msec`),s.trimEnd()}function JS(n,e){const t=[];let i=[];const r=()=>{if(i.length>0){const s=i.join("").split(` +}`;var rt=_m(function(){return $t(x,Ce+"return "+se).apply(t,T)});if(rt.source=se,Yh(rt))throw rt;return rt}function hW(f){return yt(f).toLowerCase()}function OW(f){return yt(f).toUpperCase()}function dW(f,u,d){if(f=yt(f),f&&(d||u===t))return Xp(f);if(!f||!(u=on(u)))return f;var S=Vn(f),w=Vn(u),x=Yp(S,w),T=Up(S,w)+1;return as(S,x,T).join("")}function pW(f,u,d){if(f=yt(f),f&&(d||u===t))return f.slice(0,Mp(f)+1);if(!f||!(u=on(u)))return f;var S=Vn(f),w=Up(S,Vn(u))+1;return as(S,0,w).join("")}function gW(f,u,d){if(f=yt(f),f&&(d||u===t))return f.replace(nr,"");if(!f||!(u=on(u)))return f;var S=Vn(f),w=Yp(S,Vn(u));return as(S,w).join("")}function mW(f,u){var d=N,S=G;if(Nt(u)){var w="separator"in u?u.separator:w;d="length"in u?nt(u.length):d,S="omission"in u?on(u.omission):S}f=yt(f);var x=f.length;if(ol(f)){var T=Vn(f);x=T.length}if(d>=x)return f;var M=d-al(S);if(M<1)return S;var L=T?as(T,0,M).join(""):f.slice(0,M);if(w===t)return L+S;if(T&&(M+=L.length-M),Uh(w)){if(f.slice(M).search(w)){var ee,ie=L;for(w.global||(w=Ju(w.source,yt(_r.exec(w))+"g")),w.lastIndex=0;ee=w.exec(ie);)var se=ee.index;L=L.slice(0,se===t?M:se)}}else if(f.indexOf(on(w),M)!=M){var me=L.lastIndexOf(w);me>-1&&(L=L.slice(0,me))}return L+S}function SW(f){return f=yt(f),f&&Rs.test(f)?f.replace(zt,BQ):f}var bW=pl(function(f,u,d){return f+(d?" ":"")+u.toUpperCase()}),zh=Pg("toUpperCase");function km(f,u,d){return f=yt(f),u=d?t:u,u===t?VQ(f)?GQ(f):RQ(f):f.match(u)||[]}var _m=ot(function(f,u){try{return sn(f,t,u)}catch(d){return Yh(d)?d:new Ge(d)}}),$W=Rr(function(f,u){return vn(u,function(d){d=or(d),Tr(f,d,Ah(f[d],f))}),f});function yW(f){var u=f==null?0:f.length,d=ze();return f=u?Lt(f,function(S){if(typeof S[1]!="function")throw new wn(l);return[d(S[0]),S[1]]}):[],ot(function(S){for(var w=-1;++wUe)return[];var d=We,S=Wi(f,We);u=ze(u),f-=We;for(var w=Gu(S,u);++d0||u<0)?new ht(d):(f<0?d=d.takeRight(-f):f&&(d=d.drop(f)),u!==t&&(u=nt(u),d=u<0?d.dropRight(-u):d.take(u-f)),d)},ht.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},ht.prototype.toArray=function(){return this.take(We)},sr(ht.prototype,function(f,u){var d=/^(?:filter|find|map|reject)|While$/.test(u),S=/^(?:head|last)$/.test(u),w=P[S?"take"+(u=="last"?"Right":""):u],x=S||/^find/.test(u);w&&(P.prototype[u]=function(){var T=this.__wrapped__,M=S?[1]:arguments,L=T instanceof ht,ee=M[0],ie=L||Ke(T),se=function(ct){var dt=w.apply(P,is([ct],M));return S&&me?dt[0]:dt};ie&&d&&typeof ee=="function"&&ee.length!=1&&(L=ie=!1);var me=this.__chain__,Ce=!!this.__actions__.length,Ve=x&&!me,rt=L&&!Ce;if(!x&&ie){T=rt?T:new ht(this);var qe=f.apply(T,M);return qe.__actions__.push({func:Pf,args:[se],thisArg:t}),new Qn(qe,me)}return Ve&&rt?f.apply(this,M):(qe=this.thru(se),Ve?S?qe.value()[0]:qe.value():qe)})}),vn(["pop","push","shift","sort","splice","unshift"],function(f){var u=Ka[f],d=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",S=/^(?:pop|shift)$/.test(f);P.prototype[f]=function(){var w=arguments;if(S&&!this.__chain__){var x=this.value();return u.apply(Ke(x)?x:[],w)}return this[d](function(T){return u.apply(Ke(T)?T:[],w)})}}),sr(ht.prototype,function(f,u){var d=P[u];if(d){var S=d.name+"";vt.call(hl,S)||(hl[S]=[]),hl[S].push({name:u,func:d})}}),hl[$f(t,k).name]=[{name:"wrapper",func:t}],ht.prototype.clone=S2,ht.prototype.reverse=b2,ht.prototype.value=$2,P.prototype.at=F_,P.prototype.chain=G_,P.prototype.commit=H_,P.prototype.next=K_,P.prototype.plant=eP,P.prototype.reverse=tP,P.prototype.toJSON=P.prototype.valueOf=P.prototype.value=iP,P.prototype.first=P.prototype.head,go&&(P.prototype[go]=J_),P},fl=HQ();Zt?((Zt.exports=fl)._=fl,mi._=fl):Re._=fl}).call(zo)})(tu,tu.exports);var xY=tu.exports;const WY=Ws.define({parser:zT.configure({props:[Kl.add({ParenthesisedExpression:us({closing:")",align:!1}),Application:us({closing:")",align:!1}),GeneratorCallGenerators:us({closing:")",align:!1}),LetItems:us({closing:"}",align:!1}),ArrayLiteral:us({closing:"]",align:!1}),ArrayLiteral2d:us({closing:"|]",align:!1}),SetLiteral:us({closing:"}",align:!1})}),Jl.add({ParenthesisedExpression:hr,Application:hr,GeneratorCallGenerators:hr,LetItems:hr,ArrayLiteral:hr,ArrayLiteral2d:hr,SetLiteral:hr}),Hl({Keyword:b.keyword,"Identifier QuotedIdentifier":b.variableName,"Call/Identifier Call/QuotedIdentifier GeneratorCall/Identifier GeneratorCall/QuotedIdentifier":b.name,Absent:b.null,Anonymous:b.null,BooleanLiteral:b.bool,Number:b.number,Infinity:b.number,StringLiteral:b.string,LineComment:b.comment,BlockComment:b.comment,"( )":b.paren,"{ }":b.paren,"[ ]":b.paren})]}),languageData:{commentTokens:{line:"%"}}});function dS(){return new Qa(WY)}const $Q=yi({variant:"light",settings:{background:"#fff",foreground:"#000",caret:"#000",selection:"#036dd626",gutterBackground:"#fcfcfc",gutterForeground:"#999",lineHighlight:"#90909020"},styles:[{tag:b.comment,color:"slategray"},{tag:b.string,color:"#690"},{tag:[b.number,b.bool,b.null],color:"#905"},{tag:b.variableName,color:"#000000"},{tag:b.name,color:"#07a"},{tag:[b.keyword],color:"#07a"}]}),yQ=yi({variant:"dark",settings:{background:"var(--bulma-scheme-main-bis)",foreground:"#F6F6F6",caret:"#EEE",selection:"#036dd626",gutterBackground:"var(--bulma-scheme-main-ter)",gutterForeground:"var(--bulma-text)",lineHighlight:"#90909014"},styles:[{tag:b.comment,color:"slategray"},{tag:b.string,color:"#e09177"},{tag:[b.number,b.bool,b.null],color:"#a9e07e"},{tag:b.variableName,color:"#FFFFFF"},{tag:b.name,color:"#e6cf77"},{tag:[b.keyword],color:"#54a2e3"}]}),wp=new Fl,Ns=new Fl,CY=Ns.reconfigure(Oe.editable.of(!1)),TY=Ns.reconfigure(Oe.editable.of(!0)),ZY=wp.reconfigure($Q),RY=wp.reconfigure(yQ);function oc(n,e,t,i=!1){const r=[_X,va.of([{key:"Tab",preventDefault:!0,run:({state:s,dispatch:l})=>s.selection.ranges.some(o=>!o.empty)?uw({state:s,dispatch:l}):(l(s.update(s.replaceSelection(" "),{scrollIntoView:!0,userEvent:"input"})),!0)},{key:"Shift-Tab",preventDefault:!0,run:hw}]),wp.of(t?yQ:$Q),Oe.theme({"&":{height:"100%"},"&.cm-editor.cm-focused":{outline:"none"},".cm-content, .cm-gutter":{minHeight:"100%"},"&.cm-focused .cm-selectionBackground":{backgroundColor:"#036dd638"}})];return n===".json"||n===".mpc"?[...r,Ns.of(Oe.editable.of(!i)),CX()]:n===".mzc"?[...r,Ns.of(Oe.editable.of(!1))]:n===".dzn"?[...r,Ns.of(Oe.editable.of(!i)),dS()]:n===".html"?[...r,Ns.of(Oe.editable.of(!i)),_Y()]:[...r,Ns.of(Oe.editable.of(!i)),dS(),Oe.updateListener.of(xY.debounce(e,250))]}function pS(n,e,t){const i=n.slice();return i[4]=e[t],i}function gS(n,e,t){const i=n.slice();return i[7]=e[t],i}function mS(n,e,t){const i=n.slice();return i[10]=e[t],i[12]=t,i}function AY(n){let e,t,i=iu(n[0].location)+"",r,s,l,o,a,c,h;return{c(){e=_("pre"),t=_("a"),r=pe(i),l=pe(":"),o=I(),a=_("br"),v(t,"class",s="mzn-link mzn-"+n[0].type+" svelte-w513p9"),v(e,"class","svelte-w513p9")},m(O,p){Y(O,e,p),Q(e,t),Q(t,r),Q(e,l),Y(O,o,p),Y(O,a,p),c||(h=le(t,"click",n[3]),c=!0)},p(O,p){p&1&&i!==(i=iu(O[0].location)+"")&&Ne(r,i),p&1&&s!==(s="mzn-link mzn-"+O[0].type+" svelte-w513p9")&&v(t,"class",s)},d(O){O&&(X(e),X(o),X(a)),c=!1,h()}}}function XY(n){let e,t=st(n[0].stack),i=[];for(let r=0;rr("goto",{location:o.location}),l=()=>r("goto",{location:i.location});return n.$$set=o=>{"msg"in o&&t(0,i=o.msg)},[i,r,s,l]}class vQ extends $i{constructor(e){super(),bi(this,e,DY,zY,Oi,{msg:0})}}function QS(n,e,t){const i=n.slice();return i[40]=e[t],i}function kS(n,e,t){const i=n.slice();return i[43]=e[t],i}function _S(n,e,t){const i=n.slice();return i[52]=e[t],i}function PS(n,e,t){const i=n.slice();return i[49]=e[t],i}function xS(n,e,t){const i=n.slice();return i[46]=e[t],i}const VY=n=>({}),WS=n=>({});function CS(n,e,t){const i=n.slice();return i[46]=e[t],i}function TS(n){let e,t,i,r,s,l,o,a,c,h,O,p,g;function m(z,j){return z[13].length===0?LY:qY}let $=m(n),y=$(n),k=st(n[14]),W=[];for(let z=0;z{o=null}),et()),c[2]?a?(a.p(c,h),h[0]&4&&V(a,1)):(a=zS(c),a.c(),V(a,1),a.m(e,null)):a&&(Je(),B(a,1,1,()=>{a=null}),et())},i(c){r||(V(l,c),V(o),V(a),r=!0)},o(c){B(l,c),B(o),B(a),r=!1},d(c){c&&X(e),l&&l.d(c),o&&o.d(),a&&a.d()}}}function MS(n){let e,t,i,r,s,l,o;return r=new wt({props:{icon:tT}}),{c(){e=_("p"),t=_("button"),i=_("span"),Ye(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-small"),v(t,"title","Clear output on each run"),ne(t,"is-primary",n[0]),ne(t,"is-light",!n[0]),v(e,"class","control")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),Ae(r,i,null),s=!0,l||(o=le(t,"click",n[33]),l=!0)},p(a,c){(!s||c[0]&1)&&ne(t,"is-primary",a[0]),(!s||c[0]&1)&&ne(t,"is-light",!a[0])},i(a){s||(V(r.$$.fragment,a),s=!0)},o(a){B(r.$$.fragment,a),s=!1},d(a){a&&X(e),Xe(r),l=!1,o()}}}function zS(n){let e,t,i,r,s,l,o;return r=new wt({props:{icon:tv}}),{c(){e=_("p"),t=_("button"),i=_("span"),Ye(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-small is-danger"),v(t,"title","Clear output"),v(e,"class","control")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),Ae(r,i,null),s=!0,l||(o=le(t,"click",n[34]),l=!0)},p:_e,i(a){s||(V(r.$$.fragment,a),s=!0)},o(a){B(r.$$.fragment,a),s=!1},d(a){a&&X(e),Xe(r),l=!1,o()}}}function IY(n){let e;return{c(){e=pe("Running")},m(t,i){Y(t,e,i)},d(t){t&&X(e)}}}function NY(n){let e;return{c(){e=pe("Compiling")},m(t,i){Y(t,e,i)},d(t){t&&X(e)}}}function BY(n){let e,t,i,r=nu(n[43].runTime)+"",s,l,o=n[43].code&&DS(n);return{c(){o&&o.c(),e=I(),t=_("pre"),i=pe("Finished in "),s=pe(r),l=pe("."),v(t,"class","mzn-runtime")},m(a,c){o&&o.m(a,c),Y(a,e,c),Y(a,t,c),Q(t,i),Q(t,s),Q(t,l)},p(a,c){a[43].code?o?o.p(a,c):(o=DS(a),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),c[0]&2&&r!==(r=nu(a[43].runTime)+"")&&Ne(s,r)},i:_e,o:_e,d(a){a&&(X(e),X(t)),o&&o.d(a)}}}function jY(n){let e,t,i=(n[43].type==="error"&&n[12]||n[43].type==="warning"&&n[11])&&VS(n);return{c(){i&&i.c(),e=Gt()},m(r,s){i&&i.m(r,s),Y(r,e,s),t=!0},p(r,s){r[43].type==="error"&&r[12]||r[43].type==="warning"&&r[11]?i?(i.p(r,s),s[0]&6146&&V(i,1)):(i=VS(r),i.c(),V(i,1),i.m(e.parentNode,e)):i&&(Je(),B(i,1,1,()=>{i=null}),et())},i(r){t||(V(i),t=!0)},o(r){B(i),t=!1},d(r){r&&X(e),i&&i.d(r)}}}function FY(n){let e,t=n[23][n[43].status]+"",i,r,s;return{c(){e=_("pre"),i=pe(t),r=I(),s=_("br")},m(l,o){Y(l,e,o),Q(e,i),Y(l,r,o),Y(l,s,o)},p(l,o){o[0]&2&&t!==(t=l[23][l[43].status]+"")&&Ne(i,t)},i:_e,o:_e,d(l){l&&(X(e),X(r),X(s))}}}function GY(n){let e,t,i;return{c(){e=_("pre"),e.textContent="Stopped.",t=I(),i=_("br"),v(e,"class","mzn-runtime")},m(r,s){Y(r,e,s),Y(r,t,s),Y(r,i,s)},p:_e,i:_e,o:_e,d(r){r&&(X(e),X(t),X(i))}}}function HY(n){let e,t=n[8]&&qS(n);return{c(){t&&t.c(),e=Gt()},m(i,r){t&&t.m(i,r),Y(i,e,r)},p(i,r){i[8]?t?t.p(i,r):(t=qS(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:_e,o:_e,d(i){i&&X(e),t&&t.d(i)}}}function KY(n){let e,t=n[9]&&IS(n);return{c(){t&&t.c(),e=Gt()},m(i,r){t&&t.m(i,r),Y(i,e,r)},p(i,r){i[9]?t?t.p(i,r):(t=IS(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:_e,o:_e,d(i){i&&X(e),t&&t.d(i)}}}function JY(n){let e,t=n[43].comment+"",i;return{c(){e=_("pre"),i=pe(t),v(e,"class","mzn-comment")},m(r,s){Y(r,e,s),Q(e,i)},p(r,s){s[0]&2&&t!==(t=r[43].comment+"")&&Ne(i,t)},i:_e,o:_e,d(r){r&&X(e)}}}function e9(n){let e=n[13].indexOf(n[43].section)===-1&&!n[43].section.startsWith("mzn_vis_"),t,i=e&&NS(n);return{c(){i&&i.c(),t=Gt()},m(r,s){i&&i.m(r,s),Y(r,t,s)},p(r,s){s[0]&8194&&(e=r[13].indexOf(r[43].section)===-1&&!r[43].section.startsWith("mzn_vis_")),e?i?i.p(r,s):(i=NS(r),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},i:_e,o:_e,d(r){r&&X(t),i&&i.d(r)}}}function t9(n){let e,t=n[10]&&BS(n);return{c(){t&&t.c(),e=Gt()},m(i,r){t&&t.m(i,r),Y(i,e,r)},p(i,r){i[10]?t?t.p(i,r):(t=BS(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:_e,o:_e,d(i){i&&X(e),t&&t.d(i)}}}function i9(n){let e,t,i,r,s,l,o,a=st(eb(n[43],n[13])),c=[];for(let O=0;OB(c[O],1,1,()=>{c[O]=null});return{c(){e=_("span"),t=_("pre"),t.textContent="% Solution checker report:",i=I(),r=_("br"),s=I();for(let O=0;O%%%mzn-stat-end',i=I(),r=_("br")},m(o,a){for(let c=0;c{i=null}),et())},i(r){t||(V(i),t=!0)},o(r){B(i),t=!1},d(r){r&&X(e),i&&i.d(r)}}}function o9(n){let e,t=n[49].message+"",i;return{c(){e=_("pre"),i=pe(t)},m(r,s){Y(r,e,s),Q(e,i)},p(r,s){s[0]&8194&&t!==(t=r[49].message+"")&&Ne(i,t)},i:_e,o:_e,d(r){r&&X(e)}}}function jS(n){let e,t;return e=new vQ({props:{msg:n[49]}}),e.$on("goto",n[35]),{c(){Ye(e.$$.fragment)},m(i,r){Ae(e,i,r),t=!0},p(i,r){const s={};r[0]&8194&&(s.msg=i[49]),e.$set(s)},i(i){t||(V(e.$$.fragment,i),t=!0)},o(i){B(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function FS(n){let e,t,i,r;const s=[o9,l9],l=[];function o(a,c){return a[49].type==="text"?0:a[49].type==="error"||a[49].type==="warning"?1:-1}return~(e=o(n))&&(t=l[e]=s[e](n)),{c(){t&&t.c(),i=Gt()},m(a,c){~e&&l[e].m(a,c),Y(a,i,c),r=!0},p(a,c){let h=e;e=o(a),e===h?~e&&l[e].p(a,c):(t&&(Je(),B(l[h],1,1,()=>{l[h]=null}),et()),~e?(t=l[e],t?t.p(a,c):(t=l[e]=s[e](a),t.c()),V(t,1),t.m(i.parentNode,i)):t=null)},i(a){r||(V(t),r=!0)},o(a){B(t),r=!1},d(a){a&&X(i),~e&&l[e].d(a)}}}function GS(n){let e;function t(s,l){if(typeof s[43].output[s[46]]!="string")return f9;if(s[46]!=="raw")return a9}let i=t(n),r=i&&i(n);return{c(){r&&r.c(),e=Gt()},m(s,l){r&&r.m(s,l),Y(s,e,l)},p(s,l){i===(i=t(s))&&r?r.p(s,l):(r&&r.d(1),r=i&&i(s),r&&(r.c(),r.m(e.parentNode,e)))},d(s){s&&X(e),r&&r.d(s)}}}function a9(n){let e,t=n[43].output[n[46]]+"",i;return{c(){e=_("pre"),i=pe(t)},m(r,s){Y(r,e,s),Q(e,i)},p(r,s){s[0]&2&&t!==(t=r[43].output[r[46]]+"")&&Ne(i,t)},d(r){r&&X(e)}}}function f9(n){let e,t=JSON.stringify(n[43].output[n[46]],null,2)+"",i,r,s;return{c(){e=_("pre"),i=pe(t),r=I(),s=_("br")},m(l,o){Y(l,e,o),Q(e,i),Y(l,r,o),Y(l,s,o)},p(l,o){o[0]&2&&t!==(t=JSON.stringify(l[43].output[l[46]],null,2)+"")&&Ne(i,t)},d(l){l&&(X(e),X(r),X(s))}}}function HS(n){let e=n[13].indexOf(n[46])===-1&&!n[46].startsWith("mzn_vis_"),t,i=e&&GS(n);return{c(){i&&i.c(),t=Gt()},m(r,s){i&&i.m(r,s),Y(r,t,s)},p(r,s){s[0]&8194&&(e=r[13].indexOf(r[46])===-1&&!r[46].startsWith("mzn_vis_")),e?i?i.p(r,s):(i=GS(r),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(r){r&&X(t),i&&i.d(r)}}}function KS(n){let e,t,i,r;const s=[n9,i9,t9,e9,JY,KY,HY,GY,FY,jY,BY],l=[];function o(a,c){return a[43].type==="solution"?0:a[43].type==="checker"?1:a[43].type==="time"?2:a[43].type==="trace"?3:a[43].type==="comment"?4:a[43].type==="stderr"?5:a[43].type==="statistics"?6:a[43].type==="cancel"?7:a[43].type==="status"?8:a[43].type==="error"||a[43].type==="warning"?9:a[43].type==="exit"?10:-1}return~(e=o(n))&&(t=l[e]=s[e](n)),{c(){t&&t.c(),i=Gt()},m(a,c){~e&&l[e].m(a,c),Y(a,i,c),r=!0},p(a,c){let h=e;e=o(a),e===h?~e&&l[e].p(a,c):(t&&(Je(),B(l[h],1,1,()=>{l[h]=null}),et()),~e?(t=l[e],t?t.p(a,c):(t=l[e]=s[e](a),t.c()),V(t,1),t.m(i.parentNode,i)):t=null)},i(a){r||(V(t),r=!0)},o(a){B(t),r=!1},d(a){a&&X(i),~e&&l[e].d(a)}}}function JS(n){let e,t,i,r=n[40].files.join(", ")+"",s,l,o,a,c;function h(y,k){return y[40].isCompile?NY:IY}let O=h(n),p=O(n),g=st(n[40].output),m=[];for(let y=0;yB(m[y],1,1,()=>{m[y]=null});return{c(){e=_("details"),t=_("summary"),p.c(),i=I(),s=pe(r),l=I(),o=_("div");for(let y=0;yB(O[g],1,1,()=>{O[g]=null});return{c(){e=_("div"),t=_("div"),a&&a.c(),i=I(),c&&c.c(),r=I(),s=_("div"),l=_("div");for(let g=0;g{c=null}),et()),(!o||m[0]&48)&&ne(t,"is-empty",!g[4]&&!g[5]),(!o||m[0]&64)&&ne(t,"is-tab",g[6]),m[0]&8404738){h=st(g[1]);let $;for($=0;$0&&(s+=`${e}h `),(e>0||t>0)&&(s+=`${t}m `),(e>0||t>0||i>0)&&(s+=`${i}s `),e==0&&t==0&&(i>0&&(s+=" "),s+=`${r}msec`),s.trimEnd()}function eb(n,e){const t=[];let i=[];const r=()=>{if(i.length>0){const s=i.join("").split(` `);s[s.length-1]===""&&s.splice(s.length-1,1),t.push({type:"text",message:s.map(l=>`% ${l}`).join(` `)}),i=[]}};if(n.messages){for(const s of n.messages)if(s.type==="solution")for(const l of s.sections)e.indexOf(l)===-1&&l!=="raw"&&i.push(n.output[l]);else s.type==="trace"?e.indexOf(s.section)===-1&&s.section!=="raw"&&i.push(s.message):(r(),t.push(s));r()}else{for(const s of n.sections)e.indexOf(s)===-1&&s!=="raw"&&i.push(n.output[s]);r()}return t}function u9(n,e,t){let i,r,s,l,o,a,{$$slots:c={},$$scope:h}=e;const O=nn();let{output:p}=e,{autoClearOutput:g=!1}=e,{showClearOutput:m=!0}=e,{showAutoClearOutput:$=!0}=e,{showSectionToggles:y=!0}=e,{showRightControls:k=!0}=e,{isTab:W=!1}=e,Z,A=!0,C=!0,U=!0,D=!0,z=!0;function j($e){const oe=$e.flatMap(ce=>ce.output),H=new Set([...oe.filter(ce=>ce.type==="solution"||ce.type==="checker").flatMap(ce=>ce.sections.filter(Ee=>ce.output[Ee].length>0)),...oe.filter(ce=>ce.type==="trace").map(ce=>ce.section)].filter(ce=>ce!=="raw"&&!ce.startsWith("mzn_vis_"))),ue=[...H.values()];return ue.sort(),t(13,E=E.filter(ce=>H.has(ce))),ue}function N($e){E.indexOf($e)===-1?t(13,E=[...E,$e]):t(13,E=E.filter(oe=>oe!==$e))}function G(){E.length===0?t(13,E=[...a]):t(13,E=[])}let E=[];const re={ALL_SOLUTIONS:"==========",OPTIMAL_SOLUTION:"==========",UNSATISFIABLE:"=====UNSATISFIABLE=====",UNSAT_OR_UNBOUNDED:"=====UNSATorUNBOUNDED=====",UNBOUNDED:"=====UNBOUNDED=====",UNKNOWN:"=====UNKNOWN=====",ERROR:"=====ERROR====="};async function ae($e){Z&&(await Gn(),Z.scrollTo(0,Z.scrollHeight))}const ve=()=>G(),Se=$e=>N($e),ge=()=>t(8,A=!A),Ue=()=>t(9,C=!C),Le=()=>t(10,U=!U),Pe=()=>t(11,D=!D),We=()=>t(12,z=!z),lt=()=>t(0,g=!g),Vt=()=>O("clear");function Qt($e){Am.call(this,n,$e)}function pt($e){Am.call(this,n,$e)}function qt($e){Mt[$e?"unshift":"push"](()=>{Z=$e,t(7,Z)})}return n.$$set=$e=>{"output"in $e&&t(1,p=$e.output),"autoClearOutput"in $e&&t(0,g=$e.autoClearOutput),"showClearOutput"in $e&&t(2,m=$e.showClearOutput),"showAutoClearOutput"in $e&&t(3,$=$e.showAutoClearOutput),"showSectionToggles"in $e&&t(4,y=$e.showSectionToggles),"showRightControls"in $e&&t(5,k=$e.showRightControls),"isTab"in $e&&t(6,W=$e.isTab),"$$scope"in $e&&t(24,h=$e.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(19,i=p.some($e=>$e.output.some(oe=>oe.type==="statistics"))),n.$$.dirty[0]&2&&t(18,r=p.some($e=>$e.output.some(oe=>oe.type==="stderr"))),n.$$.dirty[0]&2&&t(17,s=p.some($e=>$e.output.some(oe=>oe.type==="time"))),n.$$.dirty[0]&2&&t(16,l=p.some($e=>$e.output.some(oe=>oe.type==="warning"||oe.type==="checker"&&oe.messages&&oe.messages.some(H=>H.type==="warning")))),n.$$.dirty[0]&2&&t(15,o=p.some($e=>$e.output.some(oe=>oe.type==="error"||oe.type==="checker"&&oe.messages&&oe.messages.some(H=>H.type==="error")))),n.$$.dirty[0]&2&&t(14,a=j(p)),n.$$.dirty[0]&2&&ae()},[g,p,m,$,y,k,W,Z,A,C,U,D,z,E,a,o,l,s,r,i,O,N,G,re,h,c,ve,Se,ge,Ue,Le,Pe,We,lt,Vt,Qt,pt,qt]}class h9 extends $i{constructor(e){super(),bi(this,e,u9,c9,Oi,{output:1,autoClearOutput:0,showClearOutput:2,showAutoClearOutput:3,showSectionToggles:4,showRightControls:5,isTab:6},null,[-1,-1])}}const O9=`const MiniZincIDE = (() => { const callbacks = {}; @@ -195,7 +195,7 @@ function print() { __p += __j.call(arguments, '') } getFinishTime, }; })(); -`;function eb(n,e,t){const i=n.slice();return i[23]=e[t],i[24]=e,i[25]=t,i}function tb(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,k,W,Z;return y=new wt({props:{icon:j3}}),{c(){e=_("div"),t=_("div"),t.innerHTML="Solution:",i=I(),r=_("div"),s=_("input"),o=I(),a=_("div"),c=_("input"),O=I(),p=_("div"),g=_("p"),m=_("button"),$=_("span"),Ye(y.$$.fragment),v(t,"class","solution-label svelte-g2g7zr"),v(s,"class","input is-small"),v(s,"type","number"),v(s,"min",l=n[2]>0?1:0),v(s,"max",n[2]),v(c,"type","range"),v(c,"min",h=n[2]>0?1:0),v(c,"max",n[2]),v(c,"class","svelte-g2g7zr"),v(a,"class","solution-slider svelte-g2g7zr"),v($,"class","icon"),v(m,"class","button is-small"),v(m,"title","Follow latest solution"),ne(m,"is-primary",n[0]),ne(m,"is-light",!n[0]),v(g,"class","control"),v(p,"class","field has-addons svelte-g2g7zr"),v(e,"class","top svelte-g2g7zr")},m(A,C){Y(A,e,C),Q(e,t),Q(e,i),Q(e,r),Q(r,s),li(s,n[1]),Q(e,o),Q(e,a),Q(a,c),li(c,n[1]),Q(e,O),Q(e,p),Q(p,g),Q(g,m),Q(m,$),Ae(y,$,null),k=!0,W||(Z=[le(s,"input",n[12]),le(c,"change",n[13]),le(c,"input",n[13]),le(m,"click",n[14])],W=!0)},p(A,C){(!k||C&4&&l!==(l=A[2]>0?1:0))&&v(s,"min",l),(!k||C&4)&&v(s,"max",A[2]),C&2&&ta(s.value)!==A[1]&&li(s,A[1]),(!k||C&4&&h!==(h=A[2]>0?1:0))&&v(c,"min",h),(!k||C&4)&&v(c,"max",A[2]),C&2&&li(c,A[1]),(!k||C&1)&&ne(m,"is-primary",A[0]),(!k||C&1)&&ne(m,"is-light",!A[0])},i(A){k||(V(y.$$.fragment,A),k=!0)},o(A){B(y.$$.fragment,A),k=!1},d(A){A&&X(e),Xe(y),W=!1,Ft(Z)}}}function ib(n){let e,t,i=n[24],r=n[25],s,l;const o=()=>n[15](e,i,r),a=()=>n[15](null,i,r);function c(...h){return n[16](n[23],...h)}return{c(){e=_("iframe"),v(e,"class","vis-window svelte-g2g7zr"),Cm(e.src,t=n[23].url)||v(e,"src",t),v(e,"title","Visualisation")},m(h,O){Y(h,e,O),o(),s||(l=le(e,"load",c),s=!0)},p(h,O){n=h,O&8&&!Cm(e.src,t=n[23].url)&&v(e,"src",t),(i!==n[24]||r!==n[25])&&(a(),i=n[24],r=n[25],o())},d(h){h&&X(e),a(),s=!1,l()}}}function d9(n){let e,t,i,r,s,l,o,a=n[2]>0&&tb(n),c=st(n[3]),h=[];for(let O=0;O0?a?(a.p(O,p),p&4&&V(a,1)):(a=tb(O),a.c(),V(a,1),a.m(e,t)):a&&(Je(),B(a,1,1,()=>{a=null}),et()),p&8){c=st(O[3]);let g;for(g=0;g{re=Pe});ae.then(Pe=>{Pe.contentWindow.postMessage({event:"init",payload:E},"*")});const ve=s.reduce((Pe,We)=>({...Pe,[We.name]:We.state.doc.toString()}),{}),Se=[],ge=new DOMParser().parseFromString(G,"text/html");for(const Pe of ge.getElementsByTagName("script")){const We=Pe.getAttribute("src");if(We==="/minizinc-ide.js")Pe.src=p9;else if(We in ve&&We.endsWith(".js")){const lt=URL.createObjectURL(new Blob([ve[We]],{type:"text/javascript; charset=utf-8"}));Pe.src=lt,Se.push(lt)}}for(const Pe of ge.getElementsByTagName("link")){const We=Pe.getAttribute("href");if(We in ve&&We.endsWith(".css")){const lt=URL.createObjectURL(new Blob([ve[We]],{type:"text/css; charset=utf-8"}));Pe.href=lt,Se.push(lt)}}const Ue=new XMLSerializer().serializeToString(ge.doctype)+ge.documentElement.outerHTML,Le=URL.createObjectURL(new Blob([Ue],{type:"text/html; charset=utf-8"}));t(3,O=[...O,{key:N,url:Le,extraUrls:Se,makeReady:re,ready:ae,solutions:[],element:null}])}function y(N,G){for(const E in N){const re=O.find(ve=>ve.key===E);if(!re){console.error(`Did not find visualisation for ${E}`);continue}const ae={time:G,data:N[E]};re.solutions.push(ae),Wn({event:"solution",payload:ae},re)}t(2,h++,h)}function k(N,G){p={status:N,time:G};for(let E=0;Ere.element.contentWindow===N.source);switch(G.event){case"rebroadcast":for(const ae of O)Wn(G.message,ae);G.message.event==="goToSolution"&&(l=G.message.payload===-1,t(0,o=G.message.payload===-1),a=G.message.payload+1,t(1,c=G.message.payload+1));break;case"solve":r("solve",{modelFile:G.modelFile,dataFiles:G.dataFiles,options:G.options});break;case"getNumSolutions":Wn({event:"response",id:G.id,payload:E.solutions.length},E);break;case"getSolution":const re=G.index<0?G.index+E.solutions.length:G.index;if(re<0||re>=E.solutions.length)Wn({event:"error",id:G.id,message:"Solution index out of range"},E);else{Wn({event:"response",id:G.id,payload:E.solutions[G.index===-1?E.solutions.length-1:G.index]},E);break}case"getAllSolutions":Wn({event:"response",id:G.id,payload:E.solutions},E);break;case"getStatus":Wn({event:"response",id:G.id,payload:p},E);break;case"getFinishTime":Wn({event:"response",id:G.id,payload:g},E);break}}function A(N,G,E){if(o&&a===c&&(a=h,t(1,c=h)),o!==l){l=o;for(const re of O)Wn({event:"goToSolution",payload:o?-1:c-1},re)}if(a!==c){a=c,l=!1,t(0,o=!1);for(const re of O)Wn({event:"goToSolution",payload:c-1},re)}}function C(){c=ta(this.value),t(1,c)}function U(){c=ta(this.value),t(1,c)}const D=()=>t(0,o=!o);function z(N,G,E){Mt[N?"unshift":"push"](()=>{G[E].element=N,t(3,O)})}const j=(N,G)=>N.makeReady(G.target);return n.$$set=N=>{"files"in N&&t(6,s=N.files)},n.$$.update=()=>{n.$$.dirty&8&&t(4,i=Math.ceil(Math.sqrt(O.length))),n.$$.dirty&7&&A()},[o,c,h,O,i,Z,s,m,$,y,k,W,C,U,D,z,j]}class m9 extends $i{constructor(e){super(),bi(this,e,g9,d9,Oi,{files:6,reset:7,addVisualisation:8,addSolution:9,status:10,finish:11})}get reset(){return this.$$.ctx[7]}get addVisualisation(){return this.$$.ctx[8]}get addSolution(){return this.$$.ctx[9]}get status(){return this.$$.ctx[10]}get finish(){return this.$$.ctx[11]}}const nb=[".mzn",".mzc",".dzn",".json",".html",".js",".css"];async function vQ(n){const e=n.startsWith("http://")||n.startsWith("https://")?n:`http://${n}`,t=e.split("/").pop();if(!t.endsWith(".mzp")&&nb.every(r=>!t.endsWith(r)))throw new Error("File type not recognised");const i=await fetch(new URL(e));if(!i.ok)throw new Error(`Request failed (${i.status} ${i.statusText})`);if(t.endsWith(".mzp")){const r=await i.json(),s=[],l=r.openFiles[r.openTab];let o=0;for(const c of r.projectFiles){const h=c.split("/").pop();if(nb.every(g=>!h.endsWith(g)))continue;c===l&&(o=s.length);const O=await fetch(new URL(c,e));if(!O.ok)throw new Error(`Request failed (${O.status} ${O.statusText})`);const p=await O.text();s.push({name:h,contents:p,hidden:r.openFiles.indexOf(c)===-1})}let a=r.selectedBuiltinConfigId;return a==="org.gecode.gecode"?a="org.minizinc.gecode_presolver":a==="org.chuffed.chuffed"&&(a="org.minizinc.chuffed"),{files:s,tab:o,solverId:a,timestamp:Date.now()}}else{const r=await i.text();return{files:[{name:t,contents:r}],timestamp:Date.now()}}}function S9(n){let e,t;return e=new _s({props:{active:n[0],title:"Create new file",$$slots:{default:[$9]},$$scope:{ctx:n}}}),e.$on("activate",n[8]),e.$on("cancel",n[23]),{c(){Ye(e.$$.fragment)},m(i,r){Ae(e,i,r),t=!0},p(i,r){const s={};r&1&&(s.active=i[0]),r&134217770&&(s.$$scope={dirty:r,ctx:i}),e.$set(s)},i(i){t||(V(e.$$.fragment,i),t=!0)},o(i){B(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function b9(n){let e,t;return e=new _s({props:{active:n[0],title:"Import from URL",$$slots:{footer:[v9],default:[y9]},$$scope:{ctx:n}}}),e.$on("activate",n[8]),e.$on("cancel",n[14]),e.$on("submit",n[10]),{c(){Ye(e.$$.fragment)},m(i,r){Ae(e,i,r),t=!0},p(i,r){const s={};r&1&&(s.active=i[0]),r&134217816&&(s.$$scope={dirty:r,ctx:i}),e.$set(s)},i(i){t||(V(e.$$.fragment,i),t=!0)},o(i){B(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function $9(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,k,W,Z,A,C,U,D,z,j,N,G,E,re,ae,ve,Se,ge,Ue,Le;return{c(){e=_("aside"),t=_("p"),t.textContent="Model",i=I(),r=_("ul"),s=_("li"),l=_("button"),l.textContent="Model file (.mzn)",o=I(),a=_("li"),c=_("button"),c.textContent="Solution checker model (.mzc.mzn)",h=I(),O=_("p"),O.textContent="Data",p=I(),g=_("ul"),m=_("li"),$=_("button"),$.textContent="Data file (.dzn)",y=I(),k=_("li"),W=_("button"),W.textContent="JSON data file (.json)",Z=I(),A=_("p"),A.textContent="Visualisation",C=I(),U=_("ul"),D=_("li"),z=_("button"),z.textContent="Custom visualisation (.html)",j=I(),N=_("p"),N.textContent="Import",G=I(),E=_("ul"),re=_("li"),ae=_("button"),ae.textContent="Upload file(s)",ve=I(),Se=_("li"),ge=_("button"),ge.textContent="Import from URL",v(t,"class","menu-label"),v(l,"type","button"),v(c,"type","button"),v(r,"class","menu-list"),v(O,"class","menu-label"),v($,"type","button"),v(W,"type","button"),v(g,"class","menu-list"),v(A,"class","menu-label"),v(z,"type","button"),v(U,"class","menu-list"),v(N,"class","menu-label"),v(ae,"type","button"),v(ge,"type","button"),v(E,"class","menu-list"),v(e,"class","menu")},m(Pe,We){Y(Pe,e,We),Q(e,t),Q(e,i),Q(e,r),Q(r,s),Q(s,l),n[15](l),Q(r,o),Q(r,a),Q(a,c),Q(e,h),Q(e,O),Q(e,p),Q(e,g),Q(g,m),Q(m,$),Q(g,y),Q(g,k),Q(k,W),Q(e,Z),Q(e,A),Q(e,C),Q(e,U),Q(U,D),Q(D,z),Q(e,j),Q(e,N),Q(e,G),Q(e,E),Q(E,re),Q(re,ae),Q(E,ve),Q(E,Se),Q(Se,ge),Ue||(Le=[le(l,"click",n[16]),le(c,"click",n[17]),le($,"click",n[18]),le(W,"click",n[19]),le(z,"click",n[20]),le(ae,"click",n[21]),le(ge,"click",n[22])],Ue=!0)},p:_e,d(Pe){Pe&&X(e),n[15](null),Ue=!1,Ft(Le)}}}function rb(n){let e,t;return{c(){e=_("div"),t=pe(n[6]),v(e,"class","error svelte-6l40ed")},m(i,r){Y(i,e,r),Q(e,t)},p(i,r){r&64&&Ne(t,i[6])},d(i){i&&X(e)}}}function y9(n){let e,t,i,r,s,l,o=n[6]&&rb(n);return{c(){o&&o.c(),e=I(),t=_("div"),i=_("p"),r=_("input"),v(r,"class","input"),v(r,"type","text"),v(r,"pattern",".+\\.(mzn|dzn|json|js|html|css|mzp|mzc)"),r.required=!0,v(i,"class","control is-expanded"),v(t,"class","field")},m(a,c){o&&o.m(a,c),Y(a,e,c),Y(a,t,c),Q(t,i),Q(i,r),n[12](r),li(r,n[4]),s||(l=le(r,"input",n[13]),s=!0)},p(a,c){a[6]?o?o.p(a,c):(o=rb(a),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),c&16&&r.value!==a[4]&&li(r,a[4])},d(a){a&&(X(e),X(t)),o&&o.d(a),n[12](null),s=!1,l()}}}function v9(n){let e,t,i,r,s,l;return{c(){e=_("div"),t=_("button"),t.textContent="OK",i=I(),r=_("button"),r.textContent="Cancel",v(t,"class","button is-primary"),v(r,"class","button"),v(r,"type","button"),v(e,"slot","footer")},m(o,a){Y(o,e,a),Q(e,t),Q(e,i),Q(e,r),s||(l=le(r,"click",n[11]),s=!0)},p:_e,d(o){o&&X(e),s=!1,l()}}}function w9(n){let e,t,i,r,s,l,o;const a=[b9,S9],c=[];function h(O,p){return O[5]?0:1}return e=h(n),t=c[e]=a[e](n),{c(){t.c(),i=I(),r=_("input"),v(r,"class","is-hidden svelte-6l40ed"),v(r,"type","file"),r.multiple=!0,v(r,"accept",".mzn,.mzc,.dzn,.json,.html,.js,.css")},m(O,p){c[e].m(O,p),Y(O,i,p),Y(O,r,p),n[24](r),s=!0,l||(o=[le(r,"change",n[25]),le(r,"change",n[9])],l=!0)},p(O,[p]){let g=e;e=h(O),e===g?c[e].p(O,p):(Je(),B(c[g],1,1,()=>{c[g]=null}),et(),t=c[e],t?t.p(O,p):(t=c[e]=a[e](O),t.c()),V(t,1),t.m(i.parentNode,i))},i(O){s||(V(t),s=!0)},o(O){B(t),s=!1},d(O){O&&(X(i),X(r)),c[e].d(O),n[24](null),l=!1,Ft(o)}}}function Q9(n,e,t){let{active:i=!1}=e;const r=nn();let s,l,o,a="",c=!1,h=null;function O(ae){t(5,c=!1),t(4,a=""),t(6,h=null)}async function p(){await Gn(),o&&o.focus()}async function g(){const ae=[];for(const Se of l)ae.push(new Promise((ge,Ue)=>{const Le=new FileReader;Le.onload=()=>{ge({name:Se.name,contents:Le.result})},Le.onerror=Pe=>Ue(Pe),Le.readAsText(Se)}));const ve=await Promise.all(ae);r("open",{files:ve})}async function m(){try{r("open",await vQ(a))}catch(ae){t(6,h=`Failed to import from URL: ${ae.message||ae}`),console.error(ae)}}const $=()=>r("cancel");function y(ae){Mt[ae?"unshift":"push"](()=>{o=ae,t(3,o)})}function k(){a=this.value,t(4,a)}const W=()=>r("cancel");function Z(ae){Mt[ae?"unshift":"push"](()=>{o=ae,t(3,o)})}const A=()=>r("new",{type:".mzn"}),C=()=>r("new",{type:".mzc.mzn"}),U=()=>r("new",{type:".dzn"}),D=()=>r("new",{type:".json"}),z=()=>r("new",{type:".html"}),j=()=>s.click(),N=()=>t(5,c=!0),G=()=>r("cancel");function E(ae){Mt[ae?"unshift":"push"](()=>{s=ae,t(1,s)})}function re(){l=this.files,t(2,l)}return n.$$set=ae=>{"active"in ae&&t(0,i=ae.active)},n.$$.update=()=>{n.$$.dirty&1&&O()},[i,s,l,o,a,c,h,r,p,g,m,$,y,k,W,Z,A,C,U,D,z,j,N,G,E,re]}class k9 extends $i{constructor(e){super(),bi(this,e,Q9,w9,Oi,{active:0})}}function sb(n,e,t){const i=n.slice();return i[14]=e[t],i}function lb(n,e,t){const i=n.slice();return i[17]=e[t].file,i[18]=e[t].index,i}function _9(n){let e,t,i,r,s,l,o;i=new wt({props:{icon:n[17].readOnly?Sd:N1}});function a(){return n[11](n[18],n[17])}return{c(){e=_("button"),t=_("span"),Ye(i.$$.fragment),v(t,"class","icon"),v(e,"class","button is-small"),v(e,"title",r="Click to "+(n[17].readOnly?"unlock":"lock")+" this file for editing"),v(e,"type","button"),ne(e,"is-primary",!n[17].readOnly),ne(e,"is-light",n[17].readOnly)},m(c,h){Y(c,e,h),Q(e,t),Ae(i,t,null),s=!0,l||(o=le(e,"click",a),l=!0)},p(c,h){n=c;const O={};h&2&&(O.icon=n[17].readOnly?Sd:N1),i.$set(O),(!s||h&2&&r!==(r="Click to "+(n[17].readOnly?"unlock":"lock")+" this file for editing"))&&v(e,"title",r),(!s||h&2)&&ne(e,"is-primary",!n[17].readOnly),(!s||h&2)&&ne(e,"is-light",n[17].readOnly)},i(c){s||(V(i.$$.fragment,c),s=!0)},o(c){B(i.$$.fragment,c),s=!1},d(c){c&&X(e),Xe(i),l=!1,o()}}}function P9(n){let e,t,i,r;return i=new wt({props:{icon:Sd}}),{c(){e=_("button"),t=_("span"),Ye(i.$$.fragment),v(t,"class","icon"),v(e,"class","button is-small is-light"),v(e,"title","Compiled checkers are read only"),v(e,"type","button"),e.disabled=!0},m(s,l){Y(s,e,l),Q(e,t),Ae(i,t,null),r=!0},p:_e,i(s){r||(V(i.$$.fragment,s),r=!0)},o(s){B(i.$$.fragment,s),r=!1},d(s){s&&X(e),Xe(i)}}}function ob(n){let e,t,i=n[17].name+"",r,s,l,o,a,c,h,O,p,g,m,$,y,k,W,Z,A,C,U,D,z,j,N;p=new wt({props:{icon:n[17].hidden?I1:B1}});function G(){return n[10](n[18],n[17])}const E=[P9,_9],re=[];function ae(Se,ge){return ge&2&&(y=null),y==null&&(y=!!Se[17].name.endsWith(".mzc")),y?0:1}k=ae(n,-1),W=re[k]=E[k](n),D=new wt({props:{icon:ev}});function ve(){return n[12](n[18])}return{c(){e=_("tr"),t=_("td"),r=pe(i),s=I(),l=_("td"),o=_("div"),a=_("div"),c=_("p"),h=_("button"),O=_("span"),Ye(p.$$.fragment),m=I(),$=_("p"),W.c(),Z=I(),A=_("p"),C=_("button"),U=_("span"),Ye(D.$$.fragment),v(O,"class","icon"),v(h,"class","button is-small"),v(h,"title",g="Click to "+(n[17].hidden?"show":"hide")+" this file"),v(h,"type","button"),ne(h,"is-primary",!n[17].hidden),ne(h,"is-light",n[17].hidden),v(c,"class","control"),v($,"class","control"),v(U,"class","icon"),v(C,"class","button is-small is-danger"),v(C,"title","Delete this file"),v(C,"type","button"),v(A,"class","control"),v(a,"class","field is-grouped"),v(o,"class","tool-buttons svelte-1bgv9sn")},m(Se,ge){Y(Se,e,ge),Q(e,t),Q(t,r),Q(e,s),Q(e,l),Q(l,o),Q(o,a),Q(a,c),Q(c,h),Q(h,O),Ae(p,O,null),Q(a,m),Q(a,$),re[k].m($,null),Q(a,Z),Q(a,A),Q(A,C),Q(C,U),Ae(D,U,null),z=!0,j||(N=[le(h,"click",G),le(C,"click",ve)],j=!0)},p(Se,ge){n=Se,(!z||ge&2)&&i!==(i=n[17].name+"")&&Ne(r,i);const Ue={};ge&2&&(Ue.icon=n[17].hidden?I1:B1),p.$set(Ue),(!z||ge&2&&g!==(g="Click to "+(n[17].hidden?"show":"hide")+" this file"))&&v(h,"title",g),(!z||ge&2)&&ne(h,"is-primary",!n[17].hidden),(!z||ge&2)&&ne(h,"is-light",n[17].hidden);let Le=k;k=ae(n,ge),k===Le?re[k].p(n,ge):(Je(),B(re[Le],1,1,()=>{re[Le]=null}),et(),W=re[k],W?W.p(n,ge):(W=re[k]=E[k](n),W.c()),V(W,1),W.m($,null))},i(Se){z||(V(p.$$.fragment,Se),V(W),V(D.$$.fragment,Se),z=!0)},o(Se){B(p.$$.fragment,Se),B(W),B(D.$$.fragment,Se),z=!1},d(Se){Se&&X(e),Xe(p),re[k].d(),Xe(D),j=!1,Ft(N)}}}function ab(n){let e,t=n[14].label+"",i,r,s,l,o=st(n[14].files),a=[];for(let h=0;hB(a[h],1,1,()=>{a[h]=null});return{c(){e=_("p"),i=pe(t),r=I(),s=_("table");for(let h=0;hB(p[m],1,1,()=>{p[m]=null});return s=new wt({props:{icon:iv}}),{c(){for(let m=0;mAccept',v(e,"slot","footer")},m(t,i){Y(t,e,i)},p:_e,d(t){t&&X(e)}}}function C9(n){let e,t;return e=new _s({props:{active:n[0],title:"Manage files",$$slots:{footer:[W9],default:[x9]},$$scope:{ctx:n}}}),e.$on("submit",n[3]),e.$on("cancel",n[3]),{c(){Ye(e.$$.fragment)},m(i,r){Ae(e,i,r),t=!0},p(i,[r]){const s={};r&1&&(s.active=i[0]),r&2097154&&(s.$$scope={dirty:r,ctx:i}),e.$set(s)},i(i){t||(V(e.$$.fragment,i),t=!0)},o(i){B(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function T9(n,e,t){let i,r,s,l,o,a,{active:c=!1}=e,{files:h=[]}=e;const O=nn();function p(){O("close")}const g=(k,W)=>O("modifyFile",{index:k,options:{hidden:!W.hidden}}),m=(k,W)=>O("modifyFile",{index:k,options:{readOnly:!W.readOnly}}),$=k=>O("delete",{index:k}),y=()=>O("newFile");return n.$$set=k=>{"active"in k&&t(0,c=k.active),"files"in k&&t(4,h=k.files)},n.$$.update=()=>{n.$$.dirty&16&&t(9,i=h.map((k,W)=>({file:k,index:W}))),n.$$.dirty&512&&t(8,r=i.filter(k=>k.file.name.endsWith(".mzn")&&!k.file.name.endsWith(".mzc.mzn")).sort((k,W)=>k.file.name.localeCompare(W.file.name))),n.$$.dirty&512&&t(7,s=i.filter(k=>k.file.name.endsWith(".dzn")||k.file.name.endsWith(".json")).sort((k,W)=>k.file.name.localeCompare(W.file.name))),n.$$.dirty&512&&t(6,l=i.filter(k=>k.file.name.endsWith(".mzc")||k.file.name.endsWith(".mzc.mzn")).sort((k,W)=>k.file.name.localeCompare(W.file.name))),n.$$.dirty&512&&t(5,o=i.filter(k=>!k.file.name.endsWith(".mzn")&&!k.file.name.endsWith(".mzc")&&!k.file.name.endsWith(".dzn")&&!k.file.name.endsWith(".json")).sort((k,W)=>k.file.name.localeCompare(W.file.name))),n.$$.dirty&480&&t(1,a=[{label:"Model files",files:r},{label:"Data files",files:s},{label:"Solution checkers",files:l},{label:"Other files",files:o}].filter(k=>k.files.length>0))},[c,a,O,p,h,o,l,s,r,i,g,m,$,y]}class Z9 extends $i{constructor(e){super(),bi(this,e,T9,C9,Oi,{active:0,files:4})}}function fb(n,e,t){const i=n.slice();return i[9]=e[t],i}function cb(n){let e,t=n[9]+"",i,r;return{c(){e=_("option"),i=pe(t),e.__value=r=n[9],li(e,e.__value),v(e,"class","svelte-1x5266v")},m(s,l){Y(s,e,l),Q(e,i)},p(s,l){l&1&&t!==(t=s[9]+"")&&Ne(i,t),l&1&&r!==(r=s[9])&&(e.__value=r,li(e,e.__value))},d(s){s&&X(e)}}}function R9(n){let e,t,i,r,s,l=st(n[0]),o=[];for(let a=0;an[6].call(t)),v(e,"class","select is-fullwidth is-multiple svelte-1x5266v")},m(a,c){Y(a,e,c),Q(e,t);for(let h=0;h0&&t(2,l=p[0])}function a(){i("accept",{modelFile:l})}const c=()=>i("cancel");function h(){l=TO(this),t(2,l),t(0,r)}const O=()=>i("cancel");return n.$$set=p=>{"modelFiles"in p&&t(0,r=p.modelFiles),"active"in p&&t(1,s=p.active)},n.$$.update=()=>{n.$$.dirty&1&&o(r)},[r,s,l,i,a,c,h,O]}class U9 extends $i{constructor(e){super(),bi(this,e,Y9,X9,Oi,{modelFiles:0,active:1})}}function ub(n,e,t){const i=n.slice();return i[25]=e[t],i[26]=e,i[27]=t,i}function hb(n,e,t){const i=n.slice();return i[22]=e[t],i}function Ob(n){let e,t,i,r,s,l,o,a,c;return{c(){e=_("div"),t=_("ul"),i=_("li"),r=_("a"),r.textContent="Enter parameters",s=I(),l=_("li"),o=_("a"),o.textContent="Select data file",ne(i,"is-active",!n[2]),ne(l,"is-active",n[2]),v(e,"class","tabs")},m(h,O){Y(h,e,O),Q(e,t),Q(t,i),Q(i,r),Q(t,s),Q(t,l),Q(l,o),a||(c=[le(r,"click",n[13]),le(o,"click",n[14])],a=!0)},p(h,O){O&4&&ne(i,"is-active",!h[2]),O&4&&ne(l,"is-active",h[2])},d(h){h&&X(e),a=!1,Ft(c)}}}function E9(n){let e,t=st(n[5]),i=[];for(let r=0;rn[16].call(t)),v(e,"class","select is-fullwidth is-multiple")},m(a,c){Y(a,e,c),Q(e,t);for(let h=0;hj[N]===void 0?{name:N,value:""}:{name:N,value:j[N]}))}function $(){r?s("accept",{dataFiles:h}):s("accept",{parameters:O.reduce((j,N)=>({...j,[N.name]:N.value}),{})})}const y=()=>s("cancel"),k=()=>t(2,c=!1),W=()=>t(2,c=!0);function Z(j){Mt[j?"unshift":"push"](()=>{p=j,t(6,p)})}function A(){h=gC(this),t(4,h),t(1,a)}function C(j){Mt[j?"unshift":"push"](()=>{p=j,t(6,p)})}function U(j,N){j[N].value=this.value,t(5,O)}function D(j,N){j[N].value=this.value,t(5,O)}const z=()=>s("cancel");return n.$$set=j=>{"active"in j&&t(0,l=j.active),"parameters"in j&&t(11,o=j.parameters),"dataFiles"in j&&t(1,a=j.dataFiles)},n.$$.update=()=>{n.$$.dirty&2048&&m(o),n.$$.dirty&2&&t(3,i=a.length>0),n.$$.dirty&12&&t(7,r=i&&c)},[l,a,c,i,h,O,p,r,s,g,$,o,y,k,W,Z,A,C,U,D,z]}class N9 extends $i{constructor(e){super(),bi(this,e,I9,L9,Oi,{active:0,parameters:11,dataFiles:1})}}function gb(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,k,W,Z=Tn(n[1],"-a"),A,C=Tn(n[1],"-f"),U,D,z,j,N,G,E,re,ae,ve=Tn(n[1],"-v"),Se,ge,Ue,Le,Pe,We,lt,Vt=Tn(n[1],"-s"),Qt,pt,qt,$e,oe,H,ue,ce,Ee,tt,ft,Be,Yt,ut,Mn,kt;r=new wt({props:{icon:nv}});let xt=Z&&mb(n),bt=C&&Sb(n),je=ve&&bb(n),fe=Vt&&$b(n);return{c(){e=_("div"),t=_("button"),i=_("span"),Ye(r.$$.fragment),s=I(),l=_("form"),o=_("h5"),o.textContent="Solving options",a=I(),c=_("div"),h=_("p"),O=_("input"),p=I(),g=_("label"),g.textContent="Time limit (s)",m=I(),$=_("p"),y=_("input"),W=I(),xt&&xt.c(),A=I(),bt&&bt.c(),U=I(),D=_("h5"),D.textContent="Output options",z=I(),j=_("div"),N=_("p"),G=_("input"),E=I(),re=_("label"),re.textContent="Verbose compilation",ae=I(),je&&je.c(),Se=I(),ge=_("div"),Ue=_("p"),Le=_("input"),Pe=I(),We=_("label"),We.textContent="Compilation statistics",lt=I(),fe&&fe.c(),Qt=I(),pt=_("div"),qt=_("p"),$e=_("input"),oe=I(),H=_("label"),H.textContent="Timing information",ue=I(),ce=_("div"),Ee=_("p"),Ee.innerHTML='',tt=I(),ft=_("p"),Be=_("button"),Be.textContent="Reset to defaults",v(i,"class","icon"),v(t,"class","button is-text is-small exit-button svelte-makhy9"),v(o,"class","title is-5 svelte-makhy9"),v(O,"id","enable-timelimit"),v(O,"type","checkbox"),v(O,"class","svelte-makhy9"),v(g,"for","enable-timelimit"),v(g,"class","svelte-makhy9"),v(h,"class","control checkbox-control svelte-makhy9"),v(y,"class","input is-fullwidth"),v(y,"type","number"),v(y,"step","1"),v(y,"min",0),y.disabled=k=!n[3].enableTimeLimit,v($,"class","control is-expanded"),v(c,"class","field is-grouped"),v(D,"class","title is-5 svelte-makhy9"),v(G,"id","enable-verbose-compile"),v(G,"type","checkbox"),v(G,"class","svelte-makhy9"),v(re,"for","enable-verbose-compile"),v(re,"class","svelte-makhy9"),v(N,"class","control checkbox-control svelte-makhy9"),v(j,"class","field"),v(Le,"id","enable-compilation-satistics"),v(Le,"type","checkbox"),v(Le,"class","svelte-makhy9"),v(We,"for","enable-compilation-satistics"),v(We,"class","svelte-makhy9"),v(Ue,"class","control checkbox-control svelte-makhy9"),v(ge,"class","field"),v($e,"id","enable-timing-information"),v($e,"type","checkbox"),v($e,"class","svelte-makhy9"),v(H,"for","enable-timing-information"),v(H,"class","svelte-makhy9"),v(qt,"class","control checkbox-control svelte-makhy9"),v(pt,"class","field"),v(Ee,"class","control"),v(Be,"type","button"),v(Be,"class","button is-danger"),v(ft,"class","control"),v(ce,"class","field is-grouped bottom-buttons svelte-makhy9"),v(e,"class","config-window svelte-makhy9")},m(Fe,He){Y(Fe,e,He),Q(e,t),Q(t,i),Ae(r,i,null),Q(e,s),Q(e,l),Q(l,o),Q(l,a),Q(l,c),Q(c,h),Q(h,O),O.checked=n[3].enableTimeLimit,Q(h,p),Q(h,g),Q(c,m),Q(c,$),Q($,y),li(y,n[3].timeLimit),Q(l,W),xt&&xt.m(l,null),Q(l,A),bt&&bt.m(l,null),Q(l,U),Q(l,D),Q(l,z),Q(l,j),Q(j,N),Q(N,G),G.checked=n[3].verboseCompilation,Q(N,E),Q(N,re),Q(l,ae),je&&je.m(l,null),Q(l,Se),Q(l,ge),Q(ge,Ue),Q(Ue,Le),Le.checked=n[3].compilerStatistics,Q(Ue,Pe),Q(Ue,We),Q(l,lt),fe&&fe.m(l,null),Q(l,Qt),Q(l,pt),Q(pt,qt),Q(qt,$e),$e.checked=n[3].outputTime,Q(qt,oe),Q(qt,H),Q(l,ue),Q(l,ce),Q(ce,Ee),Q(ce,tt),Q(ce,ft),Q(ft,Be),ut=!0,Mn||(kt=[le(t,"click",n[10]),le(O,"change",n[11]),le(y,"input",n[12]),le(G,"change",n[15]),le(Le,"change",n[17]),le($e,"change",n[19]),le(Be,"click",n[2]),le(l,"submit",S$(n[20]))],Mn=!0)},p(Fe,He){He&8&&(O.checked=Fe[3].enableTimeLimit),(!ut||He&8&&k!==(k=!Fe[3].enableTimeLimit))&&(y.disabled=k),He&8&&ta(y.value)!==Fe[3].timeLimit&&li(y,Fe[3].timeLimit),He&2&&(Z=Tn(Fe[1],"-a")),Z?xt?xt.p(Fe,He):(xt=mb(Fe),xt.c(),xt.m(l,A)):xt&&(xt.d(1),xt=null),He&2&&(C=Tn(Fe[1],"-f")),C?bt?bt.p(Fe,He):(bt=Sb(Fe),bt.c(),bt.m(l,U)):bt&&(bt.d(1),bt=null),He&8&&(G.checked=Fe[3].verboseCompilation),He&2&&(ve=Tn(Fe[1],"-v")),ve?je?je.p(Fe,He):(je=bb(Fe),je.c(),je.m(l,Se)):je&&(je.d(1),je=null),He&8&&(Le.checked=Fe[3].compilerStatistics),He&2&&(Vt=Tn(Fe[1],"-s")),Vt?fe?fe.p(Fe,He):(fe=$b(Fe),fe.c(),fe.m(l,Qt)):fe&&(fe.d(1),fe=null),He&8&&($e.checked=Fe[3].outputTime)},i(Fe){ut||(V(r.$$.fragment,Fe),Fe&&Kn(()=>{ut&&(Yt||(Yt=kl(e,Tc,{x:100,duration:200},!0)),Yt.run(1))}),ut=!0)},o(Fe){B(r.$$.fragment,Fe),Fe&&(Yt||(Yt=kl(e,Tc,{x:100,duration:200},!1)),Yt.run(0)),ut=!1},d(Fe){Fe&&X(e),Xe(r),xt&&xt.d(),bt&&bt.d(),je&&je.d(),fe&&fe.d(),Fe&&Yt&&Yt.end(),Mn=!1,Ft(kt)}}}function mb(n){let e,t,i,r,s,l,o;return{c(){e=_("div"),t=_("p"),i=_("input"),r=I(),s=_("label"),s.textContent="All solutions (for satisfication problems)",v(i,"id","enable-all-solutions"),v(i,"type","checkbox"),v(i,"class","svelte-makhy9"),v(s,"for","enable-all-solutions"),v(s,"class","svelte-makhy9"),v(t,"class","control checkbox-control svelte-makhy9"),v(e,"class","field")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),i.checked=n[3].allSolutions,Q(t,r),Q(t,s),l||(o=le(i,"change",n[13]),l=!0)},p(a,c){c&8&&(i.checked=a[3].allSolutions)},d(a){a&&X(e),l=!1,o()}}}function Sb(n){let e,t,i,r,s,l,o;return{c(){e=_("div"),t=_("p"),i=_("input"),r=I(),s=_("label"),s.textContent="Free search",v(i,"id","enable-free-search"),v(i,"type","checkbox"),v(i,"class","svelte-makhy9"),v(s,"for","enable-free-search"),v(s,"class","svelte-makhy9"),v(t,"class","control checkbox-control svelte-makhy9"),v(e,"class","field")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),i.checked=n[3].freeSearch,Q(t,r),Q(t,s),l||(o=le(i,"change",n[14]),l=!0)},p(a,c){c&8&&(i.checked=a[3].freeSearch)},d(a){a&&X(e),l=!1,o()}}}function bb(n){let e,t,i,r,s,l,o;return{c(){e=_("div"),t=_("p"),i=_("input"),r=I(),s=_("label"),s.textContent="Verbose solving",v(i,"id","enable-verbose-solve"),v(i,"type","checkbox"),v(i,"class","svelte-makhy9"),v(s,"for","enable-verbose-solve"),v(s,"class","svelte-makhy9"),v(t,"class","control checkbox-control svelte-makhy9"),v(e,"class","field")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),i.checked=n[3].verboseSolving,Q(t,r),Q(t,s),l||(o=le(i,"change",n[16]),l=!0)},p(a,c){c&8&&(i.checked=a[3].verboseSolving)},d(a){a&&X(e),l=!1,o()}}}function $b(n){let e,t,i,r,s,l,o;return{c(){e=_("div"),t=_("p"),i=_("input"),r=I(),s=_("label"),s.textContent="Solving statistics",v(i,"id","enable-solving-satistics"),v(i,"type","checkbox"),v(i,"class","svelte-makhy9"),v(s,"for","enable-solving-satistics"),v(s,"class","svelte-makhy9"),v(t,"class","control checkbox-control svelte-makhy9"),v(e,"class","field")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),i.checked=n[3].solvingStatistics,Q(t,r),Q(t,s),l||(o=le(i,"change",n[18]),l=!0)},p(a,c){c&8&&(i.checked=a[3].solvingStatistics)},d(a){a&&X(e),l=!1,o()}}}function B9(n){let e,t,i=n[0]&&gb(n);return{c(){i&&i.c(),e=Gt()},m(r,s){i&&i.m(r,s),Y(r,e,s),t=!0},p(r,[s]){r[0]?i?(i.p(r,s),s&1&&V(i,1)):(i=gb(r),i.c(),V(i,1),i.m(e.parentNode,e)):i&&(Je(),B(i,1,1,()=>{i=null}),et())},i(r){t||(V(i),t=!0)},o(r){B(i),t=!1},d(r){r&&X(e),i&&i.d(r)}}}function Tn(n,e){return n.indexOf(e)!==-1}function j9(n,e,t){const i=nn();let{active:r}=e,{stdFlags:s=[]}=e;const l={enableTimeLimit:!1,timeLimit:1,allSolutions:!1,verboseCompilation:!1,verboseSolving:!1,compilerStatistics:!1,solvingStatistics:!1,outputTime:!1,freeSearch:!1};let o={...l};function a(N){const G=N*1e3;G!==Math.floor(G)&&t(3,o.timeLimit=Math.floor(G)/1e3,o)}function c(){for(const N in o)if(l[N]!==o[N])return!1;return!0}function h(){t(3,o={...l})}function O(N){const G={...l};for(const E in l)E in N&&(G[E]=N[E]);t(3,o=G)}function p(){return{...o}}function g(N){const G={solver:N};return o.enableTimeLimit&&o.timeLimit>0&&(G["time-limit"]=o.timeLimit*1e3),o.allSolutions&&Tn(s,"-a")&&(G["all-satisfaction"]=!0),o.verboseCompilation&&(G["verbose-compilation"]=!0),o.verboseSolving&&Tn(s,"-v")&&(G["verbose-solving"]=!0),o.compilerStatistics&&(G["compiler-statistics"]=!0),o.solvingStatistics&&Tn(s,"-s")&&(G["solver-statistics"]=!0),o.outputTime&&(G["output-time"]=!0),o.freeSearch&&Tn(s,"-f")&&(G["free-search"]=!0),G}function m(N){const G={solver:N};return o.verboseCompilation&&(G["verbose-compilation"]=!0),o.compilerStatistics&&(G["compiler-statistics"]=!0),G}const $=()=>i("close");function y(){o.enableTimeLimit=this.checked,t(3,o)}function k(){o.timeLimit=ta(this.value),t(3,o)}function W(){o.allSolutions=this.checked,t(3,o)}function Z(){o.freeSearch=this.checked,t(3,o)}function A(){o.verboseCompilation=this.checked,t(3,o)}function C(){o.verboseSolving=this.checked,t(3,o)}function U(){o.compilerStatistics=this.checked,t(3,o)}function D(){o.solvingStatistics=this.checked,t(3,o)}function z(){o.outputTime=this.checked,t(3,o)}const j=()=>i("close");return n.$$set=N=>{"active"in N&&t(0,r=N.active),"stdFlags"in N&&t(1,s=N.stdFlags)},n.$$.update=()=>{n.$$.dirty&8&&a(o.timeLimit)},[r,s,h,o,i,c,O,p,g,m,$,y,k,W,Z,A,C,U,D,z,j]}class F9 extends $i{constructor(e){super(),bi(this,e,j9,B9,Oi,{active:0,stdFlags:1,isDefault:5,reset:2,load:6,save:7,getSolvingConfiguration:8,getCompilationConfiguration:9})}get isDefault(){return this.$$.ctx[5]}get reset(){return this.$$.ctx[2]}get load(){return this.$$.ctx[6]}get save(){return this.$$.ctx[7]}get getSolvingConfiguration(){return this.$$.ctx[8]}get getCompilationConfiguration(){return this.$$.ctx[9]}}function yb(n,e,t){const i=n.slice();return i[14]=e[t],i}const G9=n=>({item:n&4}),vb=n=>({item:n[14]}),H9=n=>({item:n&8}),wb=n=>({item:n[3]});function Qb(n){let e;const t=n[9].selected,i=Ri(t,n,n[8],wb),r=i||K9(n);return{c(){r&&r.c()},m(s,l){r&&r.m(s,l),e=!0},p(s,l){i?i.p&&(!e||l&264)&&Xi(i,t,s,s[8],e?Ai(t,s[8],l,H9):Yi(s[8]),wb):r&&r.p&&(!e||l&8)&&r.p(s,e?l:-1)},i(s){e||(V(r,s),e=!0)},o(s){B(r,s),e=!1},d(s){r&&r.d(s)}}}function K9(n){let e=n[3].label+"",t;return{c(){t=pe(e)},m(i,r){Y(i,t,r)},p(i,r){r&8&&e!==(e=i[3].label+"")&&Ne(t,e)},d(i){i&&X(t)}}}function J9(n){let e=n[14].label+"",t;return{c(){t=pe(e)},m(i,r){Y(i,t,r)},p(i,r){r&4&&e!==(e=i[14].label+"")&&Ne(t,e)},d(i){i&&X(t)}}}function kb(n){let e,t,i,r,s;const l=n[9].item,o=Ri(l,n,n[8],vb),a=o||J9(n);function c(){return n[11](n[14])}return{c(){e=_("a"),a&&a.c(),t=I(),v(e,"href","javascript:void(0);"),v(e,"class","dropdown-item"),ne(e,"is-active",n[3]===n[14])},m(h,O){Y(h,e,O),a&&a.m(e,null),Q(e,t),i=!0,r||(s=le(e,"click",c),r=!0)},p(h,O){n=h,o?o.p&&(!i||O&260)&&Xi(o,l,n,n[8],i?Ai(l,n[8],O,G9):Yi(n[8]),vb):a&&a.p&&(!i||O&4)&&a.p(n,i?O:-1),(!i||O&12)&&ne(e,"is-active",n[3]===n[14])},i(h){i||(V(a,h),i=!0)},o(h){B(a,h),i=!1},d(h){h&&X(e),a&&a.d(h),r=!1,s()}}}function e8(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$=n[3]&&Qb(n);a=new wt({props:{icon:J3}});let y=st(n[2]),k=[];for(let Z=0;ZB(k[Z],1,1,()=>{k[Z]=null});return{c(){e=I(),t=_("div"),i=_("div"),r=_("button"),s=_("span"),$&&$.c(),l=I(),o=_("span"),Ye(a.$$.fragment),c=I(),h=_("div"),O=_("div");for(let Z=0;Z{$=null}),et()),(!p||A&16)&&(r.disabled=Z[4]),A&332){y=st(Z[2]);let C;for(C=0;Ct(0,c=!c),$=k=>p(k);function y(k){Mt[k?"unshift":"push"](()=>{O=k,t(5,O)})}return n.$$set=k=>{"title"in k&&t(1,l=k.title),"items"in k&&t(2,o=k.items),"currentItem"in k&&t(3,a=k.currentItem),"active"in k&&t(0,c=k.active),"disabled"in k&&t(4,h=k.disabled),"$$scope"in k&&t(8,r=k.$$scope)},[c,l,o,a,h,O,p,g,r,i,m,$,y]}class i8 extends $i{constructor(e){super(),bi(this,e,t8,e8,Oi,{title:1,items:2,currentItem:3,active:0,disabled:4})}}const wQ=Ie.define({map:(n,e)=>({from:e.mapPos(n.from),to:e.mapPos(n.to),msg:n.msg,type:n.type})}),QQ=Ie.define(),_b=pi.define({create(){return Ze.none},update(n,e){n=n.map(e.changes);for(const t of e.effects)t.is(QQ)&&(n=Ze.none),t.is(wQ)&&(n=n.update({add:[Ze.mark({class:`cm-mzn-underline-${t.value.type}`,attributes:{title:t.value.msg}}).range(t.value.from,t.value.to)]}));return n},provide:n=>Oe.decorations.from(n)});function Ad(n,e,t){let i,r=1,s=1;for(i=0;i=n&&s>=e)return i;s++,t[i]===` -`&&(r++,s=1)}return i}function n8(n,e,t){const i=e.map(r=>wQ.of({from:Ad(r.location.firstLine,r.location.firstColumn,n),to:Ad(r.location.lastLine,r.location.lastColumn,n)+1,msg:`${r.type==="error"?"Error":"Warning"}: ${r.what}: ${r.message}`,type:r.type}));t.state.field(_b,!1)||i.push(Ie.appendConfig.of([_b])),t.dispatch({effects:[QQ.of(null),...i]})}const yl=[];function kQ(n,e=_e){let t;const i=new Set;function r(o){if(Oi(n,o)&&(n=o,t)){const a=!yl.length;for(const c of i)c[1](),yl.push(c,n);if(a){for(let c=0;c{i.delete(c),i.size===0&&t&&(t(),t=null)}}return{set:r,update:s,subscribe:l}}const _Q=n=>{const e=window.matchMedia(n);return kQ(e.matches,t=>{const i=()=>t(window.matchMedia(n).matches);return e.addEventListener("change",i),()=>e.removeEventListener("change",i)})},r8=_Q("(prefers-color-scheme: dark)"),s8=_Q("(max-width: 768px)"),l8=n=>({isMobile:n[1]&4194304}),Pb=n=>({isMobile:n[53]}),o8=n=>({isMobile:n[1]&4194304}),xb=n=>({isMobile:n[53]}),a8=n=>({isMobile:n[1]&4194304}),Wb=n=>({isMobile:n[53]}),f8=n=>({isMobile:n[1]&4194304}),Cb=n=>({isMobile:n[53]}),c8=n=>({isMobile:n[1]&4194304}),Tb=n=>({isMobile:n[53]});function Zb(n,e,t){const i=n.slice();return i[157]=e[t],i[159]=t,i}const u8=n=>({isMobile:n[1]&4194304}),Rb=n=>({isMobile:n[53]});function Ab(n,e,t){const i=n.slice();return i[157]=e[t],i[159]=t,i}const h8=n=>({isMobile:n[1]&4194304}),Xb=n=>({isMobile:n[53]}),O8=n=>({isMobile:n[1]&4194304}),Yb=n=>({isMobile:n[53]});function d8(n){let e,t,i,r,s,l,o,a,c;return s=new wt({props:{icon:tT}}),{c(){e=_("button"),t=_("span"),t.textContent="Run",i=I(),r=_("span"),Ye(s.$$.fragment),v(r,"class","icon"),v(e,"class","button is-primary"),v(e,"title","Run the current file"),e.disabled=l=!n[50]},m(h,O){Y(h,e,O),Q(e,t),Q(e,i),Q(e,r),Ae(s,r,null),o=!0,a||(c=le(e,"click",n[62]),a=!0)},p(h,O){(!o||O[1]&524288&&l!==(l=!h[50]))&&(e.disabled=l)},i(h){o||(V(s.$$.fragment,h),o=!0)},o(h){B(s.$$.fragment,h),o=!1},d(h){h&&X(e),Xe(s),a=!1,c()}}}function p8(n){let e,t,i,r,s,l,o,a;return s=new wt({props:{icon:K3}}),{c(){e=_("button"),t=_("span"),t.textContent="Stop",i=I(),r=_("span"),Ye(s.$$.fragment),v(r,"class","icon"),v(e,"class","button is-danger"),v(e,"title","Cancel solving")},m(c,h){Y(c,e,h),Q(e,t),Q(e,i),Q(e,r),Ae(s,r,null),l=!0,o||(a=le(e,"click",n[64]),o=!0)},p:_e,i(c){l||(V(s.$$.fragment,c),l=!0)},o(c){B(s.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(s),o=!1,a()}}}function Ub(n){let e,t,i,r,s,l;return{c(){e=_("div"),t=_("button"),i=_("span"),i.textContent="Compile",v(t,"class","button"),v(t,"title","Compile the current file and show the resultant FlatZinc"),t.disabled=r=n[47]||!n[49],v(e,"class","control")},m(o,a){Y(o,e,a),Q(e,t),Q(t,i),s||(l=le(t,"click",n[63]),s=!0)},p(o,a){a[1]&327680&&r!==(r=o[47]||!o[49])&&(t.disabled=r)},d(o){o&&X(e),s=!1,l()}}}function Eb(n){let e,t,i;return t=new i8({props:{items:n[52],currentItem:n[0]?n[19].edge:n[19].latest,disabled:n[47],title:"Configure MiniZinc version",$$slots:{item:[g8,({item:r})=>({161:r}),({item:r})=>[0,0,0,0,0,r?64:0]]},$$scope:{ctx:n}}}),t.$on("selectItem",n[71]),{c(){e=_("div"),Ye(t.$$.fragment),v(e,"class","control")},m(r,s){Y(r,e,s),Ae(t,e,null),i=!0},p(r,s){const l={};s[1]&2097152&&(l.items=r[52]),s[0]&524289&&(l.currentItem=r[0]?r[19].edge:r[19].latest),s[1]&65536&&(l.disabled=r[47]),s[4]&8192|s[5]&64&&(l.$$scope={dirty:s,ctx:r}),t.$set(l)},i(r){i||(V(t.$$.fragment,r),i=!0)},o(r){B(t.$$.fragment,r),i=!1},d(r){r&&X(e),Xe(t)}}}function g8(n){let e,t=n[161].label+"",i,r,s=n[161].detail+"",l,o;return{c(){e=_("span"),i=pe(t),r=pe(" ("),l=pe(s),o=pe(")"),v(e,"slot","item")},m(a,c){Y(a,e,c),Q(e,i),Q(e,r),Q(e,l),Q(e,o)},p(a,c){c[5]&64&&t!==(t=a[161].label+"")&&Ne(i,t),c[5]&64&&s!==(s=a[161].detail+"")&&Ne(l,s)},d(a){a&&X(e)}}}function Mb(n){let e,t,i,r,s,l=st(n[23]),o=[];for(let a=0;an[93].call(i)),v(t,"class","select is-fullwidth"),v(e,"class","control is-expanded")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i);for(let h=0;hSolver:',r=I(),s=_("div"),l=_("div"),o=_("select");for(let $=0;$n[94].call(o)),v(l,"class","select is-fullwidth"),v(s,"class","control is-expanded"),v(t,"class","field has-addons"),v(e,"class","navbar-item is-hidden-mobile")},m($,y){Y($,e,y),Q(e,t),Q(t,i),Q(t,r),Q(t,s),Q(s,l),Q(l,o);for(let k=0;k{m=null}),et())},i($){c||(V(m),c=!0)},o($){B(m),c=!1},d($){$&&X(e),di(g,$),m&&m.d(),h=!1,O()}}}function Vb(n){let e,t=n[157].name+"",i,r,s=n[157].version+"",l,o;return{c(){e=_("option"),i=pe(t),r=I(),l=pe(s),o=I(),e.__value=n[159],li(e,e.__value)},m(a,c){Y(a,e,c),Q(e,i),Q(e,r),Q(e,l),Q(e,o)},p(a,c){c[0]&8388608&&t!==(t=a[157].name+"")&&Ne(i,t),c[0]&8388608&&s!==(s=a[157].version+"")&&Ne(l,s)},d(a){a&&X(e)}}}function qb(n){let e,t,i,r,s,l,o;return r=new wt({props:{icon:tv}}),{c(){e=_("div"),t=_("button"),i=_("span"),Ye(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-primary"),v(t,"title","Solver configuration"),v(e,"class","control")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),Ae(r,i,null),s=!0,l||(o=le(t,"click",n[55]),l=!0)},p:_e,i(a){s||(V(r.$$.fragment,a),s=!0)},o(a){B(r.$$.fragment,a),s=!1},d(a){a&&X(e),Xe(r),l=!1,o()}}}function m8(n){let e,t,i,r,s,l,o;const a=n[92]["navbar-before-share-buttons"],c=Ri(a,n,n[137],Wb);let h=n[10]&&Lb(n),O=n[11]&&Ib(n),p=n[12]&&Nb(n);const g=n[92]["navbar-share-buttons"],m=Ri(g,n,n[137],xb);return{c(){c&&c.c(),e=I(),t=_("div"),i=_("div"),h&&h.c(),r=I(),O&&O.c(),s=I(),p&&p.c(),l=I(),m&&m.c(),v(i,"class","field has-addons"),v(t,"class","navbar-item")},m($,y){c&&c.m($,y),Y($,e,y),Y($,t,y),Q(t,i),h&&h.m(i,null),Q(i,r),O&&O.m(i,null),Q(i,s),p&&p.m(i,null),Q(i,l),m&&m.m(i,null),o=!0},p($,y){c&&c.p&&(!o||y[1]&4194304|y[4]&8192)&&Xi(c,a,$,$[137],o?Ai(a,$[137],y,a8):Yi($[137]),Wb),$[10]?h?(h.p($,y),y[0]&1024&&V(h,1)):(h=Lb($),h.c(),V(h,1),h.m(i,r)):h&&(Je(),B(h,1,1,()=>{h=null}),et()),$[11]?O?(O.p($,y),y[0]&2048&&V(O,1)):(O=Ib($),O.c(),V(O,1),O.m(i,s)):O&&(Je(),B(O,1,1,()=>{O=null}),et()),$[12]?p?(p.p($,y),y[0]&4096&&V(p,1)):(p=Nb($),p.c(),V(p,1),p.m(i,l)):p&&(Je(),B(p,1,1,()=>{p=null}),et()),m&&m.p&&(!o||y[1]&4194304|y[4]&8192)&&Xi(m,g,$,$[137],o?Ai(g,$[137],y,o8):Yi($[137]),xb)},i($){o||(V(c,$),V(h),V(O),V(p),V(m,$),o=!0)},o($){B(c,$),B(h),B(O),B(p),B(m,$),o=!1},d($){$&&(X(e),X(t)),c&&c.d($),h&&h.d(),O&&O.d(),p&&p.d(),m&&m.d($)}}}function S8(n){let e,t,i,r,s,l,o,a=n[8]&&!n[47]&&n[49]&&Bb(n),c=n[9]&&n[5]&&n[23].length>0&&jb(n),h=n[4]&&!n[47]&&Fb(n);const O=n[92]["navbar-before-share-buttons"],p=Ri(O,n,n[137],Cb);let g=n[10]&&n[18]===0&&Gb(n),m=n[12]&&n[18]===0&&Hb(n);return{c(){a&&a.c(),e=I(),c&&c.c(),t=I(),h&&h.c(),i=I(),p&&p.c(),r=I(),g&&g.c(),s=I(),m&&m.c(),l=Gt()},m($,y){a&&a.m($,y),Y($,e,y),c&&c.m($,y),Y($,t,y),h&&h.m($,y),Y($,i,y),p&&p.m($,y),Y($,r,y),g&&g.m($,y),Y($,s,y),m&&m.m($,y),Y($,l,y),o=!0},p($,y){$[8]&&!$[47]&&$[49]?a?(a.p($,y),y[0]&256|y[1]&327680&&V(a,1)):(a=Bb($),a.c(),V(a,1),a.m(e.parentNode,e)):a&&(Je(),B(a,1,1,()=>{a=null}),et()),$[9]&&$[5]&&$[23].length>0?c?(c.p($,y),y[0]&8389152&&V(c,1)):(c=jb($),c.c(),V(c,1),c.m(t.parentNode,t)):c&&(Je(),B(c,1,1,()=>{c=null}),et()),$[4]&&!$[47]?h?(h.p($,y),y[0]&16|y[1]&65536&&V(h,1)):(h=Fb($),h.c(),V(h,1),h.m(i.parentNode,i)):h&&(Je(),B(h,1,1,()=>{h=null}),et()),p&&p.p&&(!o||y[1]&4194304|y[4]&8192)&&Xi(p,O,$,$[137],o?Ai(O,$[137],y,f8):Yi($[137]),Cb),$[10]&&$[18]===0?g?(g.p($,y),y[0]&263168&&V(g,1)):(g=Gb($),g.c(),V(g,1),g.m(s.parentNode,s)):g&&(Je(),B(g,1,1,()=>{g=null}),et()),$[12]&&$[18]===0?m?(m.p($,y),y[0]&266240&&V(m,1)):(m=Hb($),m.c(),V(m,1),m.m(l.parentNode,l)):m&&(Je(),B(m,1,1,()=>{m=null}),et())},i($){o||(V(a),V(c),V(h),V(p,$),V(g),V(m),o=!0)},o($){B(a),B(c),B(h),B(p,$),B(g),B(m),o=!1},d($){$&&(X(e),X(t),X(i),X(r),X(s),X(l)),a&&a.d($),c&&c.d($),h&&h.d($),p&&p.d($),g&&g.d($),m&&m.d($)}}}function Lb(n){let e,t,i,r,s,l,o,a;return r=new wt({props:{icon:Ky}}),{c(){e=_("div"),t=_("button"),i=_("span"),Ye(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-primary"),v(t,"title","Share"),t.disabled=s=n[18]!==0,v(e,"class","control")},m(c,h){Y(c,e,h),Q(e,t),Q(t,i),Ae(r,i,null),l=!0,o||(a=le(t,"click",n[101]),o=!0)},p(c,h){(!l||h[0]&262144&&s!==(s=c[18]!==0))&&(t.disabled=s)},i(c){l||(V(r.$$.fragment,c),l=!0)},o(c){B(r.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(r),o=!1,a()}}}function Ib(n){let e,t,i,r,s,l,o,a;return r=new wt({props:{icon:H3}}),{c(){e=_("div"),t=_("button"),i=_("span"),Ye(r.$$.fragment),v(i,"class","icon"),v(t,"class","button"),v(t,"title","Download project"),t.disabled=s=n[37]||n[18]!==0,v(e,"class","control")},m(c,h){Y(c,e,h),Q(e,t),Q(t,i),Ae(r,i,null),l=!0,o||(a=le(t,"click",n[102]),o=!0)},p(c,h){(!l||h[0]&262144|h[1]&64&&s!==(s=c[37]||c[18]!==0))&&(t.disabled=s)},i(c){l||(V(r.$$.fragment,c),l=!0)},o(c){B(r.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(r),o=!1,a()}}}function Nb(n){let e,t,i,r,s,l,o,a;return r=new wt({props:{icon:Jy}}),{c(){e=_("div"),t=_("button"),i=_("span"),Ye(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-primary"),v(t,"title","Open in playground"),t.disabled=s=n[18]!==0,v(e,"class","control")},m(c,h){Y(c,e,h),Q(e,t),Q(t,i),Ae(r,i,null),l=!0,o||(a=le(t,"click",n[68]),o=!0)},p(c,h){(!l||h[0]&262144&&s!==(s=c[18]!==0))&&(t.disabled=s)},i(c){l||(V(r.$$.fragment,c),l=!0)},o(c){B(r.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(r),o=!1,a()}}}function Bb(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:iT}}),{c(){e=_("a"),t=_("span"),Ye(i.$$.fragment),r=I(),s=_("span"),s.textContent="Compile current file",v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Ae(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[96]),o=!0)},p:_e,i(c){l||(V(i.$$.fragment,c),l=!0)},o(c){B(i.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(i),o=!1,a()}}}function jb(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:tv}}),{c(){e=_("a"),t=_("span"),Ye(i.$$.fragment),r=I(),s=_("span"),s.textContent="Solver configuration",v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Ae(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[97]),o=!0)},p:_e,i(c){l||(V(i.$$.fragment,c),l=!0)},o(c){B(i.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(i),o=!1,a()}}}function Fb(n){let e,t,i,r,s,l,o=n[0]?"latest":"edge",a,c,h,O,p;return i=new wt({props:{icon:N3}}),{c(){e=_("a"),t=_("span"),Ye(i.$$.fragment),r=I(),s=_("span"),l=pe("Switch to the "),a=pe(o),c=pe(" version of MiniZinc"),v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(g,m){Y(g,e,m),Q(e,t),Ae(i,t,null),Q(e,r),Q(e,s),Q(s,l),Q(s,a),Q(s,c),h=!0,O||(p=le(e,"click",n[98]),O=!0)},p(g,m){(!h||m[0]&1)&&o!==(o=g[0]?"latest":"edge")&&Ne(a,o)},i(g){h||(V(i.$$.fragment,g),h=!0)},o(g){B(i.$$.fragment,g),h=!1},d(g){g&&X(e),Xe(i),O=!1,p()}}}function Gb(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:Ky}}),{c(){e=_("a"),t=_("span"),Ye(i.$$.fragment),r=I(),s=_("span"),s.textContent="Share this project",v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Ae(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[99]),o=!0)},p:_e,i(c){l||(V(i.$$.fragment,c),l=!0)},o(c){B(i.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(i),o=!1,a()}}}function Hb(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:Jy}}),{c(){e=_("a"),t=_("span"),Ye(i.$$.fragment),r=I(),s=_("span"),s.textContent="Open in MiniZinc Playground",v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Ae(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[100]),o=!0)},p:_e,i(c){l||(V(i.$$.fragment,c),l=!0)},o(c){B(i.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(i),o=!1,a()}}}function Kb(n){let e,t,i;return t=new uT({props:{files:n[20],currentIndex:n[21],readonly:!n[7]}}),t.$on("selectTab",n[110]),t.$on("reorder",n[111]),t.$on("newFile",n[112]),t.$on("rename",n[58]),t.$on("close",n[113]),t.$on("manageFiles",n[114]),{c(){e=_("div"),Ye(t.$$.fragment),v(e,"class","top svelte-hl0lfa")},m(r,s){Y(r,e,s),Ae(t,e,null),i=!0},p(r,s){const l={};s[0]&1048576&&(l.files=r[20]),s[0]&2097152&&(l.currentIndex=r[21]),s[0]&128&&(l.readonly=!r[7]),t.$set(l)},i(r){i||(V(t.$$.fragment,r),i=!0)},o(r){B(t.$$.fragment,r),i=!1},d(r){r&&X(e),Xe(t)}}}function Jb(n){let e,t,i={state:n[51]};return e=new W3({props:i}),n[115](e),{c(){Ye(e.$$.fragment)},m(r,s){Ae(e,r,s),t=!0},p(r,s){const l={};s[1]&1048576&&(l.state=r[51]),e.$set(l)},i(r){t||(V(e.$$.fragment,r),t=!0)},o(r){B(e.$$.fragment,r),t=!1},d(r){n[115](null),Xe(e,r)}}}function b8(n){let e,t,i,r,s=n[6]&&Kb(n),l=n[51]&&Jb(n);return{c(){e=_("div"),s&&s.c(),t=I(),i=_("div"),l&&l.c(),v(i,"class","grow svelte-hl0lfa"),v(e,"class","panel stack svelte-hl0lfa"),v(e,"slot","panelA")},m(o,a){Y(o,e,a),s&&s.m(e,null),Q(e,t),Q(e,i),l&&l.m(i,null),r=!0},p(o,a){o[6]?s?(s.p(o,a),a[0]&64&&V(s,1)):(s=Kb(o),s.c(),V(s,1),s.m(e,t)):s&&(Je(),B(s,1,1,()=>{s=null}),et()),o[51]?l?(l.p(o,a),a[1]&1048576&&V(l,1)):(l=Jb(o),l.c(),V(l,1),l.m(i,null)):l&&(Je(),B(l,1,1,()=>{l=null}),et())},i(o){r||(V(s),V(l),r=!0)},o(o){B(s),B(l),r=!1},d(o){o&&X(e),s&&s.d(),l&&l.d()}}}function e$(n){let e,t,i,r,s,l,o,a,c,h,O,p,g=n[13]&&t$(n);return{c(){e=_("div"),t=_("div"),i=_("ul"),r=_("li"),s=_("a"),s.textContent="Output",l=I(),o=_("li"),a=_("a"),a.textContent="Visualisation",c=I(),g&&g.c(),v(s,"href","javascript:void(0);"),ne(r,"is-active",!n[43]),v(a,"href","javascript:void(0);"),ne(o,"is-active",n[43]),v(t,"class","tabs is-boxed"),v(e,"class","top svelte-hl0lfa")},m(m,$){Y(m,e,$),Q(e,t),Q(t,i),Q(i,r),Q(r,s),Q(i,l),Q(i,o),Q(o,a),Q(i,c),g&&g.m(i,null),h=!0,O||(p=[le(s,"click",n[103]),le(a,"click",n[104])],O=!0)},p(m,$){(!h||$[1]&4096)&&ne(r,"is-active",!m[43]),(!h||$[1]&4096)&&ne(o,"is-active",m[43]),m[13]?g?(g.p(m,$),$[0]&8192&&V(g,1)):(g=t$(m),g.c(),V(g,1),g.m(i,null)):g&&(Je(),B(g,1,1,()=>{g=null}),et())},i(m){h||(V(g),h=!0)},o(m){B(g),h=!1},d(m){m&&X(e),g&&g.d(),O=!1,Ft(p)}}}function t$(n){let e,t,i,r,s,l,o;return r=new wt({props:{icon:rv}}),{c(){e=_("li"),t=_("button"),i=_("span"),Ye(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-small"),v(t,"title","Switch orientation"),v(e,"class","tab-end svelte-hl0lfa")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),Ae(r,i,null),s=!0,l||(o=le(t,"click",n[70]),l=!0)},p:_e,i(a){s||(V(r.$$.fragment,a),s=!0)},o(a){B(r.$$.fragment,a),s=!1},d(a){a&&X(e),Xe(r),l=!1,o()}}}function i$(n){let e,t,i,r,s,l;return i=new wt({props:{icon:rv}}),{c(){e=_("button"),t=_("span"),Ye(i.$$.fragment),v(t,"class","icon"),v(e,"class","button is-small"),v(e,"title","Switch orientation")},m(o,a){Y(o,e,a),Q(e,t),Ae(i,t,null),r=!0,s||(l=le(e,"click",n[70]),s=!0)},p:_e,i(o){r||(V(i.$$.fragment,o),r=!0)},o(o){B(i.$$.fragment,o),r=!1},d(o){o&&X(e),Xe(i),s=!1,l()}}}function $8(n){let e,t,i=n[13]&&!n[42]&&i$(n);return{c(){e=_("p"),i&&i.c(),v(e,"class","control"),v(e,"slot","before-right-controls")},m(r,s){Y(r,e,s),i&&i.m(e,null),t=!0},p(r,s){r[13]&&!r[42]?i?(i.p(r,s),s[0]&8192|s[1]&2048&&V(i,1)):(i=i$(r),i.c(),V(i,1),i.m(e,null)):i&&(Je(),B(i,1,1,()=>{i=null}),et())},i(r){t||(V(i),t=!0)},o(r){B(i),t=!1},d(r){r&&X(e),i&&i.d()}}}function y8(n){let e,t,i,r,s,l,o,a,c,h,O=n[42]&&e$(n),p={files:n[20]};s=new m9({props:p}),n[105](s),s.$on("solve",n[106]);function g($){n[107]($)}let m={output:n[33],showClearOutput:n[14],showAutoClearOutput:n[15],showSectionToggles:n[16],showRightControls:n[17],isTab:n[42],$$slots:{"before-right-controls":[$8]},$$scope:{ctx:n}};return n[1]!==void 0&&(m.autoClearOutput=n[1]),a=new h9({props:m}),Mt.push(()=>Fo(a,"autoClearOutput",g)),a.$on("clear",n[108]),a.$on("goto",n[109]),{c(){e=_("div"),O&&O.c(),t=I(),i=_("div"),r=_("div"),Ye(s.$$.fragment),l=I(),o=_("div"),Ye(a.$$.fragment),v(r,"class","tab-window svelte-hl0lfa"),ne(r,"visible",n[43]),v(o,"class","tab-window svelte-hl0lfa"),ne(o,"visible",!n[42]||!n[43]),v(i,"class","grow svelte-hl0lfa"),v(e,"class","panel stack svelte-hl0lfa"),v(e,"slot","panelB")},m($,y){Y($,e,y),O&&O.m(e,null),Q(e,t),Q(e,i),Q(i,r),Ae(s,r,null),Q(i,l),Q(i,o),Ae(a,o,null),h=!0},p($,y){$[42]?O?(O.p($,y),y[1]&2048&&V(O,1)):(O=e$($),O.c(),V(O,1),O.m(e,t)):O&&(Je(),B(O,1,1,()=>{O=null}),et());const k={};y[0]&1048576&&(k.files=$[20]),s.$set(k),(!h||y[1]&4096)&&ne(r,"visible",$[43]);const W={};y[1]&4&&(W.output=$[33]),y[0]&16384&&(W.showClearOutput=$[14]),y[0]&32768&&(W.showAutoClearOutput=$[15]),y[0]&65536&&(W.showSectionToggles=$[16]),y[0]&131072&&(W.showRightControls=$[17]),y[1]&2048&&(W.isTab=$[42]),y[0]&8192|y[1]&2048|y[4]&8192&&(W.$$scope={dirty:y,ctx:$}),!c&&y[0]&2&&(c=!0,W.autoClearOutput=$[1],jo(()=>c=!1)),a.$set(W),(!h||y[1]&6144)&&ne(o,"visible",!$[42]||!$[43])},i($){h||(V(O),V(s.$$.fragment,$),V(a.$$.fragment,$),h=!0)},o($){B(O),B(s.$$.fragment,$),B(a.$$.fragment,$),h=!1},d($){$&&X(e),O&&O.d(),n[105](null),Xe(s),Xe(a)}}}function v8(n){let e,t,i,r=n[20][n[29]].name+"",s,l,o,a;return{c(){e=_("p"),t=pe("Are you sure you wish to delete "),i=_("code"),s=pe(r),l=pe("?"),o=I(),a=_("p"),a.textContent="This cannot be undone."},m(c,h){Y(c,e,h),Q(e,t),Q(e,i),Q(i,s),Q(e,l),Y(c,o,h),Y(c,a,h)},p(c,h){h[0]&537919488&&r!==(r=c[20][c[29]].name+"")&&Ne(s,r)},d(c){c&&(X(e),X(o),X(a))}}}function w8(n){let e,t,i,r,s,l;return{c(){e=_("div"),t=_("button"),t.textContent="Delete",i=I(),r=_("button"),r.textContent="Cancel",v(t,"class","button is-danger"),v(r,"type","button"),v(r,"class","button"),v(e,"slot","footer")},m(o,a){Y(o,e,a),Q(e,t),Q(e,i),Q(e,r),s||(l=[le(t,"click",n[126]),le(r,"click",n[127])],s=!0)},p:_e,d(o){o&&X(e),s=!1,Ft(l)}}}function Q8(n){let e,t,i,r,s,l,o,a,c,h,O;return a=new wt({props:{icon:B3}}),{c(){e=_("div"),t=_("p"),i=_("input"),r=I(),s=_("p"),l=_("button"),o=_("span"),Ye(a.$$.fragment),v(i,"class","input"),v(i,"type","text"),i.value=n[39],i.readOnly=!0,v(t,"class","control is-expanded"),v(o,"class","icon"),v(l,"type","button"),v(l,"class","button"),ne(l,"is-primary",!n[40]),ne(l,"is-success",n[40]),v(s,"class","control"),v(e,"class","field has-addons")},m(p,g){Y(p,e,g),Q(e,t),Q(t,i),n[134](i),Q(e,r),Q(e,s),Q(s,l),Q(l,o),Ae(a,o,null),c=!0,h||(O=[le(i,"click",n[135]),le(l,"click",n[67])],h=!0)},p(p,g){(!c||g[1]&256&&i.value!==p[39])&&(i.value=p[39]),(!c||g[1]&512)&&ne(l,"is-primary",!p[40]),(!c||g[1]&512)&&ne(l,"is-success",p[40])},i(p){c||(V(a.$$.fragment,p),c=!0)},o(p){B(a.$$.fragment,p),c=!1},d(p){p&&X(e),n[134](null),Xe(a),h=!1,Ft(O)}}}function k8(n){let e,t,i,r;return{c(){e=_("div"),t=_("button"),t.textContent="Done",v(t,"class","button is-primary"),v(e,"slot","footer")},m(s,l){Y(s,e,l),Q(e,t),i||(r=le(t,"click",n[133]),i=!0)},p:_e,d(s){s&&X(e),i=!1,r()}}}function _8(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,k,W,Z,A,C,U,D,z,j,N,G,E,re,ae,ve,Se,ge,Ue,Le,Pe,We,lt,Vt,Qt,pt,qt,$e,oe,H,ue,ce,Ee,tt,ft,Be,Yt,ut,Mn,kt,xt,bt;const je=n[92]["navbar-before-run-buttons"],fe=Ri(je,n,n[137],Yb),Fe=[p8,d8],He=[];function gi(J,ke){return J[47]?0:1}O=gi(n),p=He[O]=Fe[O](n);let Wt=!n[53]&&n[8]&&Ub(n),gt=!n[53]&&n[4]&&Eb(n);const zn=n[92]["navbar-run-buttons"],ai=Ri(zn,n,n[137],Xb);let Ht=n[53]&&n[5]&&n[23].length>0&&Mb(n);const mn=n[92]["navbar-after-run-buttons"],Ct=Ri(mn,n,n[137],Rb);let De=n[5]&&n[23].length>0&&Db(n);const Sn=n[92]["navbar-after-solver-selector"],ri=Ri(Sn,n,n[137],Tb),Kt=[S8,m8],bn=[];function ir(J,ke){return J[53]?0:1}Se=ir(n),ge=bn[Se]=Kt[Se](n);const Br=n[92]["navbar-after-share-buttons"],zt=Ri(Br,n,n[137],Pb);function Zs(J){n[116](J)}let Rs={direction:n[2],showPanels:n[48],$$slots:{panelB:[y8],panelA:[b8]},$$scope:{ctx:n}};n[3]!==void 0&&(Rs.split=n[3]),lt=new M3({props:Rs}),Mt.push(()=>Fo(lt,"split",Zs));let no={active:n[35],stdFlags:n[45]};pt=new F9({props:no}),n[117](pt),pt.$on("close",n[118]),$e=new Z9({props:{active:n[30],files:n[20]}}),$e.$on("close",n[119]),$e.$on("delete",n[120]),$e.$on("modifyFile",n[121]),$e.$on("newFile",n[122]),H=new k9({props:{active:n[28]}}),H.$on("cancel",n[123]),H.$on("new",n[124]),H.$on("open",n[125]),ce=new _s({props:{active:n[29]!==null,title:"Delete file",$$slots:{footer:[w8],default:[v8]},$$scope:{ctx:n}}}),ce.$on("cancel",n[128]),tt=new U9({props:{active:n[31],modelFiles:n[44]}}),tt.$on("accept",n[129]),tt.$on("cancel",n[130]),Be=new N9({props:{active:n[32],dataFiles:n[46],parameters:n[34]}}),Be.$on("accept",n[131]),Be.$on("cancel",n[132]),ut=new _s({props:{active:n[39],title:"Share this project",$$slots:{footer:[k8],default:[Q8]},$$scope:{ctx:n}}}),ut.$on("cancel",n[136]);const jr=n[92].default,xi=Ri(jr,n,n[137],null);return{c(){e=_("div"),t=_("div"),i=_("div"),r=_("div"),s=_("nav"),l=_("div"),fe&&fe.c(),o=I(),a=_("div"),c=_("div"),h=_("div"),p.c(),g=I(),Wt&&Wt.c(),m=I(),gt&>.c(),$=I(),ai&&ai.c(),y=I(),Ht&&Ht.c(),k=I(),Ct&&Ct.c(),W=I(),De&&De.c(),Z=I(),ri&&ri.c(),A=I(),C=_("a"),U=_("span"),D=I(),z=_("span"),j=I(),N=_("span"),G=I(),E=_("div"),re=_("div"),ae=I(),ve=_("div"),ge.c(),Ue=I(),zt&&zt.c(),Le=I(),Pe=_("div"),We=_("div"),Ye(lt.$$.fragment),Qt=I(),Ye(pt.$$.fragment),qt=I(),Ye($e.$$.fragment),oe=I(),Ye(H.$$.fragment),ue=I(),Ye(ce.$$.fragment),Ee=I(),Ye(tt.$$.fragment),ft=I(),Ye(Be.$$.fragment),Yt=I(),Ye(ut.$$.fragment),Mn=I(),xi&&xi.c(),v(h,"class","control"),v(c,"class","field navbar-run-buttons has-addons svelte-hl0lfa"),v(a,"class","navbar-item is-expanded"),v(U,"aria-hidden","true"),v(z,"aria-hidden","true"),v(N,"aria-hidden","true"),v(C,"role","button"),v(C,"class","navbar-burger"),v(C,"aria-label","menu"),v(C,"aria-expanded",n[26]),ne(C,"is-active",n[26]),v(l,"class","navbar-brand"),v(re,"class","navbar-start is-hidden-tablet"),v(ve,"class","navbar-end"),v(E,"class","navbar-menu"),ne(E,"is-active",n[26]),v(s,"class","navbar"),v(r,"class","top svelte-hl0lfa"),v(We,"class","left svelte-hl0lfa"),v(Pe,"class","grow main-panel svelte-hl0lfa"),v(i,"class","stack svelte-hl0lfa"),v(t,"class","mzn-playground-wrapper svelte-hl0lfa"),ne(t,"is-dark",n[24]),v(e,"class","mzn-playground svelte-hl0lfa")},m(J,ke){Y(J,e,ke),Q(e,t),Q(t,i),Q(i,r),Q(r,s),Q(s,l),fe&&fe.m(l,null),Q(l,o),Q(l,a),Q(a,c),Q(c,h),He[O].m(h,null),Q(c,g),Wt&&Wt.m(c,null),Q(c,m),gt&>.m(c,null),Q(c,$),ai&&ai.m(c,null),Q(c,y),Ht&&Ht.m(c,null),Q(l,k),Ct&&Ct.m(l,null),Q(l,W),De&&De.m(l,null),Q(l,Z),ri&&ri.m(l,null),Q(l,A),Q(l,C),Q(C,U),Q(C,D),Q(C,z),Q(C,j),Q(C,N),Q(s,G),Q(s,E),Q(E,re),Q(E,ae),Q(E,ve),bn[Se].m(ve,null),Q(ve,Ue),zt&&zt.m(ve,null),Q(i,Le),Q(i,Pe),Q(Pe,We),Ae(lt,We,null),Q(Pe,Qt),Ae(pt,Pe,null),Q(t,qt),Ae($e,t,null),Q(t,oe),Ae(H,t,null),Q(t,ue),Ae(ce,t,null),Q(t,Ee),Ae(tt,t,null),Q(t,ft),Ae(Be,t,null),Q(t,Yt),Ae(ut,t,null),Q(t,Mn),xi&&xi.m(t,null),kt=!0,xt||(bt=le(C,"click",n[95]),xt=!0)},p(J,ke){fe&&fe.p&&(!kt||ke[1]&4194304|ke[4]&8192)&&Xi(fe,je,J,J[137],kt?Ai(je,J[137],ke,O8):Yi(J[137]),Yb);let rn=O;O=gi(J),O===rn?He[O].p(J,ke):(Je(),B(He[rn],1,1,()=>{He[rn]=null}),et(),p=He[O],p?p.p(J,ke):(p=He[O]=Fe[O](J),p.c()),V(p,1),p.m(h,null)),!J[53]&&J[8]?Wt?Wt.p(J,ke):(Wt=Ub(J),Wt.c(),Wt.m(c,m)):Wt&&(Wt.d(1),Wt=null),!J[53]&&J[4]?gt?(gt.p(J,ke),ke[0]&16|ke[1]&4194304&&V(gt,1)):(gt=Eb(J),gt.c(),V(gt,1),gt.m(c,$)):gt&&(Je(),B(gt,1,1,()=>{gt=null}),et()),ai&&ai.p&&(!kt||ke[1]&4194304|ke[4]&8192)&&Xi(ai,zn,J,J[137],kt?Ai(zn,J[137],ke,h8):Yi(J[137]),Xb),J[53]&&J[5]&&J[23].length>0?Ht?Ht.p(J,ke):(Ht=Mb(J),Ht.c(),Ht.m(c,null)):Ht&&(Ht.d(1),Ht=null),Ct&&Ct.p&&(!kt||ke[1]&4194304|ke[4]&8192)&&Xi(Ct,mn,J,J[137],kt?Ai(mn,J[137],ke,u8):Yi(J[137]),Rb),J[5]&&J[23].length>0?De?(De.p(J,ke),ke[0]&8388640&&V(De,1)):(De=Db(J),De.c(),V(De,1),De.m(l,Z)):De&&(Je(),B(De,1,1,()=>{De=null}),et()),ri&&ri.p&&(!kt||ke[1]&4194304|ke[4]&8192)&&Xi(ri,Sn,J,J[137],kt?Ai(Sn,J[137],ke,c8):Yi(J[137]),Tb),(!kt||ke[0]&67108864)&&v(C,"aria-expanded",J[26]),(!kt||ke[0]&67108864)&&ne(C,"is-active",J[26]);let Fr=Se;Se=ir(J),Se===Fr?bn[Se].p(J,ke):(Je(),B(bn[Fr],1,1,()=>{bn[Fr]=null}),et(),ge=bn[Se],ge?ge.p(J,ke):(ge=bn[Se]=Kt[Se](J),ge.c()),V(ge,1),ge.m(ve,Ue)),zt&&zt.p&&(!kt||ke[1]&4194304|ke[4]&8192)&&Xi(zt,Br,J,J[137],kt?Ai(Br,J[137],ke,l8):Yi(J[137]),Pb),(!kt||ke[0]&67108864)&&ne(E,"is-active",J[26]);const Dn={};ke[0]&4&&(Dn.direction=J[2]),ke[1]&131072&&(Dn.showPanels=J[48]),ke[0]&1916002498|ke[1]&1055748|ke[4]&8192&&(Dn.$$scope={dirty:ke,ctx:J}),!Vt&&ke[0]&8&&(Vt=!0,Dn.split=J[3],jo(()=>Vt=!1)),lt.$set(Dn);const Qr={};ke[1]&16&&(Qr.active=J[35]),ke[1]&16384&&(Qr.stdFlags=J[45]),pt.$set(Qr);const nr={};ke[0]&1073741824&&(nr.active=J[30]),ke[0]&1048576&&(nr.files=J[20]),$e.$set(nr);const As={};ke[0]&268435456&&(As.active=J[28]),H.$set(As);const rr={};ke[0]&536870912&&(rr.active=J[29]!==null),ke[0]&537919488|ke[4]&8192&&(rr.$$scope={dirty:ke,ctx:J}),ce.$set(rr);const _t={};ke[1]&1&&(_t.active=J[31]),ke[1]&8192&&(_t.modelFiles=J[44]),tt.$set(_t);const kr={};ke[1]&2&&(kr.active=J[32]),ke[1]&32768&&(kr.dataFiles=J[46]),ke[1]&8&&(kr.parameters=J[34]),Be.$set(kr);const Gr={};ke[1]&256&&(Gr.active=J[39]),ke[1]&896|ke[4]&8192&&(Gr.$$scope={dirty:ke,ctx:J}),ut.$set(Gr),xi&&xi.p&&(!kt||ke[4]&8192)&&Xi(xi,jr,J,J[137],kt?Ai(jr,J[137],ke,null):Yi(J[137]),null),(!kt||ke[0]&16777216)&&ne(t,"is-dark",J[24])},i(J){kt||(V(fe,J),V(p),V(gt),V(ai,J),V(Ct,J),V(De),V(ri,J),V(ge),V(zt,J),V(lt.$$.fragment,J),V(pt.$$.fragment,J),V($e.$$.fragment,J),V(H.$$.fragment,J),V(ce.$$.fragment,J),V(tt.$$.fragment,J),V(Be.$$.fragment,J),V(ut.$$.fragment,J),V(xi,J),kt=!0)},o(J){B(fe,J),B(p),B(gt),B(ai,J),B(Ct,J),B(De),B(ri,J),B(ge),B(zt,J),B(lt.$$.fragment,J),B(pt.$$.fragment,J),B($e.$$.fragment,J),B(H.$$.fragment,J),B(ce.$$.fragment,J),B(tt.$$.fragment,J),B(Be.$$.fragment,J),B(ut.$$.fragment,J),B(xi,J),kt=!1},d(J){J&&X(e),fe&&fe.d(J),He[O].d(),Wt&&Wt.d(),gt&>.d(),ai&&ai.d(J),Ht&&Ht.d(),Ct&&Ct.d(J),De&&De.d(),ri&&ri.d(J),bn[Se].d(),zt&&zt.d(J),Xe(lt),n[117](null),Xe(pt),Xe($e),Xe(H),Xe(ce),Xe(tt),Xe(Be),Xe(ut),xi&&xi.d(J),xt=!1,bt()}}}function n$(n,e){n.effects=n.effects?[...n.effects,e]:[e]}function P8(n,e,t){let i,r,s,l,o,a,c,h,O,p,g,m,$,y,k,W,Z,A,C;CO(n,r8,R=>t(91,A=R)),CO(n,s8,R=>t(53,C=R));let{$$slots:U={},$$scope:D}=e,{showVersionSwitcher:z=!0}=e,{showSolverDropdown:j=!0}=e,{edgeMiniZinc:N=!1}=e,{autoClearOutput:G=!1}=e,{showTabs:E=!0}=e,{canEditTabs:re=!0}=e,{compilationEnabled:ae=!0}=e,{project:ve}=e,{enabledSolvers:Se=null}=e,{canEditSolverSettings:ge=!0}=e,{showShareButton:Ue=!0}=e,{showDownloadButton:Le=!0}=e,{externalPlaygroundURL:Pe=null}=e,{splitterDirection:We="vertical"}=e,{splitterSize:lt=75}=e,{canSwitchOrientation:Vt=!0}=e,{showClearOutput:Qt=!0}=e,{showAutoClearOutput:pt=!0}=e,{showOutputSectionToggles:qt=!0}=e,{showOutputRightControls:$e=!0}=e,{theme:oe="auto"}=e,{hideOutputOnStartup:H=!0}=e,{autoFocus:ue=!0}=e;const ce=nn();let Ee=0,tt=[],ft,Be,Yt={latest:{label:"Latest",detail:"stable"},edge:{label:"Edge",detail:"development"}};function ut(R){const he=N?oC:lC;if(Be!==he){t(18,Ee++,Ee);const be=ft;ft=new Promise(async(xe,Me)=>{be&&await be,Be&&Be.shutdown(),Be=he,Be.shutdown(),await Be.init();const[it]=/version \d+\.\d+\.\d+(?:, build .*)?$/m.exec(await Be.version()),Re=N?"edge":"latest";t(19,Yt={...Yt,[Re]:{...Yt[Re],detail:it}}),t(83,tt=await Be.solvers()),await Gn(),t(18,Ee--,Ee),xe()})}return ft}const Mn=new Promise((R,he)=>{su(()=>{ut(),R()})});async function kt(R){t(0,N=R.minizincVersion==="edge"),await Mn,t(20,fe=[]),Rs(R.files,ue),t(21,He=R.tab||0),await ut(),R.solverId?t(22,Kt=y.findIndex(he=>he.id===R.solverId)):t(22,Kt=y.findIndex(he=>he.extraInfo&&he.extraInfo.isDefault)||0),R.solverConfig?gi.load(R.solverConfig):gi.reset()}async function xt(R){const he=fe.length;Rs(R.files),R.tab!==void 0&&R.tab!==null&&R.tab>=0&&zt(he+R.tab),R.solverId&&(await ut(),t(22,Kt=y.findIndex(be=>be.id===R.solverId)))}function bt(){return fe.length>0}let je,fe=[],Fe=!1,He=0,gi,Wt=!1,gt=null,zn=!1,ai=!1,Ht=null,mn=!1,Ct=[],De=null,Sn=[],ri={},Kt=-1;async function bn(R,he){if(await ut(),Kt<0||Kt>=y.length){const be=y.findIndex(xe=>xe.extraInfo&&xe.extraInfo.isDefault);be!==-1&&t(22,Kt=be)}}let ir=!1;function Br(){t(35,ir=!ir)}async function zt(R,he=!0){for(je&&He=0&&fe[R].hidden;)R--;R===-1&&(R=fe.findIndex(be=>!be.hidden)),t(21,He=R),await Gn(),je&&h&&(he&&je.focus(),h.scrollTop!==void 0&&je.getView().requestMeasure({read(be){be.scrollDOM.scrollTo(h.scrollLeft,h.scrollTop)}}))}function Zs(R){let he=`Untitled${R}`,be=2;for(;fe.find(xe=>xe.name===he);)he=`Untitled-${be++}${R}`;t(20,fe=[...fe,{name:he,state:Ot.create({extensions:oc(R,xr,Z)})}]),zt(fe.length-1),t(28,Wt=!1)}function Rs(R,he=!0){let be=[];for(const xe of R){const Me=xe.name.endsWith(".mzc.mzn")?xe.name.length-8:xe.name.lastIndexOf("."),it=xe.name.substring(0,Me).replaceAll(/[\/\\\.]/g,""),Re=xe.name.substring(Me);let mi=`${it}${Re}`,Zt=2;for(;fe.find(Oo=>Oo.name===mi);)mi=`${it}-${Zt++}${Re}`;const es=oc(Re,xr,Z,xe.readOnly);be.push({...xe,hidden:xe.hidden||Re===".mzc",name:mi,state:Ot.create({doc:xe.contents,extensions:es,selection:{anchor:xe.anchor||0}})})}t(20,fe=[...fe,...be]),zt(fe.length-1,he),t(28,Wt=!1)}function no(R){const{index:he,name:be,suffix:xe}=R.detail;let Me=be,it=2;for(;fe.some(Re=>Re===Me+xe);)Me=`${be}-${it++}`;h&&t(87,h.state=je.getState(),h),t(20,fe=[...fe.slice(0,he),{...fe[he],name:be+xe},...fe.slice(he+1)])}function jr(R){const he=r===1&&!fe[R].hidden;t(20,fe=[...fe.slice(0,R),...fe.slice(R+1),...he?[{name:"Untitled.mzn",state:Ot.create({extensions:oc(".mzn",xr,Z)})}]:[]]),He>=fe.length?zt(fe.length-1):zt(He),t(29,gt=null)}function xi(R,he){h&&t(87,h.state=je.getState(),h);const be={...fe[R],...he};"readOnly"in he&&n$(be,he.readOnly?CY:TY),t(20,fe=[...fe.slice(0,R),be,...fe.slice(R+1)]),zt(He)}function J(R,he){let be;R0){await Gn();const he=je.getView();he&&he.state===R.state&&(he.dispatch({effects:R.effects}),R.effects=[])}}let rn=null;async function Fr(R){t(18,Ee++,Ee),t(87,h.state=je.getState(),h);let he=O?h:null;if(!he){if(m.length===0)return t(18,Ee--,Ee),!1;if(m.length===1)he=fe.find(Me=>Me.name===m[0]);else try{const Me=await new Promise((it,Re)=>{t(36,rn=it),t(31,ai=!0)});if(!Me)return t(18,Ee--,Ee),!1;he=fe.find(it=>it.name===Me.modelFile)}finally{t(31,ai=!1)}}const be=new Be.Model,xe=[he.name];{const Me=he.name.substring(0,he.name.length-4),it=fe.find(Re=>Re.name===`${Me}.mzc`||Re.name===`${Me}.mzc.mzn`);it&&xe.push(it.name)}he!==h&&xe.push(h.name);for(const Me of fe)be.addFile(Me.name,Me.state.doc.toString(),xe.indexOf(Me.name)!==-1);try{const{input:Me}=await be.interface({options:gi.getCompilationConfiguration(k.id)});if(Object.keys(Me).length>0){const it={};for(const Re in Me)it[Re]=ri[Re];t(34,ri=it),p&&Sn.indexOf(h.name)===-1&&(Sn=[...Sn,h.name]);try{const Re=await new Promise((mi,Zt)=>{t(36,rn=mi),t(32,Ht=!0)});if(!Re)return t(18,Ee--,Ee),!1;if(Re.parameters){let mi="";for(const Zt in Re.parameters)Re.parameters[Zt].trim().length>0&&(mi+=`${Zt} = ${Re.parameters[Zt]}; -`);be.addDznString(mi),t(34,ri=Re.parameters)}else{for(const mi of Re.dataFiles)xe.indexOf(mi)===-1&&(be.addFile(mi),xe.push(mi));Sn=Re.dataFiles}}finally{t(32,Ht=!1)}}}catch(Me){console.error(Me)}return t(18,Ee--,Ee),{model:be,fileList:xe}}async function Dn(){if(g){const Me=new Be.Model;Me.addFile(h.name,h.state.doc.toString());const it=[h.name],Re=gi.getSolvingConfiguration(k.id);await Qr(Me,it,Re);return}const R=await Fr();if(!R)return;const{model:he,fileList:be}=R,xe=gi.getSolvingConfiguration(k.id);await Qr(he,be,xe)}async function Qr(R,he,be){t(84,mn=!0);const xe=Date.now();G&&t(33,Ct=[]),t(33,Ct=[...Ct,{files:he,output:[]}]),t(85,De=R.solve({options:be,jsonOutput:!1})),kr(),De.on("error",_t),De.on("warning",_t),De.on("solution",Me=>_t(Me,Date.now()-xe)),De.on("status",Me=>_t(Me,Date.now()-xe)),De.on("statistics",_t),De.on("trace",Me=>_t(Me,Date.now()-xe)),De.on("statistics",_t),De.on("comment",_t),De.on("time",_t),De.on("checker",_t),De.on("stderr",_t);try{await De,_t({type:"exit",code:0,runTime:Date.now()-xe})}catch(Me){_t({type:"exit",code:Me.code,runTime:Date.now()-xe})}t(85,De=null)}async function nr(){t(84,mn=!0);const R=await Fr();if(!R)return;kr();const{model:he,fileList:be}=R,xe=be[0],Me=Date.now();G&&t(33,Ct=[]),t(33,Ct=[...Ct,{files:be,isCompile:!0,output:[]}]),t(85,De=he.compile({options:gi.getCompilationConfiguration(k.id)})),De.on("error",_t),De.on("warning",_t),De.on("statistics",_t),De.on("trace",_t),De.on("statistics",_t),De.on("stderr",_t);try{const it=await De;t(20,fe=[...fe,{name:`${xe.substring(0,xe.indexOf("."))}.fzn`,state:Ot.create({extensions:oc(".fzn",xr,Z),doc:it})}]),zt(fe.length-1),_t({type:"exit",code:0,runTime:Date.now()-Me})}catch(it){_t({type:"exit",code:it.code,runTime:Date.now()-Me})}t(85,De=null)}function As(){_t({type:"cancel"}),De.cancel()}let rr=null;function _t(R,he){rr?rr.then(()=>{rr=Gr(R,he)}):rr=Gr(R,he),Ct[Ct.length-1].output.push(R),t(33,Ct)}function kr(){$n&&$n.reset(),t(42,Hr=!1),t(43,Kr=!1)}async function Gr(R,he){if(R.type==="trace"&&R.section.startsWith("mzn_vis_")){Hr||(t(42,Hr=!0),t(43,Kr=!0)),await Gn();const be=fe.find(Me=>Me.name===R.message.url);let xe=null;if(be)xe=be.state.doc.toString();else try{xe=await Be.readStdlibFileContents(R.message.url)}catch(Me){console.error(Me);return}if(xe===null){console.error(`Failed to get visualisation file ${R.message.url}`);return}$n.addVisualisation(R.section,xe,R.message.userData);return}if(Hr){for(;!$n;)await Gn();switch(R.type){case"solution":$n.addSolution(R.sections.filter(be=>be.startsWith("mzn_vis_")).reduce((be,xe)=>({...be,[xe]:R.output[xe]}),{}),"time"in R?R.time:he);break;case"status":$n.status(R.status,"time"in R?R.time:he);break;case"exit":$n.status("time"in R?R.time:he);break}}}function ro(){return h&&t(87,h.state=je.getState(),h),{files:fe.map(R=>({name:R.name,contents:R.state.doc.toString(),...R.hidden?{hidden:!0}:{},...R.readOnly?{readOnly:!0}:{}})),tab:He,solverId:k.id,solverConfig:gi.save(),minizincVersion:N?"edge":"latest"}}let so=!1;async function Ca(){t(37,so=!0);try{const R=(await Ym(async()=>{const{default:Zt}=await import("./jszip.min-fAQkBUUp.js").then(es=>es.j);return{default:Zt}},[])).default,he=(await Ym(async()=>{const{default:Zt}=await import("./FileSaver.min-ZSeCQpPB.js").then(es=>es.F);return{default:Zt}},[])).default,be=ro(),xe=fe.map(Zt=>Zt.name),Me=fe.filter(Zt=>!Zt.hidden).map(Zt=>Zt.name);let it=k.id;it==="org.minizinc.gecode_presolver"?it="org.gecode.gecode":it==="org.minizinc.chuffed"&&(it="org.chuffed.chuffed");const Re=new R;for(const Zt of be.files)Re.file(Zt.name,Zt.contents);Re.file("Project.mzp",JSON.stringify({version:105,projectFiles:xe,openFiles:Me,openTab:be.tab,selectedBuiltinConfigId:it,selectedBuiltinConfigVersion:"default"}));const mi=await Re.generateAsync({type:"blob"});he.saveAs(mi,"Project.zip")}catch(R){console.error(R)}finally{t(37,so=!1)}}let _r,Pr=null,lo=!1;function nl(R){const he=ro(),be=new URL(R);return be.hash=`#project=${encodeURIComponent(JSON.stringify(he))}`,t(40,lo=!1),be.toString()}function bu(){_r.select(),_r.setSelectionRange(0,Pr.length),navigator.clipboard.writeText(Pr),t(40,lo=!0)}function Ta(){Pe&&window.open(nl(Pe),"_blank").focus()}let Za=null;async function xr(R){const he=R.view;if(!(Ee!==0||!k||!h||!h.name.endsWith(".mzn")))try{const be=he.state.doc.toString();if(be===Za)return;Za=be;const xe=new Be.Model;for(const Re of fe)xe.addFile(Re.name,Re.state.doc.toString(),!1);const Me=xe.addString(be),it=await xe.check({options:gi.getCompilationConfiguration(k.id)});if(he.state.doc.toString()!==be)return;n8(be,it.filter(Re=>Re.location.filename===Me),he)}catch(be){console.error(be)}}function Ra(R){const he=fe.findIndex(be=>be.name===R.filename);if(he!==-1){zt(he);const be=fe[he].state.doc.toString(),xe=Ad(R.firstLine,R.firstColumn,be);je.focus(),je.setCursor(xe)}}function rl(){We==="horizontal"?t(2,We="vertical"):t(2,We="horizontal")}function $u(R){t(0,N=R.detail.item===Yt.edge)}function yu(R){h&&t(87,h.state=je.getState(),h),fe.forEach(he=>n$(he,R?RY:ZY)),ke(h)}let $n,Hr=!1,Kr=!1;function oo(R){De&&As();const he=[R.modelFile],be=R.modelFile.substring(0,R.modelFile.length-4),xe=fe.find(it=>it.name===`${be}.mzc`||it.name===`${be}.mzc.mzn`);if(xe&&he.push(xe.name),R.dataFiles)for(const it of R.dataFiles)he.push(it);const Me=new Be.Model;for(const it of fe)Me.addFile(it.name,it.state.doc.toString(),he.indexOf(it.name)!==-1);Qr(Me,he,R.options||gi.getSolvingConfiguration(k.id))}function vu(){return Kt===(y.findIndex(R=>R.extraInfo&&R.extraInfo.isDefault)||0)}function wu(){return gi.isDefault()}function Qu(){Kt=TO(this),t(22,Kt)}function ku(){Kt=TO(this),t(22,Kt)}const Aa=()=>{t(26,Fe=!Fe),t(35,ir=!1)},Xa=()=>{nr(),t(26,Fe=!1)},Ya=()=>{Br(),t(26,Fe=!1)},ao=()=>{t(0,N=!N),t(26,Fe=!1)},_u=()=>{t(39,Pr=nl(window.location.href)),t(26,Fe=!1)},Ua=()=>{Ta(),t(26,Fe=!1)},sl=()=>t(39,Pr=nl(window.location.href)),Ea=()=>Ca(),Pu=()=>{t(43,Kr=!1)},Ma=()=>{t(43,Kr=!0)};function za(R){Mt[R?"unshift":"push"](()=>{$n=R,t(41,$n)})}const fo=R=>oo(R.detail);function xu(R){G=R,t(1,G)}const Da=()=>t(33,Ct=[]),co=R=>Ra(R.detail.location),uo=R=>zt(R.detail.index),Jr=R=>J(R.detail.src,R.detail.dest),Va=()=>t(28,Wt=!0),qa=R=>t(29,gt=R.detail.index),Wu=()=>t(30,zn=!0);function La(R){Mt[R?"unshift":"push"](()=>{je=R,t(25,je)})}function Ia(R){lt=R,t(3,lt)}function Na(R){Mt[R?"unshift":"push"](()=>{gi=R,t(27,gi)})}const Ba=()=>t(35,ir=!1),Cu=()=>t(30,zn=!1),Tu=R=>t(29,gt=R.detail.index),Zu=R=>xi(R.detail.index,R.detail.options),ja=()=>t(28,Wt=!0),Ru=()=>t(28,Wt=!1),Au=R=>Zs(R.detail.type),Xu=R=>xt(R.detail),Yu=()=>jr(gt),ho=()=>t(29,gt=null),Uu=()=>t(29,gt=null),Eu=R=>rn(R.detail),Mu=()=>rn(!1),zu=R=>rn(R.detail),Du=()=>rn(!1),Tt=()=>t(39,Pr=null);function Pt(R){Mt[R?"unshift":"push"](()=>{_r=R,t(38,_r)})}const Vu=()=>_r.select(),qu=()=>t(39,Pr=null);return n.$$set=R=>{"showVersionSwitcher"in R&&t(4,z=R.showVersionSwitcher),"showSolverDropdown"in R&&t(5,j=R.showSolverDropdown),"edgeMiniZinc"in R&&t(0,N=R.edgeMiniZinc),"autoClearOutput"in R&&t(1,G=R.autoClearOutput),"showTabs"in R&&t(6,E=R.showTabs),"canEditTabs"in R&&t(7,re=R.canEditTabs),"compilationEnabled"in R&&t(8,ae=R.compilationEnabled),"project"in R&&t(73,ve=R.project),"enabledSolvers"in R&&t(74,Se=R.enabledSolvers),"canEditSolverSettings"in R&&t(9,ge=R.canEditSolverSettings),"showShareButton"in R&&t(10,Ue=R.showShareButton),"showDownloadButton"in R&&t(11,Le=R.showDownloadButton),"externalPlaygroundURL"in R&&t(12,Pe=R.externalPlaygroundURL),"splitterDirection"in R&&t(2,We=R.splitterDirection),"splitterSize"in R&&t(3,lt=R.splitterSize),"canSwitchOrientation"in R&&t(13,Vt=R.canSwitchOrientation),"showClearOutput"in R&&t(14,Qt=R.showClearOutput),"showAutoClearOutput"in R&&t(15,pt=R.showAutoClearOutput),"showOutputSectionToggles"in R&&t(16,qt=R.showOutputSectionToggles),"showOutputRightControls"in R&&t(17,$e=R.showOutputRightControls),"theme"in R&&t(75,oe=R.theme),"hideOutputOnStartup"in R&&t(76,H=R.hideOutputOnStartup),"autoFocus"in R&&t(77,ue=R.autoFocus),"$$scope"in R&&t(137,D=R.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&524288&&t(52,i=[Yt.latest,Yt.edge]),n.$$.dirty[0]&1&&ut(),n.$$.dirty[2]&2048&&kt(ve),n.$$.dirty[0]&1048576&&(r=fe.filter(R=>!R.hidden).length),n.$$.dirty[0]&3145728&&t(87,h=HeSe.indexOf(R.id)!==-1):tt),n.$$.dirty[0]&12582912&&t(86,k=Kt>=0&&KtR.name.endsWith(".mzn")&&!R.name.endsWith(".mzc.mzn")).map(R=>R.name)),n.$$.dirty[0]&1048576&&t(46,$=fe.filter(R=>R.name.endsWith(".dzn")||R.name.endsWith(".json")).map(R=>R.name)),n.$$.dirty[0]&12582912&&bn(),n.$$.dirty[2]&16777216&&t(45,W=k?k.stdFlags:[]),n.$$.dirty[2]&33554432&&ke(h),n.$$.dirty[2]&536879104&&t(24,Z={dark:!0,light:!1,auto:A}[oe]),n.$$.dirty[0]&16777216&&yu(Z),n.$$.dirty[0]&8388608&&ce("solversChanged",{solvers:y})},[N,G,We,lt,z,j,E,re,ae,ge,Ue,Le,Pe,Vt,Qt,pt,qt,$e,Ee,Yt,fe,He,Kt,y,Z,je,Fe,gi,Wt,gt,zn,ai,Ht,Ct,ri,ir,rn,so,_r,Pr,lo,$n,Hr,Kr,m,W,$,c,a,o,l,s,i,C,xt,Br,zt,Zs,no,jr,xi,J,Dn,nr,As,Ca,nl,bu,Ta,Ra,rl,$u,oo,ve,Se,oe,H,ue,kt,bt,ro,vu,wu,tt,mn,De,k,h,g,p,O,A,U,Qu,ku,Aa,Xa,Ya,ao,_u,Ua,sl,Ea,Pu,Ma,za,fo,xu,Da,co,uo,Jr,Va,qa,Wu,La,Ia,Na,Ba,Cu,Tu,Zu,ja,Ru,Au,Xu,Yu,ho,Uu,Eu,Mu,zu,Du,Tt,Pt,Vu,qu,D]}class x8 extends $i{constructor(e){super(),bi(this,e,P8,_8,Oi,{showVersionSwitcher:4,showSolverDropdown:5,edgeMiniZinc:0,autoClearOutput:1,showTabs:6,canEditTabs:7,compilationEnabled:8,project:73,enabledSolvers:74,canEditSolverSettings:9,showShareButton:10,showDownloadButton:11,externalPlaygroundURL:12,splitterDirection:2,splitterSize:3,canSwitchOrientation:13,showClearOutput:14,showAutoClearOutput:15,showOutputSectionToggles:16,showOutputRightControls:17,theme:75,hideOutputOnStartup:76,autoFocus:77,loadProject:78,hasFiles:79,getProject:80,isDefaultSolver:81,isDefaultSolverConfig:82},null,[-1,-1,-1,-1,-1,-1])}get loadProject(){return this.$$.ctx[78]}get hasFiles(){return this.$$.ctx[79]}get getProject(){return this.$$.ctx[80]}get isDefaultSolver(){return this.$$.ctx[81]}get isDefaultSolverConfig(){return this.$$.ctx[82]}}function r$(n,e,t){const i=n.slice();return i[10]=e[t],i[12]=t,i}function s$(n){let e;return{c(){e=_("p"),e.textContent="No recent projects.",v(e,"class","has-text-centered")},m(t,i){Y(t,e,i)},p:_e,d(t){t&&X(e)}}}function l$(n){let e,t,i=o$(n[10])+"",r,s,l,o,a=n[10].solver+"",c,h,O,p=new Date(n[10].timestamp).toLocaleString()+"",g,m,$,y;function k(){return n[7](n[12])}return{c(){e=_("div"),t=_("div"),r=pe(i),s=I(),l=_("div"),o=_("div"),c=pe(a),h=I(),O=_("div"),g=pe(p),m=I(),v(l,"class","info is-size-7 svelte-wl1zgv"),v(e,"class","item svelte-wl1zgv"),ne(e,"has-background-primary",n[2]===n[12]),ne(e,"has-text-white",n[2]===n[12])},m(W,Z){Y(W,e,Z),Q(e,t),Q(t,r),Q(e,s),Q(e,l),Q(l,o),Q(o,c),Q(l,h),Q(l,O),Q(O,g),Q(e,m),$||(y=[le(e,"click",k),le(e,"dblclick",n[5])],$=!0)},p(W,Z){n=W,Z&2&&i!==(i=o$(n[10])+"")&&Ne(r,i),Z&2&&a!==(a=n[10].solver+"")&&Ne(c,a),Z&2&&p!==(p=new Date(n[10].timestamp).toLocaleString()+"")&&Ne(g,p),Z&4&&ne(e,"has-background-primary",n[2]===n[12]),Z&4&&ne(e,"has-text-white",n[2]===n[12])},d(W){W&&X(e),$=!1,Ft(y)}}}function W8(n){let e,t=st(n[1]),i=[];for(let s=0;si.name);return n.files.length>3&&t.push(`+${n.files.length-3} more…`),t.join(", ")}return n.files.map(t=>t.name).join(", ")}function Z8(n,e,t){let i;const r=nn();let{active:s=!1}=e,{projects:l=[]}=e,o=-1;function a(g){g||t(2,o=-1)}function c(){i&&r("accept",{project:l[o]})}const h=()=>r("cancel"),O=g=>t(2,o=g),p=()=>r("cancel");return n.$$set=g=>{"active"in g&&t(0,s=g.active),"projects"in g&&t(1,l=g.projects)},n.$$.update=()=>{n.$$.dirty&6&&t(3,i=o>=0&&o{const t=localStorage.getItem(Xd);if(t&&t.length>0){bs=!0;try{e(i=>({...i,...JSON.parse(t)}))}catch(i){console.error(i)}bs=!1}window.addEventListener("storage",i=>{if(i.storageArea===localStorage&&i.key===Xd&&i.newValue.length>0){bs=!0;try{e(r=>({...r,...JSON.parse(i.newValue)}))}catch(r){console.error(r)}bs=!1}})});Bs.subscribe(n=>{bs||(Object.keys(n.sessions).length>a$&&(bs=!0,Bs.update(e=>{const t=Object.keys(e.sessions).map(i=>({key:i,value:e.sessions[i]}));return t.sort((i,r)=>r.value.timestamp-i.value.timestamp),bs=!0,{...e,sessions:t.slice(0,a$).reduce((i,r)=>({...i,[r.key]:r.value}),{})}}),bs=!1),localStorage.setItem(Xd,JSON.stringify(n)))});const{document:A8,window:f$}=hC;function X8(n){let e,t;return e=new R8({props:{projects:n[5],active:n[4]}}),e.$on("cancel",n[12]),e.$on("accept",n[13]),{c(){Ye(e.$$.fragment)},m(i,r){Ae(e,i,r),t=!0},p(i,r){const s={};r&32&&(s.projects=i[5]),r&16&&(s.active=i[4]),e.$set(s)},i(i){t||(V(e.$$.fragment,i),t=!0)},o(i){B(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function Y8(n){let e,t,i,r,s,l,o,a,c;return l=new wt({props:{icon:sv}}),{c(){e=_("div"),t=_("div"),i=_("div"),r=_("button"),s=_("span"),Ye(l.$$.fragment),v(s,"class","icon"),v(r,"class","button"),v(r,"title","Open recent project"),v(i,"class","control"),v(t,"class","field"),v(e,"class","navbar-item")},m(h,O){Y(h,e,O),Q(e,t),Q(t,i),Q(i,r),Q(r,s),Ae(l,s,null),o=!0,a||(c=le(r,"click",n[11]),a=!0)},p:_e,i(h){o||(V(l.$$.fragment,h),o=!0)},o(h){B(l.$$.fragment,h),o=!1},d(h){h&&X(e),Xe(l),a=!1,c()}}}function U8(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:sv}}),{c(){e=_("a"),t=_("span"),Ye(i.$$.fragment),r=I(),s=_("span"),s.textContent="Open recent project",v(t,"class","icon"),v(e,"class","navbar-item mobile-menu-item"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Ae(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[10]),o=!0)},p:_e,i(c){l||(V(i.$$.fragment,c),l=!0)},o(c){B(i.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(i),o=!1,a()}}}function E8(n){let e,t,i,r;const s=[U8,Y8],l=[];function o(a,c){return a[25]?0:1}return e=o(n),t=l[e]=s[e](n),{c(){t.c(),i=Gt()},m(a,c){l[e].m(a,c),Y(a,i,c),r=!0},p(a,c){let h=e;e=o(a),e===h?l[e].p(a,c):(Je(),B(l[h],1,1,()=>{l[h]=null}),et(),t=l[e],t?t.p(a,c):(t=l[e]=s[e](a),t.c()),V(t,1),t.m(i.parentNode,i))},i(a){r||(V(t),r=!0)},o(a){B(t),r=!1},d(a){a&&X(i),l[e].d(a)}}}function M8(n){let e,t,i,r,s,l,o,a,c;function h(m){n[15](m)}function O(m){n[16](m)}function p(m){n[17](m)}let g={project:n[3],$$slots:{"navbar-before-share-buttons":[E8,({isMobile:m})=>({25:m}),({isMobile:m})=>m?33554432:0],default:[X8]},$$scope:{ctx:n}};return n[1].autoClearOutput!==void 0&&(g.autoClearOutput=n[1].autoClearOutput),n[1].splitterDirection!==void 0&&(g.splitterDirection=n[1].splitterDirection),n[1].splitterSize!==void 0&&(g.splitterSize=n[1].splitterSize),i=new x8({props:g}),n[14](i),Mt.push(()=>Fo(i,"autoClearOutput",h)),Mt.push(()=>Fo(i,"splitterDirection",O)),Mt.push(()=>Fo(i,"splitterSize",p)),i.$on("solversChanged",n[18]),{c(){e=I(),t=_("div"),Ye(i.$$.fragment),v(t,"class","playground-app svelte-tuc1wl")},m(m,$){Y(m,e,$),Y(m,t,$),Ae(i,t,null),o=!0,a||(c=[le(f$,"beforeunload",n[7]),le(f$,"hashchange",n[6]),le(A8,"visibilitychange",n[9])],a=!0)},p(m,[$]){const y={};$&8&&(y.project=m[3]),$&100663346&&(y.$$scope={dirty:$,ctx:m}),!r&&$&2&&(r=!0,y.autoClearOutput=m[1].autoClearOutput,jo(()=>r=!1)),!s&&$&2&&(s=!0,y.splitterDirection=m[1].splitterDirection,jo(()=>s=!1)),!l&&$&2&&(l=!0,y.splitterSize=m[1].splitterSize,jo(()=>l=!1)),i.$set(y)},i(m){o||(V(i.$$.fragment,m),o=!0)},o(m){B(i.$$.fragment,m),o=!1},d(m){m&&(X(e),X(t)),n[14](null),Xe(i),a=!1,Ft(c)}}}const WO=`% Use this editor as a MiniZinc scratch book -`,c$="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function z8(n,e,t){let i,r;CO(n,Bs,E=>t(1,r=E));let s,l={files:[]},o=null,a=!1,c=[];function h(E,re){return!s||!re?[]:Object.entries(re.sessions).map(([ae,ve])=>{const Se=E.find(ge=>ge.id===ve.solverId);return{key:ae,files:ve.files,timestamp:ve.timestamp,solver:Se?Se.name:""}}).filter(ae=>ae.key!==sessionStorage.mznPlaygroundSession).sort((ae,ve)=>ve.timestamp-ae.timestamp)}function O(){const E=()=>Array(6).fill(0).map(()=>c$[Math.floor(Math.random()*c$.length)]).join("");let re=E();for(;re in r.sessions;)re=E();return re}function p(E){return E.solverId||(E.solver===0?E.solverId="org.minizinc.gecode_presolver":l.solver===1&&(E.solverId="org.minizinc.mip.coin-bc")),E}let g=!1;async function m(){const E=window.location.hash;if(E.length>0&&(g=!0,window.history.replaceState(void 0,void 0,window.location.pathname+window.location.search),g=!1),!g){if(E.startsWith("#project="))try{const re=decodeURIComponent(E.substring(9));y(O(),{...JSON.parse(re),timestamp:Date.now()});return}catch(re){console.error(re)}if(E.startsWith("#code="))try{const re=decodeURIComponent(E.substring(6));y(O(),{files:[{name:"Playground.mzn",contents:re,anchor:re.length}],timestamp:Date.now()});return}catch(re){console.error(re)}if(E.startsWith("#url="))try{const re=decodeURIComponent(E.substring(5));y(O(),await vQ(re));return}catch(re){console.error(re)}if(sessionStorage.mznPlaygroundSession&&r.sessions[sessionStorage.mznPlaygroundSession]){y(sessionStorage.mznPlaygroundSession,r.sessions[sessionStorage.mznPlaygroundSession]);return}l.files.length===0&&y(O(),{files:[{name:"Playground.mzn",contents:WO,anchor:WO.length}],timestamp:Date.now()})}}su(()=>m());function $(){if(sessionStorage.mznPlaygroundSession&&s.hasFiles())try{const E=s.getProject();if(!(sessionStorage.mznPlaygroundSession in r.sessions)&&s.isDefaultSolver()&&s.isDefaultSolverConfig()&&E.files.length===1&&E.files[0].name==="Playground.mzn"&&E.files[0].contents===WO)return;o=Date.now(),uC(Bs,r.sessions[sessionStorage.mznPlaygroundSession]={...E,timestamp:o},r)}catch(E){console.error(E)}}function y(E,re){$();try{const ae=p(re);sessionStorage.mznPlaygroundSession=E,t(3,l=ae),o=re.timestamp}catch(ae){console.error(ae)}t(4,a=!1),t(5,i=h(c,r))}function k(E){o!==null&&sessionStorage.mznPlaygroundSession in E.sessions&&E.sessions[sessionStorage.mznPlaygroundSession].timestamp>o&&(sessionStorage.mznPlaygroundSession=O(),t(5,i=h(c,E)))}const W=()=>{document.hidden&&$()},Z=()=>t(4,a=!0),A=()=>t(4,a=!0),C=()=>t(4,a=!1),U=E=>y(E.detail.project.key,r.sessions[E.detail.project.key]);function D(E){Mt[E?"unshift":"push"](()=>{s=E,t(2,s)})}function z(E){n.$$.not_equal(r.autoClearOutput,E)&&(r.autoClearOutput=E,Bs.set(r))}function j(E){n.$$.not_equal(r.splitterDirection,E)&&(r.splitterDirection=E,Bs.set(r))}function N(E){n.$$.not_equal(r.splitterSize,E)&&(r.splitterSize=E,Bs.set(r))}const G=E=>t(0,c=E.detail.solvers);return n.$$.update=()=>{n.$$.dirty&3&&t(5,i=h(c,r)),n.$$.dirty&2&&k(r)},[c,r,s,l,a,i,m,$,y,W,Z,A,C,U,D,z,j,N,G]}class D8 extends $i{constructor(e){super(),bi(this,e,z8,M8,Oi,{})}}new D8({target:document.getElementById("app")});export{zo as c,N8 as g}; +`;function tb(n,e,t){const i=n.slice();return i[23]=e[t],i[24]=e,i[25]=t,i}function ib(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,k,W,Z;return y=new wt({props:{icon:F3}}),{c(){e=_("div"),t=_("div"),t.innerHTML="Solution:",i=I(),r=_("div"),s=_("input"),o=I(),a=_("div"),c=_("input"),O=I(),p=_("div"),g=_("p"),m=_("button"),$=_("span"),Ye(y.$$.fragment),v(t,"class","solution-label svelte-g2g7zr"),v(s,"class","input is-small"),v(s,"type","number"),v(s,"min",l=n[2]>0?1:0),v(s,"max",n[2]),v(c,"type","range"),v(c,"min",h=n[2]>0?1:0),v(c,"max",n[2]),v(c,"class","svelte-g2g7zr"),v(a,"class","solution-slider svelte-g2g7zr"),v($,"class","icon"),v(m,"class","button is-small"),v(m,"title","Follow latest solution"),ne(m,"is-primary",n[0]),ne(m,"is-light",!n[0]),v(g,"class","control"),v(p,"class","field has-addons svelte-g2g7zr"),v(e,"class","top svelte-g2g7zr")},m(A,C){Y(A,e,C),Q(e,t),Q(e,i),Q(e,r),Q(r,s),li(s,n[1]),Q(e,o),Q(e,a),Q(a,c),li(c,n[1]),Q(e,O),Q(e,p),Q(p,g),Q(g,m),Q(m,$),Ae(y,$,null),k=!0,W||(Z=[le(s,"input",n[12]),le(c,"change",n[13]),le(c,"input",n[13]),le(m,"click",n[14])],W=!0)},p(A,C){(!k||C&4&&l!==(l=A[2]>0?1:0))&&v(s,"min",l),(!k||C&4)&&v(s,"max",A[2]),C&2&&ta(s.value)!==A[1]&&li(s,A[1]),(!k||C&4&&h!==(h=A[2]>0?1:0))&&v(c,"min",h),(!k||C&4)&&v(c,"max",A[2]),C&2&&li(c,A[1]),(!k||C&1)&&ne(m,"is-primary",A[0]),(!k||C&1)&&ne(m,"is-light",!A[0])},i(A){k||(V(y.$$.fragment,A),k=!0)},o(A){B(y.$$.fragment,A),k=!1},d(A){A&&X(e),Xe(y),W=!1,Ft(Z)}}}function nb(n){let e,t,i=n[24],r=n[25],s,l;const o=()=>n[15](e,i,r),a=()=>n[15](null,i,r);function c(...h){return n[16](n[23],...h)}return{c(){e=_("iframe"),v(e,"class","vis-window svelte-g2g7zr"),Cm(e.src,t=n[23].url)||v(e,"src",t),v(e,"title","Visualisation")},m(h,O){Y(h,e,O),o(),s||(l=le(e,"load",c),s=!0)},p(h,O){n=h,O&8&&!Cm(e.src,t=n[23].url)&&v(e,"src",t),(i!==n[24]||r!==n[25])&&(a(),i=n[24],r=n[25],o())},d(h){h&&X(e),a(),s=!1,l()}}}function d9(n){let e,t,i,r,s,l,o,a=n[2]>0&&ib(n),c=st(n[3]),h=[];for(let O=0;O0?a?(a.p(O,p),p&4&&V(a,1)):(a=ib(O),a.c(),V(a,1),a.m(e,t)):a&&(Je(),B(a,1,1,()=>{a=null}),et()),p&8){c=st(O[3]);let g;for(g=0;g{re=Pe});ae.then(Pe=>{Pe.contentWindow.postMessage({event:"init",payload:E},"*")});const ve=s.reduce((Pe,We)=>({...Pe,[We.name]:We.state.doc.toString()}),{}),Se=[],ge=new DOMParser().parseFromString(G,"text/html");for(const Pe of ge.getElementsByTagName("script")){const We=Pe.getAttribute("src");if(We==="/minizinc-ide.js")Pe.src=p9;else if(We in ve&&We.endsWith(".js")){const lt=URL.createObjectURL(new Blob([ve[We]],{type:"text/javascript; charset=utf-8"}));Pe.src=lt,Se.push(lt)}}for(const Pe of ge.getElementsByTagName("link")){const We=Pe.getAttribute("href");if(We in ve&&We.endsWith(".css")){const lt=URL.createObjectURL(new Blob([ve[We]],{type:"text/css; charset=utf-8"}));Pe.href=lt,Se.push(lt)}}const Ue=new XMLSerializer().serializeToString(ge.doctype)+ge.documentElement.outerHTML,Le=URL.createObjectURL(new Blob([Ue],{type:"text/html; charset=utf-8"}));t(3,O=[...O,{key:N,url:Le,extraUrls:Se,makeReady:re,ready:ae,solutions:[],element:null}])}function y(N,G){for(const E in N){const re=O.find(ve=>ve.key===E);if(!re){console.error(`Did not find visualisation for ${E}`);continue}const ae={time:G,data:N[E]};re.solutions.push(ae),Wn({event:"solution",payload:ae},re)}t(2,h++,h)}function k(N,G){p={status:N,time:G};for(let E=0;Ere.element.contentWindow===N.source);switch(G.event){case"rebroadcast":for(const ae of O)Wn(G.message,ae);G.message.event==="goToSolution"&&(l=G.message.payload===-1,t(0,o=G.message.payload===-1),a=G.message.payload+1,t(1,c=G.message.payload+1));break;case"solve":r("solve",{modelFile:G.modelFile,dataFiles:G.dataFiles,options:G.options});break;case"getNumSolutions":Wn({event:"response",id:G.id,payload:E.solutions.length},E);break;case"getSolution":const re=G.index<0?G.index+E.solutions.length:G.index;if(re<0||re>=E.solutions.length)Wn({event:"error",id:G.id,message:"Solution index out of range"},E);else{Wn({event:"response",id:G.id,payload:E.solutions[G.index===-1?E.solutions.length-1:G.index]},E);break}case"getAllSolutions":Wn({event:"response",id:G.id,payload:E.solutions},E);break;case"getStatus":Wn({event:"response",id:G.id,payload:p},E);break;case"getFinishTime":Wn({event:"response",id:G.id,payload:g},E);break}}function A(N,G,E){if(o&&a===c&&(a=h,t(1,c=h)),o!==l){l=o;for(const re of O)Wn({event:"goToSolution",payload:o?-1:c-1},re)}if(a!==c){a=c,l=!1,t(0,o=!1);for(const re of O)Wn({event:"goToSolution",payload:c-1},re)}}function C(){c=ta(this.value),t(1,c)}function U(){c=ta(this.value),t(1,c)}const D=()=>t(0,o=!o);function z(N,G,E){Mt[N?"unshift":"push"](()=>{G[E].element=N,t(3,O)})}const j=(N,G)=>N.makeReady(G.target);return n.$$set=N=>{"files"in N&&t(6,s=N.files)},n.$$.update=()=>{n.$$.dirty&8&&t(4,i=Math.ceil(Math.sqrt(O.length))),n.$$.dirty&7&&A()},[o,c,h,O,i,Z,s,m,$,y,k,W,C,U,D,z,j]}class m9 extends $i{constructor(e){super(),bi(this,e,g9,d9,Oi,{files:6,reset:7,addVisualisation:8,addSolution:9,status:10,finish:11})}get reset(){return this.$$.ctx[7]}get addVisualisation(){return this.$$.ctx[8]}get addSolution(){return this.$$.ctx[9]}get status(){return this.$$.ctx[10]}get finish(){return this.$$.ctx[11]}}const rb=[".mzn",".mzc",".dzn",".json",".html",".js",".css"];async function wQ(n){const e=n.startsWith("http://")||n.startsWith("https://")?n:`http://${n}`,t=e.split("/").pop();if(!t.endsWith(".mzp")&&rb.every(r=>!t.endsWith(r)))throw new Error("File type not recognised");const i=await fetch(new URL(e));if(!i.ok)throw new Error(`Request failed (${i.status} ${i.statusText})`);if(t.endsWith(".mzp")){const r=await i.json(),s=[],l=r.openFiles[r.openTab];let o=0;for(const c of r.projectFiles){const h=c.split("/").pop();if(rb.every(g=>!h.endsWith(g)))continue;c===l&&(o=s.length);const O=await fetch(new URL(c,e));if(!O.ok)throw new Error(`Request failed (${O.status} ${O.statusText})`);const p=await O.text();s.push({name:h,contents:p,hidden:r.openFiles.indexOf(c)===-1})}let a=r.selectedBuiltinConfigId;return a==="org.gecode.gecode"?a="org.minizinc.gecode_presolver":a==="org.chuffed.chuffed"&&(a="org.minizinc.chuffed"),{files:s,tab:o,solverId:a,timestamp:Date.now()}}else{const r=await i.text();return{files:[{name:t,contents:r}],timestamp:Date.now()}}}function S9(n){let e,t;return e=new _s({props:{active:n[0],title:"Create new file",$$slots:{default:[$9]},$$scope:{ctx:n}}}),e.$on("activate",n[8]),e.$on("cancel",n[23]),{c(){Ye(e.$$.fragment)},m(i,r){Ae(e,i,r),t=!0},p(i,r){const s={};r&1&&(s.active=i[0]),r&134217770&&(s.$$scope={dirty:r,ctx:i}),e.$set(s)},i(i){t||(V(e.$$.fragment,i),t=!0)},o(i){B(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function b9(n){let e,t;return e=new _s({props:{active:n[0],title:"Import from URL",$$slots:{footer:[v9],default:[y9]},$$scope:{ctx:n}}}),e.$on("activate",n[8]),e.$on("cancel",n[14]),e.$on("submit",n[10]),{c(){Ye(e.$$.fragment)},m(i,r){Ae(e,i,r),t=!0},p(i,r){const s={};r&1&&(s.active=i[0]),r&134217816&&(s.$$scope={dirty:r,ctx:i}),e.$set(s)},i(i){t||(V(e.$$.fragment,i),t=!0)},o(i){B(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function $9(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,k,W,Z,A,C,U,D,z,j,N,G,E,re,ae,ve,Se,ge,Ue,Le;return{c(){e=_("aside"),t=_("p"),t.textContent="Model",i=I(),r=_("ul"),s=_("li"),l=_("button"),l.textContent="Model file (.mzn)",o=I(),a=_("li"),c=_("button"),c.textContent="Solution checker model (.mzc.mzn)",h=I(),O=_("p"),O.textContent="Data",p=I(),g=_("ul"),m=_("li"),$=_("button"),$.textContent="Data file (.dzn)",y=I(),k=_("li"),W=_("button"),W.textContent="JSON data file (.json)",Z=I(),A=_("p"),A.textContent="Visualisation",C=I(),U=_("ul"),D=_("li"),z=_("button"),z.textContent="Custom visualisation (.html)",j=I(),N=_("p"),N.textContent="Import",G=I(),E=_("ul"),re=_("li"),ae=_("button"),ae.textContent="Upload file(s)",ve=I(),Se=_("li"),ge=_("button"),ge.textContent="Import from URL",v(t,"class","menu-label"),v(l,"type","button"),v(c,"type","button"),v(r,"class","menu-list"),v(O,"class","menu-label"),v($,"type","button"),v(W,"type","button"),v(g,"class","menu-list"),v(A,"class","menu-label"),v(z,"type","button"),v(U,"class","menu-list"),v(N,"class","menu-label"),v(ae,"type","button"),v(ge,"type","button"),v(E,"class","menu-list"),v(e,"class","menu")},m(Pe,We){Y(Pe,e,We),Q(e,t),Q(e,i),Q(e,r),Q(r,s),Q(s,l),n[15](l),Q(r,o),Q(r,a),Q(a,c),Q(e,h),Q(e,O),Q(e,p),Q(e,g),Q(g,m),Q(m,$),Q(g,y),Q(g,k),Q(k,W),Q(e,Z),Q(e,A),Q(e,C),Q(e,U),Q(U,D),Q(D,z),Q(e,j),Q(e,N),Q(e,G),Q(e,E),Q(E,re),Q(re,ae),Q(E,ve),Q(E,Se),Q(Se,ge),Ue||(Le=[le(l,"click",n[16]),le(c,"click",n[17]),le($,"click",n[18]),le(W,"click",n[19]),le(z,"click",n[20]),le(ae,"click",n[21]),le(ge,"click",n[22])],Ue=!0)},p:_e,d(Pe){Pe&&X(e),n[15](null),Ue=!1,Ft(Le)}}}function sb(n){let e,t;return{c(){e=_("div"),t=pe(n[6]),v(e,"class","error svelte-6l40ed")},m(i,r){Y(i,e,r),Q(e,t)},p(i,r){r&64&&Ne(t,i[6])},d(i){i&&X(e)}}}function y9(n){let e,t,i,r,s,l,o=n[6]&&sb(n);return{c(){o&&o.c(),e=I(),t=_("div"),i=_("p"),r=_("input"),v(r,"class","input"),v(r,"type","text"),v(r,"pattern",".+\\.(mzn|dzn|json|js|html|css|mzp|mzc)"),r.required=!0,v(i,"class","control is-expanded"),v(t,"class","field")},m(a,c){o&&o.m(a,c),Y(a,e,c),Y(a,t,c),Q(t,i),Q(i,r),n[12](r),li(r,n[4]),s||(l=le(r,"input",n[13]),s=!0)},p(a,c){a[6]?o?o.p(a,c):(o=sb(a),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),c&16&&r.value!==a[4]&&li(r,a[4])},d(a){a&&(X(e),X(t)),o&&o.d(a),n[12](null),s=!1,l()}}}function v9(n){let e,t,i,r,s,l;return{c(){e=_("div"),t=_("button"),t.textContent="OK",i=I(),r=_("button"),r.textContent="Cancel",v(t,"class","button is-primary"),v(r,"class","button"),v(r,"type","button"),v(e,"slot","footer")},m(o,a){Y(o,e,a),Q(e,t),Q(e,i),Q(e,r),s||(l=le(r,"click",n[11]),s=!0)},p:_e,d(o){o&&X(e),s=!1,l()}}}function w9(n){let e,t,i,r,s,l,o;const a=[b9,S9],c=[];function h(O,p){return O[5]?0:1}return e=h(n),t=c[e]=a[e](n),{c(){t.c(),i=I(),r=_("input"),v(r,"class","is-hidden svelte-6l40ed"),v(r,"type","file"),r.multiple=!0,v(r,"accept",".mzn,.mzc,.dzn,.json,.html,.js,.css")},m(O,p){c[e].m(O,p),Y(O,i,p),Y(O,r,p),n[24](r),s=!0,l||(o=[le(r,"change",n[25]),le(r,"change",n[9])],l=!0)},p(O,[p]){let g=e;e=h(O),e===g?c[e].p(O,p):(Je(),B(c[g],1,1,()=>{c[g]=null}),et(),t=c[e],t?t.p(O,p):(t=c[e]=a[e](O),t.c()),V(t,1),t.m(i.parentNode,i))},i(O){s||(V(t),s=!0)},o(O){B(t),s=!1},d(O){O&&(X(i),X(r)),c[e].d(O),n[24](null),l=!1,Ft(o)}}}function Q9(n,e,t){let{active:i=!1}=e;const r=nn();let s,l,o,a="",c=!1,h=null;function O(ae){t(5,c=!1),t(4,a=""),t(6,h=null)}async function p(){await Gn(),o&&o.focus()}async function g(){const ae=[];for(const Se of l)ae.push(new Promise((ge,Ue)=>{const Le=new FileReader;Le.onload=()=>{ge({name:Se.name,contents:Le.result})},Le.onerror=Pe=>Ue(Pe),Le.readAsText(Se)}));const ve=await Promise.all(ae);r("open",{files:ve})}async function m(){try{r("open",await wQ(a))}catch(ae){t(6,h=`Failed to import from URL: ${ae.message||ae}`),console.error(ae)}}const $=()=>r("cancel");function y(ae){Mt[ae?"unshift":"push"](()=>{o=ae,t(3,o)})}function k(){a=this.value,t(4,a)}const W=()=>r("cancel");function Z(ae){Mt[ae?"unshift":"push"](()=>{o=ae,t(3,o)})}const A=()=>r("new",{type:".mzn"}),C=()=>r("new",{type:".mzc.mzn"}),U=()=>r("new",{type:".dzn"}),D=()=>r("new",{type:".json"}),z=()=>r("new",{type:".html"}),j=()=>s.click(),N=()=>t(5,c=!0),G=()=>r("cancel");function E(ae){Mt[ae?"unshift":"push"](()=>{s=ae,t(1,s)})}function re(){l=this.files,t(2,l)}return n.$$set=ae=>{"active"in ae&&t(0,i=ae.active)},n.$$.update=()=>{n.$$.dirty&1&&O()},[i,s,l,o,a,c,h,r,p,g,m,$,y,k,W,Z,A,C,U,D,z,j,N,G,E,re]}class k9 extends $i{constructor(e){super(),bi(this,e,Q9,w9,Oi,{active:0})}}function lb(n,e,t){const i=n.slice();return i[14]=e[t],i}function ob(n,e,t){const i=n.slice();return i[17]=e[t].file,i[18]=e[t].index,i}function _9(n){let e,t,i,r,s,l,o;i=new wt({props:{icon:n[17].readOnly?Sd:N1}});function a(){return n[11](n[18],n[17])}return{c(){e=_("button"),t=_("span"),Ye(i.$$.fragment),v(t,"class","icon"),v(e,"class","button is-small"),v(e,"title",r="Click to "+(n[17].readOnly?"unlock":"lock")+" this file for editing"),v(e,"type","button"),ne(e,"is-primary",!n[17].readOnly),ne(e,"is-light",n[17].readOnly)},m(c,h){Y(c,e,h),Q(e,t),Ae(i,t,null),s=!0,l||(o=le(e,"click",a),l=!0)},p(c,h){n=c;const O={};h&2&&(O.icon=n[17].readOnly?Sd:N1),i.$set(O),(!s||h&2&&r!==(r="Click to "+(n[17].readOnly?"unlock":"lock")+" this file for editing"))&&v(e,"title",r),(!s||h&2)&&ne(e,"is-primary",!n[17].readOnly),(!s||h&2)&&ne(e,"is-light",n[17].readOnly)},i(c){s||(V(i.$$.fragment,c),s=!0)},o(c){B(i.$$.fragment,c),s=!1},d(c){c&&X(e),Xe(i),l=!1,o()}}}function P9(n){let e,t,i,r;return i=new wt({props:{icon:Sd}}),{c(){e=_("button"),t=_("span"),Ye(i.$$.fragment),v(t,"class","icon"),v(e,"class","button is-small is-light"),v(e,"title","Compiled checkers are read only"),v(e,"type","button"),e.disabled=!0},m(s,l){Y(s,e,l),Q(e,t),Ae(i,t,null),r=!0},p:_e,i(s){r||(V(i.$$.fragment,s),r=!0)},o(s){B(i.$$.fragment,s),r=!1},d(s){s&&X(e),Xe(i)}}}function ab(n){let e,t,i=n[17].name+"",r,s,l,o,a,c,h,O,p,g,m,$,y,k,W,Z,A,C,U,D,z,j,N;p=new wt({props:{icon:n[17].hidden?I1:B1}});function G(){return n[10](n[18],n[17])}const E=[P9,_9],re=[];function ae(Se,ge){return ge&2&&(y=null),y==null&&(y=!!Se[17].name.endsWith(".mzc")),y?0:1}k=ae(n,-1),W=re[k]=E[k](n),D=new wt({props:{icon:tv}});function ve(){return n[12](n[18])}return{c(){e=_("tr"),t=_("td"),r=pe(i),s=I(),l=_("td"),o=_("div"),a=_("div"),c=_("p"),h=_("button"),O=_("span"),Ye(p.$$.fragment),m=I(),$=_("p"),W.c(),Z=I(),A=_("p"),C=_("button"),U=_("span"),Ye(D.$$.fragment),v(O,"class","icon"),v(h,"class","button is-small"),v(h,"title",g="Click to "+(n[17].hidden?"show":"hide")+" this file"),v(h,"type","button"),ne(h,"is-primary",!n[17].hidden),ne(h,"is-light",n[17].hidden),v(c,"class","control"),v($,"class","control"),v(U,"class","icon"),v(C,"class","button is-small is-danger"),v(C,"title","Delete this file"),v(C,"type","button"),v(A,"class","control"),v(a,"class","field is-grouped"),v(o,"class","tool-buttons svelte-1bgv9sn")},m(Se,ge){Y(Se,e,ge),Q(e,t),Q(t,r),Q(e,s),Q(e,l),Q(l,o),Q(o,a),Q(a,c),Q(c,h),Q(h,O),Ae(p,O,null),Q(a,m),Q(a,$),re[k].m($,null),Q(a,Z),Q(a,A),Q(A,C),Q(C,U),Ae(D,U,null),z=!0,j||(N=[le(h,"click",G),le(C,"click",ve)],j=!0)},p(Se,ge){n=Se,(!z||ge&2)&&i!==(i=n[17].name+"")&&Ne(r,i);const Ue={};ge&2&&(Ue.icon=n[17].hidden?I1:B1),p.$set(Ue),(!z||ge&2&&g!==(g="Click to "+(n[17].hidden?"show":"hide")+" this file"))&&v(h,"title",g),(!z||ge&2)&&ne(h,"is-primary",!n[17].hidden),(!z||ge&2)&&ne(h,"is-light",n[17].hidden);let Le=k;k=ae(n,ge),k===Le?re[k].p(n,ge):(Je(),B(re[Le],1,1,()=>{re[Le]=null}),et(),W=re[k],W?W.p(n,ge):(W=re[k]=E[k](n),W.c()),V(W,1),W.m($,null))},i(Se){z||(V(p.$$.fragment,Se),V(W),V(D.$$.fragment,Se),z=!0)},o(Se){B(p.$$.fragment,Se),B(W),B(D.$$.fragment,Se),z=!1},d(Se){Se&&X(e),Xe(p),re[k].d(),Xe(D),j=!1,Ft(N)}}}function fb(n){let e,t=n[14].label+"",i,r,s,l,o=st(n[14].files),a=[];for(let h=0;hB(a[h],1,1,()=>{a[h]=null});return{c(){e=_("p"),i=pe(t),r=I(),s=_("table");for(let h=0;hB(p[m],1,1,()=>{p[m]=null});return s=new wt({props:{icon:nv}}),{c(){for(let m=0;mAccept',v(e,"slot","footer")},m(t,i){Y(t,e,i)},p:_e,d(t){t&&X(e)}}}function C9(n){let e,t;return e=new _s({props:{active:n[0],title:"Manage files",$$slots:{footer:[W9],default:[x9]},$$scope:{ctx:n}}}),e.$on("submit",n[3]),e.$on("cancel",n[3]),{c(){Ye(e.$$.fragment)},m(i,r){Ae(e,i,r),t=!0},p(i,[r]){const s={};r&1&&(s.active=i[0]),r&2097154&&(s.$$scope={dirty:r,ctx:i}),e.$set(s)},i(i){t||(V(e.$$.fragment,i),t=!0)},o(i){B(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function T9(n,e,t){let i,r,s,l,o,a,{active:c=!1}=e,{files:h=[]}=e;const O=nn();function p(){O("close")}const g=(k,W)=>O("modifyFile",{index:k,options:{hidden:!W.hidden}}),m=(k,W)=>O("modifyFile",{index:k,options:{readOnly:!W.readOnly}}),$=k=>O("delete",{index:k}),y=()=>O("newFile");return n.$$set=k=>{"active"in k&&t(0,c=k.active),"files"in k&&t(4,h=k.files)},n.$$.update=()=>{n.$$.dirty&16&&t(9,i=h.map((k,W)=>({file:k,index:W}))),n.$$.dirty&512&&t(8,r=i.filter(k=>k.file.name.endsWith(".mzn")&&!k.file.name.endsWith(".mzc.mzn")).sort((k,W)=>k.file.name.localeCompare(W.file.name))),n.$$.dirty&512&&t(7,s=i.filter(k=>k.file.name.endsWith(".dzn")||k.file.name.endsWith(".json")).sort((k,W)=>k.file.name.localeCompare(W.file.name))),n.$$.dirty&512&&t(6,l=i.filter(k=>k.file.name.endsWith(".mzc")||k.file.name.endsWith(".mzc.mzn")).sort((k,W)=>k.file.name.localeCompare(W.file.name))),n.$$.dirty&512&&t(5,o=i.filter(k=>!k.file.name.endsWith(".mzn")&&!k.file.name.endsWith(".mzc")&&!k.file.name.endsWith(".dzn")&&!k.file.name.endsWith(".json")).sort((k,W)=>k.file.name.localeCompare(W.file.name))),n.$$.dirty&480&&t(1,a=[{label:"Model files",files:r},{label:"Data files",files:s},{label:"Solution checkers",files:l},{label:"Other files",files:o}].filter(k=>k.files.length>0))},[c,a,O,p,h,o,l,s,r,i,g,m,$,y]}class Z9 extends $i{constructor(e){super(),bi(this,e,T9,C9,Oi,{active:0,files:4})}}function cb(n,e,t){const i=n.slice();return i[9]=e[t],i}function ub(n){let e,t=n[9]+"",i,r;return{c(){e=_("option"),i=pe(t),e.__value=r=n[9],li(e,e.__value),v(e,"class","svelte-1x5266v")},m(s,l){Y(s,e,l),Q(e,i)},p(s,l){l&1&&t!==(t=s[9]+"")&&Ne(i,t),l&1&&r!==(r=s[9])&&(e.__value=r,li(e,e.__value))},d(s){s&&X(e)}}}function R9(n){let e,t,i,r,s,l=st(n[0]),o=[];for(let a=0;an[6].call(t)),v(e,"class","select is-fullwidth is-multiple svelte-1x5266v")},m(a,c){Y(a,e,c),Q(e,t);for(let h=0;h0&&t(2,l=p[0])}function a(){i("accept",{modelFile:l})}const c=()=>i("cancel");function h(){l=TO(this),t(2,l),t(0,r)}const O=()=>i("cancel");return n.$$set=p=>{"modelFiles"in p&&t(0,r=p.modelFiles),"active"in p&&t(1,s=p.active)},n.$$.update=()=>{n.$$.dirty&1&&o(r)},[r,s,l,i,a,c,h,O]}class U9 extends $i{constructor(e){super(),bi(this,e,Y9,X9,Oi,{modelFiles:0,active:1})}}function hb(n,e,t){const i=n.slice();return i[25]=e[t],i[26]=e,i[27]=t,i}function Ob(n,e,t){const i=n.slice();return i[22]=e[t],i}function db(n){let e,t,i,r,s,l,o,a,c;return{c(){e=_("div"),t=_("ul"),i=_("li"),r=_("a"),r.textContent="Enter parameters",s=I(),l=_("li"),o=_("a"),o.textContent="Select data file",ne(i,"is-active",!n[2]),ne(l,"is-active",n[2]),v(e,"class","tabs")},m(h,O){Y(h,e,O),Q(e,t),Q(t,i),Q(i,r),Q(t,s),Q(t,l),Q(l,o),a||(c=[le(r,"click",n[13]),le(o,"click",n[14])],a=!0)},p(h,O){O&4&&ne(i,"is-active",!h[2]),O&4&&ne(l,"is-active",h[2])},d(h){h&&X(e),a=!1,Ft(c)}}}function E9(n){let e,t=st(n[5]),i=[];for(let r=0;rn[16].call(t)),v(e,"class","select is-fullwidth is-multiple")},m(a,c){Y(a,e,c),Q(e,t);for(let h=0;hj[N]===void 0?{name:N,value:""}:{name:N,value:j[N]}))}function $(){r?s("accept",{dataFiles:h}):s("accept",{parameters:O.reduce((j,N)=>({...j,[N.name]:N.value}),{})})}const y=()=>s("cancel"),k=()=>t(2,c=!1),W=()=>t(2,c=!0);function Z(j){Mt[j?"unshift":"push"](()=>{p=j,t(6,p)})}function A(){h=mC(this),t(4,h),t(1,a)}function C(j){Mt[j?"unshift":"push"](()=>{p=j,t(6,p)})}function U(j,N){j[N].value=this.value,t(5,O)}function D(j,N){j[N].value=this.value,t(5,O)}const z=()=>s("cancel");return n.$$set=j=>{"active"in j&&t(0,l=j.active),"parameters"in j&&t(11,o=j.parameters),"dataFiles"in j&&t(1,a=j.dataFiles)},n.$$.update=()=>{n.$$.dirty&2048&&m(o),n.$$.dirty&2&&t(3,i=a.length>0),n.$$.dirty&12&&t(7,r=i&&c)},[l,a,c,i,h,O,p,r,s,g,$,o,y,k,W,Z,A,C,U,D,z]}class N9 extends $i{constructor(e){super(),bi(this,e,I9,L9,Oi,{active:0,parameters:11,dataFiles:1})}}function mb(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,k,W,Z=Tn(n[1],"-a"),A,C=Tn(n[1],"-f"),U,D,z,j,N,G,E,re,ae,ve=Tn(n[1],"-v"),Se,ge,Ue,Le,Pe,We,lt,Vt=Tn(n[1],"-s"),Qt,pt,qt,$e,oe,H,ue,ce,Ee,tt,ft,Be,Yt,ut,Mn,kt;r=new wt({props:{icon:rv}});let xt=Z&&Sb(n),bt=C&&bb(n),je=ve&&$b(n),fe=Vt&&yb(n);return{c(){e=_("div"),t=_("button"),i=_("span"),Ye(r.$$.fragment),s=I(),l=_("form"),o=_("h5"),o.textContent="Solving options",a=I(),c=_("div"),h=_("p"),O=_("input"),p=I(),g=_("label"),g.textContent="Time limit (s)",m=I(),$=_("p"),y=_("input"),W=I(),xt&&xt.c(),A=I(),bt&&bt.c(),U=I(),D=_("h5"),D.textContent="Output options",z=I(),j=_("div"),N=_("p"),G=_("input"),E=I(),re=_("label"),re.textContent="Verbose compilation",ae=I(),je&&je.c(),Se=I(),ge=_("div"),Ue=_("p"),Le=_("input"),Pe=I(),We=_("label"),We.textContent="Compilation statistics",lt=I(),fe&&fe.c(),Qt=I(),pt=_("div"),qt=_("p"),$e=_("input"),oe=I(),H=_("label"),H.textContent="Timing information",ue=I(),ce=_("div"),Ee=_("p"),Ee.innerHTML='',tt=I(),ft=_("p"),Be=_("button"),Be.textContent="Reset to defaults",v(i,"class","icon"),v(t,"class","button is-text is-small exit-button svelte-makhy9"),v(o,"class","title is-5 svelte-makhy9"),v(O,"id","enable-timelimit"),v(O,"type","checkbox"),v(O,"class","svelte-makhy9"),v(g,"for","enable-timelimit"),v(g,"class","svelte-makhy9"),v(h,"class","control checkbox-control svelte-makhy9"),v(y,"class","input is-fullwidth"),v(y,"type","number"),v(y,"step","1"),v(y,"min",0),y.disabled=k=!n[3].enableTimeLimit,v($,"class","control is-expanded"),v(c,"class","field is-grouped"),v(D,"class","title is-5 svelte-makhy9"),v(G,"id","enable-verbose-compile"),v(G,"type","checkbox"),v(G,"class","svelte-makhy9"),v(re,"for","enable-verbose-compile"),v(re,"class","svelte-makhy9"),v(N,"class","control checkbox-control svelte-makhy9"),v(j,"class","field"),v(Le,"id","enable-compilation-satistics"),v(Le,"type","checkbox"),v(Le,"class","svelte-makhy9"),v(We,"for","enable-compilation-satistics"),v(We,"class","svelte-makhy9"),v(Ue,"class","control checkbox-control svelte-makhy9"),v(ge,"class","field"),v($e,"id","enable-timing-information"),v($e,"type","checkbox"),v($e,"class","svelte-makhy9"),v(H,"for","enable-timing-information"),v(H,"class","svelte-makhy9"),v(qt,"class","control checkbox-control svelte-makhy9"),v(pt,"class","field"),v(Ee,"class","control"),v(Be,"type","button"),v(Be,"class","button is-danger"),v(ft,"class","control"),v(ce,"class","field is-grouped bottom-buttons svelte-makhy9"),v(e,"class","config-window svelte-makhy9")},m(Fe,He){Y(Fe,e,He),Q(e,t),Q(t,i),Ae(r,i,null),Q(e,s),Q(e,l),Q(l,o),Q(l,a),Q(l,c),Q(c,h),Q(h,O),O.checked=n[3].enableTimeLimit,Q(h,p),Q(h,g),Q(c,m),Q(c,$),Q($,y),li(y,n[3].timeLimit),Q(l,W),xt&&xt.m(l,null),Q(l,A),bt&&bt.m(l,null),Q(l,U),Q(l,D),Q(l,z),Q(l,j),Q(j,N),Q(N,G),G.checked=n[3].verboseCompilation,Q(N,E),Q(N,re),Q(l,ae),je&&je.m(l,null),Q(l,Se),Q(l,ge),Q(ge,Ue),Q(Ue,Le),Le.checked=n[3].compilerStatistics,Q(Ue,Pe),Q(Ue,We),Q(l,lt),fe&&fe.m(l,null),Q(l,Qt),Q(l,pt),Q(pt,qt),Q(qt,$e),$e.checked=n[3].outputTime,Q(qt,oe),Q(qt,H),Q(l,ue),Q(l,ce),Q(ce,Ee),Q(ce,tt),Q(ce,ft),Q(ft,Be),ut=!0,Mn||(kt=[le(t,"click",n[10]),le(O,"change",n[11]),le(y,"input",n[12]),le(G,"change",n[15]),le(Le,"change",n[17]),le($e,"change",n[19]),le(Be,"click",n[2]),le(l,"submit",b$(n[20]))],Mn=!0)},p(Fe,He){He&8&&(O.checked=Fe[3].enableTimeLimit),(!ut||He&8&&k!==(k=!Fe[3].enableTimeLimit))&&(y.disabled=k),He&8&&ta(y.value)!==Fe[3].timeLimit&&li(y,Fe[3].timeLimit),He&2&&(Z=Tn(Fe[1],"-a")),Z?xt?xt.p(Fe,He):(xt=Sb(Fe),xt.c(),xt.m(l,A)):xt&&(xt.d(1),xt=null),He&2&&(C=Tn(Fe[1],"-f")),C?bt?bt.p(Fe,He):(bt=bb(Fe),bt.c(),bt.m(l,U)):bt&&(bt.d(1),bt=null),He&8&&(G.checked=Fe[3].verboseCompilation),He&2&&(ve=Tn(Fe[1],"-v")),ve?je?je.p(Fe,He):(je=$b(Fe),je.c(),je.m(l,Se)):je&&(je.d(1),je=null),He&8&&(Le.checked=Fe[3].compilerStatistics),He&2&&(Vt=Tn(Fe[1],"-s")),Vt?fe?fe.p(Fe,He):(fe=yb(Fe),fe.c(),fe.m(l,Qt)):fe&&(fe.d(1),fe=null),He&8&&($e.checked=Fe[3].outputTime)},i(Fe){ut||(V(r.$$.fragment,Fe),Fe&&Kn(()=>{ut&&(Yt||(Yt=kl(e,Tc,{x:100,duration:200},!0)),Yt.run(1))}),ut=!0)},o(Fe){B(r.$$.fragment,Fe),Fe&&(Yt||(Yt=kl(e,Tc,{x:100,duration:200},!1)),Yt.run(0)),ut=!1},d(Fe){Fe&&X(e),Xe(r),xt&&xt.d(),bt&&bt.d(),je&&je.d(),fe&&fe.d(),Fe&&Yt&&Yt.end(),Mn=!1,Ft(kt)}}}function Sb(n){let e,t,i,r,s,l,o;return{c(){e=_("div"),t=_("p"),i=_("input"),r=I(),s=_("label"),s.textContent="All solutions (for satisfication problems)",v(i,"id","enable-all-solutions"),v(i,"type","checkbox"),v(i,"class","svelte-makhy9"),v(s,"for","enable-all-solutions"),v(s,"class","svelte-makhy9"),v(t,"class","control checkbox-control svelte-makhy9"),v(e,"class","field")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),i.checked=n[3].allSolutions,Q(t,r),Q(t,s),l||(o=le(i,"change",n[13]),l=!0)},p(a,c){c&8&&(i.checked=a[3].allSolutions)},d(a){a&&X(e),l=!1,o()}}}function bb(n){let e,t,i,r,s,l,o;return{c(){e=_("div"),t=_("p"),i=_("input"),r=I(),s=_("label"),s.textContent="Free search",v(i,"id","enable-free-search"),v(i,"type","checkbox"),v(i,"class","svelte-makhy9"),v(s,"for","enable-free-search"),v(s,"class","svelte-makhy9"),v(t,"class","control checkbox-control svelte-makhy9"),v(e,"class","field")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),i.checked=n[3].freeSearch,Q(t,r),Q(t,s),l||(o=le(i,"change",n[14]),l=!0)},p(a,c){c&8&&(i.checked=a[3].freeSearch)},d(a){a&&X(e),l=!1,o()}}}function $b(n){let e,t,i,r,s,l,o;return{c(){e=_("div"),t=_("p"),i=_("input"),r=I(),s=_("label"),s.textContent="Verbose solving",v(i,"id","enable-verbose-solve"),v(i,"type","checkbox"),v(i,"class","svelte-makhy9"),v(s,"for","enable-verbose-solve"),v(s,"class","svelte-makhy9"),v(t,"class","control checkbox-control svelte-makhy9"),v(e,"class","field")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),i.checked=n[3].verboseSolving,Q(t,r),Q(t,s),l||(o=le(i,"change",n[16]),l=!0)},p(a,c){c&8&&(i.checked=a[3].verboseSolving)},d(a){a&&X(e),l=!1,o()}}}function yb(n){let e,t,i,r,s,l,o;return{c(){e=_("div"),t=_("p"),i=_("input"),r=I(),s=_("label"),s.textContent="Solving statistics",v(i,"id","enable-solving-satistics"),v(i,"type","checkbox"),v(i,"class","svelte-makhy9"),v(s,"for","enable-solving-satistics"),v(s,"class","svelte-makhy9"),v(t,"class","control checkbox-control svelte-makhy9"),v(e,"class","field")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),i.checked=n[3].solvingStatistics,Q(t,r),Q(t,s),l||(o=le(i,"change",n[18]),l=!0)},p(a,c){c&8&&(i.checked=a[3].solvingStatistics)},d(a){a&&X(e),l=!1,o()}}}function B9(n){let e,t,i=n[0]&&mb(n);return{c(){i&&i.c(),e=Gt()},m(r,s){i&&i.m(r,s),Y(r,e,s),t=!0},p(r,[s]){r[0]?i?(i.p(r,s),s&1&&V(i,1)):(i=mb(r),i.c(),V(i,1),i.m(e.parentNode,e)):i&&(Je(),B(i,1,1,()=>{i=null}),et())},i(r){t||(V(i),t=!0)},o(r){B(i),t=!1},d(r){r&&X(e),i&&i.d(r)}}}function Tn(n,e){return n.indexOf(e)!==-1}function j9(n,e,t){const i=nn();let{active:r}=e,{stdFlags:s=[]}=e;const l={enableTimeLimit:!1,timeLimit:1,allSolutions:!1,verboseCompilation:!1,verboseSolving:!1,compilerStatistics:!1,solvingStatistics:!1,outputTime:!1,freeSearch:!1};let o={...l};function a(N){const G=N*1e3;G!==Math.floor(G)&&t(3,o.timeLimit=Math.floor(G)/1e3,o)}function c(){for(const N in o)if(l[N]!==o[N])return!1;return!0}function h(){t(3,o={...l})}function O(N){const G={...l};for(const E in l)E in N&&(G[E]=N[E]);t(3,o=G)}function p(){return{...o}}function g(N){const G={solver:N};return o.enableTimeLimit&&o.timeLimit>0&&(G["time-limit"]=o.timeLimit*1e3),o.allSolutions&&Tn(s,"-a")&&(G["all-satisfaction"]=!0),o.verboseCompilation&&(G["verbose-compilation"]=!0),o.verboseSolving&&Tn(s,"-v")&&(G["verbose-solving"]=!0),o.compilerStatistics&&(G["compiler-statistics"]=!0),o.solvingStatistics&&Tn(s,"-s")&&(G["solver-statistics"]=!0),o.outputTime&&(G["output-time"]=!0),o.freeSearch&&Tn(s,"-f")&&(G["free-search"]=!0),G}function m(N){const G={solver:N};return o.verboseCompilation&&(G["verbose-compilation"]=!0),o.compilerStatistics&&(G["compiler-statistics"]=!0),G}const $=()=>i("close");function y(){o.enableTimeLimit=this.checked,t(3,o)}function k(){o.timeLimit=ta(this.value),t(3,o)}function W(){o.allSolutions=this.checked,t(3,o)}function Z(){o.freeSearch=this.checked,t(3,o)}function A(){o.verboseCompilation=this.checked,t(3,o)}function C(){o.verboseSolving=this.checked,t(3,o)}function U(){o.compilerStatistics=this.checked,t(3,o)}function D(){o.solvingStatistics=this.checked,t(3,o)}function z(){o.outputTime=this.checked,t(3,o)}const j=()=>i("close");return n.$$set=N=>{"active"in N&&t(0,r=N.active),"stdFlags"in N&&t(1,s=N.stdFlags)},n.$$.update=()=>{n.$$.dirty&8&&a(o.timeLimit)},[r,s,h,o,i,c,O,p,g,m,$,y,k,W,Z,A,C,U,D,z,j]}class F9 extends $i{constructor(e){super(),bi(this,e,j9,B9,Oi,{active:0,stdFlags:1,isDefault:5,reset:2,load:6,save:7,getSolvingConfiguration:8,getCompilationConfiguration:9})}get isDefault(){return this.$$.ctx[5]}get reset(){return this.$$.ctx[2]}get load(){return this.$$.ctx[6]}get save(){return this.$$.ctx[7]}get getSolvingConfiguration(){return this.$$.ctx[8]}get getCompilationConfiguration(){return this.$$.ctx[9]}}function vb(n,e,t){const i=n.slice();return i[14]=e[t],i}const G9=n=>({item:n&4}),wb=n=>({item:n[14]}),H9=n=>({item:n&8}),Qb=n=>({item:n[3]});function kb(n){let e;const t=n[9].selected,i=Ri(t,n,n[8],Qb),r=i||K9(n);return{c(){r&&r.c()},m(s,l){r&&r.m(s,l),e=!0},p(s,l){i?i.p&&(!e||l&264)&&Xi(i,t,s,s[8],e?Ai(t,s[8],l,H9):Yi(s[8]),Qb):r&&r.p&&(!e||l&8)&&r.p(s,e?l:-1)},i(s){e||(V(r,s),e=!0)},o(s){B(r,s),e=!1},d(s){r&&r.d(s)}}}function K9(n){let e=n[3].label+"",t;return{c(){t=pe(e)},m(i,r){Y(i,t,r)},p(i,r){r&8&&e!==(e=i[3].label+"")&&Ne(t,e)},d(i){i&&X(t)}}}function J9(n){let e=n[14].label+"",t;return{c(){t=pe(e)},m(i,r){Y(i,t,r)},p(i,r){r&4&&e!==(e=i[14].label+"")&&Ne(t,e)},d(i){i&&X(t)}}}function _b(n){let e,t,i,r,s;const l=n[9].item,o=Ri(l,n,n[8],wb),a=o||J9(n);function c(){return n[11](n[14])}return{c(){e=_("a"),a&&a.c(),t=I(),v(e,"href","javascript:void(0);"),v(e,"class","dropdown-item"),ne(e,"is-active",n[3]===n[14])},m(h,O){Y(h,e,O),a&&a.m(e,null),Q(e,t),i=!0,r||(s=le(e,"click",c),r=!0)},p(h,O){n=h,o?o.p&&(!i||O&260)&&Xi(o,l,n,n[8],i?Ai(l,n[8],O,G9):Yi(n[8]),wb):a&&a.p&&(!i||O&4)&&a.p(n,i?O:-1),(!i||O&12)&&ne(e,"is-active",n[3]===n[14])},i(h){i||(V(a,h),i=!0)},o(h){B(a,h),i=!1},d(h){h&&X(e),a&&a.d(h),r=!1,s()}}}function e8(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$=n[3]&&kb(n);a=new wt({props:{icon:eT}});let y=st(n[2]),k=[];for(let Z=0;ZB(k[Z],1,1,()=>{k[Z]=null});return{c(){e=I(),t=_("div"),i=_("div"),r=_("button"),s=_("span"),$&&$.c(),l=I(),o=_("span"),Ye(a.$$.fragment),c=I(),h=_("div"),O=_("div");for(let Z=0;Z{$=null}),et()),(!p||A&16)&&(r.disabled=Z[4]),A&332){y=st(Z[2]);let C;for(C=0;Ct(0,c=!c),$=k=>p(k);function y(k){Mt[k?"unshift":"push"](()=>{O=k,t(5,O)})}return n.$$set=k=>{"title"in k&&t(1,l=k.title),"items"in k&&t(2,o=k.items),"currentItem"in k&&t(3,a=k.currentItem),"active"in k&&t(0,c=k.active),"disabled"in k&&t(4,h=k.disabled),"$$scope"in k&&t(8,r=k.$$scope)},[c,l,o,a,h,O,p,g,r,i,m,$,y]}class i8 extends $i{constructor(e){super(),bi(this,e,t8,e8,Oi,{title:1,items:2,currentItem:3,active:0,disabled:4})}}const QQ=Ie.define({map:(n,e)=>({from:e.mapPos(n.from),to:e.mapPos(n.to),msg:n.msg,type:n.type})}),kQ=Ie.define(),Pb=pi.define({create(){return Ze.none},update(n,e){n=n.map(e.changes);for(const t of e.effects)t.is(kQ)&&(n=Ze.none),t.is(QQ)&&(n=n.update({add:[Ze.mark({class:`cm-mzn-underline-${t.value.type}`,attributes:{title:t.value.msg}}).range(t.value.from,t.value.to)]}));return n},provide:n=>Oe.decorations.from(n)});function Ad(n,e,t){let i,r=1,s=1;for(i=0;i=n&&s>=e)return i;s++,t[i]===` +`&&(r++,s=1)}return i}function n8(n,e,t){const i=e.map(r=>QQ.of({from:Ad(r.location.firstLine,r.location.firstColumn,n),to:Ad(r.location.lastLine,r.location.lastColumn,n)+1,msg:`${r.type==="error"?"Error":"Warning"}: ${r.what}: ${r.message}`,type:r.type}));t.state.field(Pb,!1)||i.push(Ie.appendConfig.of([Pb])),t.dispatch({effects:[kQ.of(null),...i]})}const yl=[];function _Q(n,e=_e){let t;const i=new Set;function r(o){if(Oi(n,o)&&(n=o,t)){const a=!yl.length;for(const c of i)c[1](),yl.push(c,n);if(a){for(let c=0;c{i.delete(c),i.size===0&&t&&(t(),t=null)}}return{set:r,update:s,subscribe:l}}const PQ=n=>{const e=window.matchMedia(n);return _Q(e.matches,t=>{const i=()=>t(window.matchMedia(n).matches);return e.addEventListener("change",i),()=>e.removeEventListener("change",i)})},r8=PQ("(prefers-color-scheme: dark)"),s8=PQ("(max-width: 768px)"),l8=n=>({isMobile:n[1]&4194304}),xb=n=>({isMobile:n[53]}),o8=n=>({isMobile:n[1]&4194304}),Wb=n=>({isMobile:n[53]}),a8=n=>({isMobile:n[1]&4194304}),Cb=n=>({isMobile:n[53]}),f8=n=>({isMobile:n[1]&4194304}),Tb=n=>({isMobile:n[53]}),c8=n=>({isMobile:n[1]&4194304}),Zb=n=>({isMobile:n[53]});function Rb(n,e,t){const i=n.slice();return i[157]=e[t],i[159]=t,i}const u8=n=>({isMobile:n[1]&4194304}),Ab=n=>({isMobile:n[53]});function Xb(n,e,t){const i=n.slice();return i[157]=e[t],i[159]=t,i}const h8=n=>({isMobile:n[1]&4194304}),Yb=n=>({isMobile:n[53]}),O8=n=>({isMobile:n[1]&4194304}),Ub=n=>({isMobile:n[53]});function d8(n){let e,t,i,r,s,l,o,a,c;return s=new wt({props:{icon:iT}}),{c(){e=_("button"),t=_("span"),t.textContent="Run",i=I(),r=_("span"),Ye(s.$$.fragment),v(r,"class","icon"),v(e,"class","button is-primary"),v(e,"title","Run the current file"),e.disabled=l=!n[50]},m(h,O){Y(h,e,O),Q(e,t),Q(e,i),Q(e,r),Ae(s,r,null),o=!0,a||(c=le(e,"click",n[62]),a=!0)},p(h,O){(!o||O[1]&524288&&l!==(l=!h[50]))&&(e.disabled=l)},i(h){o||(V(s.$$.fragment,h),o=!0)},o(h){B(s.$$.fragment,h),o=!1},d(h){h&&X(e),Xe(s),a=!1,c()}}}function p8(n){let e,t,i,r,s,l,o,a;return s=new wt({props:{icon:J3}}),{c(){e=_("button"),t=_("span"),t.textContent="Stop",i=I(),r=_("span"),Ye(s.$$.fragment),v(r,"class","icon"),v(e,"class","button is-danger"),v(e,"title","Cancel solving")},m(c,h){Y(c,e,h),Q(e,t),Q(e,i),Q(e,r),Ae(s,r,null),l=!0,o||(a=le(e,"click",n[64]),o=!0)},p:_e,i(c){l||(V(s.$$.fragment,c),l=!0)},o(c){B(s.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(s),o=!1,a()}}}function Eb(n){let e,t,i,r,s,l;return{c(){e=_("div"),t=_("button"),i=_("span"),i.textContent="Compile",v(t,"class","button"),v(t,"title","Compile the current file and show the resultant FlatZinc"),t.disabled=r=n[47]||!n[49],v(e,"class","control")},m(o,a){Y(o,e,a),Q(e,t),Q(t,i),s||(l=le(t,"click",n[63]),s=!0)},p(o,a){a[1]&327680&&r!==(r=o[47]||!o[49])&&(t.disabled=r)},d(o){o&&X(e),s=!1,l()}}}function Mb(n){let e,t,i;return t=new i8({props:{items:n[52],currentItem:n[0]?n[19].edge:n[19].latest,disabled:n[47],title:"Configure MiniZinc version",$$slots:{item:[g8,({item:r})=>({161:r}),({item:r})=>[0,0,0,0,0,r?64:0]]},$$scope:{ctx:n}}}),t.$on("selectItem",n[71]),{c(){e=_("div"),Ye(t.$$.fragment),v(e,"class","control")},m(r,s){Y(r,e,s),Ae(t,e,null),i=!0},p(r,s){const l={};s[1]&2097152&&(l.items=r[52]),s[0]&524289&&(l.currentItem=r[0]?r[19].edge:r[19].latest),s[1]&65536&&(l.disabled=r[47]),s[4]&8192|s[5]&64&&(l.$$scope={dirty:s,ctx:r}),t.$set(l)},i(r){i||(V(t.$$.fragment,r),i=!0)},o(r){B(t.$$.fragment,r),i=!1},d(r){r&&X(e),Xe(t)}}}function g8(n){let e,t=n[161].label+"",i,r,s=n[161].detail+"",l,o;return{c(){e=_("span"),i=pe(t),r=pe(" ("),l=pe(s),o=pe(")"),v(e,"slot","item")},m(a,c){Y(a,e,c),Q(e,i),Q(e,r),Q(e,l),Q(e,o)},p(a,c){c[5]&64&&t!==(t=a[161].label+"")&&Ne(i,t),c[5]&64&&s!==(s=a[161].detail+"")&&Ne(l,s)},d(a){a&&X(e)}}}function zb(n){let e,t,i,r,s,l=st(n[23]),o=[];for(let a=0;an[93].call(i)),v(t,"class","select is-fullwidth"),v(e,"class","control is-expanded")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i);for(let h=0;hSolver:',r=I(),s=_("div"),l=_("div"),o=_("select");for(let $=0;$n[94].call(o)),v(l,"class","select is-fullwidth"),v(s,"class","control is-expanded"),v(t,"class","field has-addons"),v(e,"class","navbar-item is-hidden-mobile")},m($,y){Y($,e,y),Q(e,t),Q(t,i),Q(t,r),Q(t,s),Q(s,l),Q(l,o);for(let k=0;k{m=null}),et())},i($){c||(V(m),c=!0)},o($){B(m),c=!1},d($){$&&X(e),di(g,$),m&&m.d(),h=!1,O()}}}function qb(n){let e,t=n[157].name+"",i,r,s=n[157].version+"",l,o;return{c(){e=_("option"),i=pe(t),r=I(),l=pe(s),o=I(),e.__value=n[159],li(e,e.__value)},m(a,c){Y(a,e,c),Q(e,i),Q(e,r),Q(e,l),Q(e,o)},p(a,c){c[0]&8388608&&t!==(t=a[157].name+"")&&Ne(i,t),c[0]&8388608&&s!==(s=a[157].version+"")&&Ne(l,s)},d(a){a&&X(e)}}}function Lb(n){let e,t,i,r,s,l,o;return r=new wt({props:{icon:iv}}),{c(){e=_("div"),t=_("button"),i=_("span"),Ye(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-primary"),v(t,"title","Solver configuration"),v(e,"class","control")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),Ae(r,i,null),s=!0,l||(o=le(t,"click",n[55]),l=!0)},p:_e,i(a){s||(V(r.$$.fragment,a),s=!0)},o(a){B(r.$$.fragment,a),s=!1},d(a){a&&X(e),Xe(r),l=!1,o()}}}function m8(n){let e,t,i,r,s,l,o;const a=n[92]["navbar-before-share-buttons"],c=Ri(a,n,n[137],Cb);let h=n[10]&&Ib(n),O=n[11]&&Nb(n),p=n[12]&&Bb(n);const g=n[92]["navbar-share-buttons"],m=Ri(g,n,n[137],Wb);return{c(){c&&c.c(),e=I(),t=_("div"),i=_("div"),h&&h.c(),r=I(),O&&O.c(),s=I(),p&&p.c(),l=I(),m&&m.c(),v(i,"class","field has-addons"),v(t,"class","navbar-item")},m($,y){c&&c.m($,y),Y($,e,y),Y($,t,y),Q(t,i),h&&h.m(i,null),Q(i,r),O&&O.m(i,null),Q(i,s),p&&p.m(i,null),Q(i,l),m&&m.m(i,null),o=!0},p($,y){c&&c.p&&(!o||y[1]&4194304|y[4]&8192)&&Xi(c,a,$,$[137],o?Ai(a,$[137],y,a8):Yi($[137]),Cb),$[10]?h?(h.p($,y),y[0]&1024&&V(h,1)):(h=Ib($),h.c(),V(h,1),h.m(i,r)):h&&(Je(),B(h,1,1,()=>{h=null}),et()),$[11]?O?(O.p($,y),y[0]&2048&&V(O,1)):(O=Nb($),O.c(),V(O,1),O.m(i,s)):O&&(Je(),B(O,1,1,()=>{O=null}),et()),$[12]?p?(p.p($,y),y[0]&4096&&V(p,1)):(p=Bb($),p.c(),V(p,1),p.m(i,l)):p&&(Je(),B(p,1,1,()=>{p=null}),et()),m&&m.p&&(!o||y[1]&4194304|y[4]&8192)&&Xi(m,g,$,$[137],o?Ai(g,$[137],y,o8):Yi($[137]),Wb)},i($){o||(V(c,$),V(h),V(O),V(p),V(m,$),o=!0)},o($){B(c,$),B(h),B(O),B(p),B(m,$),o=!1},d($){$&&(X(e),X(t)),c&&c.d($),h&&h.d(),O&&O.d(),p&&p.d(),m&&m.d($)}}}function S8(n){let e,t,i,r,s,l,o,a=n[8]&&!n[47]&&n[49]&&jb(n),c=n[9]&&n[5]&&n[23].length>0&&Fb(n),h=n[4]&&!n[47]&&Gb(n);const O=n[92]["navbar-before-share-buttons"],p=Ri(O,n,n[137],Tb);let g=n[10]&&n[18]===0&&Hb(n),m=n[12]&&n[18]===0&&Kb(n);return{c(){a&&a.c(),e=I(),c&&c.c(),t=I(),h&&h.c(),i=I(),p&&p.c(),r=I(),g&&g.c(),s=I(),m&&m.c(),l=Gt()},m($,y){a&&a.m($,y),Y($,e,y),c&&c.m($,y),Y($,t,y),h&&h.m($,y),Y($,i,y),p&&p.m($,y),Y($,r,y),g&&g.m($,y),Y($,s,y),m&&m.m($,y),Y($,l,y),o=!0},p($,y){$[8]&&!$[47]&&$[49]?a?(a.p($,y),y[0]&256|y[1]&327680&&V(a,1)):(a=jb($),a.c(),V(a,1),a.m(e.parentNode,e)):a&&(Je(),B(a,1,1,()=>{a=null}),et()),$[9]&&$[5]&&$[23].length>0?c?(c.p($,y),y[0]&8389152&&V(c,1)):(c=Fb($),c.c(),V(c,1),c.m(t.parentNode,t)):c&&(Je(),B(c,1,1,()=>{c=null}),et()),$[4]&&!$[47]?h?(h.p($,y),y[0]&16|y[1]&65536&&V(h,1)):(h=Gb($),h.c(),V(h,1),h.m(i.parentNode,i)):h&&(Je(),B(h,1,1,()=>{h=null}),et()),p&&p.p&&(!o||y[1]&4194304|y[4]&8192)&&Xi(p,O,$,$[137],o?Ai(O,$[137],y,f8):Yi($[137]),Tb),$[10]&&$[18]===0?g?(g.p($,y),y[0]&263168&&V(g,1)):(g=Hb($),g.c(),V(g,1),g.m(s.parentNode,s)):g&&(Je(),B(g,1,1,()=>{g=null}),et()),$[12]&&$[18]===0?m?(m.p($,y),y[0]&266240&&V(m,1)):(m=Kb($),m.c(),V(m,1),m.m(l.parentNode,l)):m&&(Je(),B(m,1,1,()=>{m=null}),et())},i($){o||(V(a),V(c),V(h),V(p,$),V(g),V(m),o=!0)},o($){B(a),B(c),B(h),B(p,$),B(g),B(m),o=!1},d($){$&&(X(e),X(t),X(i),X(r),X(s),X(l)),a&&a.d($),c&&c.d($),h&&h.d($),p&&p.d($),g&&g.d($),m&&m.d($)}}}function Ib(n){let e,t,i,r,s,l,o,a;return r=new wt({props:{icon:Jy}}),{c(){e=_("div"),t=_("button"),i=_("span"),Ye(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-primary"),v(t,"title","Share"),t.disabled=s=n[18]!==0,v(e,"class","control")},m(c,h){Y(c,e,h),Q(e,t),Q(t,i),Ae(r,i,null),l=!0,o||(a=le(t,"click",n[101]),o=!0)},p(c,h){(!l||h[0]&262144&&s!==(s=c[18]!==0))&&(t.disabled=s)},i(c){l||(V(r.$$.fragment,c),l=!0)},o(c){B(r.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(r),o=!1,a()}}}function Nb(n){let e,t,i,r,s,l,o,a;return r=new wt({props:{icon:K3}}),{c(){e=_("div"),t=_("button"),i=_("span"),Ye(r.$$.fragment),v(i,"class","icon"),v(t,"class","button"),v(t,"title","Download project"),t.disabled=s=n[37]||n[18]!==0,v(e,"class","control")},m(c,h){Y(c,e,h),Q(e,t),Q(t,i),Ae(r,i,null),l=!0,o||(a=le(t,"click",n[102]),o=!0)},p(c,h){(!l||h[0]&262144|h[1]&64&&s!==(s=c[37]||c[18]!==0))&&(t.disabled=s)},i(c){l||(V(r.$$.fragment,c),l=!0)},o(c){B(r.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(r),o=!1,a()}}}function Bb(n){let e,t,i,r,s,l,o,a;return r=new wt({props:{icon:ev}}),{c(){e=_("div"),t=_("button"),i=_("span"),Ye(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-primary"),v(t,"title","Open in playground"),t.disabled=s=n[18]!==0,v(e,"class","control")},m(c,h){Y(c,e,h),Q(e,t),Q(t,i),Ae(r,i,null),l=!0,o||(a=le(t,"click",n[68]),o=!0)},p(c,h){(!l||h[0]&262144&&s!==(s=c[18]!==0))&&(t.disabled=s)},i(c){l||(V(r.$$.fragment,c),l=!0)},o(c){B(r.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(r),o=!1,a()}}}function jb(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:nT}}),{c(){e=_("a"),t=_("span"),Ye(i.$$.fragment),r=I(),s=_("span"),s.textContent="Compile current file",v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Ae(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[96]),o=!0)},p:_e,i(c){l||(V(i.$$.fragment,c),l=!0)},o(c){B(i.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(i),o=!1,a()}}}function Fb(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:iv}}),{c(){e=_("a"),t=_("span"),Ye(i.$$.fragment),r=I(),s=_("span"),s.textContent="Solver configuration",v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Ae(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[97]),o=!0)},p:_e,i(c){l||(V(i.$$.fragment,c),l=!0)},o(c){B(i.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(i),o=!1,a()}}}function Gb(n){let e,t,i,r,s,l,o=n[0]?"latest":"edge",a,c,h,O,p;return i=new wt({props:{icon:B3}}),{c(){e=_("a"),t=_("span"),Ye(i.$$.fragment),r=I(),s=_("span"),l=pe("Switch to the "),a=pe(o),c=pe(" version of MiniZinc"),v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(g,m){Y(g,e,m),Q(e,t),Ae(i,t,null),Q(e,r),Q(e,s),Q(s,l),Q(s,a),Q(s,c),h=!0,O||(p=le(e,"click",n[98]),O=!0)},p(g,m){(!h||m[0]&1)&&o!==(o=g[0]?"latest":"edge")&&Ne(a,o)},i(g){h||(V(i.$$.fragment,g),h=!0)},o(g){B(i.$$.fragment,g),h=!1},d(g){g&&X(e),Xe(i),O=!1,p()}}}function Hb(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:Jy}}),{c(){e=_("a"),t=_("span"),Ye(i.$$.fragment),r=I(),s=_("span"),s.textContent="Share this project",v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Ae(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[99]),o=!0)},p:_e,i(c){l||(V(i.$$.fragment,c),l=!0)},o(c){B(i.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(i),o=!1,a()}}}function Kb(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:ev}}),{c(){e=_("a"),t=_("span"),Ye(i.$$.fragment),r=I(),s=_("span"),s.textContent="Open in MiniZinc Playground",v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Ae(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[100]),o=!0)},p:_e,i(c){l||(V(i.$$.fragment,c),l=!0)},o(c){B(i.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(i),o=!1,a()}}}function Jb(n){let e,t,i;return t=new hT({props:{files:n[20],currentIndex:n[21],readonly:!n[7]}}),t.$on("selectTab",n[110]),t.$on("reorder",n[111]),t.$on("newFile",n[112]),t.$on("rename",n[58]),t.$on("close",n[113]),t.$on("manageFiles",n[114]),{c(){e=_("div"),Ye(t.$$.fragment),v(e,"class","top svelte-hl0lfa")},m(r,s){Y(r,e,s),Ae(t,e,null),i=!0},p(r,s){const l={};s[0]&1048576&&(l.files=r[20]),s[0]&2097152&&(l.currentIndex=r[21]),s[0]&128&&(l.readonly=!r[7]),t.$set(l)},i(r){i||(V(t.$$.fragment,r),i=!0)},o(r){B(t.$$.fragment,r),i=!1},d(r){r&&X(e),Xe(t)}}}function e$(n){let e,t,i={state:n[51]};return e=new C3({props:i}),n[115](e),{c(){Ye(e.$$.fragment)},m(r,s){Ae(e,r,s),t=!0},p(r,s){const l={};s[1]&1048576&&(l.state=r[51]),e.$set(l)},i(r){t||(V(e.$$.fragment,r),t=!0)},o(r){B(e.$$.fragment,r),t=!1},d(r){n[115](null),Xe(e,r)}}}function b8(n){let e,t,i,r,s=n[6]&&Jb(n),l=n[51]&&e$(n);return{c(){e=_("div"),s&&s.c(),t=I(),i=_("div"),l&&l.c(),v(i,"class","grow svelte-hl0lfa"),v(e,"class","panel stack svelte-hl0lfa"),v(e,"slot","panelA")},m(o,a){Y(o,e,a),s&&s.m(e,null),Q(e,t),Q(e,i),l&&l.m(i,null),r=!0},p(o,a){o[6]?s?(s.p(o,a),a[0]&64&&V(s,1)):(s=Jb(o),s.c(),V(s,1),s.m(e,t)):s&&(Je(),B(s,1,1,()=>{s=null}),et()),o[51]?l?(l.p(o,a),a[1]&1048576&&V(l,1)):(l=e$(o),l.c(),V(l,1),l.m(i,null)):l&&(Je(),B(l,1,1,()=>{l=null}),et())},i(o){r||(V(s),V(l),r=!0)},o(o){B(s),B(l),r=!1},d(o){o&&X(e),s&&s.d(),l&&l.d()}}}function t$(n){let e,t,i,r,s,l,o,a,c,h,O,p,g=n[13]&&i$(n);return{c(){e=_("div"),t=_("div"),i=_("ul"),r=_("li"),s=_("a"),s.textContent="Output",l=I(),o=_("li"),a=_("a"),a.textContent="Visualisation",c=I(),g&&g.c(),v(s,"href","javascript:void(0);"),ne(r,"is-active",!n[43]),v(a,"href","javascript:void(0);"),ne(o,"is-active",n[43]),v(t,"class","tabs is-boxed"),v(e,"class","top svelte-hl0lfa")},m(m,$){Y(m,e,$),Q(e,t),Q(t,i),Q(i,r),Q(r,s),Q(i,l),Q(i,o),Q(o,a),Q(i,c),g&&g.m(i,null),h=!0,O||(p=[le(s,"click",n[103]),le(a,"click",n[104])],O=!0)},p(m,$){(!h||$[1]&4096)&&ne(r,"is-active",!m[43]),(!h||$[1]&4096)&&ne(o,"is-active",m[43]),m[13]?g?(g.p(m,$),$[0]&8192&&V(g,1)):(g=i$(m),g.c(),V(g,1),g.m(i,null)):g&&(Je(),B(g,1,1,()=>{g=null}),et())},i(m){h||(V(g),h=!0)},o(m){B(g),h=!1},d(m){m&&X(e),g&&g.d(),O=!1,Ft(p)}}}function i$(n){let e,t,i,r,s,l,o;return r=new wt({props:{icon:sv}}),{c(){e=_("li"),t=_("button"),i=_("span"),Ye(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-small"),v(t,"title","Switch orientation"),v(e,"class","tab-end svelte-hl0lfa")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),Ae(r,i,null),s=!0,l||(o=le(t,"click",n[70]),l=!0)},p:_e,i(a){s||(V(r.$$.fragment,a),s=!0)},o(a){B(r.$$.fragment,a),s=!1},d(a){a&&X(e),Xe(r),l=!1,o()}}}function n$(n){let e,t,i,r,s,l;return i=new wt({props:{icon:sv}}),{c(){e=_("button"),t=_("span"),Ye(i.$$.fragment),v(t,"class","icon"),v(e,"class","button is-small"),v(e,"title","Switch orientation")},m(o,a){Y(o,e,a),Q(e,t),Ae(i,t,null),r=!0,s||(l=le(e,"click",n[70]),s=!0)},p:_e,i(o){r||(V(i.$$.fragment,o),r=!0)},o(o){B(i.$$.fragment,o),r=!1},d(o){o&&X(e),Xe(i),s=!1,l()}}}function $8(n){let e,t,i=n[13]&&!n[42]&&n$(n);return{c(){e=_("p"),i&&i.c(),v(e,"class","control"),v(e,"slot","before-right-controls")},m(r,s){Y(r,e,s),i&&i.m(e,null),t=!0},p(r,s){r[13]&&!r[42]?i?(i.p(r,s),s[0]&8192|s[1]&2048&&V(i,1)):(i=n$(r),i.c(),V(i,1),i.m(e,null)):i&&(Je(),B(i,1,1,()=>{i=null}),et())},i(r){t||(V(i),t=!0)},o(r){B(i),t=!1},d(r){r&&X(e),i&&i.d()}}}function y8(n){let e,t,i,r,s,l,o,a,c,h,O=n[42]&&t$(n),p={files:n[20]};s=new m9({props:p}),n[105](s),s.$on("solve",n[106]);function g($){n[107]($)}let m={output:n[33],showClearOutput:n[14],showAutoClearOutput:n[15],showSectionToggles:n[16],showRightControls:n[17],isTab:n[42],$$slots:{"before-right-controls":[$8]},$$scope:{ctx:n}};return n[1]!==void 0&&(m.autoClearOutput=n[1]),a=new h9({props:m}),Mt.push(()=>Fo(a,"autoClearOutput",g)),a.$on("clear",n[108]),a.$on("goto",n[109]),{c(){e=_("div"),O&&O.c(),t=I(),i=_("div"),r=_("div"),Ye(s.$$.fragment),l=I(),o=_("div"),Ye(a.$$.fragment),v(r,"class","tab-window svelte-hl0lfa"),ne(r,"visible",n[43]),v(o,"class","tab-window svelte-hl0lfa"),ne(o,"visible",!n[42]||!n[43]),v(i,"class","grow svelte-hl0lfa"),v(e,"class","panel stack svelte-hl0lfa"),v(e,"slot","panelB")},m($,y){Y($,e,y),O&&O.m(e,null),Q(e,t),Q(e,i),Q(i,r),Ae(s,r,null),Q(i,l),Q(i,o),Ae(a,o,null),h=!0},p($,y){$[42]?O?(O.p($,y),y[1]&2048&&V(O,1)):(O=t$($),O.c(),V(O,1),O.m(e,t)):O&&(Je(),B(O,1,1,()=>{O=null}),et());const k={};y[0]&1048576&&(k.files=$[20]),s.$set(k),(!h||y[1]&4096)&&ne(r,"visible",$[43]);const W={};y[1]&4&&(W.output=$[33]),y[0]&16384&&(W.showClearOutput=$[14]),y[0]&32768&&(W.showAutoClearOutput=$[15]),y[0]&65536&&(W.showSectionToggles=$[16]),y[0]&131072&&(W.showRightControls=$[17]),y[1]&2048&&(W.isTab=$[42]),y[0]&8192|y[1]&2048|y[4]&8192&&(W.$$scope={dirty:y,ctx:$}),!c&&y[0]&2&&(c=!0,W.autoClearOutput=$[1],jo(()=>c=!1)),a.$set(W),(!h||y[1]&6144)&&ne(o,"visible",!$[42]||!$[43])},i($){h||(V(O),V(s.$$.fragment,$),V(a.$$.fragment,$),h=!0)},o($){B(O),B(s.$$.fragment,$),B(a.$$.fragment,$),h=!1},d($){$&&X(e),O&&O.d(),n[105](null),Xe(s),Xe(a)}}}function v8(n){let e,t,i,r=n[20][n[29]].name+"",s,l,o,a;return{c(){e=_("p"),t=pe("Are you sure you wish to delete "),i=_("code"),s=pe(r),l=pe("?"),o=I(),a=_("p"),a.textContent="This cannot be undone."},m(c,h){Y(c,e,h),Q(e,t),Q(e,i),Q(i,s),Q(e,l),Y(c,o,h),Y(c,a,h)},p(c,h){h[0]&537919488&&r!==(r=c[20][c[29]].name+"")&&Ne(s,r)},d(c){c&&(X(e),X(o),X(a))}}}function w8(n){let e,t,i,r,s,l;return{c(){e=_("div"),t=_("button"),t.textContent="Delete",i=I(),r=_("button"),r.textContent="Cancel",v(t,"class","button is-danger"),v(r,"type","button"),v(r,"class","button"),v(e,"slot","footer")},m(o,a){Y(o,e,a),Q(e,t),Q(e,i),Q(e,r),s||(l=[le(t,"click",n[126]),le(r,"click",n[127])],s=!0)},p:_e,d(o){o&&X(e),s=!1,Ft(l)}}}function Q8(n){let e,t,i,r,s,l,o,a,c,h,O;return a=new wt({props:{icon:j3}}),{c(){e=_("div"),t=_("p"),i=_("input"),r=I(),s=_("p"),l=_("button"),o=_("span"),Ye(a.$$.fragment),v(i,"class","input"),v(i,"type","text"),i.value=n[39],i.readOnly=!0,v(t,"class","control is-expanded"),v(o,"class","icon"),v(l,"type","button"),v(l,"class","button"),ne(l,"is-primary",!n[40]),ne(l,"is-success",n[40]),v(s,"class","control"),v(e,"class","field has-addons")},m(p,g){Y(p,e,g),Q(e,t),Q(t,i),n[134](i),Q(e,r),Q(e,s),Q(s,l),Q(l,o),Ae(a,o,null),c=!0,h||(O=[le(i,"click",n[135]),le(l,"click",n[67])],h=!0)},p(p,g){(!c||g[1]&256&&i.value!==p[39])&&(i.value=p[39]),(!c||g[1]&512)&&ne(l,"is-primary",!p[40]),(!c||g[1]&512)&&ne(l,"is-success",p[40])},i(p){c||(V(a.$$.fragment,p),c=!0)},o(p){B(a.$$.fragment,p),c=!1},d(p){p&&X(e),n[134](null),Xe(a),h=!1,Ft(O)}}}function k8(n){let e,t,i,r;return{c(){e=_("div"),t=_("button"),t.textContent="Done",v(t,"class","button is-primary"),v(e,"slot","footer")},m(s,l){Y(s,e,l),Q(e,t),i||(r=le(t,"click",n[133]),i=!0)},p:_e,d(s){s&&X(e),i=!1,r()}}}function _8(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,k,W,Z,A,C,U,D,z,j,N,G,E,re,ae,ve,Se,ge,Ue,Le,Pe,We,lt,Vt,Qt,pt,qt,$e,oe,H,ue,ce,Ee,tt,ft,Be,Yt,ut,Mn,kt,xt,bt;const je=n[92]["navbar-before-run-buttons"],fe=Ri(je,n,n[137],Ub),Fe=[p8,d8],He=[];function gi(J,ke){return J[47]?0:1}O=gi(n),p=He[O]=Fe[O](n);let Wt=!n[53]&&n[8]&&Eb(n),gt=!n[53]&&n[4]&&Mb(n);const zn=n[92]["navbar-run-buttons"],ai=Ri(zn,n,n[137],Yb);let Ht=n[53]&&n[5]&&n[23].length>0&&zb(n);const mn=n[92]["navbar-after-run-buttons"],Ct=Ri(mn,n,n[137],Ab);let De=n[5]&&n[23].length>0&&Vb(n);const Sn=n[92]["navbar-after-solver-selector"],ri=Ri(Sn,n,n[137],Zb),Kt=[S8,m8],bn=[];function ir(J,ke){return J[53]?0:1}Se=ir(n),ge=bn[Se]=Kt[Se](n);const Br=n[92]["navbar-after-share-buttons"],zt=Ri(Br,n,n[137],xb);function Zs(J){n[116](J)}let Rs={direction:n[2],showPanels:n[48],$$slots:{panelB:[y8],panelA:[b8]},$$scope:{ctx:n}};n[3]!==void 0&&(Rs.split=n[3]),lt=new z3({props:Rs}),Mt.push(()=>Fo(lt,"split",Zs));let no={active:n[35],stdFlags:n[45]};pt=new F9({props:no}),n[117](pt),pt.$on("close",n[118]),$e=new Z9({props:{active:n[30],files:n[20]}}),$e.$on("close",n[119]),$e.$on("delete",n[120]),$e.$on("modifyFile",n[121]),$e.$on("newFile",n[122]),H=new k9({props:{active:n[28]}}),H.$on("cancel",n[123]),H.$on("new",n[124]),H.$on("open",n[125]),ce=new _s({props:{active:n[29]!==null,title:"Delete file",$$slots:{footer:[w8],default:[v8]},$$scope:{ctx:n}}}),ce.$on("cancel",n[128]),tt=new U9({props:{active:n[31],modelFiles:n[44]}}),tt.$on("accept",n[129]),tt.$on("cancel",n[130]),Be=new N9({props:{active:n[32],dataFiles:n[46],parameters:n[34]}}),Be.$on("accept",n[131]),Be.$on("cancel",n[132]),ut=new _s({props:{active:n[39],title:"Share this project",$$slots:{footer:[k8],default:[Q8]},$$scope:{ctx:n}}}),ut.$on("cancel",n[136]);const jr=n[92].default,xi=Ri(jr,n,n[137],null);return{c(){e=_("div"),t=_("div"),i=_("div"),r=_("div"),s=_("nav"),l=_("div"),fe&&fe.c(),o=I(),a=_("div"),c=_("div"),h=_("div"),p.c(),g=I(),Wt&&Wt.c(),m=I(),gt&>.c(),$=I(),ai&&ai.c(),y=I(),Ht&&Ht.c(),k=I(),Ct&&Ct.c(),W=I(),De&&De.c(),Z=I(),ri&&ri.c(),A=I(),C=_("a"),U=_("span"),D=I(),z=_("span"),j=I(),N=_("span"),G=I(),E=_("div"),re=_("div"),ae=I(),ve=_("div"),ge.c(),Ue=I(),zt&&zt.c(),Le=I(),Pe=_("div"),We=_("div"),Ye(lt.$$.fragment),Qt=I(),Ye(pt.$$.fragment),qt=I(),Ye($e.$$.fragment),oe=I(),Ye(H.$$.fragment),ue=I(),Ye(ce.$$.fragment),Ee=I(),Ye(tt.$$.fragment),ft=I(),Ye(Be.$$.fragment),Yt=I(),Ye(ut.$$.fragment),Mn=I(),xi&&xi.c(),v(h,"class","control"),v(c,"class","field navbar-run-buttons has-addons svelte-hl0lfa"),v(a,"class","navbar-item is-expanded"),v(U,"aria-hidden","true"),v(z,"aria-hidden","true"),v(N,"aria-hidden","true"),v(C,"role","button"),v(C,"class","navbar-burger"),v(C,"aria-label","menu"),v(C,"aria-expanded",n[26]),ne(C,"is-active",n[26]),v(l,"class","navbar-brand"),v(re,"class","navbar-start is-hidden-tablet"),v(ve,"class","navbar-end"),v(E,"class","navbar-menu"),ne(E,"is-active",n[26]),v(s,"class","navbar"),v(r,"class","top svelte-hl0lfa"),v(We,"class","left svelte-hl0lfa"),v(Pe,"class","grow main-panel svelte-hl0lfa"),v(i,"class","stack svelte-hl0lfa"),v(t,"class","mzn-playground-wrapper svelte-hl0lfa"),ne(t,"is-dark",n[24]),v(e,"class","mzn-playground svelte-hl0lfa")},m(J,ke){Y(J,e,ke),Q(e,t),Q(t,i),Q(i,r),Q(r,s),Q(s,l),fe&&fe.m(l,null),Q(l,o),Q(l,a),Q(a,c),Q(c,h),He[O].m(h,null),Q(c,g),Wt&&Wt.m(c,null),Q(c,m),gt&>.m(c,null),Q(c,$),ai&&ai.m(c,null),Q(c,y),Ht&&Ht.m(c,null),Q(l,k),Ct&&Ct.m(l,null),Q(l,W),De&&De.m(l,null),Q(l,Z),ri&&ri.m(l,null),Q(l,A),Q(l,C),Q(C,U),Q(C,D),Q(C,z),Q(C,j),Q(C,N),Q(s,G),Q(s,E),Q(E,re),Q(E,ae),Q(E,ve),bn[Se].m(ve,null),Q(ve,Ue),zt&&zt.m(ve,null),Q(i,Le),Q(i,Pe),Q(Pe,We),Ae(lt,We,null),Q(Pe,Qt),Ae(pt,Pe,null),Q(t,qt),Ae($e,t,null),Q(t,oe),Ae(H,t,null),Q(t,ue),Ae(ce,t,null),Q(t,Ee),Ae(tt,t,null),Q(t,ft),Ae(Be,t,null),Q(t,Yt),Ae(ut,t,null),Q(t,Mn),xi&&xi.m(t,null),kt=!0,xt||(bt=le(C,"click",n[95]),xt=!0)},p(J,ke){fe&&fe.p&&(!kt||ke[1]&4194304|ke[4]&8192)&&Xi(fe,je,J,J[137],kt?Ai(je,J[137],ke,O8):Yi(J[137]),Ub);let rn=O;O=gi(J),O===rn?He[O].p(J,ke):(Je(),B(He[rn],1,1,()=>{He[rn]=null}),et(),p=He[O],p?p.p(J,ke):(p=He[O]=Fe[O](J),p.c()),V(p,1),p.m(h,null)),!J[53]&&J[8]?Wt?Wt.p(J,ke):(Wt=Eb(J),Wt.c(),Wt.m(c,m)):Wt&&(Wt.d(1),Wt=null),!J[53]&&J[4]?gt?(gt.p(J,ke),ke[0]&16|ke[1]&4194304&&V(gt,1)):(gt=Mb(J),gt.c(),V(gt,1),gt.m(c,$)):gt&&(Je(),B(gt,1,1,()=>{gt=null}),et()),ai&&ai.p&&(!kt||ke[1]&4194304|ke[4]&8192)&&Xi(ai,zn,J,J[137],kt?Ai(zn,J[137],ke,h8):Yi(J[137]),Yb),J[53]&&J[5]&&J[23].length>0?Ht?Ht.p(J,ke):(Ht=zb(J),Ht.c(),Ht.m(c,null)):Ht&&(Ht.d(1),Ht=null),Ct&&Ct.p&&(!kt||ke[1]&4194304|ke[4]&8192)&&Xi(Ct,mn,J,J[137],kt?Ai(mn,J[137],ke,u8):Yi(J[137]),Ab),J[5]&&J[23].length>0?De?(De.p(J,ke),ke[0]&8388640&&V(De,1)):(De=Vb(J),De.c(),V(De,1),De.m(l,Z)):De&&(Je(),B(De,1,1,()=>{De=null}),et()),ri&&ri.p&&(!kt||ke[1]&4194304|ke[4]&8192)&&Xi(ri,Sn,J,J[137],kt?Ai(Sn,J[137],ke,c8):Yi(J[137]),Zb),(!kt||ke[0]&67108864)&&v(C,"aria-expanded",J[26]),(!kt||ke[0]&67108864)&&ne(C,"is-active",J[26]);let Fr=Se;Se=ir(J),Se===Fr?bn[Se].p(J,ke):(Je(),B(bn[Fr],1,1,()=>{bn[Fr]=null}),et(),ge=bn[Se],ge?ge.p(J,ke):(ge=bn[Se]=Kt[Se](J),ge.c()),V(ge,1),ge.m(ve,Ue)),zt&&zt.p&&(!kt||ke[1]&4194304|ke[4]&8192)&&Xi(zt,Br,J,J[137],kt?Ai(Br,J[137],ke,l8):Yi(J[137]),xb),(!kt||ke[0]&67108864)&&ne(E,"is-active",J[26]);const Dn={};ke[0]&4&&(Dn.direction=J[2]),ke[1]&131072&&(Dn.showPanels=J[48]),ke[0]&1916002498|ke[1]&1055748|ke[4]&8192&&(Dn.$$scope={dirty:ke,ctx:J}),!Vt&&ke[0]&8&&(Vt=!0,Dn.split=J[3],jo(()=>Vt=!1)),lt.$set(Dn);const Qr={};ke[1]&16&&(Qr.active=J[35]),ke[1]&16384&&(Qr.stdFlags=J[45]),pt.$set(Qr);const nr={};ke[0]&1073741824&&(nr.active=J[30]),ke[0]&1048576&&(nr.files=J[20]),$e.$set(nr);const As={};ke[0]&268435456&&(As.active=J[28]),H.$set(As);const rr={};ke[0]&536870912&&(rr.active=J[29]!==null),ke[0]&537919488|ke[4]&8192&&(rr.$$scope={dirty:ke,ctx:J}),ce.$set(rr);const _t={};ke[1]&1&&(_t.active=J[31]),ke[1]&8192&&(_t.modelFiles=J[44]),tt.$set(_t);const kr={};ke[1]&2&&(kr.active=J[32]),ke[1]&32768&&(kr.dataFiles=J[46]),ke[1]&8&&(kr.parameters=J[34]),Be.$set(kr);const Gr={};ke[1]&256&&(Gr.active=J[39]),ke[1]&896|ke[4]&8192&&(Gr.$$scope={dirty:ke,ctx:J}),ut.$set(Gr),xi&&xi.p&&(!kt||ke[4]&8192)&&Xi(xi,jr,J,J[137],kt?Ai(jr,J[137],ke,null):Yi(J[137]),null),(!kt||ke[0]&16777216)&&ne(t,"is-dark",J[24])},i(J){kt||(V(fe,J),V(p),V(gt),V(ai,J),V(Ct,J),V(De),V(ri,J),V(ge),V(zt,J),V(lt.$$.fragment,J),V(pt.$$.fragment,J),V($e.$$.fragment,J),V(H.$$.fragment,J),V(ce.$$.fragment,J),V(tt.$$.fragment,J),V(Be.$$.fragment,J),V(ut.$$.fragment,J),V(xi,J),kt=!0)},o(J){B(fe,J),B(p),B(gt),B(ai,J),B(Ct,J),B(De),B(ri,J),B(ge),B(zt,J),B(lt.$$.fragment,J),B(pt.$$.fragment,J),B($e.$$.fragment,J),B(H.$$.fragment,J),B(ce.$$.fragment,J),B(tt.$$.fragment,J),B(Be.$$.fragment,J),B(ut.$$.fragment,J),B(xi,J),kt=!1},d(J){J&&X(e),fe&&fe.d(J),He[O].d(),Wt&&Wt.d(),gt&>.d(),ai&&ai.d(J),Ht&&Ht.d(),Ct&&Ct.d(J),De&&De.d(),ri&&ri.d(J),bn[Se].d(),zt&&zt.d(J),Xe(lt),n[117](null),Xe(pt),Xe($e),Xe(H),Xe(ce),Xe(tt),Xe(Be),Xe(ut),xi&&xi.d(J),xt=!1,bt()}}}function r$(n,e){n.effects=n.effects?[...n.effects,e]:[e]}function P8(n,e,t){let i,r,s,l,o,a,c,h,O,p,g,m,$,y,k,W,Z,A,C;CO(n,r8,R=>t(91,A=R)),CO(n,s8,R=>t(53,C=R));let{$$slots:U={},$$scope:D}=e,{showVersionSwitcher:z=!0}=e,{showSolverDropdown:j=!0}=e,{edgeMiniZinc:N=!1}=e,{autoClearOutput:G=!1}=e,{showTabs:E=!0}=e,{canEditTabs:re=!0}=e,{compilationEnabled:ae=!0}=e,{project:ve}=e,{enabledSolvers:Se=null}=e,{canEditSolverSettings:ge=!0}=e,{showShareButton:Ue=!0}=e,{showDownloadButton:Le=!0}=e,{externalPlaygroundURL:Pe=null}=e,{splitterDirection:We="vertical"}=e,{splitterSize:lt=75}=e,{canSwitchOrientation:Vt=!0}=e,{showClearOutput:Qt=!0}=e,{showAutoClearOutput:pt=!0}=e,{showOutputSectionToggles:qt=!0}=e,{showOutputRightControls:$e=!0}=e,{theme:oe="auto"}=e,{hideOutputOnStartup:H=!0}=e,{autoFocus:ue=!0}=e;const ce=nn();let Ee=0,tt=[],ft,Be,Yt={latest:{label:"Latest",detail:"stable"},edge:{label:"Edge",detail:"development"}};function ut(R){const he=N?aC:oC;if(Be!==he){t(18,Ee++,Ee);const be=ft;ft=new Promise(async(xe,Me)=>{be&&await be,Be&&Be.shutdown(),Be=he,Be.shutdown(),await Be.init();const[it]=/version \d+\.\d+\.\d+(?:, build .*)?$/m.exec(await Be.version()),Re=N?"edge":"latest";t(19,Yt={...Yt,[Re]:{...Yt[Re],detail:it}}),t(83,tt=await Be.solvers()),await Gn(),t(18,Ee--,Ee),xe()})}return ft}const Mn=new Promise((R,he)=>{su(()=>{ut(),R()})});async function kt(R){t(0,N=R.minizincVersion==="edge"),await Mn,t(20,fe=[]),Rs(R.files,ue),t(21,He=R.tab||0),await ut(),R.solverId?t(22,Kt=y.findIndex(he=>he.id===R.solverId)):t(22,Kt=y.findIndex(he=>he.extraInfo&&he.extraInfo.isDefault)||0),R.solverConfig?gi.load(R.solverConfig):gi.reset()}async function xt(R){const he=fe.length;Rs(R.files),R.tab!==void 0&&R.tab!==null&&R.tab>=0&&zt(he+R.tab),R.solverId&&(await ut(),t(22,Kt=y.findIndex(be=>be.id===R.solverId)))}function bt(){return fe.length>0}let je,fe=[],Fe=!1,He=0,gi,Wt=!1,gt=null,zn=!1,ai=!1,Ht=null,mn=!1,Ct=[],De=null,Sn=[],ri={},Kt=-1;async function bn(R,he){if(await ut(),Kt<0||Kt>=y.length){const be=y.findIndex(xe=>xe.extraInfo&&xe.extraInfo.isDefault);be!==-1&&t(22,Kt=be)}}let ir=!1;function Br(){t(35,ir=!ir)}async function zt(R,he=!0){for(je&&He=0&&fe[R].hidden;)R--;R===-1&&(R=fe.findIndex(be=>!be.hidden)),t(21,He=R),await Gn(),je&&h&&(he&&je.focus(),h.scrollTop!==void 0&&je.getView().requestMeasure({read(be){be.scrollDOM.scrollTo(h.scrollLeft,h.scrollTop)}}))}function Zs(R){let he=`Untitled${R}`,be=2;for(;fe.find(xe=>xe.name===he);)he=`Untitled-${be++}${R}`;t(20,fe=[...fe,{name:he,state:Ot.create({extensions:oc(R,xr,Z)})}]),zt(fe.length-1),t(28,Wt=!1)}function Rs(R,he=!0){let be=[];for(const xe of R){const Me=xe.name.endsWith(".mzc.mzn")?xe.name.length-8:xe.name.lastIndexOf("."),it=xe.name.substring(0,Me).replaceAll(/[\/\\\.]/g,""),Re=xe.name.substring(Me);let mi=`${it}${Re}`,Zt=2;for(;fe.find(Oo=>Oo.name===mi);)mi=`${it}-${Zt++}${Re}`;const es=oc(Re,xr,Z,xe.readOnly);be.push({...xe,hidden:xe.hidden||Re===".mzc",name:mi,state:Ot.create({doc:xe.contents,extensions:es,selection:{anchor:xe.anchor||0}})})}t(20,fe=[...fe,...be]),zt(fe.length-1,he),t(28,Wt=!1)}function no(R){const{index:he,name:be,suffix:xe}=R.detail;let Me=be,it=2;for(;fe.some(Re=>Re===Me+xe);)Me=`${be}-${it++}`;h&&t(87,h.state=je.getState(),h),t(20,fe=[...fe.slice(0,he),{...fe[he],name:be+xe},...fe.slice(he+1)])}function jr(R){const he=r===1&&!fe[R].hidden;t(20,fe=[...fe.slice(0,R),...fe.slice(R+1),...he?[{name:"Untitled.mzn",state:Ot.create({extensions:oc(".mzn",xr,Z)})}]:[]]),He>=fe.length?zt(fe.length-1):zt(He),t(29,gt=null)}function xi(R,he){h&&t(87,h.state=je.getState(),h);const be={...fe[R],...he};"readOnly"in he&&r$(be,he.readOnly?CY:TY),t(20,fe=[...fe.slice(0,R),be,...fe.slice(R+1)]),zt(He)}function J(R,he){let be;R0){await Gn();const he=je.getView();he&&he.state===R.state&&(he.dispatch({effects:R.effects}),R.effects=[])}}let rn=null;async function Fr(R){t(18,Ee++,Ee),t(87,h.state=je.getState(),h);let he=O?h:null;if(!he){if(m.length===0)return t(18,Ee--,Ee),!1;if(m.length===1)he=fe.find(Me=>Me.name===m[0]);else try{const Me=await new Promise((it,Re)=>{t(36,rn=it),t(31,ai=!0)});if(!Me)return t(18,Ee--,Ee),!1;he=fe.find(it=>it.name===Me.modelFile)}finally{t(31,ai=!1)}}const be=new Be.Model,xe=[he.name];{const Me=he.name.substring(0,he.name.length-4),it=fe.find(Re=>Re.name===`${Me}.mzc`||Re.name===`${Me}.mzc.mzn`);it&&xe.push(it.name)}he!==h&&xe.push(h.name);for(const Me of fe)be.addFile(Me.name,Me.state.doc.toString(),xe.indexOf(Me.name)!==-1);try{const{input:Me}=await be.interface({options:gi.getCompilationConfiguration(k.id)});if(Object.keys(Me).length>0){const it={};for(const Re in Me)it[Re]=ri[Re];t(34,ri=it),p&&Sn.indexOf(h.name)===-1&&(Sn=[...Sn,h.name]);try{const Re=await new Promise((mi,Zt)=>{t(36,rn=mi),t(32,Ht=!0)});if(!Re)return t(18,Ee--,Ee),!1;if(Re.parameters){let mi="";for(const Zt in Re.parameters)Re.parameters[Zt].trim().length>0&&(mi+=`${Zt} = ${Re.parameters[Zt]}; +`);be.addDznString(mi),t(34,ri=Re.parameters)}else{for(const mi of Re.dataFiles)xe.indexOf(mi)===-1&&(be.addFile(mi),xe.push(mi));Sn=Re.dataFiles}}finally{t(32,Ht=!1)}}}catch(Me){console.error(Me)}return t(18,Ee--,Ee),{model:be,fileList:xe}}async function Dn(){if(g){const Me=new Be.Model;Me.addFile(h.name,h.state.doc.toString());const it=[h.name],Re=gi.getSolvingConfiguration(k.id);await Qr(Me,it,Re);return}const R=await Fr();if(!R)return;const{model:he,fileList:be}=R,xe=gi.getSolvingConfiguration(k.id);await Qr(he,be,xe)}async function Qr(R,he,be){t(84,mn=!0);const xe=Date.now();G&&t(33,Ct=[]),t(33,Ct=[...Ct,{files:he,output:[]}]),t(85,De=R.solve({options:be,jsonOutput:!1})),kr(),De.on("error",_t),De.on("warning",_t),De.on("solution",Me=>_t(Me,Date.now()-xe)),De.on("status",Me=>_t(Me,Date.now()-xe)),De.on("statistics",_t),De.on("trace",Me=>_t(Me,Date.now()-xe)),De.on("statistics",_t),De.on("comment",_t),De.on("time",_t),De.on("checker",_t),De.on("stderr",_t);try{await De,_t({type:"exit",code:0,runTime:Date.now()-xe})}catch(Me){_t({type:"exit",code:Me.code,runTime:Date.now()-xe})}t(85,De=null)}async function nr(){t(84,mn=!0);const R=await Fr();if(!R)return;kr();const{model:he,fileList:be}=R,xe=be[0],Me=Date.now();G&&t(33,Ct=[]),t(33,Ct=[...Ct,{files:be,isCompile:!0,output:[]}]),t(85,De=he.compile({options:gi.getCompilationConfiguration(k.id)})),De.on("error",_t),De.on("warning",_t),De.on("statistics",_t),De.on("trace",_t),De.on("statistics",_t),De.on("stderr",_t);try{const it=await De;t(20,fe=[...fe,{name:`${xe.substring(0,xe.indexOf("."))}.fzn`,state:Ot.create({extensions:oc(".fzn",xr,Z),doc:it})}]),zt(fe.length-1),_t({type:"exit",code:0,runTime:Date.now()-Me})}catch(it){_t({type:"exit",code:it.code,runTime:Date.now()-Me})}t(85,De=null)}function As(){_t({type:"cancel"}),De.cancel()}let rr=null;function _t(R,he){rr?rr.then(()=>{rr=Gr(R,he)}):rr=Gr(R,he),Ct[Ct.length-1].output.push(R),t(33,Ct)}function kr(){$n&&$n.reset(),t(42,Hr=!1),t(43,Kr=!1)}async function Gr(R,he){if(R.type==="trace"&&R.section.startsWith("mzn_vis_")){Hr||(t(42,Hr=!0),t(43,Kr=!0)),await Gn();const be=fe.find(Me=>Me.name===R.message.url);let xe=null;if(be)xe=be.state.doc.toString();else try{xe=await Be.readStdlibFileContents(R.message.url)}catch(Me){console.error(Me);return}if(xe===null){console.error(`Failed to get visualisation file ${R.message.url}`);return}$n.addVisualisation(R.section,xe,R.message.userData);return}if(Hr){for(;!$n;)await Gn();switch(R.type){case"solution":$n.addSolution(R.sections.filter(be=>be.startsWith("mzn_vis_")).reduce((be,xe)=>({...be,[xe]:R.output[xe]}),{}),"time"in R?R.time:he);break;case"status":$n.status(R.status,"time"in R?R.time:he);break;case"exit":$n.status("time"in R?R.time:he);break}}}function ro(){return h&&t(87,h.state=je.getState(),h),{files:fe.map(R=>({name:R.name,contents:R.state.doc.toString(),...R.hidden?{hidden:!0}:{},...R.readOnly?{readOnly:!0}:{}})),tab:He,solverId:k.id,solverConfig:gi.save(),minizincVersion:N?"edge":"latest"}}let so=!1;async function Ca(){t(37,so=!0);try{const R=(await Ym(async()=>{const{default:Zt}=await import("./jszip.min-C8Qcruww.js").then(es=>es.j);return{default:Zt}},[])).default,he=(await Ym(async()=>{const{default:Zt}=await import("./FileSaver.min-I5oEYwPn.js").then(es=>es.F);return{default:Zt}},[])).default,be=ro(),xe=fe.map(Zt=>Zt.name),Me=fe.filter(Zt=>!Zt.hidden).map(Zt=>Zt.name);let it=k.id;it==="org.minizinc.gecode_presolver"?it="org.gecode.gecode":it==="org.minizinc.chuffed"&&(it="org.chuffed.chuffed");const Re=new R;for(const Zt of be.files)Re.file(Zt.name,Zt.contents);Re.file("Project.mzp",JSON.stringify({version:105,projectFiles:xe,openFiles:Me,openTab:be.tab,selectedBuiltinConfigId:it,selectedBuiltinConfigVersion:"default"}));const mi=await Re.generateAsync({type:"blob"});he.saveAs(mi,"Project.zip")}catch(R){console.error(R)}finally{t(37,so=!1)}}let _r,Pr=null,lo=!1;function nl(R){const he=ro(),be=new URL(R);return be.hash=`#project=${encodeURIComponent(JSON.stringify(he))}`,t(40,lo=!1),be.toString()}function bu(){_r.select(),_r.setSelectionRange(0,Pr.length),navigator.clipboard.writeText(Pr),t(40,lo=!0)}function Ta(){Pe&&window.open(nl(Pe),"_blank").focus()}let Za=null;async function xr(R){const he=R.view;if(!(Ee!==0||!k||!h||!h.name.endsWith(".mzn")))try{const be=he.state.doc.toString();if(be===Za)return;Za=be;const xe=new Be.Model;for(const Re of fe)xe.addFile(Re.name,Re.state.doc.toString(),!1);const Me=xe.addString(be),it=await xe.check({options:gi.getCompilationConfiguration(k.id)});if(he.state.doc.toString()!==be)return;n8(be,it.filter(Re=>Re.location.filename===Me),he)}catch(be){console.error(be)}}function Ra(R){const he=fe.findIndex(be=>be.name===R.filename);if(he!==-1){zt(he);const be=fe[he].state.doc.toString(),xe=Ad(R.firstLine,R.firstColumn,be);je.focus(),je.setCursor(xe)}}function rl(){We==="horizontal"?t(2,We="vertical"):t(2,We="horizontal")}function $u(R){t(0,N=R.detail.item===Yt.edge)}function yu(R){h&&t(87,h.state=je.getState(),h),fe.forEach(he=>r$(he,R?RY:ZY)),ke(h)}let $n,Hr=!1,Kr=!1;function oo(R){De&&As();const he=[R.modelFile],be=R.modelFile.substring(0,R.modelFile.length-4),xe=fe.find(it=>it.name===`${be}.mzc`||it.name===`${be}.mzc.mzn`);if(xe&&he.push(xe.name),R.dataFiles)for(const it of R.dataFiles)he.push(it);const Me=new Be.Model;for(const it of fe)Me.addFile(it.name,it.state.doc.toString(),he.indexOf(it.name)!==-1);Qr(Me,he,R.options||gi.getSolvingConfiguration(k.id))}function vu(){return Kt===(y.findIndex(R=>R.extraInfo&&R.extraInfo.isDefault)||0)}function wu(){return gi.isDefault()}function Qu(){Kt=TO(this),t(22,Kt)}function ku(){Kt=TO(this),t(22,Kt)}const Aa=()=>{t(26,Fe=!Fe),t(35,ir=!1)},Xa=()=>{nr(),t(26,Fe=!1)},Ya=()=>{Br(),t(26,Fe=!1)},ao=()=>{t(0,N=!N),t(26,Fe=!1)},_u=()=>{t(39,Pr=nl(window.location.href)),t(26,Fe=!1)},Ua=()=>{Ta(),t(26,Fe=!1)},sl=()=>t(39,Pr=nl(window.location.href)),Ea=()=>Ca(),Pu=()=>{t(43,Kr=!1)},Ma=()=>{t(43,Kr=!0)};function za(R){Mt[R?"unshift":"push"](()=>{$n=R,t(41,$n)})}const fo=R=>oo(R.detail);function xu(R){G=R,t(1,G)}const Da=()=>t(33,Ct=[]),co=R=>Ra(R.detail.location),uo=R=>zt(R.detail.index),Jr=R=>J(R.detail.src,R.detail.dest),Va=()=>t(28,Wt=!0),qa=R=>t(29,gt=R.detail.index),Wu=()=>t(30,zn=!0);function La(R){Mt[R?"unshift":"push"](()=>{je=R,t(25,je)})}function Ia(R){lt=R,t(3,lt)}function Na(R){Mt[R?"unshift":"push"](()=>{gi=R,t(27,gi)})}const Ba=()=>t(35,ir=!1),Cu=()=>t(30,zn=!1),Tu=R=>t(29,gt=R.detail.index),Zu=R=>xi(R.detail.index,R.detail.options),ja=()=>t(28,Wt=!0),Ru=()=>t(28,Wt=!1),Au=R=>Zs(R.detail.type),Xu=R=>xt(R.detail),Yu=()=>jr(gt),ho=()=>t(29,gt=null),Uu=()=>t(29,gt=null),Eu=R=>rn(R.detail),Mu=()=>rn(!1),zu=R=>rn(R.detail),Du=()=>rn(!1),Tt=()=>t(39,Pr=null);function Pt(R){Mt[R?"unshift":"push"](()=>{_r=R,t(38,_r)})}const Vu=()=>_r.select(),qu=()=>t(39,Pr=null);return n.$$set=R=>{"showVersionSwitcher"in R&&t(4,z=R.showVersionSwitcher),"showSolverDropdown"in R&&t(5,j=R.showSolverDropdown),"edgeMiniZinc"in R&&t(0,N=R.edgeMiniZinc),"autoClearOutput"in R&&t(1,G=R.autoClearOutput),"showTabs"in R&&t(6,E=R.showTabs),"canEditTabs"in R&&t(7,re=R.canEditTabs),"compilationEnabled"in R&&t(8,ae=R.compilationEnabled),"project"in R&&t(73,ve=R.project),"enabledSolvers"in R&&t(74,Se=R.enabledSolvers),"canEditSolverSettings"in R&&t(9,ge=R.canEditSolverSettings),"showShareButton"in R&&t(10,Ue=R.showShareButton),"showDownloadButton"in R&&t(11,Le=R.showDownloadButton),"externalPlaygroundURL"in R&&t(12,Pe=R.externalPlaygroundURL),"splitterDirection"in R&&t(2,We=R.splitterDirection),"splitterSize"in R&&t(3,lt=R.splitterSize),"canSwitchOrientation"in R&&t(13,Vt=R.canSwitchOrientation),"showClearOutput"in R&&t(14,Qt=R.showClearOutput),"showAutoClearOutput"in R&&t(15,pt=R.showAutoClearOutput),"showOutputSectionToggles"in R&&t(16,qt=R.showOutputSectionToggles),"showOutputRightControls"in R&&t(17,$e=R.showOutputRightControls),"theme"in R&&t(75,oe=R.theme),"hideOutputOnStartup"in R&&t(76,H=R.hideOutputOnStartup),"autoFocus"in R&&t(77,ue=R.autoFocus),"$$scope"in R&&t(137,D=R.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&524288&&t(52,i=[Yt.latest,Yt.edge]),n.$$.dirty[0]&1&&ut(),n.$$.dirty[2]&2048&&kt(ve),n.$$.dirty[0]&1048576&&(r=fe.filter(R=>!R.hidden).length),n.$$.dirty[0]&3145728&&t(87,h=HeSe.indexOf(R.id)!==-1):tt),n.$$.dirty[0]&12582912&&t(86,k=Kt>=0&&KtR.name.endsWith(".mzn")&&!R.name.endsWith(".mzc.mzn")).map(R=>R.name)),n.$$.dirty[0]&1048576&&t(46,$=fe.filter(R=>R.name.endsWith(".dzn")||R.name.endsWith(".json")).map(R=>R.name)),n.$$.dirty[0]&12582912&&bn(),n.$$.dirty[2]&16777216&&t(45,W=k?k.stdFlags:[]),n.$$.dirty[2]&33554432&&ke(h),n.$$.dirty[2]&536879104&&t(24,Z={dark:!0,light:!1,auto:A}[oe]),n.$$.dirty[0]&16777216&&yu(Z),n.$$.dirty[0]&8388608&&ce("solversChanged",{solvers:y})},[N,G,We,lt,z,j,E,re,ae,ge,Ue,Le,Pe,Vt,Qt,pt,qt,$e,Ee,Yt,fe,He,Kt,y,Z,je,Fe,gi,Wt,gt,zn,ai,Ht,Ct,ri,ir,rn,so,_r,Pr,lo,$n,Hr,Kr,m,W,$,c,a,o,l,s,i,C,xt,Br,zt,Zs,no,jr,xi,J,Dn,nr,As,Ca,nl,bu,Ta,Ra,rl,$u,oo,ve,Se,oe,H,ue,kt,bt,ro,vu,wu,tt,mn,De,k,h,g,p,O,A,U,Qu,ku,Aa,Xa,Ya,ao,_u,Ua,sl,Ea,Pu,Ma,za,fo,xu,Da,co,uo,Jr,Va,qa,Wu,La,Ia,Na,Ba,Cu,Tu,Zu,ja,Ru,Au,Xu,Yu,ho,Uu,Eu,Mu,zu,Du,Tt,Pt,Vu,qu,D]}class x8 extends $i{constructor(e){super(),bi(this,e,P8,_8,Oi,{showVersionSwitcher:4,showSolverDropdown:5,edgeMiniZinc:0,autoClearOutput:1,showTabs:6,canEditTabs:7,compilationEnabled:8,project:73,enabledSolvers:74,canEditSolverSettings:9,showShareButton:10,showDownloadButton:11,externalPlaygroundURL:12,splitterDirection:2,splitterSize:3,canSwitchOrientation:13,showClearOutput:14,showAutoClearOutput:15,showOutputSectionToggles:16,showOutputRightControls:17,theme:75,hideOutputOnStartup:76,autoFocus:77,loadProject:78,hasFiles:79,getProject:80,isDefaultSolver:81,isDefaultSolverConfig:82},null,[-1,-1,-1,-1,-1,-1])}get loadProject(){return this.$$.ctx[78]}get hasFiles(){return this.$$.ctx[79]}get getProject(){return this.$$.ctx[80]}get isDefaultSolver(){return this.$$.ctx[81]}get isDefaultSolverConfig(){return this.$$.ctx[82]}}function s$(n,e,t){const i=n.slice();return i[10]=e[t],i[12]=t,i}function l$(n){let e;return{c(){e=_("p"),e.textContent="No recent projects.",v(e,"class","has-text-centered")},m(t,i){Y(t,e,i)},p:_e,d(t){t&&X(e)}}}function o$(n){let e,t,i=a$(n[10])+"",r,s,l,o,a=n[10].solver+"",c,h,O,p=new Date(n[10].timestamp).toLocaleString()+"",g,m,$,y;function k(){return n[7](n[12])}return{c(){e=_("div"),t=_("div"),r=pe(i),s=I(),l=_("div"),o=_("div"),c=pe(a),h=I(),O=_("div"),g=pe(p),m=I(),v(l,"class","info is-size-7 svelte-wl1zgv"),v(e,"class","item svelte-wl1zgv"),ne(e,"has-background-primary",n[2]===n[12]),ne(e,"has-text-white",n[2]===n[12])},m(W,Z){Y(W,e,Z),Q(e,t),Q(t,r),Q(e,s),Q(e,l),Q(l,o),Q(o,c),Q(l,h),Q(l,O),Q(O,g),Q(e,m),$||(y=[le(e,"click",k),le(e,"dblclick",n[5])],$=!0)},p(W,Z){n=W,Z&2&&i!==(i=a$(n[10])+"")&&Ne(r,i),Z&2&&a!==(a=n[10].solver+"")&&Ne(c,a),Z&2&&p!==(p=new Date(n[10].timestamp).toLocaleString()+"")&&Ne(g,p),Z&4&&ne(e,"has-background-primary",n[2]===n[12]),Z&4&&ne(e,"has-text-white",n[2]===n[12])},d(W){W&&X(e),$=!1,Ft(y)}}}function W8(n){let e,t=st(n[1]),i=[];for(let s=0;si.name);return n.files.length>3&&t.push(`+${n.files.length-3} more…`),t.join(", ")}return n.files.map(t=>t.name).join(", ")}function Z8(n,e,t){let i;const r=nn();let{active:s=!1}=e,{projects:l=[]}=e,o=-1;function a(g){g||t(2,o=-1)}function c(){i&&r("accept",{project:l[o]})}const h=()=>r("cancel"),O=g=>t(2,o=g),p=()=>r("cancel");return n.$$set=g=>{"active"in g&&t(0,s=g.active),"projects"in g&&t(1,l=g.projects)},n.$$.update=()=>{n.$$.dirty&6&&t(3,i=o>=0&&o{const t=localStorage.getItem(Xd);if(t&&t.length>0){bs=!0;try{e(i=>({...i,...JSON.parse(t)}))}catch(i){console.error(i)}bs=!1}window.addEventListener("storage",i=>{if(i.storageArea===localStorage&&i.key===Xd&&i.newValue.length>0){bs=!0;try{e(r=>({...r,...JSON.parse(i.newValue)}))}catch(r){console.error(r)}bs=!1}})});Bs.subscribe(n=>{bs||(Object.keys(n.sessions).length>f$&&(bs=!0,Bs.update(e=>{const t=Object.keys(e.sessions).map(i=>({key:i,value:e.sessions[i]}));return t.sort((i,r)=>r.value.timestamp-i.value.timestamp),bs=!0,{...e,sessions:t.slice(0,f$).reduce((i,r)=>({...i,[r.key]:r.value}),{})}}),bs=!1),localStorage.setItem(Xd,JSON.stringify(n)))});const{document:A8,window:c$}=OC;function X8(n){let e,t;return e=new R8({props:{projects:n[5],active:n[4]}}),e.$on("cancel",n[12]),e.$on("accept",n[13]),{c(){Ye(e.$$.fragment)},m(i,r){Ae(e,i,r),t=!0},p(i,r){const s={};r&32&&(s.projects=i[5]),r&16&&(s.active=i[4]),e.$set(s)},i(i){t||(V(e.$$.fragment,i),t=!0)},o(i){B(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function Y8(n){let e,t,i,r,s,l,o,a,c;return l=new wt({props:{icon:lv}}),{c(){e=_("div"),t=_("div"),i=_("div"),r=_("button"),s=_("span"),Ye(l.$$.fragment),v(s,"class","icon"),v(r,"class","button"),v(r,"title","Open recent project"),v(i,"class","control"),v(t,"class","field"),v(e,"class","navbar-item")},m(h,O){Y(h,e,O),Q(e,t),Q(t,i),Q(i,r),Q(r,s),Ae(l,s,null),o=!0,a||(c=le(r,"click",n[11]),a=!0)},p:_e,i(h){o||(V(l.$$.fragment,h),o=!0)},o(h){B(l.$$.fragment,h),o=!1},d(h){h&&X(e),Xe(l),a=!1,c()}}}function U8(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:lv}}),{c(){e=_("a"),t=_("span"),Ye(i.$$.fragment),r=I(),s=_("span"),s.textContent="Open recent project",v(t,"class","icon"),v(e,"class","navbar-item mobile-menu-item"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Ae(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[10]),o=!0)},p:_e,i(c){l||(V(i.$$.fragment,c),l=!0)},o(c){B(i.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(i),o=!1,a()}}}function E8(n){let e,t,i,r;const s=[U8,Y8],l=[];function o(a,c){return a[25]?0:1}return e=o(n),t=l[e]=s[e](n),{c(){t.c(),i=Gt()},m(a,c){l[e].m(a,c),Y(a,i,c),r=!0},p(a,c){let h=e;e=o(a),e===h?l[e].p(a,c):(Je(),B(l[h],1,1,()=>{l[h]=null}),et(),t=l[e],t?t.p(a,c):(t=l[e]=s[e](a),t.c()),V(t,1),t.m(i.parentNode,i))},i(a){r||(V(t),r=!0)},o(a){B(t),r=!1},d(a){a&&X(i),l[e].d(a)}}}function M8(n){let e,t,i,r,s,l,o,a,c;function h(m){n[15](m)}function O(m){n[16](m)}function p(m){n[17](m)}let g={project:n[3],$$slots:{"navbar-before-share-buttons":[E8,({isMobile:m})=>({25:m}),({isMobile:m})=>m?33554432:0],default:[X8]},$$scope:{ctx:n}};return n[1].autoClearOutput!==void 0&&(g.autoClearOutput=n[1].autoClearOutput),n[1].splitterDirection!==void 0&&(g.splitterDirection=n[1].splitterDirection),n[1].splitterSize!==void 0&&(g.splitterSize=n[1].splitterSize),i=new x8({props:g}),n[14](i),Mt.push(()=>Fo(i,"autoClearOutput",h)),Mt.push(()=>Fo(i,"splitterDirection",O)),Mt.push(()=>Fo(i,"splitterSize",p)),i.$on("solversChanged",n[18]),{c(){e=I(),t=_("div"),Ye(i.$$.fragment),v(t,"class","playground-app svelte-tuc1wl")},m(m,$){Y(m,e,$),Y(m,t,$),Ae(i,t,null),o=!0,a||(c=[le(c$,"beforeunload",n[7]),le(c$,"hashchange",n[6]),le(A8,"visibilitychange",n[9])],a=!0)},p(m,[$]){const y={};$&8&&(y.project=m[3]),$&100663346&&(y.$$scope={dirty:$,ctx:m}),!r&&$&2&&(r=!0,y.autoClearOutput=m[1].autoClearOutput,jo(()=>r=!1)),!s&&$&2&&(s=!0,y.splitterDirection=m[1].splitterDirection,jo(()=>s=!1)),!l&&$&2&&(l=!0,y.splitterSize=m[1].splitterSize,jo(()=>l=!1)),i.$set(y)},i(m){o||(V(i.$$.fragment,m),o=!0)},o(m){B(i.$$.fragment,m),o=!1},d(m){m&&(X(e),X(t)),n[14](null),Xe(i),a=!1,Ft(c)}}}const WO=`% Use this editor as a MiniZinc scratch book +`,u$="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function z8(n,e,t){let i,r;CO(n,Bs,E=>t(1,r=E));let s,l={files:[]},o=null,a=!1,c=[];function h(E,re){return!s||!re?[]:Object.entries(re.sessions).map(([ae,ve])=>{const Se=E.find(ge=>ge.id===ve.solverId);return{key:ae,files:ve.files,timestamp:ve.timestamp,solver:Se?Se.name:""}}).filter(ae=>ae.key!==sessionStorage.mznPlaygroundSession).sort((ae,ve)=>ve.timestamp-ae.timestamp)}function O(){const E=()=>Array(6).fill(0).map(()=>u$[Math.floor(Math.random()*u$.length)]).join("");let re=E();for(;re in r.sessions;)re=E();return re}function p(E){return E.solverId||(E.solver===0?E.solverId="org.minizinc.gecode_presolver":l.solver===1&&(E.solverId="org.minizinc.mip.coin-bc")),E}let g=!1;async function m(){const E=window.location.hash;if(E.length>0&&(g=!0,window.history.replaceState(void 0,void 0,window.location.pathname+window.location.search),g=!1),!g){if(E.startsWith("#project="))try{const re=decodeURIComponent(E.substring(9));y(O(),{...JSON.parse(re),timestamp:Date.now()});return}catch(re){console.error(re)}if(E.startsWith("#code="))try{const re=decodeURIComponent(E.substring(6));y(O(),{files:[{name:"Playground.mzn",contents:re,anchor:re.length}],timestamp:Date.now()});return}catch(re){console.error(re)}if(E.startsWith("#url="))try{const re=decodeURIComponent(E.substring(5));y(O(),await wQ(re));return}catch(re){console.error(re)}if(sessionStorage.mznPlaygroundSession&&r.sessions[sessionStorage.mznPlaygroundSession]){y(sessionStorage.mznPlaygroundSession,r.sessions[sessionStorage.mznPlaygroundSession]);return}l.files.length===0&&y(O(),{files:[{name:"Playground.mzn",contents:WO,anchor:WO.length}],timestamp:Date.now()})}}su(()=>m());function $(){if(sessionStorage.mznPlaygroundSession&&s.hasFiles())try{const E=s.getProject();if(!(sessionStorage.mznPlaygroundSession in r.sessions)&&s.isDefaultSolver()&&s.isDefaultSolverConfig()&&E.files.length===1&&E.files[0].name==="Playground.mzn"&&E.files[0].contents===WO)return;o=Date.now(),hC(Bs,r.sessions[sessionStorage.mznPlaygroundSession]={...E,timestamp:o},r)}catch(E){console.error(E)}}function y(E,re){$();try{const ae=p(re);sessionStorage.mznPlaygroundSession=E,t(3,l=ae),o=re.timestamp}catch(ae){console.error(ae)}t(4,a=!1),t(5,i=h(c,r))}function k(E){o!==null&&sessionStorage.mznPlaygroundSession in E.sessions&&E.sessions[sessionStorage.mznPlaygroundSession].timestamp>o&&(sessionStorage.mznPlaygroundSession=O(),t(5,i=h(c,E)))}const W=()=>{document.hidden&&$()},Z=()=>t(4,a=!0),A=()=>t(4,a=!0),C=()=>t(4,a=!1),U=E=>y(E.detail.project.key,r.sessions[E.detail.project.key]);function D(E){Mt[E?"unshift":"push"](()=>{s=E,t(2,s)})}function z(E){n.$$.not_equal(r.autoClearOutput,E)&&(r.autoClearOutput=E,Bs.set(r))}function j(E){n.$$.not_equal(r.splitterDirection,E)&&(r.splitterDirection=E,Bs.set(r))}function N(E){n.$$.not_equal(r.splitterSize,E)&&(r.splitterSize=E,Bs.set(r))}const G=E=>t(0,c=E.detail.solvers);return n.$$.update=()=>{n.$$.dirty&3&&t(5,i=h(c,r)),n.$$.dirty&2&&k(r)},[c,r,s,l,a,i,m,$,y,W,Z,A,C,U,D,z,j,N,G]}class D8 extends $i{constructor(e){super(),bi(this,e,z8,M8,Oi,{})}}new D8({target:document.getElementById("app")});export{zo as c,N8 as g}; diff --git a/develop/assets/jszip.min-fAQkBUUp.js b/develop/assets/jszip.min-C8Qcruww.js similarity index 99% rename from develop/assets/jszip.min-fAQkBUUp.js rename to develop/assets/jszip.min-C8Qcruww.js index 5888cc7..aed5444 100644 --- a/develop/assets/jszip.min-fAQkBUUp.js +++ b/develop/assets/jszip.min-C8Qcruww.js @@ -1,4 +1,4 @@ -import{g as At,c as bt}from"./index-DeqmUj4P.js";function vt(yt){throw new Error('Could not dynamically require "'+yt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var St={exports:{}};/*! +import{g as At,c as bt}from"./index-DVfhyV_L.js";function vt(yt){throw new Error('Could not dynamically require "'+yt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var St={exports:{}};/*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files diff --git a/develop/index.html b/develop/index.html index e168524..e03fb70 100644 --- a/develop/index.html +++ b/develop/index.html @@ -5,7 +5,7 @@ MiniZinc Playground - +