From d74e62f8553f5e5669fa9615d1cad1750e40d27f Mon Sep 17 00:00:00 2001 From: tillvit Date: Wed, 20 Dec 2023 04:48:58 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20tillvit/?= =?UTF-8?q?smeditor@37a7a84e92ae48893dc49de9a8fe77dfb2b98d75=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 2 +- sw.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 5dbc585a..239767de 100644 --- a/app.js +++ b/app.js @@ -1,4 +1,4 @@ -import{g as Ut,F as V,M as dn,K as mn,a as Xt,I as vn,t as En,O as ie,l as gn,C as ut,b as wn,R as $n,T as yn,D as ft,U as Rn,B as In,c as Tn,A as pt,i as Sn,d as dt,e as Ln,f as mt,h as An,E as Nn,j as vt,k as On,m as xn,W as Et,n as bn}from"./ChartManager-5a16a8de.js";var qe={exports:{}};const Cn="2.0.0",Bt=256,_n=Number.MAX_SAFE_INTEGER||9007199254740991,Pn=16,Dn=Bt-6,jn=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Ae={MAX_LENGTH:Bt,MAX_SAFE_COMPONENT_LENGTH:Pn,MAX_SAFE_BUILD_LENGTH:Dn,MAX_SAFE_INTEGER:_n,RELEASE_TYPES:jn,SEMVER_SPEC_VERSION:Cn,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Fn=typeof process=="object"&&process.env&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{};var Ne=Fn;(function(n,e){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:o}=Ae,a=Ne;e=n.exports={};const d=e.re=[],E=e.safeRe=[],c=e.src=[],u=e.t={};let m=0;const $="[a-zA-Z0-9-]",_=[["\\s",1],["\\d",o],[$,s]],y=z=>{for(const[H,J]of _)z=z.split(`${H}*`).join(`${H}{0,${J}}`).split(`${H}+`).join(`${H}{1,${J}}`);return z},S=(z,H,J)=>{const G=y(H),Q=m++;a(z,Q,H),u[z]=Q,c[Q]=H,d[Q]=new RegExp(H,J?"g":void 0),E[Q]=new RegExp(G,J?"g":void 0)};S("NUMERICIDENTIFIER","0|[1-9]\\d*"),S("NUMERICIDENTIFIERLOOSE","\\d+"),S("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${$}*`),S("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),S("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),S("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),S("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),S("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),S("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),S("BUILDIDENTIFIER",`${$}+`),S("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),S("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),S("FULL",`^${c[u.FULLPLAIN]}$`),S("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),S("LOOSE",`^${c[u.LOOSEPLAIN]}$`),S("GTLT","((?:<|>)?=?)"),S("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),S("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),S("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),S("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),S("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),S("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),S("COERCE",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?(?:$|[^\\d])`),S("COERCERTL",c[u.COERCE],!0),S("LONETILDE","(?:~>?)"),S("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",S("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),S("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),S("LONECARET","(?:\\^)"),S("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",S("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),S("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),S("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),S("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),S("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",S("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),S("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),S("STAR","(<|>)?=?\\s*\\*"),S("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),S("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(qe,qe.exports);var Ee=qe.exports;const Gn=Object.freeze({loose:!0}),Wn=Object.freeze({}),Mn=n=>n?typeof n!="object"?Gn:n:Wn;var ze=Mn;const gt=/^[0-9]+$/,qt=(n,e)=>{const t=gt.test(n),s=gt.test(e);return t&&s&&(n=+n,e=+e),n===e?0:t&&!s?-1:s&&!t?1:nqt(e,n);var zt={compareIdentifiers:qt,rcompareIdentifiers:Vn};const Re=Ne,{MAX_LENGTH:wt,MAX_SAFE_INTEGER:Ie}=Ae,{safeRe:$t,t:yt}=Ee,Hn=ze,{compareIdentifiers:he}=zt;let Un=class ee{constructor(e,t){if(t=Hn(t),e instanceof ee){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>wt)throw new TypeError(`version is longer than ${wt} characters`);Re("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const s=e.trim().match(t.loose?$t[yt.LOOSE]:$t[yt.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>Ie||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ie||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ie||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){const a=+o;if(a>=0&&a=0;)typeof this.prerelease[a]=="number"&&(this.prerelease[a]++,a=-2);if(a===-1){if(t===this.prerelease.join(".")&&s===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(t){let a=[t,o];s===!1&&(a=[t]),he(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var X=Un;const Rt=X,Xn=(n,e,t=!1)=>{if(n instanceof Rt)return n;try{return new Rt(n,e)}catch(s){if(!t)return null;throw s}};var pe=Xn;const Bn=pe,qn=(n,e)=>{const t=Bn(n,e);return t?t.version:null};var zn=qn;const Yn=pe,kn=(n,e)=>{const t=Yn(n.trim().replace(/^[=v]+/,""),e);return t?t.version:null};var Kn=kn;const It=X,Zn=(n,e,t,s,o)=>{typeof t=="string"&&(o=s,s=t,t=void 0);try{return new It(n instanceof It?n.version:n,t).inc(e,s,o).version}catch{return null}};var Jn=Zn;const Tt=pe,Qn=(n,e)=>{const t=Tt(n,null,!0),s=Tt(e,null,!0),o=t.compare(s);if(o===0)return null;const a=o>0,d=a?t:s,E=a?s:t,c=!!d.prerelease.length;if(!!E.prerelease.length&&!c)return!E.patch&&!E.minor?"major":d.patch?"patch":d.minor?"minor":"major";const m=c?"pre":"";return t.major!==s.major?m+"major":t.minor!==s.minor?m+"minor":t.patch!==s.patch?m+"patch":"prerelease"};var er=Qn;const tr=X,nr=(n,e)=>new tr(n,e).major;var rr=nr;const sr=X,ir=(n,e)=>new sr(n,e).minor;var or=ir;const ar=X,lr=(n,e)=>new ar(n,e).patch;var cr=lr;const hr=pe,ur=(n,e)=>{const t=hr(n,e);return t&&t.prerelease.length?t.prerelease:null};var fr=ur;const St=X,pr=(n,e,t)=>new St(n,t).compare(new St(e,t));var K=pr;const dr=K,mr=(n,e,t)=>dr(e,n,t);var vr=mr;const Er=K,gr=(n,e)=>Er(n,e,!0);var wr=gr;const Lt=X,$r=(n,e,t)=>{const s=new Lt(n,t),o=new Lt(e,t);return s.compare(o)||s.compareBuild(o)};var Ye=$r;const yr=Ye,Rr=(n,e)=>n.sort((t,s)=>yr(t,s,e));var Ir=Rr;const Tr=Ye,Sr=(n,e)=>n.sort((t,s)=>Tr(s,t,e));var Lr=Sr;const Ar=K,Nr=(n,e,t)=>Ar(n,e,t)>0;var Oe=Nr;const Or=K,xr=(n,e,t)=>Or(n,e,t)<0;var ke=xr;const br=K,Cr=(n,e,t)=>br(n,e,t)===0;var Yt=Cr;const _r=K,Pr=(n,e,t)=>_r(n,e,t)!==0;var kt=Pr;const Dr=K,jr=(n,e,t)=>Dr(n,e,t)>=0;var Ke=jr;const Fr=K,Gr=(n,e,t)=>Fr(n,e,t)<=0;var Ze=Gr;const Wr=Yt,Mr=kt,Vr=Oe,Hr=Ke,Ur=ke,Xr=Ze,Br=(n,e,t,s)=>{switch(e){case"===":return typeof n=="object"&&(n=n.version),typeof t=="object"&&(t=t.version),n===t;case"!==":return typeof n=="object"&&(n=n.version),typeof t=="object"&&(t=t.version),n!==t;case"":case"=":case"==":return Wr(n,t,s);case"!=":return Mr(n,t,s);case">":return Vr(n,t,s);case">=":return Hr(n,t,s);case"<":return Ur(n,t,s);case"<=":return Xr(n,t,s);default:throw new TypeError(`Invalid operator: ${e}`)}};var Kt=Br;const qr=X,zr=pe,{safeRe:Te,t:Se}=Ee,Yr=(n,e)=>{if(n instanceof qr)return n;if(typeof n=="number"&&(n=String(n)),typeof n!="string")return null;e=e||{};let t=null;if(!e.rtl)t=n.match(Te[Se.COERCE]);else{let s;for(;(s=Te[Se.COERCERTL].exec(n))&&(!t||t.index+t[0].length!==n.length);)(!t||s.index+s[0].length!==t.index+t[0].length)&&(t=s),Te[Se.COERCERTL].lastIndex=s.index+s[1].length+s[2].length;Te[Se.COERCERTL].lastIndex=-1}return t===null?null:zr(`${t[2]}.${t[3]||"0"}.${t[4]||"0"}`,e)};var kr=Yr,Ge,At;function Kr(){return At||(At=1,Ge=function(n){n.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Ge}var Zr=O;O.Node=le;O.create=O;function O(n){var e=this;if(e instanceof O||(e=new O),e.tail=null,e.head=null,e.length=0,n&&typeof n.forEach=="function")n.forEach(function(o){e.push(o)});else if(arguments.length>0)for(var t=0,s=arguments.length;t1)t=e;else if(this.head)s=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=0;s!==null;o++)t=n(t,s.value,o),s=s.next;return t};O.prototype.reduceReverse=function(n,e){var t,s=this.tail;if(arguments.length>1)t=e;else if(this.tail)s=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=this.length-1;s!==null;o--)t=n(t,s.value,o),s=s.prev;return t};O.prototype.toArray=function(){for(var n=new Array(this.length),e=0,t=this.head;t!==null;e++)n[e]=t.value,t=t.next;return n};O.prototype.toArrayReverse=function(){for(var n=new Array(this.length),e=0,t=this.tail;t!==null;e++)n[e]=t.value,t=t.prev;return n};O.prototype.slice=function(n,e){e=e||this.length,e<0&&(e+=this.length),n=n||0,n<0&&(n+=this.length);var t=new O;if(ethis.length&&(e=this.length);for(var s=0,o=this.head;o!==null&&sthis.length&&(e=this.length);for(var s=this.length,o=this.tail;o!==null&&s>e;s--)o=o.prev;for(;o!==null&&s>n;s--,o=o.prev)t.push(o.value);return t};O.prototype.splice=function(n,e,...t){n>this.length&&(n=this.length-1),n<0&&(n=this.length+n);for(var s=0,o=this.head;o!==null&&s1;class ns{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[oe]=e.max||1/0;const t=e.length||We;if(this[ue]=typeof t!="function"?We:t,this[ve]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[ae]=e.maxAge||0,this[te]=e.dispose,this[Nt]=e.noDisposeOnSet||!1,this[Zt]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[oe]=e||1/0,de(this)}get max(){return this[oe]}set allowStale(e){this[ve]=!!e}get allowStale(){return this[ve]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[ae]=e,de(this)}get maxAge(){return this[ae]}set lengthCalculator(e){typeof e!="function"&&(e=We),e!==this[ue]&&(this[ue]=e,this[ne]=0,this[W].forEach(t=>{t.length=this[ue](t.value,t.key),this[ne]+=t.length})),de(this)}get lengthCalculator(){return this[ue]}get length(){return this[ne]}get itemCount(){return this[W].length}rforEach(e,t){t=t||this;for(let s=this[W].tail;s!==null;){const o=s.prev;Ot(this,e,s,t),s=o}}forEach(e,t){t=t||this;for(let s=this[W].head;s!==null;){const o=s.next;Ot(this,e,s,t),s=o}}keys(){return this[W].toArray().map(e=>e.key)}values(){return this[W].toArray().map(e=>e.value)}reset(){this[te]&&this[W]&&this[W].length&&this[W].forEach(e=>this[te](e.key,e.value)),this[k]=new Map,this[W]=new ts,this[ne]=0}dump(){return this[W].map(e=>Le(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[W]}set(e,t,s){if(s=s||this[ae],s&&typeof s!="number")throw new TypeError("maxAge must be a number");const o=s?Date.now():0,a=this[ue](t,e);if(this[k].has(e)){if(a>this[oe])return fe(this,this[k].get(e)),!1;const c=this[k].get(e).value;return this[te]&&(this[Nt]||this[te](e,c.value)),c.now=o,c.maxAge=s,c.value=t,this[ne]+=a-c.length,c.length=a,this.get(e),de(this),!0}const d=new rs(e,t,a,o,s);return d.length>this[oe]?(this[te]&&this[te](e,t),!1):(this[ne]+=d.length,this[W].unshift(d),this[k].set(e,this[W].head),de(this),!0)}has(e){if(!this[k].has(e))return!1;const t=this[k].get(e).value;return!Le(this,t)}get(e){return Me(this,e,!0)}peek(e){return Me(this,e,!1)}pop(){const e=this[W].tail;return e?(fe(this,e),e.value):null}del(e){fe(this,this[k].get(e))}load(e){this.reset();const t=Date.now();for(let s=e.length-1;s>=0;s--){const o=e[s],a=o.e||0;if(a===0)this.set(o.k,o.v);else{const d=a-t;d>0&&this.set(o.k,o.v,d)}}}prune(){this[k].forEach((e,t)=>Me(this,t,!1))}}const Me=(n,e,t)=>{const s=n[k].get(e);if(s){const o=s.value;if(Le(n,o)){if(fe(n,s),!n[ve])return}else t&&(n[Zt]&&(s.value.now=Date.now()),n[W].unshiftNode(s));return o.value}},Le=(n,e)=>{if(!e||!e.maxAge&&!n[ae])return!1;const t=Date.now()-e.now;return e.maxAge?t>e.maxAge:n[ae]&&t>n[ae]},de=n=>{if(n[ne]>n[oe])for(let e=n[W].tail;n[ne]>n[oe]&&e!==null;){const t=e.prev;fe(n,e),e=t}},fe=(n,e)=>{if(e){const t=e.value;n[te]&&n[te](t.key,t.value),n[ne]-=t.length,n[k].delete(t.key),n[W].removeNode(e)}};class rs{constructor(e,t,s,o,a){this.key=e,this.value=t,this.length=s,this.now=o,this.maxAge=a||0}}const Ot=(n,e,t,s)=>{let o=t.value;Le(n,o)&&(fe(n,t),n[ve]||(o=void 0)),o&&e.call(s,o.value,o.key,n)};var ss=ns,Ve,xt;function Z(){if(xt)return Ve;xt=1;class n{constructor(p,L){if(L=s(L),p instanceof n)return p.loose===!!L.loose&&p.includePrerelease===!!L.includePrerelease?p:new n(p.raw,L);if(p instanceof o)return this.raw=p.value,this.set=[[p]],this.format(),this;if(this.options=L,this.loose=!!L.loose,this.includePrerelease=!!L.includePrerelease,this.raw=p.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(R=>this.parseRange(R.trim())).filter(R=>R.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const R=this.set[0];if(this.set=this.set.filter(I=>!S(I[0])),this.set.length===0)this.set=[R];else if(this.set.length>1){for(const I of this.set)if(I.length===1&&z(I[0])){this.set=[I];break}}}this.format()}format(){return this.range=this.set.map(p=>p.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(p){const R=((this.options.includePrerelease&&_)|(this.options.loose&&y))+":"+p,I=t.get(R);if(I)return I;const g=this.options.loose,A=g?E[c.HYPHENRANGELOOSE]:E[c.HYPHENRANGE];p=p.replace(A,De(this.options.includePrerelease)),a("hyphen replace",p),p=p.replace(E[c.COMPARATORTRIM],u),a("comparator trim",p),p=p.replace(E[c.TILDETRIM],m),a("tilde trim",p),p=p.replace(E[c.CARETTRIM],$),a("caret trim",p);let x=p.split(" ").map(D=>J(D,this.options)).join(" ").split(/\s+/).map(D=>Pe(D,this.options));g&&(x=x.filter(D=>(a("loose invalid filter",D,this.options),!!D.match(E[c.COMPARATORLOOSE])))),a("range list",x);const N=new Map,P=x.map(D=>new o(D,this.options));for(const D of P){if(S(D))return[D];N.set(D.value,D)}N.size>1&&N.has("")&&N.delete("");const M=[...N.values()];return t.set(R,M),M}intersects(p,L){if(!(p instanceof n))throw new TypeError("a Range is required");return this.set.some(R=>H(R,L)&&p.set.some(I=>H(I,L)&&R.every(g=>I.every(A=>g.intersects(A,L)))))}test(p){if(!p)return!1;if(typeof p=="string")try{p=new d(p,this.options)}catch{return!1}for(let L=0;Lv.value==="<0.0.0-0",z=v=>v.value==="",H=(v,p)=>{let L=!0;const R=v.slice();let I=R.pop();for(;L&&R.length;)L=R.every(g=>I.intersects(g,p)),I=R.pop();return L},J=(v,p)=>(a("comp",v,p),v=Ce(v,p),a("caret",v),v=Q(v,p),a("tildes",v),v=B(v,p),a("xrange",v),v=_e(v,p),a("stars",v),v),G=v=>!v||v.toLowerCase()==="x"||v==="*",Q=(v,p)=>v.trim().split(/\s+/).map(L=>q(L,p)).join(" "),q=(v,p)=>{const L=p.loose?E[c.TILDELOOSE]:E[c.TILDE];return v.replace(L,(R,I,g,A,x)=>{a("tilde",v,R,I,g,A,x);let N;return G(I)?N="":G(g)?N=`>=${I}.0.0 <${+I+1}.0.0-0`:G(A)?N=`>=${I}.${g}.0 <${I}.${+g+1}.0-0`:x?(a("replaceTilde pr",x),N=`>=${I}.${g}.${A}-${x} <${I}.${+g+1}.0-0`):N=`>=${I}.${g}.${A} <${I}.${+g+1}.0-0`,a("tilde return",N),N})},Ce=(v,p)=>v.trim().split(/\s+/).map(L=>ge(L,p)).join(" "),ge=(v,p)=>{a("caret",v,p);const L=p.loose?E[c.CARETLOOSE]:E[c.CARET],R=p.includePrerelease?"-0":"";return v.replace(L,(I,g,A,x,N)=>{a("caret",v,I,g,A,x,N);let P;return G(g)?P="":G(A)?P=`>=${g}.0.0${R} <${+g+1}.0.0-0`:G(x)?g==="0"?P=`>=${g}.${A}.0${R} <${g}.${+A+1}.0-0`:P=`>=${g}.${A}.0${R} <${+g+1}.0.0-0`:N?(a("replaceCaret pr",N),g==="0"?A==="0"?P=`>=${g}.${A}.${x}-${N} <${g}.${A}.${+x+1}-0`:P=`>=${g}.${A}.${x}-${N} <${g}.${+A+1}.0-0`:P=`>=${g}.${A}.${x}-${N} <${+g+1}.0.0-0`):(a("no pr"),g==="0"?A==="0"?P=`>=${g}.${A}.${x}${R} <${g}.${A}.${+x+1}-0`:P=`>=${g}.${A}.${x}${R} <${g}.${+A+1}.0-0`:P=`>=${g}.${A}.${x} <${+g+1}.0.0-0`),a("caret return",P),P})},B=(v,p)=>(a("replaceXRanges",v,p),v.split(/\s+/).map(L=>we(L,p)).join(" ")),we=(v,p)=>{v=v.trim();const L=p.loose?E[c.XRANGELOOSE]:E[c.XRANGE];return v.replace(L,(R,I,g,A,x,N)=>{a("xRange",v,R,I,g,A,x,N);const P=G(g),M=P||G(A),D=M||G(x),re=D;return I==="="&&re&&(I=""),N=p.includePrerelease?"-0":"",P?I===">"||I==="<"?R="<0.0.0-0":R="*":I&&re?(M&&(A=0),x=0,I===">"?(I=">=",M?(g=+g+1,A=0,x=0):(A=+A+1,x=0)):I==="<="&&(I="<",M?g=+g+1:A=+A+1),I==="<"&&(N="-0"),R=`${I+g}.${A}.${x}${N}`):M?R=`>=${g}.0.0${N} <${+g+1}.0.0-0`:D&&(R=`>=${g}.${A}.0${N} <${g}.${+A+1}.0-0`),a("xRange return",R),R})},_e=(v,p)=>(a("replaceStars",v,p),v.trim().replace(E[c.STAR],"")),Pe=(v,p)=>(a("replaceGTE0",v,p),v.trim().replace(E[p.includePrerelease?c.GTE0PRE:c.GTE0],"")),De=v=>(p,L,R,I,g,A,x,N,P,M,D,re,tt)=>(G(R)?L="":G(I)?L=`>=${R}.0.0${v?"-0":""}`:G(g)?L=`>=${R}.${I}.0${v?"-0":""}`:A?L=`>=${L}`:L=`>=${L}${v?"-0":""}`,G(P)?N="":G(M)?N=`<${+P+1}.0.0-0`:G(D)?N=`<${P}.${+M+1}.0-0`:re?N=`<=${P}.${M}.${D}-${re}`:v?N=`<${P}.${M}.${+D+1}-0`:N=`<=${N}`,`${L} ${N}`.trim()),$e=(v,p,L)=>{for(let R=0;R0){const I=v[R].semver;if(I.major===p.major&&I.minor===p.minor&&I.patch===p.patch)return!0}return!1}return!0};return Ve}var He,bt;function xe(){if(bt)return He;bt=1;const n=Symbol("SemVer ANY");class e{static get ANY(){return n}constructor(m,$){if($=t($),m instanceof e){if(m.loose===!!$.loose)return m;m=m.value}m=m.trim().split(/\s+/).join(" "),d("comparator",m,$),this.options=$,this.loose=!!$.loose,this.parse(m),this.semver===n?this.value="":this.value=this.operator+this.semver.version,d("comp",this)}parse(m){const $=this.options.loose?s[o.COMPARATORLOOSE]:s[o.COMPARATOR],_=m.match($);if(!_)throw new TypeError(`Invalid comparator: ${m}`);this.operator=_[1]!==void 0?_[1]:"",this.operator==="="&&(this.operator=""),_[2]?this.semver=new E(_[2],this.options.loose):this.semver=n}toString(){return this.value}test(m){if(d("Comparator.test",m,this.options.loose),this.semver===n||m===n)return!0;if(typeof m=="string")try{m=new E(m,this.options)}catch{return!1}return a(m,this.operator,this.semver,this.options)}intersects(m,$){if(!(m instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(m.value,$).test(this.value):m.operator===""?m.value===""?!0:new c(this.value,$).test(m.semver):($=t($),$.includePrerelease&&(this.value==="<0.0.0-0"||m.value==="<0.0.0-0")||!$.includePrerelease&&(this.value.startsWith("<0.0.0")||m.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&m.operator.startsWith(">")||this.operator.startsWith("<")&&m.operator.startsWith("<")||this.semver.version===m.semver.version&&this.operator.includes("=")&&m.operator.includes("=")||a(this.semver,"<",m.semver,$)&&this.operator.startsWith(">")&&m.operator.startsWith("<")||a(this.semver,">",m.semver,$)&&this.operator.startsWith("<")&&m.operator.startsWith(">")))}}He=e;const t=ze,{safeRe:s,t:o}=Ee,a=Kt,d=Ne,E=X,c=Z();return He}const is=Z(),os=(n,e,t)=>{try{e=new is(e,t)}catch{return!1}return e.test(n)};var be=os;const as=Z(),ls=(n,e)=>new as(n,e).set.map(t=>t.map(s=>s.value).join(" ").trim().split(" "));var cs=ls;const hs=X,us=Z(),fs=(n,e,t)=>{let s=null,o=null,a=null;try{a=new us(e,t)}catch{return null}return n.forEach(d=>{a.test(d)&&(!s||o.compare(d)===-1)&&(s=d,o=new hs(s,t))}),s};var ps=fs;const ds=X,ms=Z(),vs=(n,e,t)=>{let s=null,o=null,a=null;try{a=new ms(e,t)}catch{return null}return n.forEach(d=>{a.test(d)&&(!s||o.compare(d)===1)&&(s=d,o=new ds(s,t))}),s};var Es=vs;const Ue=X,gs=Z(),Ct=Oe,ws=(n,e)=>{n=new gs(n,e);let t=new Ue("0.0.0");if(n.test(t)||(t=new Ue("0.0.0-0"),n.test(t)))return t;t=null;for(let s=0;s{const E=new Ue(d.semver.version);switch(d.operator){case">":E.prerelease.length===0?E.patch++:E.prerelease.push(0),E.raw=E.format();case"":case">=":(!a||Ct(E,a))&&(a=E);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${d.operator}`)}}),a&&(!t||Ct(t,a))&&(t=a)}return t&&n.test(t)?t:null};var $s=ws;const ys=Z(),Rs=(n,e)=>{try{return new ys(n,e).range||"*"}catch{return null}};var Is=Rs;const Ts=X,Jt=xe(),{ANY:Ss}=Jt,Ls=Z(),As=be,_t=Oe,Pt=ke,Ns=Ze,Os=Ke,xs=(n,e,t,s)=>{n=new Ts(n,s),e=new Ls(e,s);let o,a,d,E,c;switch(t){case">":o=_t,a=Ns,d=Pt,E=">",c=">=";break;case"<":o=Pt,a=Os,d=_t,E="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(As(n,e,s))return!1;for(let u=0;u{y.semver===Ss&&(y=new Jt(">=0.0.0")),$=$||y,_=_||y,o(y.semver,$.semver,s)?$=y:d(y.semver,_.semver,s)&&(_=y)}),$.operator===E||$.operator===c||(!_.operator||_.operator===E)&&a(n,_.semver))return!1;if(_.operator===c&&d(n,_.semver))return!1}return!0};var Je=xs;const bs=Je,Cs=(n,e,t)=>bs(n,e,">",t);var _s=Cs;const Ps=Je,Ds=(n,e,t)=>Ps(n,e,"<",t);var js=Ds;const Dt=Z(),Fs=(n,e,t)=>(n=new Dt(n,t),e=new Dt(e,t),n.intersects(e,t));var Gs=Fs;const Ws=be,Ms=K;var Vs=(n,e,t)=>{const s=[];let o=null,a=null;const d=n.sort((m,$)=>Ms(m,$,t));for(const m of d)Ws(m,e,t)?(a=m,o||(o=m)):(a&&s.push([o,a]),a=null,o=null);o&&s.push([o,null]);const E=[];for(const[m,$]of s)m===$?E.push(m):!$&&m===d[0]?E.push("*"):$?m===d[0]?E.push(`<=${$}`):E.push(`${m} - ${$}`):E.push(`>=${m}`);const c=E.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length{if(n===e)return!0;n=new jt(n,t),e=new jt(e,t);let s=!1;e:for(const o of n.set){for(const a of e.set){const d=Xs(o,a,t);if(s=s||d!==null,d)continue e}if(s)return!1}return!0},Us=[new Qe(">=0.0.0-0")],Ft=[new Qe(">=0.0.0")],Xs=(n,e,t)=>{if(n===e)return!0;if(n.length===1&&n[0].semver===Xe){if(e.length===1&&e[0].semver===Xe)return!0;t.includePrerelease?n=Us:n=Ft}if(e.length===1&&e[0].semver===Xe){if(t.includePrerelease)return!0;e=Ft}const s=new Set;let o,a;for(const y of n)y.operator===">"||y.operator===">="?o=Gt(o,y,t):y.operator==="<"||y.operator==="<="?a=Wt(a,y,t):s.add(y.semver);if(s.size>1)return null;let d;if(o&&a){if(d=et(o.semver,a.semver,t),d>0)return null;if(d===0&&(o.operator!==">="||a.operator!=="<="))return null}for(const y of s){if(o&&!me(y,String(o),t)||a&&!me(y,String(a),t))return null;for(const S of e)if(!me(y,String(S),t))return!1;return!0}let E,c,u,m,$=a&&!t.includePrerelease&&a.semver.prerelease.length?a.semver:!1,_=o&&!t.includePrerelease&&o.semver.prerelease.length?o.semver:!1;$&&$.prerelease.length===1&&a.operator==="<"&&$.prerelease[0]===0&&($=!1);for(const y of e){if(m=m||y.operator===">"||y.operator===">=",u=u||y.operator==="<"||y.operator==="<=",o){if(_&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===_.major&&y.semver.minor===_.minor&&y.semver.patch===_.patch&&(_=!1),y.operator===">"||y.operator===">="){if(E=Gt(o,y,t),E===y&&E!==o)return!1}else if(o.operator===">="&&!me(o.semver,String(y),t))return!1}if(a){if($&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===$.major&&y.semver.minor===$.minor&&y.semver.patch===$.patch&&($=!1),y.operator==="<"||y.operator==="<="){if(c=Wt(a,y,t),c===y&&c!==a)return!1}else if(a.operator==="<="&&!me(a.semver,String(y),t))return!1}if(!y.operator&&(a||o)&&d!==0)return!1}return!(o&&u&&!a&&d!==0||a&&m&&!o&&d!==0||_||$)},Gt=(n,e,t)=>{if(!n)return e;const s=et(n.semver,e.semver,t);return s>0?n:s<0||e.operator===">"&&n.operator===">="?e:n},Wt=(n,e,t)=>{if(!n)return e;const s=et(n.semver,e.semver,t);return s<0?n:s>0||e.operator==="<"&&n.operator==="<="?e:n};var Bs=Hs;const Be=Ee,Mt=Ae,qs=X,Vt=zt,zs=pe,Ys=zn,ks=Kn,Ks=Jn,Zs=er,Js=rr,Qs=or,ei=cr,ti=fr,ni=K,ri=vr,si=wr,ii=Ye,oi=Ir,ai=Lr,li=Oe,ci=ke,hi=Yt,ui=kt,fi=Ke,pi=Ze,di=Kt,mi=kr,vi=xe(),Ei=Z(),gi=be,wi=cs,$i=ps,yi=Es,Ri=$s,Ii=Is,Ti=Je,Si=_s,Li=js,Ai=Gs,Ni=Vs,Oi=Bs;var xi={parse:zs,valid:Ys,clean:ks,inc:Ks,diff:Zs,major:Js,minor:Qs,patch:ei,prerelease:ti,compare:ni,rcompare:ri,compareLoose:si,compareBuild:ii,sort:oi,rsort:ai,gt:li,lt:ci,eq:hi,neq:ui,gte:fi,lte:pi,cmp:di,coerce:mi,Comparator:vi,Range:Ei,satisfies:gi,toComparators:wi,maxSatisfying:$i,minSatisfying:yi,minVersion:Ri,validRange:Ii,outside:Ti,gtr:Si,ltr:Li,intersects:Ai,simplifyRange:Ni,subset:Oi,SemVer:qs,re:Be.re,src:Be.src,tokens:Be.t,SEMVER_SPEC_VERSION:Mt.SEMVER_SPEC_VERSION,RELEASE_TYPES:Mt.RELEASE_TYPES,compareIdentifiers:Vt.compareIdentifiers,rcompareIdentifiers:Vt.rcompareIdentifiers};const bi=Ut(xi);var Qt={exports:{}};(function(n){(function(){function e(r,i,h){return r.call.apply(r.bind,arguments)}function t(r,i,h){if(!r)throw Error();if(2=i.f?b():r.fonts.load(Ce(i.a),i.h).then(function(j){1<=j.length?T():setTimeout(C,25)},function(){b()})}C()}),f=null,w=new Promise(function(T,b){f=setTimeout(b,i.f)});Promise.race([w,l]).then(function(){f&&(clearTimeout(f),f=null),i.g(i.a)},function(){i.j(i.a)})};function x(r,i,h,l,f,w,T){this.v=r,this.B=i,this.c=h,this.a=l,this.s=T||"BESbswy",this.f={},this.w=f||3e3,this.u=w||null,this.m=this.j=this.h=this.g=null,this.g=new R(this.c,this.s),this.h=new R(this.c,this.s),this.j=new R(this.c,this.s),this.m=new R(this.c,this.s),r=new q(this.a.c+",serif",B(this.a)),r=g(r),this.g.a.style.cssText=r,r=new q(this.a.c+",sans-serif",B(this.a)),r=g(r),this.h.a.style.cssText=r,r=new q("serif",B(this.a)),r=g(r),this.j.a.style.cssText=r,r=new q("sans-serif",B(this.a)),r=g(r),this.m.a.style.cssText=r,I(this.g),I(this.h),I(this.j),I(this.m)}var N={D:"serif",C:"sans-serif"},P=null;function M(){if(P===null){var r=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);P=!!r&&(536>parseInt(r[1],10)||parseInt(r[1],10)===536&&11>=parseInt(r[2],10))}return P}x.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=o(),re(this)};function D(r,i,h){for(var l in N)if(N.hasOwnProperty(l)&&i===r.f[N[l]]&&h===r.f[N[l]])return!0;return!1}function re(r){var i=r.g.a.offsetWidth,h=r.h.a.offsetWidth,l;(l=i===r.f.serif&&h===r.f["sans-serif"])||(l=M()&&D(r,i,h)),l?o()-r.A>=r.w?M()&&D(r,i,h)&&(r.u===null||r.u.hasOwnProperty(r.a.c))?je(r,r.v):je(r,r.B):tt(r):je(r,r.v)}function tt(r){setTimeout(s(function(){re(this)},r),50)}function je(r,i){setTimeout(s(function(){u(this.g.a),u(this.h.a),u(this.j.a),u(this.m.a),i(this.a)},r),0)}function Fe(r,i,h){this.c=r,this.a=i,this.f=0,this.m=this.j=!1,this.s=h}var ye=null;Fe.prototype.g=function(r){var i=this.a;i.g&&m(i.f,[i.a.c("wf",r.c,B(r).toString(),"active")],[i.a.c("wf",r.c,B(r).toString(),"loading"),i.a.c("wf",r.c,B(r).toString(),"inactive")]),v(i,"fontactive",r),this.m=!0,nt(this)},Fe.prototype.h=function(r){var i=this.a;if(i.g){var h=$(i.f,i.a.c("wf",r.c,B(r).toString(),"active")),l=[],f=[i.a.c("wf",r.c,B(r).toString(),"loading")];h||l.push(i.a.c("wf",r.c,B(r).toString(),"inactive")),m(i.f,l,f)}v(i,"fontinactive",r),nt(this)};function nt(r){--r.f==0&&r.j&&(r.m?(r=r.a,r.g&&m(r.f,[r.a.c("wf","active")],[r.a.c("wf","loading"),r.a.c("wf","inactive")]),v(r,"active")):$e(r.a))}function rt(r){this.j=r,this.a=new p,this.h=0,this.f=this.g=!0}rt.prototype.load=function(r){this.c=new a(this.j,r.context||this.j),this.g=r.events!==!1,this.f=r.classes!==!1,tn(this,new Pe(this.c,r),r)};function en(r,i,h,l,f){var w=--r.h==0;(r.f||r.g)&&setTimeout(function(){var T=f||null,b=l||null||{};if(h.length===0&&w)$e(i.a);else{i.f+=h.length,w&&(i.j=w);var C,j=[];for(C=0;Cthis.createElement(o));t.replaceChildren(...s)}createElement(e){if(e.type=="separator"){const t=document.createElement("div");return t.classList.add("separator"),t}if(e.type=="selection"||e.type=="checkbox"||e.type=="dropdown"){const t=document.createElement("div"),s=document.createElement("div"),o=document.createElement("div");let a;if(e.type=="selection"||e.type=="checkbox"){const d=mn[e.id]??{label:e.id,combos:[],callback:()=>{}};a=document.createElement("div"),a.innerText=Xt.getKeybindString(e.id),a.classList.add("keybind","unselectable"),o.innerText=d.label;let E=d.disabled;typeof E=="function"&&(E=E(this.app)),E&&t.classList.add("disabled"),t.addEventListener("click",()=>{if(E)return;d.callback(this.app),t.closest(".menu-main").querySelector(".menubar-dropdown").replaceChildren()})}else a=document.createElement("img"),a.classList.add("icon"),a.src=vn.CHEVRON,a.style.transform="rotate(-90deg)",o.innerText=typeof e.title=="function"?e.title(this.app):e.title;if(s.appendChild(o),s.appendChild(a),t.appendChild(s),t.classList.add("menu-item"),s.classList.add("menu-item-title","menu-hover"),o.classList.add("title","unselectable"),e.type=="dropdown"){const d=document.createElement("div");t.appendChild(d),d.classList.add("menubar-dropdown"),e.options.map(E=>this.createElement(E)).forEach(E=>d.appendChild(E))}if(e.type=="checkbox"){let d=e.checked;typeof d=="function"&&(d=d(this.app)),d&&(o.innerText="✓ "+o.innerText)}return t}if(e.type=="menu"){const t=document.createElement("div"),s=document.createElement("div"),o=document.createElement("div");return t.appendChild(s),s.innerText=e.title,t.appendChild(o),s.classList.add("title","unselectable"),t.classList.add("menu-item","menu-main"),s.classList.add("menu-hover"),o.classList.add("menubar-dropdown","unselectable"),t.onmouseenter=()=>{o.replaceChildren(...e.options.map(a=>this.createElement(a)))},t.onmouseleave=()=>{o.replaceChildren()},t}return document.createElement("div")}}class Di{view;windows=[];app;constructor(e,t){this.app=e,this.view=t}unfocusAll(){for(const e of this.view.querySelectorAll(".focused"))e.classList.remove("focused")}getFocusedWindow(){for(const e of this.windows)if(e.windowElement.classList.contains("focused"))return e;return null}isBlocked(){return!this.windows.every(e=>!e.options.blocking)}openWindow(e){if(e.options.win_id){const t=this.getWindowById(e.options.win_id);if(t){t.focus();return}}e.addToManager(this),this.windows.push(e)}removeWindow(e){this.windows.splice(this.windows.indexOf(e),1)}getWindowById(e){for(const t of this.windows)if(t.options.win_id==e)return t}}class ji{renderer;ticker;stage;view;chartManager;windowManager;menubarManager;actionHistory;lastWidth=window.innerWidth;lastHeight=window.innerHeight;constructor(){if(En.setDefaultProps({duration:[200,100],theme:"sm"}),window.nw){const e=nw.Window.get();window.addEventListener("keydown",t=>{(t.key=="r"&&(t.metaKey||t.ctrlKey)||t.key=="F5")&&(t.preventDefault(),e.reload())}),this.checkAppVersion()}if(ie.loadOptions(),gn(),Xt.load(this),setInterval(()=>ie.saveOptions(),1e4),ie.general.smoothAnimations&&document.body.classList.add("animated"),this.registerFonts(),this.view=document.getElementById("pixi"),document.oncontextmenu=e=>{e.preventDefault(),this.chartManager.loadedChart&&e.target==this.view&&ut.open(this,e)},this.view.onmousedown=()=>{ut.close()},this.stage=new wn,this.stage.sortableChildren=!0,this.renderer=new $n({backgroundColor:1579292,antialias:ie.performance.antialiasing,width:this.view.clientWidth,height:this.view.clientHeight,resolution:ie.performance.resolution,autoDensity:!0,view:this.view,powerPreference:"low-power"}),this.onResize(),this.ticker=new yn,this.ticker.maxFPS=120,this.ticker.add(()=>{const e=performance.now();this.renderer.render(this.stage),ft.instance?.addFrameTimeValue(performance.now()-e),performance.memory?.usedJSHeapSize&&ft.instance?.addMemoryTimeValue(performance.memory.usedJSHeapSize),bn()},Rn.LOW),this.ticker.start(),In.init(this.renderer),this.chartManager=new Tn(this),this.menubarManager=new Pi(this,document.getElementById("menubar")),this.windowManager=new Di(this,document.getElementById("windows")),this.actionHistory=new pt(this),this.registerListeners(),!V.hidePoweredByText&&Sn()){const e=document.getElementById("embed");e.appendChild(document.createTextNode("Powered by "));const t=document.createElement("a");if(t.href="https://tillvit.github.io/smeditor/",t.innerText="SMEditor",t.target="_blank",e.appendChild(t),V.url!=null){e.appendChild(document.createTextNode(" | Open this chart in a "));const s=document.createElement("a"),o=new URL(location.origin+"/smeditor/app/");s.innerText="new tab",s.target="_blank",o.searchParams.append("url",V.url),V.chartType!==null&&o.searchParams.append("chartType",V.chartType),V.chartIndex!==null&&o.searchParams.append("chartIndex",V.chartIndex+""),s.href=o.toString(),e.appendChild(s)}}dt.initFileSystem().then(()=>{if(V.url){this.chartManager.loadSM(V.url).then(()=>{const e=this.chartManager.loadedSM;if(!e)return;let t;if(V.chartType!=null&&(t=e.charts[V.chartType],t===void 0)){Et.createFormatted(`Couldn't find chart with type ${V.chartType}`,"warn");return}if(t===void 0){const o=Object.keys(e.charts);if(o.length==0||(t=e.charts[o[0]],t.length==0))return}let s;if(V.chartIndex!=null&&(s=t.at(V.chartIndex),s===void 0)){Et.createFormatted(`Couldn't find chart with index ${V.chartIndex}`,"warn");return}s===void 0&&(s=t.at(-1),!s)||this.chartManager.loadChart(s)});return}this.windowManager.openWindow(new Ln(this))}),window.onbeforeunload=e=>{if(pt.instance.isDirty()&&ie.general.warnBeforeExit)return e.preventDefault(),e.returnValue="Are you sure you want to exit?"},window.onunload=()=>{ie.saveOptions()}}registerFonts(){mt.from("Main",{fontFamily:"Assistant",fontSize:20,fill:"white"},{chars:[["a","z"],["A","Z"],"!@#$%^&*()~{}[]:.-?=,_","0123456789/"," "],resolution:window.devicePixelRatio}),mt.from("Fancy",{fontFamily:"Assistant",fontSize:40,fontWeight:"700",fill:["#dddddd","#ffffff"],fillGradientType:An.LINEAR_VERTICAL,stroke:11184810,strokeThickness:3},{chars:[["a","z"],["A","Z"],"!@#$%^&*()~{}[]:.-?=,_","0123456789/"," "],resolution:window.devicePixelRatio})}registerListeners(){window.addEventListener("keydown",function(e){e.code=="Tab"&&e.preventDefault(),e.code=="Enter"&&e.target instanceof HTMLButtonElement&&e.preventDefault()}),window.addEventListener("dragstart",function(e){e.target instanceof HTMLImageElement&&e.preventDefault()}),setInterval(()=>{(this.lastHeight!=window.innerHeight||this.lastWidth!=window.innerWidth)&&(this.lastHeight=window.innerHeight,this.lastWidth=window.innerWidth,this.onResize(),Nn.emit("resize"))},100),window.addEventListener("dragover",e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy"}),window.addEventListener("drop",e=>{if(window.nw){e.stopPropagation(),e.preventDefault();let t="";for(const s of e.dataTransfer.files)if(s.path)if(vt(s.path)==".ssc"){t=s.path;break}else t==""&&vt(s.path)==".sm"&&(t=s.path);t!=""&&(this.chartManager.loadSM(t),this.windowManager.getWindowById("select_sm_initial")?.closeWindow())}else dt.handleDropEvent(e).then(t=>{const s=new On(this,{title:"Select an sm/ssc file...",accepted_file_types:[".sm",".ssc"],disableClose:!0,callback:o=>{this.chartManager.loadSM(o),this.windowManager.getWindowById("select_sm_initial")?.closeWindow()},onload:()=>{s.getAcceptableFile(t??"").then(o=>s.selectPath(o))}});this.windowManager.openWindow(s)})})}onResize(){const e=window.innerWidth,t=window.innerHeight-document.getElementById("menubar").clientHeight;this.renderer.screen.width=e,this.renderer.screen.height=t,this.view.width=e*this.renderer.resolution,this.view.height=t*this.renderer.resolution,this.view.style.width=`${e}px`,this.view.style.height=`${t}px`}checkAppVersion(){if(!window.nw)return;const e=nw.require("nw.gui"),t={stable:3,beta:2,alpha:1,nightly:0};let s="win";navigator.userAgent.includes("Mac")?s="mac":navigator.userAgent.includes("Linux")&&(s="linux"),fetch("/smeditor/assets/app/versions.json").then(o=>o.json()).then(o=>{o=o.sort((d,E)=>t[d.type]!=t[E.type]?t[E.type]-t[d.type]:E.date-d.date);const a=o[0];bi.lt(e.App.manifest.version,a.version)&&localStorage.getItem("downloadedVersion")!==a.version&&xn.open(a.version,a.downloads[s])})}}document.querySelector("body").innerHTML=`
+import{g as Ut,F as V,M as dn,K as mn,a as Xt,I as vn,t as En,O as ie,l as gn,C as ut,b as wn,R as $n,T as yn,D as ft,U as Rn,B as In,c as Tn,A as pt,i as Sn,d as dt,e as Ln,f as mt,h as An,E as Nn,j as vt,k as On,m as xn,W as Et,n as bn}from"./ChartManager-5a16a8de.js";var qe={exports:{}};const Cn="2.0.0",Bt=256,_n=Number.MAX_SAFE_INTEGER||9007199254740991,Pn=16,Dn=Bt-6,jn=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Ae={MAX_LENGTH:Bt,MAX_SAFE_COMPONENT_LENGTH:Pn,MAX_SAFE_BUILD_LENGTH:Dn,MAX_SAFE_INTEGER:_n,RELEASE_TYPES:jn,SEMVER_SPEC_VERSION:Cn,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Fn=typeof process=="object"&&process.env&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{};var Ne=Fn;(function(n,e){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:o}=Ae,a=Ne;e=n.exports={};const d=e.re=[],E=e.safeRe=[],c=e.src=[],u=e.t={};let m=0;const $="[a-zA-Z0-9-]",_=[["\\s",1],["\\d",o],[$,s]],y=z=>{for(const[H,J]of _)z=z.split(`${H}*`).join(`${H}{0,${J}}`).split(`${H}+`).join(`${H}{1,${J}}`);return z},S=(z,H,J)=>{const G=y(H),Q=m++;a(z,Q,H),u[z]=Q,c[Q]=H,d[Q]=new RegExp(H,J?"g":void 0),E[Q]=new RegExp(G,J?"g":void 0)};S("NUMERICIDENTIFIER","0|[1-9]\\d*"),S("NUMERICIDENTIFIERLOOSE","\\d+"),S("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${$}*`),S("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),S("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),S("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),S("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),S("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),S("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),S("BUILDIDENTIFIER",`${$}+`),S("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),S("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),S("FULL",`^${c[u.FULLPLAIN]}$`),S("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),S("LOOSE",`^${c[u.LOOSEPLAIN]}$`),S("GTLT","((?:<|>)?=?)"),S("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),S("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),S("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),S("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),S("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),S("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),S("COERCE",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?(?:$|[^\\d])`),S("COERCERTL",c[u.COERCE],!0),S("LONETILDE","(?:~>?)"),S("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",S("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),S("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),S("LONECARET","(?:\\^)"),S("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",S("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),S("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),S("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),S("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),S("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",S("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),S("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),S("STAR","(<|>)?=?\\s*\\*"),S("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),S("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(qe,qe.exports);var Ee=qe.exports;const Gn=Object.freeze({loose:!0}),Wn=Object.freeze({}),Mn=n=>n?typeof n!="object"?Gn:n:Wn;var ze=Mn;const gt=/^[0-9]+$/,qt=(n,e)=>{const t=gt.test(n),s=gt.test(e);return t&&s&&(n=+n,e=+e),n===e?0:t&&!s?-1:s&&!t?1:nqt(e,n);var zt={compareIdentifiers:qt,rcompareIdentifiers:Vn};const Re=Ne,{MAX_LENGTH:wt,MAX_SAFE_INTEGER:Ie}=Ae,{safeRe:$t,t:yt}=Ee,Hn=ze,{compareIdentifiers:he}=zt;let Un=class ee{constructor(e,t){if(t=Hn(t),e instanceof ee){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>wt)throw new TypeError(`version is longer than ${wt} characters`);Re("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const s=e.trim().match(t.loose?$t[yt.LOOSE]:$t[yt.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>Ie||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ie||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ie||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){const a=+o;if(a>=0&&a=0;)typeof this.prerelease[a]=="number"&&(this.prerelease[a]++,a=-2);if(a===-1){if(t===this.prerelease.join(".")&&s===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(t){let a=[t,o];s===!1&&(a=[t]),he(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var X=Un;const Rt=X,Xn=(n,e,t=!1)=>{if(n instanceof Rt)return n;try{return new Rt(n,e)}catch(s){if(!t)return null;throw s}};var pe=Xn;const Bn=pe,qn=(n,e)=>{const t=Bn(n,e);return t?t.version:null};var zn=qn;const Yn=pe,kn=(n,e)=>{const t=Yn(n.trim().replace(/^[=v]+/,""),e);return t?t.version:null};var Kn=kn;const It=X,Zn=(n,e,t,s,o)=>{typeof t=="string"&&(o=s,s=t,t=void 0);try{return new It(n instanceof It?n.version:n,t).inc(e,s,o).version}catch{return null}};var Jn=Zn;const Tt=pe,Qn=(n,e)=>{const t=Tt(n,null,!0),s=Tt(e,null,!0),o=t.compare(s);if(o===0)return null;const a=o>0,d=a?t:s,E=a?s:t,c=!!d.prerelease.length;if(!!E.prerelease.length&&!c)return!E.patch&&!E.minor?"major":d.patch?"patch":d.minor?"minor":"major";const m=c?"pre":"";return t.major!==s.major?m+"major":t.minor!==s.minor?m+"minor":t.patch!==s.patch?m+"patch":"prerelease"};var er=Qn;const tr=X,nr=(n,e)=>new tr(n,e).major;var rr=nr;const sr=X,ir=(n,e)=>new sr(n,e).minor;var or=ir;const ar=X,lr=(n,e)=>new ar(n,e).patch;var cr=lr;const hr=pe,ur=(n,e)=>{const t=hr(n,e);return t&&t.prerelease.length?t.prerelease:null};var fr=ur;const St=X,pr=(n,e,t)=>new St(n,t).compare(new St(e,t));var K=pr;const dr=K,mr=(n,e,t)=>dr(e,n,t);var vr=mr;const Er=K,gr=(n,e)=>Er(n,e,!0);var wr=gr;const Lt=X,$r=(n,e,t)=>{const s=new Lt(n,t),o=new Lt(e,t);return s.compare(o)||s.compareBuild(o)};var Ye=$r;const yr=Ye,Rr=(n,e)=>n.sort((t,s)=>yr(t,s,e));var Ir=Rr;const Tr=Ye,Sr=(n,e)=>n.sort((t,s)=>Tr(s,t,e));var Lr=Sr;const Ar=K,Nr=(n,e,t)=>Ar(n,e,t)>0;var Oe=Nr;const Or=K,xr=(n,e,t)=>Or(n,e,t)<0;var ke=xr;const br=K,Cr=(n,e,t)=>br(n,e,t)===0;var Yt=Cr;const _r=K,Pr=(n,e,t)=>_r(n,e,t)!==0;var kt=Pr;const Dr=K,jr=(n,e,t)=>Dr(n,e,t)>=0;var Ke=jr;const Fr=K,Gr=(n,e,t)=>Fr(n,e,t)<=0;var Ze=Gr;const Wr=Yt,Mr=kt,Vr=Oe,Hr=Ke,Ur=ke,Xr=Ze,Br=(n,e,t,s)=>{switch(e){case"===":return typeof n=="object"&&(n=n.version),typeof t=="object"&&(t=t.version),n===t;case"!==":return typeof n=="object"&&(n=n.version),typeof t=="object"&&(t=t.version),n!==t;case"":case"=":case"==":return Wr(n,t,s);case"!=":return Mr(n,t,s);case">":return Vr(n,t,s);case">=":return Hr(n,t,s);case"<":return Ur(n,t,s);case"<=":return Xr(n,t,s);default:throw new TypeError(`Invalid operator: ${e}`)}};var Kt=Br;const qr=X,zr=pe,{safeRe:Te,t:Se}=Ee,Yr=(n,e)=>{if(n instanceof qr)return n;if(typeof n=="number"&&(n=String(n)),typeof n!="string")return null;e=e||{};let t=null;if(!e.rtl)t=n.match(Te[Se.COERCE]);else{let s;for(;(s=Te[Se.COERCERTL].exec(n))&&(!t||t.index+t[0].length!==n.length);)(!t||s.index+s[0].length!==t.index+t[0].length)&&(t=s),Te[Se.COERCERTL].lastIndex=s.index+s[1].length+s[2].length;Te[Se.COERCERTL].lastIndex=-1}return t===null?null:zr(`${t[2]}.${t[3]||"0"}.${t[4]||"0"}`,e)};var kr=Yr,Ge,At;function Kr(){return At||(At=1,Ge=function(n){n.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Ge}var Zr=O;O.Node=le;O.create=O;function O(n){var e=this;if(e instanceof O||(e=new O),e.tail=null,e.head=null,e.length=0,n&&typeof n.forEach=="function")n.forEach(function(o){e.push(o)});else if(arguments.length>0)for(var t=0,s=arguments.length;t1)t=e;else if(this.head)s=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=0;s!==null;o++)t=n(t,s.value,o),s=s.next;return t};O.prototype.reduceReverse=function(n,e){var t,s=this.tail;if(arguments.length>1)t=e;else if(this.tail)s=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=this.length-1;s!==null;o--)t=n(t,s.value,o),s=s.prev;return t};O.prototype.toArray=function(){for(var n=new Array(this.length),e=0,t=this.head;t!==null;e++)n[e]=t.value,t=t.next;return n};O.prototype.toArrayReverse=function(){for(var n=new Array(this.length),e=0,t=this.tail;t!==null;e++)n[e]=t.value,t=t.prev;return n};O.prototype.slice=function(n,e){e=e||this.length,e<0&&(e+=this.length),n=n||0,n<0&&(n+=this.length);var t=new O;if(ethis.length&&(e=this.length);for(var s=0,o=this.head;o!==null&&sthis.length&&(e=this.length);for(var s=this.length,o=this.tail;o!==null&&s>e;s--)o=o.prev;for(;o!==null&&s>n;s--,o=o.prev)t.push(o.value);return t};O.prototype.splice=function(n,e,...t){n>this.length&&(n=this.length-1),n<0&&(n=this.length+n);for(var s=0,o=this.head;o!==null&&s1;class ns{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[oe]=e.max||1/0;const t=e.length||We;if(this[ue]=typeof t!="function"?We:t,this[ve]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[ae]=e.maxAge||0,this[te]=e.dispose,this[Nt]=e.noDisposeOnSet||!1,this[Zt]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[oe]=e||1/0,de(this)}get max(){return this[oe]}set allowStale(e){this[ve]=!!e}get allowStale(){return this[ve]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[ae]=e,de(this)}get maxAge(){return this[ae]}set lengthCalculator(e){typeof e!="function"&&(e=We),e!==this[ue]&&(this[ue]=e,this[ne]=0,this[W].forEach(t=>{t.length=this[ue](t.value,t.key),this[ne]+=t.length})),de(this)}get lengthCalculator(){return this[ue]}get length(){return this[ne]}get itemCount(){return this[W].length}rforEach(e,t){t=t||this;for(let s=this[W].tail;s!==null;){const o=s.prev;Ot(this,e,s,t),s=o}}forEach(e,t){t=t||this;for(let s=this[W].head;s!==null;){const o=s.next;Ot(this,e,s,t),s=o}}keys(){return this[W].toArray().map(e=>e.key)}values(){return this[W].toArray().map(e=>e.value)}reset(){this[te]&&this[W]&&this[W].length&&this[W].forEach(e=>this[te](e.key,e.value)),this[k]=new Map,this[W]=new ts,this[ne]=0}dump(){return this[W].map(e=>Le(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[W]}set(e,t,s){if(s=s||this[ae],s&&typeof s!="number")throw new TypeError("maxAge must be a number");const o=s?Date.now():0,a=this[ue](t,e);if(this[k].has(e)){if(a>this[oe])return fe(this,this[k].get(e)),!1;const c=this[k].get(e).value;return this[te]&&(this[Nt]||this[te](e,c.value)),c.now=o,c.maxAge=s,c.value=t,this[ne]+=a-c.length,c.length=a,this.get(e),de(this),!0}const d=new rs(e,t,a,o,s);return d.length>this[oe]?(this[te]&&this[te](e,t),!1):(this[ne]+=d.length,this[W].unshift(d),this[k].set(e,this[W].head),de(this),!0)}has(e){if(!this[k].has(e))return!1;const t=this[k].get(e).value;return!Le(this,t)}get(e){return Me(this,e,!0)}peek(e){return Me(this,e,!1)}pop(){const e=this[W].tail;return e?(fe(this,e),e.value):null}del(e){fe(this,this[k].get(e))}load(e){this.reset();const t=Date.now();for(let s=e.length-1;s>=0;s--){const o=e[s],a=o.e||0;if(a===0)this.set(o.k,o.v);else{const d=a-t;d>0&&this.set(o.k,o.v,d)}}}prune(){this[k].forEach((e,t)=>Me(this,t,!1))}}const Me=(n,e,t)=>{const s=n[k].get(e);if(s){const o=s.value;if(Le(n,o)){if(fe(n,s),!n[ve])return}else t&&(n[Zt]&&(s.value.now=Date.now()),n[W].unshiftNode(s));return o.value}},Le=(n,e)=>{if(!e||!e.maxAge&&!n[ae])return!1;const t=Date.now()-e.now;return e.maxAge?t>e.maxAge:n[ae]&&t>n[ae]},de=n=>{if(n[ne]>n[oe])for(let e=n[W].tail;n[ne]>n[oe]&&e!==null;){const t=e.prev;fe(n,e),e=t}},fe=(n,e)=>{if(e){const t=e.value;n[te]&&n[te](t.key,t.value),n[ne]-=t.length,n[k].delete(t.key),n[W].removeNode(e)}};class rs{constructor(e,t,s,o,a){this.key=e,this.value=t,this.length=s,this.now=o,this.maxAge=a||0}}const Ot=(n,e,t,s)=>{let o=t.value;Le(n,o)&&(fe(n,t),n[ve]||(o=void 0)),o&&e.call(s,o.value,o.key,n)};var ss=ns,Ve,xt;function Z(){if(xt)return Ve;xt=1;class n{constructor(p,L){if(L=s(L),p instanceof n)return p.loose===!!L.loose&&p.includePrerelease===!!L.includePrerelease?p:new n(p.raw,L);if(p instanceof o)return this.raw=p.value,this.set=[[p]],this.format(),this;if(this.options=L,this.loose=!!L.loose,this.includePrerelease=!!L.includePrerelease,this.raw=p.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(R=>this.parseRange(R.trim())).filter(R=>R.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const R=this.set[0];if(this.set=this.set.filter(I=>!S(I[0])),this.set.length===0)this.set=[R];else if(this.set.length>1){for(const I of this.set)if(I.length===1&&z(I[0])){this.set=[I];break}}}this.format()}format(){return this.range=this.set.map(p=>p.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(p){const R=((this.options.includePrerelease&&_)|(this.options.loose&&y))+":"+p,I=t.get(R);if(I)return I;const g=this.options.loose,A=g?E[c.HYPHENRANGELOOSE]:E[c.HYPHENRANGE];p=p.replace(A,De(this.options.includePrerelease)),a("hyphen replace",p),p=p.replace(E[c.COMPARATORTRIM],u),a("comparator trim",p),p=p.replace(E[c.TILDETRIM],m),a("tilde trim",p),p=p.replace(E[c.CARETTRIM],$),a("caret trim",p);let x=p.split(" ").map(D=>J(D,this.options)).join(" ").split(/\s+/).map(D=>Pe(D,this.options));g&&(x=x.filter(D=>(a("loose invalid filter",D,this.options),!!D.match(E[c.COMPARATORLOOSE])))),a("range list",x);const N=new Map,P=x.map(D=>new o(D,this.options));for(const D of P){if(S(D))return[D];N.set(D.value,D)}N.size>1&&N.has("")&&N.delete("");const M=[...N.values()];return t.set(R,M),M}intersects(p,L){if(!(p instanceof n))throw new TypeError("a Range is required");return this.set.some(R=>H(R,L)&&p.set.some(I=>H(I,L)&&R.every(g=>I.every(A=>g.intersects(A,L)))))}test(p){if(!p)return!1;if(typeof p=="string")try{p=new d(p,this.options)}catch{return!1}for(let L=0;Lv.value==="<0.0.0-0",z=v=>v.value==="",H=(v,p)=>{let L=!0;const R=v.slice();let I=R.pop();for(;L&&R.length;)L=R.every(g=>I.intersects(g,p)),I=R.pop();return L},J=(v,p)=>(a("comp",v,p),v=Ce(v,p),a("caret",v),v=Q(v,p),a("tildes",v),v=B(v,p),a("xrange",v),v=_e(v,p),a("stars",v),v),G=v=>!v||v.toLowerCase()==="x"||v==="*",Q=(v,p)=>v.trim().split(/\s+/).map(L=>q(L,p)).join(" "),q=(v,p)=>{const L=p.loose?E[c.TILDELOOSE]:E[c.TILDE];return v.replace(L,(R,I,g,A,x)=>{a("tilde",v,R,I,g,A,x);let N;return G(I)?N="":G(g)?N=`>=${I}.0.0 <${+I+1}.0.0-0`:G(A)?N=`>=${I}.${g}.0 <${I}.${+g+1}.0-0`:x?(a("replaceTilde pr",x),N=`>=${I}.${g}.${A}-${x} <${I}.${+g+1}.0-0`):N=`>=${I}.${g}.${A} <${I}.${+g+1}.0-0`,a("tilde return",N),N})},Ce=(v,p)=>v.trim().split(/\s+/).map(L=>ge(L,p)).join(" "),ge=(v,p)=>{a("caret",v,p);const L=p.loose?E[c.CARETLOOSE]:E[c.CARET],R=p.includePrerelease?"-0":"";return v.replace(L,(I,g,A,x,N)=>{a("caret",v,I,g,A,x,N);let P;return G(g)?P="":G(A)?P=`>=${g}.0.0${R} <${+g+1}.0.0-0`:G(x)?g==="0"?P=`>=${g}.${A}.0${R} <${g}.${+A+1}.0-0`:P=`>=${g}.${A}.0${R} <${+g+1}.0.0-0`:N?(a("replaceCaret pr",N),g==="0"?A==="0"?P=`>=${g}.${A}.${x}-${N} <${g}.${A}.${+x+1}-0`:P=`>=${g}.${A}.${x}-${N} <${g}.${+A+1}.0-0`:P=`>=${g}.${A}.${x}-${N} <${+g+1}.0.0-0`):(a("no pr"),g==="0"?A==="0"?P=`>=${g}.${A}.${x}${R} <${g}.${A}.${+x+1}-0`:P=`>=${g}.${A}.${x}${R} <${g}.${+A+1}.0-0`:P=`>=${g}.${A}.${x} <${+g+1}.0.0-0`),a("caret return",P),P})},B=(v,p)=>(a("replaceXRanges",v,p),v.split(/\s+/).map(L=>we(L,p)).join(" ")),we=(v,p)=>{v=v.trim();const L=p.loose?E[c.XRANGELOOSE]:E[c.XRANGE];return v.replace(L,(R,I,g,A,x,N)=>{a("xRange",v,R,I,g,A,x,N);const P=G(g),M=P||G(A),D=M||G(x),re=D;return I==="="&&re&&(I=""),N=p.includePrerelease?"-0":"",P?I===">"||I==="<"?R="<0.0.0-0":R="*":I&&re?(M&&(A=0),x=0,I===">"?(I=">=",M?(g=+g+1,A=0,x=0):(A=+A+1,x=0)):I==="<="&&(I="<",M?g=+g+1:A=+A+1),I==="<"&&(N="-0"),R=`${I+g}.${A}.${x}${N}`):M?R=`>=${g}.0.0${N} <${+g+1}.0.0-0`:D&&(R=`>=${g}.${A}.0${N} <${g}.${+A+1}.0-0`),a("xRange return",R),R})},_e=(v,p)=>(a("replaceStars",v,p),v.trim().replace(E[c.STAR],"")),Pe=(v,p)=>(a("replaceGTE0",v,p),v.trim().replace(E[p.includePrerelease?c.GTE0PRE:c.GTE0],"")),De=v=>(p,L,R,I,g,A,x,N,P,M,D,re,tt)=>(G(R)?L="":G(I)?L=`>=${R}.0.0${v?"-0":""}`:G(g)?L=`>=${R}.${I}.0${v?"-0":""}`:A?L=`>=${L}`:L=`>=${L}${v?"-0":""}`,G(P)?N="":G(M)?N=`<${+P+1}.0.0-0`:G(D)?N=`<${P}.${+M+1}.0-0`:re?N=`<=${P}.${M}.${D}-${re}`:v?N=`<${P}.${M}.${+D+1}-0`:N=`<=${N}`,`${L} ${N}`.trim()),$e=(v,p,L)=>{for(let R=0;R0){const I=v[R].semver;if(I.major===p.major&&I.minor===p.minor&&I.patch===p.patch)return!0}return!1}return!0};return Ve}var He,bt;function xe(){if(bt)return He;bt=1;const n=Symbol("SemVer ANY");class e{static get ANY(){return n}constructor(m,$){if($=t($),m instanceof e){if(m.loose===!!$.loose)return m;m=m.value}m=m.trim().split(/\s+/).join(" "),d("comparator",m,$),this.options=$,this.loose=!!$.loose,this.parse(m),this.semver===n?this.value="":this.value=this.operator+this.semver.version,d("comp",this)}parse(m){const $=this.options.loose?s[o.COMPARATORLOOSE]:s[o.COMPARATOR],_=m.match($);if(!_)throw new TypeError(`Invalid comparator: ${m}`);this.operator=_[1]!==void 0?_[1]:"",this.operator==="="&&(this.operator=""),_[2]?this.semver=new E(_[2],this.options.loose):this.semver=n}toString(){return this.value}test(m){if(d("Comparator.test",m,this.options.loose),this.semver===n||m===n)return!0;if(typeof m=="string")try{m=new E(m,this.options)}catch{return!1}return a(m,this.operator,this.semver,this.options)}intersects(m,$){if(!(m instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(m.value,$).test(this.value):m.operator===""?m.value===""?!0:new c(this.value,$).test(m.semver):($=t($),$.includePrerelease&&(this.value==="<0.0.0-0"||m.value==="<0.0.0-0")||!$.includePrerelease&&(this.value.startsWith("<0.0.0")||m.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&m.operator.startsWith(">")||this.operator.startsWith("<")&&m.operator.startsWith("<")||this.semver.version===m.semver.version&&this.operator.includes("=")&&m.operator.includes("=")||a(this.semver,"<",m.semver,$)&&this.operator.startsWith(">")&&m.operator.startsWith("<")||a(this.semver,">",m.semver,$)&&this.operator.startsWith("<")&&m.operator.startsWith(">")))}}He=e;const t=ze,{safeRe:s,t:o}=Ee,a=Kt,d=Ne,E=X,c=Z();return He}const is=Z(),os=(n,e,t)=>{try{e=new is(e,t)}catch{return!1}return e.test(n)};var be=os;const as=Z(),ls=(n,e)=>new as(n,e).set.map(t=>t.map(s=>s.value).join(" ").trim().split(" "));var cs=ls;const hs=X,us=Z(),fs=(n,e,t)=>{let s=null,o=null,a=null;try{a=new us(e,t)}catch{return null}return n.forEach(d=>{a.test(d)&&(!s||o.compare(d)===-1)&&(s=d,o=new hs(s,t))}),s};var ps=fs;const ds=X,ms=Z(),vs=(n,e,t)=>{let s=null,o=null,a=null;try{a=new ms(e,t)}catch{return null}return n.forEach(d=>{a.test(d)&&(!s||o.compare(d)===1)&&(s=d,o=new ds(s,t))}),s};var Es=vs;const Ue=X,gs=Z(),Ct=Oe,ws=(n,e)=>{n=new gs(n,e);let t=new Ue("0.0.0");if(n.test(t)||(t=new Ue("0.0.0-0"),n.test(t)))return t;t=null;for(let s=0;s{const E=new Ue(d.semver.version);switch(d.operator){case">":E.prerelease.length===0?E.patch++:E.prerelease.push(0),E.raw=E.format();case"":case">=":(!a||Ct(E,a))&&(a=E);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${d.operator}`)}}),a&&(!t||Ct(t,a))&&(t=a)}return t&&n.test(t)?t:null};var $s=ws;const ys=Z(),Rs=(n,e)=>{try{return new ys(n,e).range||"*"}catch{return null}};var Is=Rs;const Ts=X,Jt=xe(),{ANY:Ss}=Jt,Ls=Z(),As=be,_t=Oe,Pt=ke,Ns=Ze,Os=Ke,xs=(n,e,t,s)=>{n=new Ts(n,s),e=new Ls(e,s);let o,a,d,E,c;switch(t){case">":o=_t,a=Ns,d=Pt,E=">",c=">=";break;case"<":o=Pt,a=Os,d=_t,E="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(As(n,e,s))return!1;for(let u=0;u{y.semver===Ss&&(y=new Jt(">=0.0.0")),$=$||y,_=_||y,o(y.semver,$.semver,s)?$=y:d(y.semver,_.semver,s)&&(_=y)}),$.operator===E||$.operator===c||(!_.operator||_.operator===E)&&a(n,_.semver))return!1;if(_.operator===c&&d(n,_.semver))return!1}return!0};var Je=xs;const bs=Je,Cs=(n,e,t)=>bs(n,e,">",t);var _s=Cs;const Ps=Je,Ds=(n,e,t)=>Ps(n,e,"<",t);var js=Ds;const Dt=Z(),Fs=(n,e,t)=>(n=new Dt(n,t),e=new Dt(e,t),n.intersects(e,t));var Gs=Fs;const Ws=be,Ms=K;var Vs=(n,e,t)=>{const s=[];let o=null,a=null;const d=n.sort((m,$)=>Ms(m,$,t));for(const m of d)Ws(m,e,t)?(a=m,o||(o=m)):(a&&s.push([o,a]),a=null,o=null);o&&s.push([o,null]);const E=[];for(const[m,$]of s)m===$?E.push(m):!$&&m===d[0]?E.push("*"):$?m===d[0]?E.push(`<=${$}`):E.push(`${m} - ${$}`):E.push(`>=${m}`);const c=E.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length{if(n===e)return!0;n=new jt(n,t),e=new jt(e,t);let s=!1;e:for(const o of n.set){for(const a of e.set){const d=Xs(o,a,t);if(s=s||d!==null,d)continue e}if(s)return!1}return!0},Us=[new Qe(">=0.0.0-0")],Ft=[new Qe(">=0.0.0")],Xs=(n,e,t)=>{if(n===e)return!0;if(n.length===1&&n[0].semver===Xe){if(e.length===1&&e[0].semver===Xe)return!0;t.includePrerelease?n=Us:n=Ft}if(e.length===1&&e[0].semver===Xe){if(t.includePrerelease)return!0;e=Ft}const s=new Set;let o,a;for(const y of n)y.operator===">"||y.operator===">="?o=Gt(o,y,t):y.operator==="<"||y.operator==="<="?a=Wt(a,y,t):s.add(y.semver);if(s.size>1)return null;let d;if(o&&a){if(d=et(o.semver,a.semver,t),d>0)return null;if(d===0&&(o.operator!==">="||a.operator!=="<="))return null}for(const y of s){if(o&&!me(y,String(o),t)||a&&!me(y,String(a),t))return null;for(const S of e)if(!me(y,String(S),t))return!1;return!0}let E,c,u,m,$=a&&!t.includePrerelease&&a.semver.prerelease.length?a.semver:!1,_=o&&!t.includePrerelease&&o.semver.prerelease.length?o.semver:!1;$&&$.prerelease.length===1&&a.operator==="<"&&$.prerelease[0]===0&&($=!1);for(const y of e){if(m=m||y.operator===">"||y.operator===">=",u=u||y.operator==="<"||y.operator==="<=",o){if(_&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===_.major&&y.semver.minor===_.minor&&y.semver.patch===_.patch&&(_=!1),y.operator===">"||y.operator===">="){if(E=Gt(o,y,t),E===y&&E!==o)return!1}else if(o.operator===">="&&!me(o.semver,String(y),t))return!1}if(a){if($&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===$.major&&y.semver.minor===$.minor&&y.semver.patch===$.patch&&($=!1),y.operator==="<"||y.operator==="<="){if(c=Wt(a,y,t),c===y&&c!==a)return!1}else if(a.operator==="<="&&!me(a.semver,String(y),t))return!1}if(!y.operator&&(a||o)&&d!==0)return!1}return!(o&&u&&!a&&d!==0||a&&m&&!o&&d!==0||_||$)},Gt=(n,e,t)=>{if(!n)return e;const s=et(n.semver,e.semver,t);return s>0?n:s<0||e.operator===">"&&n.operator===">="?e:n},Wt=(n,e,t)=>{if(!n)return e;const s=et(n.semver,e.semver,t);return s<0?n:s>0||e.operator==="<"&&n.operator==="<="?e:n};var Bs=Hs;const Be=Ee,Mt=Ae,qs=X,Vt=zt,zs=pe,Ys=zn,ks=Kn,Ks=Jn,Zs=er,Js=rr,Qs=or,ei=cr,ti=fr,ni=K,ri=vr,si=wr,ii=Ye,oi=Ir,ai=Lr,li=Oe,ci=ke,hi=Yt,ui=kt,fi=Ke,pi=Ze,di=Kt,mi=kr,vi=xe(),Ei=Z(),gi=be,wi=cs,$i=ps,yi=Es,Ri=$s,Ii=Is,Ti=Je,Si=_s,Li=js,Ai=Gs,Ni=Vs,Oi=Bs;var xi={parse:zs,valid:Ys,clean:ks,inc:Ks,diff:Zs,major:Js,minor:Qs,patch:ei,prerelease:ti,compare:ni,rcompare:ri,compareLoose:si,compareBuild:ii,sort:oi,rsort:ai,gt:li,lt:ci,eq:hi,neq:ui,gte:fi,lte:pi,cmp:di,coerce:mi,Comparator:vi,Range:Ei,satisfies:gi,toComparators:wi,maxSatisfying:$i,minSatisfying:yi,minVersion:Ri,validRange:Ii,outside:Ti,gtr:Si,ltr:Li,intersects:Ai,simplifyRange:Ni,subset:Oi,SemVer:qs,re:Be.re,src:Be.src,tokens:Be.t,SEMVER_SPEC_VERSION:Mt.SEMVER_SPEC_VERSION,RELEASE_TYPES:Mt.RELEASE_TYPES,compareIdentifiers:Vt.compareIdentifiers,rcompareIdentifiers:Vt.rcompareIdentifiers};const bi=Ut(xi);var Qt={exports:{}};(function(n){(function(){function e(r,i,h){return r.call.apply(r.bind,arguments)}function t(r,i,h){if(!r)throw Error();if(2=i.f?b():r.fonts.load(Ce(i.a),i.h).then(function(j){1<=j.length?T():setTimeout(C,25)},function(){b()})}C()}),f=null,w=new Promise(function(T,b){f=setTimeout(b,i.f)});Promise.race([w,l]).then(function(){f&&(clearTimeout(f),f=null),i.g(i.a)},function(){i.j(i.a)})};function x(r,i,h,l,f,w,T){this.v=r,this.B=i,this.c=h,this.a=l,this.s=T||"BESbswy",this.f={},this.w=f||3e3,this.u=w||null,this.m=this.j=this.h=this.g=null,this.g=new R(this.c,this.s),this.h=new R(this.c,this.s),this.j=new R(this.c,this.s),this.m=new R(this.c,this.s),r=new q(this.a.c+",serif",B(this.a)),r=g(r),this.g.a.style.cssText=r,r=new q(this.a.c+",sans-serif",B(this.a)),r=g(r),this.h.a.style.cssText=r,r=new q("serif",B(this.a)),r=g(r),this.j.a.style.cssText=r,r=new q("sans-serif",B(this.a)),r=g(r),this.m.a.style.cssText=r,I(this.g),I(this.h),I(this.j),I(this.m)}var N={D:"serif",C:"sans-serif"},P=null;function M(){if(P===null){var r=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);P=!!r&&(536>parseInt(r[1],10)||parseInt(r[1],10)===536&&11>=parseInt(r[2],10))}return P}x.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=o(),re(this)};function D(r,i,h){for(var l in N)if(N.hasOwnProperty(l)&&i===r.f[N[l]]&&h===r.f[N[l]])return!0;return!1}function re(r){var i=r.g.a.offsetWidth,h=r.h.a.offsetWidth,l;(l=i===r.f.serif&&h===r.f["sans-serif"])||(l=M()&&D(r,i,h)),l?o()-r.A>=r.w?M()&&D(r,i,h)&&(r.u===null||r.u.hasOwnProperty(r.a.c))?je(r,r.v):je(r,r.B):tt(r):je(r,r.v)}function tt(r){setTimeout(s(function(){re(this)},r),50)}function je(r,i){setTimeout(s(function(){u(this.g.a),u(this.h.a),u(this.j.a),u(this.m.a),i(this.a)},r),0)}function Fe(r,i,h){this.c=r,this.a=i,this.f=0,this.m=this.j=!1,this.s=h}var ye=null;Fe.prototype.g=function(r){var i=this.a;i.g&&m(i.f,[i.a.c("wf",r.c,B(r).toString(),"active")],[i.a.c("wf",r.c,B(r).toString(),"loading"),i.a.c("wf",r.c,B(r).toString(),"inactive")]),v(i,"fontactive",r),this.m=!0,nt(this)},Fe.prototype.h=function(r){var i=this.a;if(i.g){var h=$(i.f,i.a.c("wf",r.c,B(r).toString(),"active")),l=[],f=[i.a.c("wf",r.c,B(r).toString(),"loading")];h||l.push(i.a.c("wf",r.c,B(r).toString(),"inactive")),m(i.f,l,f)}v(i,"fontinactive",r),nt(this)};function nt(r){--r.f==0&&r.j&&(r.m?(r=r.a,r.g&&m(r.f,[r.a.c("wf","active")],[r.a.c("wf","loading"),r.a.c("wf","inactive")]),v(r,"active")):$e(r.a))}function rt(r){this.j=r,this.a=new p,this.h=0,this.f=this.g=!0}rt.prototype.load=function(r){this.c=new a(this.j,r.context||this.j),this.g=r.events!==!1,this.f=r.classes!==!1,tn(this,new Pe(this.c,r),r)};function en(r,i,h,l,f){var w=--r.h==0;(r.f||r.g)&&setTimeout(function(){var T=f||null,b=l||null||{};if(h.length===0&&w)$e(i.a);else{i.f+=h.length,w&&(i.j=w);var C,j=[];for(C=0;Cthis.createElement(o));t.replaceChildren(...s)}createElement(e){if(e.type=="separator"){const t=document.createElement("div");return t.classList.add("separator"),t}if(e.type=="selection"||e.type=="checkbox"||e.type=="dropdown"){const t=document.createElement("div"),s=document.createElement("div"),o=document.createElement("div");let a;if(e.type=="selection"||e.type=="checkbox"){const d=mn[e.id]??{label:e.id,combos:[],callback:()=>{}};a=document.createElement("div"),a.innerText=Xt.getKeybindString(e.id),a.classList.add("keybind","unselectable"),o.innerText=d.label;let E=d.disabled;typeof E=="function"&&(E=E(this.app)),E&&t.classList.add("disabled"),t.addEventListener("click",()=>{if(E)return;d.callback(this.app),t.closest(".menu-main").querySelector(".menubar-dropdown").replaceChildren()})}else a=document.createElement("img"),a.classList.add("icon"),a.src=vn.CHEVRON,a.style.transform="rotate(-90deg)",o.innerText=typeof e.title=="function"?e.title(this.app):e.title;if(s.appendChild(o),s.appendChild(a),t.appendChild(s),t.classList.add("menu-item"),s.classList.add("menu-item-title","menu-hover"),o.classList.add("title","unselectable"),e.type=="dropdown"){const d=document.createElement("div");t.appendChild(d),d.classList.add("menubar-dropdown"),e.options.map(E=>this.createElement(E)).forEach(E=>d.appendChild(E))}if(e.type=="checkbox"){let d=e.checked;typeof d=="function"&&(d=d(this.app)),d&&(o.innerText="✓ "+o.innerText)}return t}if(e.type=="menu"){const t=document.createElement("div"),s=document.createElement("div"),o=document.createElement("div");return t.appendChild(s),s.innerText=e.title,t.appendChild(o),s.classList.add("title","unselectable"),t.classList.add("menu-item","menu-main"),s.classList.add("menu-hover"),o.classList.add("menubar-dropdown","unselectable"),t.onmouseenter=()=>{o.replaceChildren(...e.options.map(a=>this.createElement(a)))},t.onmouseleave=()=>{o.replaceChildren()},t}return document.createElement("div")}}class Di{view;windows=[];app;constructor(e,t){this.app=e,this.view=t}unfocusAll(){for(const e of this.view.querySelectorAll(".focused"))e.classList.remove("focused")}getFocusedWindow(){for(const e of this.windows)if(e.windowElement.classList.contains("focused"))return e;return null}isBlocked(){return!this.windows.every(e=>!e.options.blocking)}openWindow(e){if(e.options.win_id){const t=this.getWindowById(e.options.win_id);if(t){t.focus();return}}e.addToManager(this),this.windows.push(e)}removeWindow(e){this.windows.splice(this.windows.indexOf(e),1)}getWindowById(e){for(const t of this.windows)if(t.options.win_id==e)return t}}class ji{renderer;ticker;stage;view;chartManager;windowManager;menubarManager;actionHistory;lastWidth=window.innerWidth;lastHeight=window.innerHeight;constructor(){if(En.setDefaultProps({duration:[200,100],theme:"sm"}),window.nw){const e=nw.Window.get();window.addEventListener("keydown",t=>{(t.key=="r"&&(t.metaKey||t.ctrlKey)||t.key=="F5")&&(t.preventDefault(),e.reload())}),this.checkAppVersion()}if(ie.loadOptions(),gn(),Xt.load(this),setInterval(()=>ie.saveOptions(),1e4),ie.general.smoothAnimations&&document.body.classList.add("animated"),this.registerFonts(),this.view=document.getElementById("pixi"),document.oncontextmenu=e=>{e.preventDefault(),this.chartManager.loadedChart&&e.target==this.view&&ut.open(this,e)},this.view.onmousedown=()=>{ut.close()},this.stage=new wn,this.stage.sortableChildren=!0,this.renderer=new $n({backgroundColor:1579292,antialias:ie.performance.antialiasing,width:this.view.clientWidth,height:this.view.clientHeight,resolution:ie.performance.resolution,autoDensity:!0,view:this.view,powerPreference:"low-power"}),setTimeout(()=>this.onResize(),1e3),this.ticker=new yn,this.ticker.maxFPS=120,this.ticker.add(()=>{const e=performance.now();this.renderer.render(this.stage),ft.instance?.addFrameTimeValue(performance.now()-e),performance.memory?.usedJSHeapSize&&ft.instance?.addMemoryTimeValue(performance.memory.usedJSHeapSize),bn()},Rn.LOW),this.ticker.start(),In.init(this.renderer),this.chartManager=new Tn(this),this.menubarManager=new Pi(this,document.getElementById("menubar")),this.windowManager=new Di(this,document.getElementById("windows")),this.actionHistory=new pt(this),this.registerListeners(),!V.hidePoweredByText&&Sn()){const e=document.getElementById("embed");e.appendChild(document.createTextNode("Powered by "));const t=document.createElement("a");if(t.href="https://tillvit.github.io/smeditor/",t.innerText="SMEditor",t.target="_blank",e.appendChild(t),V.url!=null){e.appendChild(document.createTextNode(" | Open this chart in a "));const s=document.createElement("a"),o=new URL(location.origin+"/smeditor/app/");s.innerText="new tab",s.target="_blank",o.searchParams.append("url",V.url),V.chartType!==null&&o.searchParams.append("chartType",V.chartType),V.chartIndex!==null&&o.searchParams.append("chartIndex",V.chartIndex+""),s.href=o.toString(),e.appendChild(s)}}dt.initFileSystem().then(()=>{if(V.url){this.chartManager.loadSM(V.url).then(()=>{const e=this.chartManager.loadedSM;if(!e)return;let t;if(V.chartType!=null&&(t=e.charts[V.chartType],t===void 0)){Et.createFormatted(`Couldn't find chart with type ${V.chartType}`,"warn");return}if(t===void 0){const o=Object.keys(e.charts);if(o.length==0||(t=e.charts[o[0]],t.length==0))return}let s;if(V.chartIndex!=null&&(s=t.at(V.chartIndex),s===void 0)){Et.createFormatted(`Couldn't find chart with index ${V.chartIndex}`,"warn");return}s===void 0&&(s=t.at(-1),!s)||this.chartManager.loadChart(s)});return}this.windowManager.openWindow(new Ln(this))}),window.onbeforeunload=e=>{if(pt.instance.isDirty()&&ie.general.warnBeforeExit)return e.preventDefault(),e.returnValue="Are you sure you want to exit?"},window.onunload=()=>{ie.saveOptions()}}registerFonts(){mt.from("Main",{fontFamily:"Assistant",fontSize:20,fill:"white"},{chars:[["a","z"],["A","Z"],"!@#$%^&*()~{}[]:.-?=,_","0123456789/"," "],resolution:window.devicePixelRatio}),mt.from("Fancy",{fontFamily:"Assistant",fontSize:40,fontWeight:"700",fill:["#dddddd","#ffffff"],fillGradientType:An.LINEAR_VERTICAL,stroke:11184810,strokeThickness:3},{chars:[["a","z"],["A","Z"],"!@#$%^&*()~{}[]:.-?=,_","0123456789/"," "],resolution:window.devicePixelRatio})}registerListeners(){window.addEventListener("keydown",function(e){e.code=="Tab"&&e.preventDefault(),e.code=="Enter"&&e.target instanceof HTMLButtonElement&&e.preventDefault()}),window.addEventListener("dragstart",function(e){e.target instanceof HTMLImageElement&&e.preventDefault()}),setInterval(()=>{(this.lastHeight!=window.innerHeight||this.lastWidth!=window.innerWidth)&&(this.lastHeight=window.innerHeight,this.lastWidth=window.innerWidth,this.onResize(),Nn.emit("resize"))},100),window.addEventListener("dragover",e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy"}),window.addEventListener("drop",e=>{if(window.nw){e.stopPropagation(),e.preventDefault();let t="";for(const s of e.dataTransfer.files)if(s.path)if(vt(s.path)==".ssc"){t=s.path;break}else t==""&&vt(s.path)==".sm"&&(t=s.path);t!=""&&(this.chartManager.loadSM(t),this.windowManager.getWindowById("select_sm_initial")?.closeWindow())}else dt.handleDropEvent(e).then(t=>{const s=new On(this,{title:"Select an sm/ssc file...",accepted_file_types:[".sm",".ssc"],disableClose:!0,callback:o=>{this.chartManager.loadSM(o),this.windowManager.getWindowById("select_sm_initial")?.closeWindow()},onload:()=>{s.getAcceptableFile(t??"").then(o=>s.selectPath(o))}});this.windowManager.openWindow(s)})})}onResize(){const e=window.innerWidth,t=window.innerHeight-document.getElementById("menubar").clientHeight;this.renderer.screen.width=e,this.renderer.screen.height=t,this.view.width=e*this.renderer.resolution,this.view.height=t*this.renderer.resolution,this.view.style.width=`${e}px`,this.view.style.height=`${t}px`}checkAppVersion(){if(!window.nw)return;const e=nw.require("nw.gui"),t={stable:3,beta:2,alpha:1,nightly:0};let s="win";navigator.userAgent.includes("Mac")?s="mac":navigator.userAgent.includes("Linux")&&(s="linux"),fetch("/smeditor/assets/app/versions.json").then(o=>o.json()).then(o=>{o=o.sort((d,E)=>t[d.type]!=t[E.type]?t[E.type]-t[d.type]:E.date-d.date);const a=o[0];bi.lt(e.App.manifest.version,a.version)&&localStorage.getItem("downloadedVersion")!==a.version&&xn.open(a.version,a.downloads[s])})}}document.querySelector("body").innerHTML=`
diff --git a/sw.js b/sw.js index 9d798ed0..350f161d 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -if(!self.define){let s,e={};const n=(n,l)=>(n=new URL(n+".js",l).href,e[n]||new Promise((e=>{if("document"in self){const s=document.createElement("script");s.src=n,s.onload=e,document.head.appendChild(s)}else s=n,importScripts(n),e()})).then((()=>{let s=e[n];if(!s)throw new Error(`Module ${n} didn’t register its module`);return s})));self.define=(l,i)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let a={};const u=s=>n(s,r),o={module:{uri:r},exports:a,require:u};e[r]=Promise.all(l.map((s=>o[s]||u(s)))).then((s=>(i(...s),a)))}}define(["./workbox-fa446783"],(function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"app.js",revision:"dfbc9ca8a0f4b742f23bb7b6e9c3c894"},{url:"app/index.html",revision:"bd739c0327a673f351e34c00930a7cbd"},{url:"assets/ChartManager-00dfcf8b.css",revision:null},{url:"assets/index-8a1528ec.css",revision:null},{url:"assets/index-8c6c3f75.css",revision:null},{url:"assets/index-a3dfc1ac.css",revision:null},{url:"assets/SafariFileWorker-557e53c3.js",revision:null},{url:"ChartManager-5a16a8de.js",revision:null},{url:"downloader-1bfef0dc.js",revision:null},{url:"embed.js",revision:"8477746d18262eb80568e305fc0bd4f3"},{url:"embed/index.html",revision:"3e4c0f5c81e05a2ad3152495ea0d55ea"},{url:"FileSystemWritableFileStream-e4c13ad9.js",revision:null},{url:"index.html",revision:"1017ad538ab1cfab7596f6a15a8a7b95"},{url:"memory-2718bf03.js",revision:null},{url:"NodeFileHandler-6e08cebf.js",revision:null},{url:"OggDec-2941c3fd.js",revision:null},{url:"registerSW.js",revision:"21684c117fd68cc7dc1643829ea87c07"},{url:"web-streams-ponyfill-4a0f4950.js",revision:null},{url:"assets/app/versions.json",revision:"4ba536c7c2aa91a3e28b6af8a0f19d9d"},{url:"assets/assist_tick-b8aada2a.ogg",revision:null},{url:"assets/av-05878b27.mp4",revision:null},{url:"assets/banner-fa29dd27.png",revision:null},{url:"assets/body-614d0188.png",revision:null},{url:"assets/decent-f3f8a110.png",revision:null},{url:"assets/embed-8c85cbda.png",revision:null},{url:"assets/eq-6befbaef.mp4",revision:null},{url:"assets/excellent-84718ac0.png",revision:null},{url:"assets/exportlua-6de45f3b.png",revision:null},{url:"assets/fantastic-1755e773.png",revision:null},{url:"assets/font/Assistant-Hebrew.woff2",revision:"e99c63e8dcd7799e8adf32df82b46376"},{url:"assets/font/Assistant-Latin.woff2",revision:"a416191c7641acf049f804b685235d3d"},{url:"assets/font/Assistant-LatinExt.woff2",revision:"2423d82cdbc6a34b99d5bbacf82623c7"},{url:"assets/frame-d599a2fe.png",revision:null},{url:"assets/git-67477794.png",revision:null},{url:"assets/great-0e864574.png",revision:null},{url:"assets/highpass-d9d7cfcb.svg",revision:null},{url:"assets/highshelf-11ccf64e.svg",revision:null},{url:"assets/hold_judgment-82934f15.png",revision:null},{url:"assets/hold-7b947e11.png",revision:null},{url:"assets/icon/favicon.ico",revision:"7bcbdd2344641a21b0f6f9393b491d65"},{url:"assets/icon/icon_512.png",revision:"1a4014fcbfaa08050ff38cabb8235165"},{url:"assets/icon/logo.png",revision:"3170c21a8539047fffea9eb4bd912d8e"},{url:"assets/icon/mac.icns",revision:"ac52a49fb658a942abeaa019bd05e9aa"},{url:"assets/judgmentITG-5390eacd.png",revision:null},{url:"assets/judgmentWaterfall-5bb3f994.png",revision:null},{url:"assets/lowpass-ff013247.svg",revision:null},{url:"assets/lowshelf-2b031328.svg",revision:null},{url:"assets/metronome_high-6fa54e52.ogg",revision:null},{url:"assets/metronome_low-4db4e760.ogg",revision:null},{url:"assets/mine-590d445e.png",revision:null},{url:"assets/mine-b65ce42d.ogg",revision:null},{url:"assets/mode-cac62e2a.png",revision:null},{url:"assets/mouse-ef7f3cf3.mp4",revision:null},{url:"assets/parts-0c8fa692.png",revision:null},{url:"assets/parts-9668caec.png",revision:null},{url:"assets/parts-b37af2cf.png",revision:null},{url:"assets/peaking-eec48769.svg",revision:null},{url:"assets/playtest-f34f5856.mp4",revision:null},{url:"assets/popup-b6da9784.mp4",revision:null},{url:"assets/pref-fdc09174.mp4",revision:null},{url:"assets/scrolls-a04758c8.mp4",revision:null},{url:"assets/timesig-9e28e1f2.png",revision:null},{url:"assets/way_off-8bc3fd65.png",revision:null},{url:"assets/white_fantastic-b65b4f11.png",revision:null},{url:"assets/icon/icon_512.png",revision:"1a4014fcbfaa08050ff38cabb8235165"},{url:"manifest.json",revision:"1d72161daa4e530e15d85baf4906bf4c"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html")))})); +if(!self.define){let s,e={};const n=(n,l)=>(n=new URL(n+".js",l).href,e[n]||new Promise((e=>{if("document"in self){const s=document.createElement("script");s.src=n,s.onload=e,document.head.appendChild(s)}else s=n,importScripts(n),e()})).then((()=>{let s=e[n];if(!s)throw new Error(`Module ${n} didn’t register its module`);return s})));self.define=(l,i)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let a={};const u=s=>n(s,r),o={module:{uri:r},exports:a,require:u};e[r]=Promise.all(l.map((s=>o[s]||u(s)))).then((s=>(i(...s),a)))}}define(["./workbox-fa446783"],(function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"app.js",revision:"7d160dcab5c0239a5bf7f364ad7a9400"},{url:"app/index.html",revision:"bd739c0327a673f351e34c00930a7cbd"},{url:"assets/ChartManager-00dfcf8b.css",revision:null},{url:"assets/index-8a1528ec.css",revision:null},{url:"assets/index-8c6c3f75.css",revision:null},{url:"assets/index-a3dfc1ac.css",revision:null},{url:"assets/SafariFileWorker-557e53c3.js",revision:null},{url:"ChartManager-5a16a8de.js",revision:null},{url:"downloader-1bfef0dc.js",revision:null},{url:"embed.js",revision:"8477746d18262eb80568e305fc0bd4f3"},{url:"embed/index.html",revision:"3e4c0f5c81e05a2ad3152495ea0d55ea"},{url:"FileSystemWritableFileStream-e4c13ad9.js",revision:null},{url:"index.html",revision:"1017ad538ab1cfab7596f6a15a8a7b95"},{url:"memory-2718bf03.js",revision:null},{url:"NodeFileHandler-6e08cebf.js",revision:null},{url:"OggDec-2941c3fd.js",revision:null},{url:"registerSW.js",revision:"21684c117fd68cc7dc1643829ea87c07"},{url:"web-streams-ponyfill-4a0f4950.js",revision:null},{url:"assets/app/versions.json",revision:"4ba536c7c2aa91a3e28b6af8a0f19d9d"},{url:"assets/assist_tick-b8aada2a.ogg",revision:null},{url:"assets/av-05878b27.mp4",revision:null},{url:"assets/banner-fa29dd27.png",revision:null},{url:"assets/body-614d0188.png",revision:null},{url:"assets/decent-f3f8a110.png",revision:null},{url:"assets/embed-8c85cbda.png",revision:null},{url:"assets/eq-6befbaef.mp4",revision:null},{url:"assets/excellent-84718ac0.png",revision:null},{url:"assets/exportlua-6de45f3b.png",revision:null},{url:"assets/fantastic-1755e773.png",revision:null},{url:"assets/font/Assistant-Hebrew.woff2",revision:"e99c63e8dcd7799e8adf32df82b46376"},{url:"assets/font/Assistant-Latin.woff2",revision:"a416191c7641acf049f804b685235d3d"},{url:"assets/font/Assistant-LatinExt.woff2",revision:"2423d82cdbc6a34b99d5bbacf82623c7"},{url:"assets/frame-d599a2fe.png",revision:null},{url:"assets/git-67477794.png",revision:null},{url:"assets/great-0e864574.png",revision:null},{url:"assets/highpass-d9d7cfcb.svg",revision:null},{url:"assets/highshelf-11ccf64e.svg",revision:null},{url:"assets/hold_judgment-82934f15.png",revision:null},{url:"assets/hold-7b947e11.png",revision:null},{url:"assets/icon/favicon.ico",revision:"7bcbdd2344641a21b0f6f9393b491d65"},{url:"assets/icon/icon_512.png",revision:"1a4014fcbfaa08050ff38cabb8235165"},{url:"assets/icon/logo.png",revision:"3170c21a8539047fffea9eb4bd912d8e"},{url:"assets/icon/mac.icns",revision:"ac52a49fb658a942abeaa019bd05e9aa"},{url:"assets/judgmentITG-5390eacd.png",revision:null},{url:"assets/judgmentWaterfall-5bb3f994.png",revision:null},{url:"assets/lowpass-ff013247.svg",revision:null},{url:"assets/lowshelf-2b031328.svg",revision:null},{url:"assets/metronome_high-6fa54e52.ogg",revision:null},{url:"assets/metronome_low-4db4e760.ogg",revision:null},{url:"assets/mine-590d445e.png",revision:null},{url:"assets/mine-b65ce42d.ogg",revision:null},{url:"assets/mode-cac62e2a.png",revision:null},{url:"assets/mouse-ef7f3cf3.mp4",revision:null},{url:"assets/parts-0c8fa692.png",revision:null},{url:"assets/parts-9668caec.png",revision:null},{url:"assets/parts-b37af2cf.png",revision:null},{url:"assets/peaking-eec48769.svg",revision:null},{url:"assets/playtest-f34f5856.mp4",revision:null},{url:"assets/popup-b6da9784.mp4",revision:null},{url:"assets/pref-fdc09174.mp4",revision:null},{url:"assets/scrolls-a04758c8.mp4",revision:null},{url:"assets/timesig-9e28e1f2.png",revision:null},{url:"assets/way_off-8bc3fd65.png",revision:null},{url:"assets/white_fantastic-b65b4f11.png",revision:null},{url:"assets/icon/icon_512.png",revision:"1a4014fcbfaa08050ff38cabb8235165"},{url:"manifest.json",revision:"1d72161daa4e530e15d85baf4906bf4c"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html")))}));