diff --git a/assets/index.9e177b53.js b/assets/index.c7b0e259.js similarity index 62% rename from assets/index.9e177b53.js rename to assets/index.c7b0e259.js index 31f3563..b8c16a1 100644 --- a/assets/index.9e177b53.js +++ b/assets/index.c7b0e259.js @@ -1,37 +1,37 @@ -var au=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var Pg=au((Ig,oi)=>{const ou=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const n of r)if(n.type==="childList")for(const a of n.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function e(r){const n={};return r.integrity&&(n.integrity=r.integrity),r.referrerpolicy&&(n.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?n.credentials="include":r.crossorigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function s(r){if(r.ep)return;r.ep=!0;const n=e(r);fetch(r.href,n)}};ou();/** +var au=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var Pg=au((Ig,oi)=>{const ou=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const a of r.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function e(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerpolicy&&(r.referrerPolicy=n.referrerpolicy),n.crossorigin==="use-credentials"?r.credentials="include":n.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(n){if(n.ep)return;n.ep=!0;const r=e(n);fetch(n.href,r)}};ou();/** * @vue/shared v3.5.11 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function _n(i){const t=Object.create(null);for(const e of i.split(","))t[e]=1;return e=>e in t}const Be={},Ds=[],Et=()=>{},lu=()=>!1,pr=i=>i.charCodeAt(0)===111&&i.charCodeAt(1)===110&&(i.charCodeAt(2)>122||i.charCodeAt(2)<97),Mn=i=>i.startsWith("onUpdate:"),Xe=Object.assign,On=(i,t)=>{const e=i.indexOf(t);e>-1&&i.splice(e,1)},cu=Object.prototype.hasOwnProperty,Oe=(i,t)=>cu.call(i,t),be=Array.isArray,Fs=i=>Li(i)==="[object Map]",dr=i=>Li(i)==="[object Set]",wa=i=>Li(i)==="[object Date]",Ee=i=>typeof i=="function",We=i=>typeof i=="string",Nt=i=>typeof i=="symbol",je=i=>i!==null&&typeof i=="object",Ho=i=>(je(i)||Ee(i))&&Ee(i.then)&&Ee(i.catch),Go=Object.prototype.toString,Li=i=>Go.call(i),uu=i=>Li(i).slice(8,-1),Wo=i=>Li(i)==="[object Object]",Dn=i=>We(i)&&i!=="NaN"&&i[0]!=="-"&&""+parseInt(i,10)===i,li=_n(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),mr=i=>{const t=Object.create(null);return e=>t[e]||(t[e]=i(e))},hu=/-(\w)/g,xt=mr(i=>i.replace(hu,(t,e)=>e?e.toUpperCase():"")),fu=/\B([A-Z])/g,ws=mr(i=>i.replace(fu,"-$1").toLowerCase()),yr=mr(i=>i.charAt(0).toUpperCase()+i.slice(1)),Rr=mr(i=>i?`on${yr(i)}`:""),ls=(i,t)=>!Object.is(i,t),Wi=(i,...t)=>{for(let e=0;e{Object.defineProperty(i,t,{configurable:!0,enumerable:!1,writable:s,value:e})},cn=i=>{const t=parseFloat(i);return isNaN(t)?i:t};let Ca;const Fn=()=>Ca||(Ca=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});function Bn(i){if(be(i)){const t={};for(let e=0;e{if(e){const s=e.split(du);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function bi(i){let t="";if(We(i))t=i;else if(be(i))for(let e=0;egr(e,t))}const Jo=i=>!!(i&&i.__v_isRef===!0),Ns=i=>We(i)?i:i==null?"":be(i)||je(i)&&(i.toString===Go||!Ee(i.toString))?Jo(i)?Ns(i.value):JSON.stringify(i,Xo,2):String(i),Xo=(i,t)=>Jo(t)?Xo(i,t.value):Fs(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[s,r],n)=>(e[$r(s,n)+" =>"]=r,e),{})}:dr(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>$r(e))}:Nt(t)?$r(t):je(t)&&!be(t)&&!Wo(t)?String(t):t,$r=(i,t="")=>{var e;return Nt(i)?`Symbol(${(e=i.description)!=null?e:t})`:i};/** +**//*! #__NO_SIDE_EFFECTS__ */function _r(i){const t=Object.create(null);for(const e of i.split(","))t[e]=1;return e=>e in t}const Re={},Ds=[],Et=()=>{},lu=()=>!1,dn=i=>i.charCodeAt(0)===111&&i.charCodeAt(1)===110&&(i.charCodeAt(2)>122||i.charCodeAt(2)<97),Mr=i=>i.startsWith("onUpdate:"),Xe=Object.assign,Or=(i,t)=>{const e=i.indexOf(t);e>-1&&i.splice(e,1)},cu=Object.prototype.hasOwnProperty,Oe=(i,t)=>cu.call(i,t),be=Array.isArray,Fs=i=>Li(i)==="[object Map]",mn=i=>Li(i)==="[object Set]",wa=i=>Li(i)==="[object Date]",Ee=i=>typeof i=="function",We=i=>typeof i=="string",Nt=i=>typeof i=="symbol",je=i=>i!==null&&typeof i=="object",Ho=i=>(je(i)||Ee(i))&&Ee(i.then)&&Ee(i.catch),Go=Object.prototype.toString,Li=i=>Go.call(i),uu=i=>Li(i).slice(8,-1),Wo=i=>Li(i)==="[object Object]",Dr=i=>We(i)&&i!=="NaN"&&i[0]!=="-"&&""+parseInt(i,10)===i,li=_r(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),yn=i=>{const t=Object.create(null);return e=>t[e]||(t[e]=i(e))},hu=/-(\w)/g,xt=yn(i=>i.replace(hu,(t,e)=>e?e.toUpperCase():"")),fu=/\B([A-Z])/g,ws=yn(i=>i.replace(fu,"-$1").toLowerCase()),gn=yn(i=>i.charAt(0).toUpperCase()+i.slice(1)),$n=yn(i=>i?`on${gn(i)}`:""),ls=(i,t)=>!Object.is(i,t),Wi=(i,...t)=>{for(let e=0;e{Object.defineProperty(i,t,{configurable:!0,enumerable:!1,writable:s,value:e})},cr=i=>{const t=parseFloat(i);return isNaN(t)?i:t};let Ca;const Fr=()=>Ca||(Ca=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});function Br(i){if(be(i)){const t={};for(let e=0;e{if(e){const s=e.split(du);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function bi(i){let t="";if(We(i))t=i;else if(be(i))for(let e=0;eTn(e,t))}const Jo=i=>!!(i&&i.__v_isRef===!0),Ns=i=>We(i)?i:i==null?"":be(i)||je(i)&&(i.toString===Go||!Ee(i.toString))?Jo(i)?Ns(i.value):JSON.stringify(i,Xo,2):String(i),Xo=(i,t)=>Jo(t)?Xo(i,t.value):Fs(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[s,n],r)=>(e[jn(s,r)+" =>"]=n,e),{})}:mn(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>jn(e))}:Nt(t)?jn(t):je(t)&&!be(t)&&!Wo(t)?String(t):t,jn=(i,t="")=>{var e;return Nt(i)?`Symbol(${(e=i.description)!=null?e:t})`:i};/** * @vue/reactivity v3.5.11 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let pt;class xu{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=pt,!t&&pt&&(this.index=(pt.scopes||(pt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,e;if(this.scopes)for(t=0,e=this.scopes.length;t0)return;if(ui){let t=ui;for(ui=void 0;t;){const e=t.next;t.next=void 0,t.flags&=-9,t=e}}let i;for(;ci;){let t=ci;for(ci=void 0;t;){const e=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){i||(i=s)}t=e}}if(i)throw i}function el(i){for(let t=i.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function tl(i){let t,e=i.depsTail,s=e;for(;s;){const r=s.prevDep;s.version===-1?(s===e&&(e=r),jn(s),Pu(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}i.deps=t,i.depsTail=e}function un(i){for(let t=i.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(sl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!i._dirty}function sl(i){if(i.flags&4&&!(i.flags&16)||(i.flags&=-17,i.globalVersion===xi))return;i.globalVersion=xi;const t=i.dep;if(i.flags|=2,t.version>0&&!i.isSSR&&i.deps&&!un(i)){i.flags&=-3;return}const e=$e,s=At;$e=i,At=!0;try{el(i);const r=i.fn(i._value);(t.version===0||ls(r,i._value))&&(i._value=r,t.version++)}catch(r){throw t.version++,r}finally{$e=e,At=s,tl(i),i.flags&=-3}}function jn(i,t=!1){const{dep:e,prevSub:s,nextSub:r}=i;if(s&&(s.nextSub=r,i.prevSub=void 0),r&&(r.prevSub=s,i.nextSub=void 0),e.subs===i&&(e.subs=s),!e.subs&&e.computed){e.computed.flags&=-5;for(let n=e.computed.deps;n;n=n.nextDep)jn(n,!0)}!t&&!--e.sc&&e.map&&e.map.delete(e.key)}function Pu(i){const{prevDep:t,nextDep:e}=i;t&&(t.nextDep=e,i.prevDep=void 0),e&&(e.prevDep=t,i.nextDep=void 0)}let At=!0;const il=[];function cs(){il.push(At),At=!1}function us(){const i=il.pop();At=i===void 0?!0:i}function ka(i){const{cleanup:t}=i;if(i.cleanup=void 0,t){const e=$e;$e=void 0;try{t()}finally{$e=e}}}let xi=0;class Eu{constructor(t,e){this.sub=t,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Un{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(t){if(!$e||!At||$e===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==$e)e=this.activeLink=new Eu($e,this),$e.deps?(e.prevDep=$e.depsTail,$e.depsTail.nextDep=e,$e.depsTail=e):$e.deps=$e.depsTail=e,rl(e);else if(e.version===-1&&(e.version=this.version,e.nextDep)){const s=e.nextDep;s.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=s),e.prevDep=$e.depsTail,e.nextDep=void 0,$e.depsTail.nextDep=e,$e.depsTail=e,$e.deps===e&&($e.deps=s)}return e}trigger(t){this.version++,xi++,this.notify(t)}notify(t){Rn();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{$n()}}}function rl(i){if(i.dep.sc++,i.sub.flags&4){const t=i.dep.computed;if(t&&!i.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)rl(s)}const e=i.dep.subs;e!==i&&(i.prevSub=e,e&&(e.nextSub=i)),i.dep.subs=i}}const hn=new WeakMap,xs=Symbol(""),fn=Symbol(""),Si=Symbol("");function st(i,t,e){if(At&&$e){let s=hn.get(i);s||hn.set(i,s=new Map);let r=s.get(e);r||(s.set(e,r=new Un),r.map=s,r.key=e),r.track()}}function qt(i,t,e,s,r,n){const a=hn.get(i);if(!a){xi++;return}const o=l=>{l&&l.trigger()};if(Rn(),t==="clear")a.forEach(o);else{const l=be(i),h=l&&Dn(e);if(l&&e==="length"){const u=Number(s);a.forEach((d,c)=>{(c==="length"||c===Si||!Nt(c)&&c>=u)&&o(d)})}else switch(e!==void 0&&o(a.get(e)),h&&o(a.get(Si)),t){case"add":l?h&&o(a.get("length")):(o(a.get(xs)),Fs(i)&&o(a.get(fn)));break;case"delete":l||(o(a.get(xs)),Fs(i)&&o(a.get(fn)));break;case"set":Fs(i)&&o(a.get(xs));break}}$n()}function vs(i){const t=De(i);return t===i?t:(st(t,"iterate",Si),bt(i)?t:t.map(Qe))}function Tr(i){return st(i=De(i),"iterate",Si),i}const Au={__proto__:null,[Symbol.iterator](){return Ur(this,Symbol.iterator,Qe)},concat(...i){return vs(this).concat(...i.map(t=>be(t)?vs(t):t))},entries(){return Ur(this,"entries",i=>(i[1]=Qe(i[1]),i))},every(i,t){return Ot(this,"every",i,t,void 0,arguments)},filter(i,t){return Ot(this,"filter",i,t,e=>e.map(Qe),arguments)},find(i,t){return Ot(this,"find",i,t,Qe,arguments)},findIndex(i,t){return Ot(this,"findIndex",i,t,void 0,arguments)},findLast(i,t){return Ot(this,"findLast",i,t,Qe,arguments)},findLastIndex(i,t){return Ot(this,"findLastIndex",i,t,void 0,arguments)},forEach(i,t){return Ot(this,"forEach",i,t,void 0,arguments)},includes(...i){return Vr(this,"includes",i)},indexOf(...i){return Vr(this,"indexOf",i)},join(i){return vs(this).join(i)},lastIndexOf(...i){return Vr(this,"lastIndexOf",i)},map(i,t){return Ot(this,"map",i,t,void 0,arguments)},pop(){return qs(this,"pop")},push(...i){return qs(this,"push",i)},reduce(i,...t){return va(this,"reduce",i,t)},reduceRight(i,...t){return va(this,"reduceRight",i,t)},shift(){return qs(this,"shift")},some(i,t){return Ot(this,"some",i,t,void 0,arguments)},splice(...i){return qs(this,"splice",i)},toReversed(){return vs(this).toReversed()},toSorted(i){return vs(this).toSorted(i)},toSpliced(...i){return vs(this).toSpliced(...i)},unshift(...i){return qs(this,"unshift",i)},values(){return Ur(this,"values",Qe)}};function Ur(i,t,e){const s=Tr(i),r=s[t]();return s!==i&&!bt(i)&&(r._next=r.next,r.next=()=>{const n=r._next();return n.value&&(n.value=e(n.value)),n}),r}const wu=Array.prototype;function Ot(i,t,e,s,r,n){const a=Tr(i),o=a!==i&&!bt(i),l=a[t];if(l!==wu[t]){const d=l.apply(i,n);return o?Qe(d):d}let h=e;a!==i&&(o?h=function(d,c){return e.call(this,Qe(d),c,i)}:e.length>2&&(h=function(d,c){return e.call(this,d,c,i)}));const u=l.call(a,h,s);return o&&r?r(u):u}function va(i,t,e,s){const r=Tr(i);let n=e;return r!==i&&(bt(i)?e.length>3&&(n=function(a,o,l){return e.call(this,a,o,l,i)}):n=function(a,o,l){return e.call(this,a,Qe(o),l,i)}),r[t](n,...s)}function Vr(i,t,e){const s=De(i);st(s,"iterate",Si);const r=s[t](...e);return(r===-1||r===!1)&&Wn(e[0])?(e[0]=De(e[0]),s[t](...e)):r}function qs(i,t,e=[]){cs(),Rn();const s=De(i)[t].apply(i,e);return $n(),us(),s}const Cu=_n("__proto__,__v_isRef,__isVue"),nl=new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(Nt));function ku(i){Nt(i)||(i=String(i));const t=De(this);return st(t,"has",i),t.hasOwnProperty(i)}class al{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,s){const r=this._isReadonly,n=this._isShallow;if(e==="__v_isReactive")return!r;if(e==="__v_isReadonly")return r;if(e==="__v_isShallow")return n;if(e==="__v_raw")return s===(r?n?ju:ul:n?cl:ll).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const a=be(t);if(!r){let l;if(a&&(l=Au[e]))return l;if(e==="hasOwnProperty")return ku}const o=Reflect.get(t,e,tt(t)?t:s);return(Nt(e)?nl.has(e):Cu(e))||(r||st(t,"get",e),n)?o:tt(o)?a&&Dn(e)?o:o.value:je(o)?r?hl(o):xr(o):o}}class ol extends al{constructor(t=!1){super(!1,t)}set(t,e,s,r){let n=t[e];if(!this._isShallow){const l=Es(n);if(!bt(s)&&!Es(s)&&(n=De(n),s=De(s)),!be(t)&&tt(n)&&!tt(s))return l?!1:(n.value=s,!0)}const a=be(t)&&Dn(e)?Number(e)i,br=i=>Reflect.getPrototypeOf(i);function Di(i,t,e=!1,s=!1){i=i.__v_raw;const r=De(i),n=De(t);e||(ls(t,n)&&st(r,"get",t),st(r,"get",n));const{has:a}=br(r),o=s?Vn:e?Kn:Qe;if(a.call(r,t))return o(i.get(t));if(a.call(r,n))return o(i.get(n));i!==r&&i.get(t)}function Fi(i,t=!1){const e=this.__v_raw,s=De(e),r=De(i);return t||(ls(i,r)&&st(s,"has",i),st(s,"has",r)),i===r?e.has(i):e.has(i)||e.has(r)}function Bi(i,t=!1){return i=i.__v_raw,!t&&st(De(i),"iterate",xs),Reflect.get(i,"size",i)}function La(i,t=!1){!t&&!bt(i)&&!Es(i)&&(i=De(i));const e=De(this);return br(e).has.call(e,i)||(e.add(i),qt(e,"add",i,i)),this}function Ia(i,t,e=!1){!e&&!bt(t)&&!Es(t)&&(t=De(t));const s=De(this),{has:r,get:n}=br(s);let a=r.call(s,i);a||(i=De(i),a=r.call(s,i));const o=n.call(s,i);return s.set(i,t),a?ls(t,o)&&qt(s,"set",i,t):qt(s,"add",i,t),this}function Na(i){const t=De(this),{has:e,get:s}=br(t);let r=e.call(t,i);r||(i=De(i),r=e.call(t,i)),s&&s.call(t,i);const n=t.delete(i);return r&&qt(t,"delete",i,void 0),n}function _a(){const i=De(this),t=i.size!==0,e=i.clear();return t&&qt(i,"clear",void 0,void 0),e}function Ri(i,t){return function(s,r){const n=this,a=n.__v_raw,o=De(a),l=t?Vn:i?Kn:Qe;return!i&&st(o,"iterate",xs),a.forEach((h,u)=>s.call(r,l(h),l(u),n))}}function $i(i,t,e){return function(...s){const r=this.__v_raw,n=De(r),a=Fs(n),o=i==="entries"||i===Symbol.iterator&&a,l=i==="keys"&&a,h=r[i](...s),u=e?Vn:t?Kn:Qe;return!t&&st(n,"iterate",l?fn:xs),{next(){const{value:d,done:c}=h.next();return c?{value:d,done:c}:{value:o?[u(d[0]),u(d[1])]:u(d),done:c}},[Symbol.iterator](){return this}}}}function Zt(i){return function(...t){return i==="delete"?!1:i==="clear"?void 0:this}}function _u(){const i={get(n){return Di(this,n)},get size(){return Bi(this)},has:Fi,add:La,set:Ia,delete:Na,clear:_a,forEach:Ri(!1,!1)},t={get(n){return Di(this,n,!1,!0)},get size(){return Bi(this)},has:Fi,add(n){return La.call(this,n,!0)},set(n,a){return Ia.call(this,n,a,!0)},delete:Na,clear:_a,forEach:Ri(!1,!0)},e={get(n){return Di(this,n,!0)},get size(){return Bi(this,!0)},has(n){return Fi.call(this,n,!0)},add:Zt("add"),set:Zt("set"),delete:Zt("delete"),clear:Zt("clear"),forEach:Ri(!0,!1)},s={get(n){return Di(this,n,!0,!0)},get size(){return Bi(this,!0)},has(n){return Fi.call(this,n,!0)},add:Zt("add"),set:Zt("set"),delete:Zt("delete"),clear:Zt("clear"),forEach:Ri(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(n=>{i[n]=$i(n,!1,!1),e[n]=$i(n,!0,!1),t[n]=$i(n,!1,!0),s[n]=$i(n,!0,!0)}),[i,e,t,s]}const[Mu,Ou,Du,Fu]=_u();function Hn(i,t){const e=t?i?Fu:Du:i?Ou:Mu;return(s,r,n)=>r==="__v_isReactive"?!i:r==="__v_isReadonly"?i:r==="__v_raw"?s:Reflect.get(Oe(e,r)&&r in s?e:s,r,n)}const Bu={get:Hn(!1,!1)},Ru={get:Hn(!1,!0)},$u={get:Hn(!0,!1)},ll=new WeakMap,cl=new WeakMap,ul=new WeakMap,ju=new WeakMap;function Uu(i){switch(i){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Vu(i){return i.__v_skip||!Object.isExtensible(i)?0:Uu(uu(i))}function xr(i){return Es(i)?i:Gn(i,!1,Lu,Bu,ll)}function Hu(i){return Gn(i,!1,Nu,Ru,cl)}function hl(i){return Gn(i,!0,Iu,$u,ul)}function Gn(i,t,e,s,r){if(!je(i)||i.__v_raw&&!(t&&i.__v_isReactive))return i;const n=r.get(i);if(n)return n;const a=Vu(i);if(a===0)return i;const o=new Proxy(i,a===2?s:e);return r.set(i,o),o}function Bs(i){return Es(i)?Bs(i.__v_raw):!!(i&&i.__v_isReactive)}function Es(i){return!!(i&&i.__v_isReadonly)}function bt(i){return!!(i&&i.__v_isShallow)}function Wn(i){return i?!!i.__v_raw:!1}function De(i){const t=i&&i.__v_raw;return t?De(t):i}function Gu(i){return!Oe(i,"__v_skip")&&Object.isExtensible(i)&&Ko(i,"__v_skip",!0),i}const Qe=i=>je(i)?xr(i):i,Kn=i=>je(i)?hl(i):i;function tt(i){return i?i.__v_isRef===!0:!1}function gs(i){return Wu(i,!1)}function Wu(i,t){return tt(i)?i:new Ku(i,t)}class Ku{constructor(t,e){this.dep=new Un,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:De(t),this._value=e?t:Qe(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){const e=this._rawValue,s=this.__v_isShallow||bt(t)||Es(t);t=s?t:De(t),ls(t,e)&&(this._rawValue=t,this._value=s?t:Qe(t),this.dep.trigger())}}function Ki(i){return tt(i)?i.value:i}const qu={get:(i,t,e)=>t==="__v_raw"?i:Ki(Reflect.get(i,t,e)),set:(i,t,e,s)=>{const r=i[t];return tt(r)&&!tt(e)?(r.value=e,!0):Reflect.set(i,t,e,s)}};function fl(i){return Bs(i)?i:new Proxy(i,qu)}class zu{constructor(t,e,s){this.fn=t,this.setter=e,this._value=void 0,this.dep=new Un(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=xi-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!e,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&$e!==this)return Qo(this,!0),!0}get value(){const t=this.dep.track();return sl(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Ju(i,t,e=!1){let s,r;return Ee(i)?s=i:(s=i.get,r=i.set),new zu(s,r,e)}const ji={},tr=new WeakMap;let Ts;function Xu(i,t=!1,e=Ts){if(e){let s=tr.get(e);s||tr.set(e,s=[]),s.push(i)}}function Yu(i,t,e=Be){const{immediate:s,deep:r,once:n,scheduler:a,augmentJob:o,call:l}=e,h=O=>r?O:bt(O)||r===!1||r===0?jt(O,1):jt(O);let u,d,c,f,p=!1,m=!1;if(tt(i)?(d=()=>i.value,p=bt(i)):Bs(i)?(d=()=>h(i),p=!0):be(i)?(m=!0,p=i.some(O=>Bs(O)||bt(O)),d=()=>i.map(O=>{if(tt(O))return O.value;if(Bs(O))return h(O);if(Ee(O))return l?l(O,2):O()})):Ee(i)?t?d=l?()=>l(i,2):i:d=()=>{if(c){cs();try{c()}finally{us()}}const O=Ts;Ts=u;try{return l?l(i,3,[f]):i(f)}finally{Ts=O}}:d=Et,t&&r){const O=d,S=r===!0?1/0:r;d=()=>jt(O(),S)}const b=Su(),P=()=>{u.stop(),b&&On(b.effects,u)};if(n&&t){const O=t;t=(...S)=>{O(...S),P()}}let A=m?new Array(i.length).fill(ji):ji;const U=O=>{if(!(!(u.flags&1)||!u.dirty&&!O))if(t){const S=u.run();if(r||p||(m?S.some((W,fe)=>ls(W,A[fe])):ls(S,A))){c&&c();const W=Ts;Ts=u;try{const fe=[S,A===ji?void 0:m&&A[0]===ji?[]:A,f];l?l(t,3,fe):t(...fe),A=S}finally{Ts=W}}}else u.run()};return o&&o(U),u=new Yo(d),u.scheduler=a?()=>a(U,!1):U,f=O=>Xu(O,!1,u),c=u.onStop=()=>{const O=tr.get(u);if(O){if(l)l(O,4);else for(const S of O)S();tr.delete(u)}},t?s?U(!0):A=u.run():a?a(U.bind(null,!0),!0):u.run(),P.pause=u.pause.bind(u),P.resume=u.resume.bind(u),P.stop=P,P}function jt(i,t=1/0,e){if(t<=0||!je(i)||i.__v_skip||(e=e||new Set,e.has(i)))return i;if(e.add(i),t--,tt(i))jt(i.value,t,e);else if(be(i))for(let s=0;s{jt(s,t,e)});else if(Wo(i)){for(const s in i)jt(i[s],t,e);for(const s of Object.getOwnPropertySymbols(i))Object.prototype.propertyIsEnumerable.call(i,s)&&jt(i[s],t,e)}return i}/** +**/let pt;class xu{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=pt,!t&&pt&&(this.index=(pt.scopes||(pt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,e;if(this.scopes)for(t=0,e=this.scopes.length;t0)return;if(ui){let t=ui;for(ui=void 0;t;){const e=t.next;t.next=void 0,t.flags&=-9,t=e}}let i;for(;ci;){let t=ci;for(ci=void 0;t;){const e=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){i||(i=s)}t=e}}if(i)throw i}function el(i){for(let t=i.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function tl(i){let t,e=i.depsTail,s=e;for(;s;){const n=s.prevDep;s.version===-1?(s===e&&(e=n),jr(s),Pu(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=n}i.deps=t,i.depsTail=e}function ur(i){for(let t=i.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(sl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!i._dirty}function sl(i){if(i.flags&4&&!(i.flags&16)||(i.flags&=-17,i.globalVersion===xi))return;i.globalVersion=xi;const t=i.dep;if(i.flags|=2,t.version>0&&!i.isSSR&&i.deps&&!ur(i)){i.flags&=-3;return}const e=$e,s=At;$e=i,At=!0;try{el(i);const n=i.fn(i._value);(t.version===0||ls(n,i._value))&&(i._value=n,t.version++)}catch(n){throw t.version++,n}finally{$e=e,At=s,tl(i),i.flags&=-3}}function jr(i,t=!1){const{dep:e,prevSub:s,nextSub:n}=i;if(s&&(s.nextSub=n,i.prevSub=void 0),n&&(n.prevSub=s,i.nextSub=void 0),e.subs===i&&(e.subs=s),!e.subs&&e.computed){e.computed.flags&=-5;for(let r=e.computed.deps;r;r=r.nextDep)jr(r,!0)}!t&&!--e.sc&&e.map&&e.map.delete(e.key)}function Pu(i){const{prevDep:t,nextDep:e}=i;t&&(t.nextDep=e,i.prevDep=void 0),e&&(e.prevDep=t,i.nextDep=void 0)}let At=!0;const il=[];function cs(){il.push(At),At=!1}function us(){const i=il.pop();At=i===void 0?!0:i}function ka(i){const{cleanup:t}=i;if(i.cleanup=void 0,t){const e=$e;$e=void 0;try{t()}finally{$e=e}}}let xi=0;class Eu{constructor(t,e){this.sub=t,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ur{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(t){if(!$e||!At||$e===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==$e)e=this.activeLink=new Eu($e,this),$e.deps?(e.prevDep=$e.depsTail,$e.depsTail.nextDep=e,$e.depsTail=e):$e.deps=$e.depsTail=e,nl(e);else if(e.version===-1&&(e.version=this.version,e.nextDep)){const s=e.nextDep;s.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=s),e.prevDep=$e.depsTail,e.nextDep=void 0,$e.depsTail.nextDep=e,$e.depsTail=e,$e.deps===e&&($e.deps=s)}return e}trigger(t){this.version++,xi++,this.notify(t)}notify(t){Rr();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{$r()}}}function nl(i){if(i.dep.sc++,i.sub.flags&4){const t=i.dep.computed;if(t&&!i.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)nl(s)}const e=i.dep.subs;e!==i&&(i.prevSub=e,e&&(e.nextSub=i)),i.dep.subs=i}}const hr=new WeakMap,xs=Symbol(""),fr=Symbol(""),Si=Symbol("");function st(i,t,e){if(At&&$e){let s=hr.get(i);s||hr.set(i,s=new Map);let n=s.get(e);n||(s.set(e,n=new Ur),n.map=s,n.key=e),n.track()}}function qt(i,t,e,s,n,r){const a=hr.get(i);if(!a){xi++;return}const o=l=>{l&&l.trigger()};if(Rr(),t==="clear")a.forEach(o);else{const l=be(i),h=l&&Dr(e);if(l&&e==="length"){const u=Number(s);a.forEach((d,c)=>{(c==="length"||c===Si||!Nt(c)&&c>=u)&&o(d)})}else switch(e!==void 0&&o(a.get(e)),h&&o(a.get(Si)),t){case"add":l?h&&o(a.get("length")):(o(a.get(xs)),Fs(i)&&o(a.get(fr)));break;case"delete":l||(o(a.get(xs)),Fs(i)&&o(a.get(fr)));break;case"set":Fs(i)&&o(a.get(xs));break}}$r()}function vs(i){const t=De(i);return t===i?t:(st(t,"iterate",Si),bt(i)?t:t.map(Qe))}function bn(i){return st(i=De(i),"iterate",Si),i}const Au={__proto__:null,[Symbol.iterator](){return Vn(this,Symbol.iterator,Qe)},concat(...i){return vs(this).concat(...i.map(t=>be(t)?vs(t):t))},entries(){return Vn(this,"entries",i=>(i[1]=Qe(i[1]),i))},every(i,t){return Ot(this,"every",i,t,void 0,arguments)},filter(i,t){return Ot(this,"filter",i,t,e=>e.map(Qe),arguments)},find(i,t){return Ot(this,"find",i,t,Qe,arguments)},findIndex(i,t){return Ot(this,"findIndex",i,t,void 0,arguments)},findLast(i,t){return Ot(this,"findLast",i,t,Qe,arguments)},findLastIndex(i,t){return Ot(this,"findLastIndex",i,t,void 0,arguments)},forEach(i,t){return Ot(this,"forEach",i,t,void 0,arguments)},includes(...i){return Hn(this,"includes",i)},indexOf(...i){return Hn(this,"indexOf",i)},join(i){return vs(this).join(i)},lastIndexOf(...i){return Hn(this,"lastIndexOf",i)},map(i,t){return Ot(this,"map",i,t,void 0,arguments)},pop(){return qs(this,"pop")},push(...i){return qs(this,"push",i)},reduce(i,...t){return va(this,"reduce",i,t)},reduceRight(i,...t){return va(this,"reduceRight",i,t)},shift(){return qs(this,"shift")},some(i,t){return Ot(this,"some",i,t,void 0,arguments)},splice(...i){return qs(this,"splice",i)},toReversed(){return vs(this).toReversed()},toSorted(i){return vs(this).toSorted(i)},toSpliced(...i){return vs(this).toSpliced(...i)},unshift(...i){return qs(this,"unshift",i)},values(){return Vn(this,"values",Qe)}};function Vn(i,t,e){const s=bn(i),n=s[t]();return s!==i&&!bt(i)&&(n._next=n.next,n.next=()=>{const r=n._next();return r.value&&(r.value=e(r.value)),r}),n}const wu=Array.prototype;function Ot(i,t,e,s,n,r){const a=bn(i),o=a!==i&&!bt(i),l=a[t];if(l!==wu[t]){const d=l.apply(i,r);return o?Qe(d):d}let h=e;a!==i&&(o?h=function(d,c){return e.call(this,Qe(d),c,i)}:e.length>2&&(h=function(d,c){return e.call(this,d,c,i)}));const u=l.call(a,h,s);return o&&n?n(u):u}function va(i,t,e,s){const n=bn(i);let r=e;return n!==i&&(bt(i)?e.length>3&&(r=function(a,o,l){return e.call(this,a,o,l,i)}):r=function(a,o,l){return e.call(this,a,Qe(o),l,i)}),n[t](r,...s)}function Hn(i,t,e){const s=De(i);st(s,"iterate",Si);const n=s[t](...e);return(n===-1||n===!1)&&Wr(e[0])?(e[0]=De(e[0]),s[t](...e)):n}function qs(i,t,e=[]){cs(),Rr();const s=De(i)[t].apply(i,e);return $r(),us(),s}const Cu=_r("__proto__,__v_isRef,__isVue"),rl=new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(Nt));function ku(i){Nt(i)||(i=String(i));const t=De(this);return st(t,"has",i),t.hasOwnProperty(i)}class al{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,s){const n=this._isReadonly,r=this._isShallow;if(e==="__v_isReactive")return!n;if(e==="__v_isReadonly")return n;if(e==="__v_isShallow")return r;if(e==="__v_raw")return s===(n?r?ju:ul:r?cl:ll).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const a=be(t);if(!n){let l;if(a&&(l=Au[e]))return l;if(e==="hasOwnProperty")return ku}const o=Reflect.get(t,e,tt(t)?t:s);return(Nt(e)?rl.has(e):Cu(e))||(n||st(t,"get",e),r)?o:tt(o)?a&&Dr(e)?o:o.value:je(o)?n?hl(o):Sn(o):o}}class ol extends al{constructor(t=!1){super(!1,t)}set(t,e,s,n){let r=t[e];if(!this._isShallow){const l=Es(r);if(!bt(s)&&!Es(s)&&(r=De(r),s=De(s)),!be(t)&&tt(r)&&!tt(s))return l?!1:(r.value=s,!0)}const a=be(t)&&Dr(e)?Number(e)i,xn=i=>Reflect.getPrototypeOf(i);function Di(i,t,e=!1,s=!1){i=i.__v_raw;const n=De(i),r=De(t);e||(ls(t,r)&&st(n,"get",t),st(n,"get",r));const{has:a}=xn(n),o=s?Vr:e?Kr:Qe;if(a.call(n,t))return o(i.get(t));if(a.call(n,r))return o(i.get(r));i!==n&&i.get(t)}function Fi(i,t=!1){const e=this.__v_raw,s=De(e),n=De(i);return t||(ls(i,n)&&st(s,"has",i),st(s,"has",n)),i===n?e.has(i):e.has(i)||e.has(n)}function Bi(i,t=!1){return i=i.__v_raw,!t&&st(De(i),"iterate",xs),Reflect.get(i,"size",i)}function La(i,t=!1){!t&&!bt(i)&&!Es(i)&&(i=De(i));const e=De(this);return xn(e).has.call(e,i)||(e.add(i),qt(e,"add",i,i)),this}function Ia(i,t,e=!1){!e&&!bt(t)&&!Es(t)&&(t=De(t));const s=De(this),{has:n,get:r}=xn(s);let a=n.call(s,i);a||(i=De(i),a=n.call(s,i));const o=r.call(s,i);return s.set(i,t),a?ls(t,o)&&qt(s,"set",i,t):qt(s,"add",i,t),this}function Na(i){const t=De(this),{has:e,get:s}=xn(t);let n=e.call(t,i);n||(i=De(i),n=e.call(t,i)),s&&s.call(t,i);const r=t.delete(i);return n&&qt(t,"delete",i,void 0),r}function _a(){const i=De(this),t=i.size!==0,e=i.clear();return t&&qt(i,"clear",void 0,void 0),e}function Ri(i,t){return function(s,n){const r=this,a=r.__v_raw,o=De(a),l=t?Vr:i?Kr:Qe;return!i&&st(o,"iterate",xs),a.forEach((h,u)=>s.call(n,l(h),l(u),r))}}function $i(i,t,e){return function(...s){const n=this.__v_raw,r=De(n),a=Fs(r),o=i==="entries"||i===Symbol.iterator&&a,l=i==="keys"&&a,h=n[i](...s),u=e?Vr:t?Kr:Qe;return!t&&st(r,"iterate",l?fr:xs),{next(){const{value:d,done:c}=h.next();return c?{value:d,done:c}:{value:o?[u(d[0]),u(d[1])]:u(d),done:c}},[Symbol.iterator](){return this}}}}function Zt(i){return function(...t){return i==="delete"?!1:i==="clear"?void 0:this}}function _u(){const i={get(r){return Di(this,r)},get size(){return Bi(this)},has:Fi,add:La,set:Ia,delete:Na,clear:_a,forEach:Ri(!1,!1)},t={get(r){return Di(this,r,!1,!0)},get size(){return Bi(this)},has:Fi,add(r){return La.call(this,r,!0)},set(r,a){return Ia.call(this,r,a,!0)},delete:Na,clear:_a,forEach:Ri(!1,!0)},e={get(r){return Di(this,r,!0)},get size(){return Bi(this,!0)},has(r){return Fi.call(this,r,!0)},add:Zt("add"),set:Zt("set"),delete:Zt("delete"),clear:Zt("clear"),forEach:Ri(!0,!1)},s={get(r){return Di(this,r,!0,!0)},get size(){return Bi(this,!0)},has(r){return Fi.call(this,r,!0)},add:Zt("add"),set:Zt("set"),delete:Zt("delete"),clear:Zt("clear"),forEach:Ri(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(r=>{i[r]=$i(r,!1,!1),e[r]=$i(r,!0,!1),t[r]=$i(r,!1,!0),s[r]=$i(r,!0,!0)}),[i,e,t,s]}const[Mu,Ou,Du,Fu]=_u();function Hr(i,t){const e=t?i?Fu:Du:i?Ou:Mu;return(s,n,r)=>n==="__v_isReactive"?!i:n==="__v_isReadonly"?i:n==="__v_raw"?s:Reflect.get(Oe(e,n)&&n in s?e:s,n,r)}const Bu={get:Hr(!1,!1)},Ru={get:Hr(!1,!0)},$u={get:Hr(!0,!1)},ll=new WeakMap,cl=new WeakMap,ul=new WeakMap,ju=new WeakMap;function Uu(i){switch(i){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Vu(i){return i.__v_skip||!Object.isExtensible(i)?0:Uu(uu(i))}function Sn(i){return Es(i)?i:Gr(i,!1,Lu,Bu,ll)}function Hu(i){return Gr(i,!1,Nu,Ru,cl)}function hl(i){return Gr(i,!0,Iu,$u,ul)}function Gr(i,t,e,s,n){if(!je(i)||i.__v_raw&&!(t&&i.__v_isReactive))return i;const r=n.get(i);if(r)return r;const a=Vu(i);if(a===0)return i;const o=new Proxy(i,a===2?s:e);return n.set(i,o),o}function Bs(i){return Es(i)?Bs(i.__v_raw):!!(i&&i.__v_isReactive)}function Es(i){return!!(i&&i.__v_isReadonly)}function bt(i){return!!(i&&i.__v_isShallow)}function Wr(i){return i?!!i.__v_raw:!1}function De(i){const t=i&&i.__v_raw;return t?De(t):i}function Gu(i){return!Oe(i,"__v_skip")&&Object.isExtensible(i)&&Ko(i,"__v_skip",!0),i}const Qe=i=>je(i)?Sn(i):i,Kr=i=>je(i)?hl(i):i;function tt(i){return i?i.__v_isRef===!0:!1}function gs(i){return Wu(i,!1)}function Wu(i,t){return tt(i)?i:new Ku(i,t)}class Ku{constructor(t,e){this.dep=new Ur,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:De(t),this._value=e?t:Qe(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){const e=this._rawValue,s=this.__v_isShallow||bt(t)||Es(t);t=s?t:De(t),ls(t,e)&&(this._rawValue=t,this._value=s?t:Qe(t),this.dep.trigger())}}function Ki(i){return tt(i)?i.value:i}const qu={get:(i,t,e)=>t==="__v_raw"?i:Ki(Reflect.get(i,t,e)),set:(i,t,e,s)=>{const n=i[t];return tt(n)&&!tt(e)?(n.value=e,!0):Reflect.set(i,t,e,s)}};function fl(i){return Bs(i)?i:new Proxy(i,qu)}class zu{constructor(t,e,s){this.fn=t,this.setter=e,this._value=void 0,this.dep=new Ur(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=xi-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!e,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&$e!==this)return Qo(this,!0),!0}get value(){const t=this.dep.track();return sl(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Ju(i,t,e=!1){let s,n;return Ee(i)?s=i:(s=i.get,n=i.set),new zu(s,n,e)}const ji={},tn=new WeakMap;let Ts;function Xu(i,t=!1,e=Ts){if(e){let s=tn.get(e);s||tn.set(e,s=[]),s.push(i)}}function Yu(i,t,e=Re){const{immediate:s,deep:n,once:r,scheduler:a,augmentJob:o,call:l}=e,h=O=>n?O:bt(O)||n===!1||n===0?jt(O,1):jt(O);let u,d,c,f,p=!1,m=!1;if(tt(i)?(d=()=>i.value,p=bt(i)):Bs(i)?(d=()=>h(i),p=!0):be(i)?(m=!0,p=i.some(O=>Bs(O)||bt(O)),d=()=>i.map(O=>{if(tt(O))return O.value;if(Bs(O))return h(O);if(Ee(O))return l?l(O,2):O()})):Ee(i)?t?d=l?()=>l(i,2):i:d=()=>{if(c){cs();try{c()}finally{us()}}const O=Ts;Ts=u;try{return l?l(i,3,[f]):i(f)}finally{Ts=O}}:d=Et,t&&n){const O=d,S=n===!0?1/0:n;d=()=>jt(O(),S)}const b=Su(),P=()=>{u.stop(),b&&Or(b.effects,u)};if(r&&t){const O=t;t=(...S)=>{O(...S),P()}}let A=m?new Array(i.length).fill(ji):ji;const U=O=>{if(!(!(u.flags&1)||!u.dirty&&!O))if(t){const S=u.run();if(n||p||(m?S.some((W,fe)=>ls(W,A[fe])):ls(S,A))){c&&c();const W=Ts;Ts=u;try{const fe=[S,A===ji?void 0:m&&A[0]===ji?[]:A,f];l?l(t,3,fe):t(...fe),A=S}finally{Ts=W}}}else u.run()};return o&&o(U),u=new Yo(d),u.scheduler=a?()=>a(U,!1):U,f=O=>Xu(O,!1,u),c=u.onStop=()=>{const O=tn.get(u);if(O){if(l)l(O,4);else for(const S of O)S();tn.delete(u)}},t?s?U(!0):A=u.run():a?a(U.bind(null,!0),!0):u.run(),P.pause=u.pause.bind(u),P.resume=u.resume.bind(u),P.stop=P,P}function jt(i,t=1/0,e){if(t<=0||!je(i)||i.__v_skip||(e=e||new Set,e.has(i)))return i;if(e.add(i),t--,tt(i))jt(i.value,t,e);else if(be(i))for(let s=0;s{jt(s,t,e)});else if(Wo(i)){for(const s in i)jt(i[s],t,e);for(const s of Object.getOwnPropertySymbols(i))Object.prototype.propertyIsEnumerable.call(i,s)&&jt(i[s],t,e)}return i}/** * @vue/runtime-core v3.5.11 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function Ii(i,t,e,s){try{return s?i(...s):i()}catch(r){Sr(r,t,e)}}function _t(i,t,e,s){if(Ee(i)){const r=Ii(i,t,e,s);return r&&Ho(r)&&r.catch(n=>{Sr(n,t,e)}),r}if(be(i)){const r=[];for(let n=0;n>>1,r=at[s],n=Pi(r);n=Pi(e)?at.push(i):at.splice(eh(t),0,i),i.flags|=1,dl()}}function dl(){sr||(sr=pl.then(yl))}function th(i){be(i)?Rs.push(...i):is&&i.id===-1?is.splice(_s+1,0,i):i.flags&1||(Rs.push(i),i.flags|=1),dl()}function Ma(i,t,e=Lt+1){for(;ePi(e)-Pi(s));if(Rs.length=0,is){is.push(...t);return}for(is=t,_s=0;_si.id==null?i.flags&2?-1:1/0:i.id;function yl(i){const t=Et;try{for(Lt=0;Lt{s._d&&Va(-1);const n=ir(t);let a;try{a=i(...r)}finally{ir(n),s._d&&Va(1)}return a};return s._n=!0,s._c=!0,s._d=!0,s}function zs(i,t){if(mt===null)return i;const e=Cr(mt),s=i.dirs||(i.dirs=[]);for(let r=0;ri.__isTeleport;function zn(i,t){i.shapeFlag&6&&i.component?(i.transition=t,zn(i.component.subTree,t)):i.shapeFlag&128?(i.ssContent.transition=t.clone(i.ssContent),i.ssFallback.transition=t.clone(i.ssFallback)):i.transition=t}/*! #__NO_SIDE_EFFECTS__ */function nh(i,t){return Ee(i)?(()=>Xe({name:i.name},t,{setup:i}))():i}function Tl(i){i.ids=[i.ids[0]+i.ids[2]+++"-",0,0]}function pn(i,t,e,s,r=!1){if(be(i)){i.forEach((p,m)=>pn(p,t&&(be(t)?t[m]:t),e,s,r));return}if(hi(s)&&!r)return;const n=s.shapeFlag&4?Cr(s.component):s.el,a=r?null:n,{i:o,r:l}=i,h=t&&t.r,u=o.refs===Be?o.refs={}:o.refs,d=o.setupState,c=De(d),f=d===Be?()=>!1:p=>Oe(c,p);if(h!=null&&h!==l&&(We(h)?(u[h]=null,f(h)&&(d[h]=null)):tt(h)&&(h.value=null)),Ee(l))Ii(l,o,12,[a,u]);else{const p=We(l),m=tt(l);if(p||m){const b=()=>{if(i.f){const P=p?f(l)?d[l]:u[l]:l.value;r?be(P)&&On(P,n):be(P)?P.includes(n)||P.push(n):p?(u[l]=[n],f(l)&&(d[l]=u[l])):(l.value=[n],i.k&&(u[i.k]=l.value))}else p?(u[l]=a,f(l)&&(d[l]=a)):m&&(l.value=a,i.k&&(u[i.k]=a))};a?(b.id=-1,ft(b,e)):b()}}}const hi=i=>!!i.type.__asyncLoader,bl=i=>i.type.__isKeepAlive;function ah(i,t){xl(i,"a",t)}function oh(i,t){xl(i,"da",t)}function xl(i,t,e=et){const s=i.__wdc||(i.__wdc=()=>{let r=e;for(;r;){if(r.isDeactivated)return;r=r.parent}return i()});if(Pr(t,s,e),e){let r=e.parent;for(;r&&r.parent;)bl(r.parent.vnode)&&lh(s,t,e,r),r=r.parent}}function lh(i,t,e,s){const r=Pr(t,i,s,!0);Sl(()=>{On(s[t],r)},e)}function Pr(i,t,e=et,s=!1){if(e){const r=e[i]||(e[i]=[]),n=t.__weh||(t.__weh=(...a)=>{cs();const o=Ni(e),l=_t(t,e,i,a);return o(),us(),l});return s?r.unshift(n):r.push(n),n}}const Xt=i=>(t,e=et)=>{(!wr||i==="sp")&&Pr(i,(...s)=>t(...s),e)},ch=Xt("bm"),uh=Xt("m"),hh=Xt("bu"),fh=Xt("u"),ph=Xt("bum"),Sl=Xt("um"),dh=Xt("sp"),mh=Xt("rtg"),yh=Xt("rtc");function gh(i,t=et){Pr("ec",i,t)}const Pl="components";function Th(i,t){return xh(Pl,i,!0,t)||i}const bh=Symbol.for("v-ndc");function xh(i,t,e=!0,s=!1){const r=mt||et;if(r){const n=r.type;if(i===Pl){const o=hf(n,!1);if(o&&(o===t||o===xt(t)||o===yr(xt(t))))return n}const a=Oa(r[i]||n[i],t)||Oa(r.appContext[i],t);return!a&&s?n:a}}function Oa(i,t){return i&&(i[t]||i[xt(t)]||i[yr(xt(t))])}function Hr(i,t,e,s){let r;const n=e&&e[s],a=be(i);if(a||We(i)){const o=a&&Bs(i);let l=!1;o&&(l=!bt(i),i=Tr(i)),r=new Array(i.length);for(let h=0,u=i.length;ht(o,l,void 0,n&&n[l]));else{const o=Object.keys(i);r=new Array(o.length);for(let l=0,h=o.length;li?Vl(i)?Cr(i):dn(i.parent):null,fi=Xe(Object.create(null),{$:i=>i,$el:i=>i.vnode.el,$data:i=>i.data,$props:i=>i.props,$attrs:i=>i.attrs,$slots:i=>i.slots,$refs:i=>i.refs,$parent:i=>dn(i.parent),$root:i=>dn(i.root),$host:i=>i.ce,$emit:i=>i.emit,$options:i=>Jn(i),$forceUpdate:i=>i.f||(i.f=()=>{qn(i.update)}),$nextTick:i=>i.n||(i.n=Qu.bind(i.proxy)),$watch:i=>Hh.bind(i)}),Gr=(i,t)=>i!==Be&&!i.__isScriptSetup&&Oe(i,t),Sh={get({_:i},t){if(t==="__v_skip")return!0;const{ctx:e,setupState:s,data:r,props:n,accessCache:a,type:o,appContext:l}=i;let h;if(t[0]!=="$"){const f=a[t];if(f!==void 0)switch(f){case 1:return s[t];case 2:return r[t];case 4:return e[t];case 3:return n[t]}else{if(Gr(s,t))return a[t]=1,s[t];if(r!==Be&&Oe(r,t))return a[t]=2,r[t];if((h=i.propsOptions[0])&&Oe(h,t))return a[t]=3,n[t];if(e!==Be&&Oe(e,t))return a[t]=4,e[t];mn&&(a[t]=0)}}const u=fi[t];let d,c;if(u)return t==="$attrs"&&st(i.attrs,"get",""),u(i);if((d=o.__cssModules)&&(d=d[t]))return d;if(e!==Be&&Oe(e,t))return a[t]=4,e[t];if(c=l.config.globalProperties,Oe(c,t))return c[t]},set({_:i},t,e){const{data:s,setupState:r,ctx:n}=i;return Gr(r,t)?(r[t]=e,!0):s!==Be&&Oe(s,t)?(s[t]=e,!0):Oe(i.props,t)||t[0]==="$"&&t.slice(1)in i?!1:(n[t]=e,!0)},has({_:{data:i,setupState:t,accessCache:e,ctx:s,appContext:r,propsOptions:n}},a){let o;return!!e[a]||i!==Be&&Oe(i,a)||Gr(t,a)||(o=n[0])&&Oe(o,a)||Oe(s,a)||Oe(fi,a)||Oe(r.config.globalProperties,a)},defineProperty(i,t,e){return e.get!=null?i._.accessCache[t]=0:Oe(e,"value")&&this.set(i,t,e.value,null),Reflect.defineProperty(i,t,e)}};function Da(i){return be(i)?i.reduce((t,e)=>(t[e]=null,t),{}):i}let mn=!0;function Ph(i){const t=Jn(i),e=i.proxy,s=i.ctx;mn=!1,t.beforeCreate&&Fa(t.beforeCreate,i,"bc");const{data:r,computed:n,methods:a,watch:o,provide:l,inject:h,created:u,beforeMount:d,mounted:c,beforeUpdate:f,updated:p,activated:m,deactivated:b,beforeDestroy:P,beforeUnmount:A,destroyed:U,unmounted:O,render:S,renderTracked:W,renderTriggered:fe,errorCaptured:g,serverPrefetch:se,expose:ie,inheritAttrs:T,components:k,directives:Y,filters:z}=t;if(h&&Eh(h,s,null),a)for(const x in a){const C=a[x];Ee(C)&&(s[x]=C.bind(e))}if(r){const x=r.call(e,e);je(x)&&(i.data=xr(x))}if(mn=!0,n)for(const x in n){const C=n[x],R=Ee(C)?C.bind(e,e):Ee(C.get)?C.get.bind(e,e):Et,re=!Ee(C)&&Ee(C.set)?C.set.bind(e):Et,M=Ht({get:R,set:re});Object.defineProperty(s,x,{enumerable:!0,configurable:!0,get:()=>M.value,set:F=>M.value=F})}if(o)for(const x in o)El(o[x],s,e,x);if(l){const x=Ee(l)?l.call(e):l;Reflect.ownKeys(x).forEach(C=>{Lh(C,x[C])})}u&&Fa(u,i,"c");function L(x,C){be(C)?C.forEach(R=>x(R.bind(e))):C&&x(C.bind(e))}if(L(ch,d),L(uh,c),L(hh,f),L(fh,p),L(ah,m),L(oh,b),L(gh,g),L(yh,W),L(mh,fe),L(ph,A),L(Sl,O),L(dh,se),be(ie))if(ie.length){const x=i.exposed||(i.exposed={});ie.forEach(C=>{Object.defineProperty(x,C,{get:()=>e[C],set:R=>e[C]=R})})}else i.exposed||(i.exposed={});S&&i.render===Et&&(i.render=S),T!=null&&(i.inheritAttrs=T),k&&(i.components=k),Y&&(i.directives=Y),se&&Tl(i)}function Eh(i,t,e=Et){be(i)&&(i=yn(i));for(const s in i){const r=i[s];let n;je(r)?"default"in r?n=qi(r.from||s,r.default,!0):n=qi(r.from||s):n=qi(r),tt(n)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>n.value,set:a=>n.value=a}):t[s]=n}}function Fa(i,t,e){_t(be(i)?i.map(s=>s.bind(t.proxy)):i.bind(t.proxy),t,e)}function El(i,t,e,s){let r=s.includes(".")?Bl(e,s):()=>e[s];if(We(i)){const n=t[i];Ee(n)&&pi(r,n)}else if(Ee(i))pi(r,i.bind(e));else if(je(i))if(be(i))i.forEach(n=>El(n,t,e,s));else{const n=Ee(i.handler)?i.handler.bind(e):t[i.handler];Ee(n)&&pi(r,n,i)}}function Jn(i){const t=i.type,{mixins:e,extends:s}=t,{mixins:r,optionsCache:n,config:{optionMergeStrategies:a}}=i.appContext,o=n.get(t);let l;return o?l=o:!r.length&&!e&&!s?l=t:(l={},r.length&&r.forEach(h=>rr(l,h,a,!0)),rr(l,t,a)),je(t)&&n.set(t,l),l}function rr(i,t,e,s=!1){const{mixins:r,extends:n}=t;n&&rr(i,n,e,!0),r&&r.forEach(a=>rr(i,a,e,!0));for(const a in t)if(!(s&&a==="expose")){const o=Ah[a]||e&&e[a];i[a]=o?o(i[a],t[a]):t[a]}return i}const Ah={data:Ba,props:Ra,emits:Ra,methods:ii,computed:ii,beforeCreate:nt,created:nt,beforeMount:nt,mounted:nt,beforeUpdate:nt,updated:nt,beforeDestroy:nt,beforeUnmount:nt,destroyed:nt,unmounted:nt,activated:nt,deactivated:nt,errorCaptured:nt,serverPrefetch:nt,components:ii,directives:ii,watch:Ch,provide:Ba,inject:wh};function Ba(i,t){return t?i?function(){return Xe(Ee(i)?i.call(this,this):i,Ee(t)?t.call(this,this):t)}:t:i}function wh(i,t){return ii(yn(i),yn(t))}function yn(i){if(be(i)){const t={};for(let e=0;e1)return e&&Ee(t)?t.call(s&&s.proxy):t}}const wl={},Cl=()=>Object.create(wl),kl=i=>Object.getPrototypeOf(i)===wl;function Ih(i,t,e,s=!1){const r={},n=Cl();i.propsDefaults=Object.create(null),vl(i,t,r,n);for(const a in i.propsOptions[0])a in r||(r[a]=void 0);e?i.props=s?r:Hu(r):i.type.props?i.props=r:i.props=n,i.attrs=n}function Nh(i,t,e,s){const{props:r,attrs:n,vnode:{patchFlag:a}}=i,o=De(r),[l]=i.propsOptions;let h=!1;if((s||a>0)&&!(a&16)){if(a&8){const u=i.vnode.dynamicProps;for(let d=0;d{l=!0;const[c,f]=Ll(d,t,!0);Xe(a,c),f&&o.push(...f)};!e&&t.mixins.length&&t.mixins.forEach(u),i.extends&&u(i.extends),i.mixins&&i.mixins.forEach(u)}if(!n&&!l)return je(i)&&s.set(i,Ds),Ds;if(be(n))for(let u=0;ui[0]==="_"||i==="$stable",Xn=i=>be(i)?i.map(It):[It(i)],Mh=(i,t,e)=>{if(t._n)return t;const s=sh((...r)=>Xn(t(...r)),e);return s._c=!1,s},Nl=(i,t,e)=>{const s=i._ctx;for(const r in i){if(Il(r))continue;const n=i[r];if(Ee(n))t[r]=Mh(r,n,s);else if(n!=null){const a=Xn(n);t[r]=()=>a}}},_l=(i,t)=>{const e=Xn(t);i.slots.default=()=>e},Ml=(i,t,e)=>{for(const s in t)(e||s!=="_")&&(i[s]=t[s])},Oh=(i,t,e)=>{const s=i.slots=Cl();if(i.vnode.shapeFlag&32){const r=t._;r?(Ml(s,t,e),e&&Ko(s,"_",r,!0)):Nl(t,s)}else t&&_l(i,t)},Dh=(i,t,e)=>{const{vnode:s,slots:r}=i;let n=!0,a=Be;if(s.shapeFlag&32){const o=t._;o?e&&o===1?n=!1:Ml(r,t,e):(n=!t.$stable,Nl(t,r)),a=t}else t&&(_l(i,t),a={default:1});if(n)for(const o in r)!Il(o)&&a[o]==null&&delete r[o]};function Fh(){typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__!="boolean"&&(Fn().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!1)}const ft=Xh;function Bh(i){return Rh(i)}function Rh(i,t){Fh();const e=Fn();e.__VUE__=!0;const{insert:s,remove:r,patchProp:n,createElement:a,createText:o,createComment:l,setText:h,setElementText:u,parentNode:d,nextSibling:c,setScopeId:f=Et,insertStaticContent:p}=i,m=(E,I,_,B=null,$=null,q=null,H=void 0,te=null,X=!!I.dynamicChildren)=>{if(E===I)return;E&&!Js(E,I)&&(B=Z(E),F(E,$,q,!0),E=null),I.patchFlag===-2&&(X=!1,I.dynamicChildren=null);const{type:G,ref:ye,shapeFlag:ae}=I;switch(G){case Ar:b(E,I,_,B);break;case As:P(E,I,_,B);break;case qr:E==null&&A(I,_,B,H);break;case dt:k(E,I,_,B,$,q,H,te,X);break;default:ae&1?S(E,I,_,B,$,q,H,te,X):ae&6?Y(E,I,_,B,$,q,H,te,X):(ae&64||ae&128)&&G.process(E,I,_,B,$,q,H,te,X,ke)}ye!=null&&$&&pn(ye,E&&E.ref,q,I||E,!I)},b=(E,I,_,B)=>{if(E==null)s(I.el=o(I.children),_,B);else{const $=I.el=E.el;I.children!==E.children&&h($,I.children)}},P=(E,I,_,B)=>{E==null?s(I.el=l(I.children||""),_,B):I.el=E.el},A=(E,I,_,B)=>{[E.el,E.anchor]=p(E.children,I,_,B,E.el,E.anchor)},U=({el:E,anchor:I},_,B)=>{let $;for(;E&&E!==I;)$=c(E),s(E,_,B),E=$;s(I,_,B)},O=({el:E,anchor:I})=>{let _;for(;E&&E!==I;)_=c(E),r(E),E=_;r(I)},S=(E,I,_,B,$,q,H,te,X)=>{I.type==="svg"?H="svg":I.type==="math"&&(H="mathml"),E==null?W(I,_,B,$,q,H,te,X):se(E,I,$,q,H,te,X)},W=(E,I,_,B,$,q,H,te)=>{let X,G;const{props:ye,shapeFlag:ae,transition:de,dirs:Te}=E;if(X=E.el=a(E.type,q,ye&&ye.is,ye),ae&8?u(X,E.children):ae&16&&g(E.children,X,null,B,$,Wr(E,q),H,te),Te&&ps(E,null,B,"created"),fe(X,E,E.scopeId,H,B),ye){for(const ee in ye)ee!=="value"&&!li(ee)&&n(X,ee,null,ye[ee],q,B);"value"in ye&&n(X,"value",null,ye.value,q),(G=ye.onVnodeBeforeMount)&&kt(G,B,E)}Te&&ps(E,null,B,"beforeMount");const J=$h($,de);J&&de.beforeEnter(X),s(X,I,_),((G=ye&&ye.onVnodeMounted)||J||Te)&&ft(()=>{G&&kt(G,B,E),J&&de.enter(X),Te&&ps(E,null,B,"mounted")},$)},fe=(E,I,_,B,$)=>{if(_&&f(E,_),B)for(let q=0;q{for(let G=X;G{const te=I.el=E.el;let{patchFlag:X,dynamicChildren:G,dirs:ye}=I;X|=E.patchFlag&16;const ae=E.props||Be,de=I.props||Be;let Te;if(_&&ds(_,!1),(Te=de.onVnodeBeforeUpdate)&&kt(Te,_,I,E),ye&&ps(I,E,_,"beforeUpdate"),_&&ds(_,!0),(ae.innerHTML&&de.innerHTML==null||ae.textContent&&de.textContent==null)&&u(te,""),G?ie(E.dynamicChildren,G,te,_,B,Wr(I,$),q):H||C(E,I,te,null,_,B,Wr(I,$),q,!1),X>0){if(X&16)T(te,ae,de,_,$);else if(X&2&&ae.class!==de.class&&n(te,"class",null,de.class,$),X&4&&n(te,"style",ae.style,de.style,$),X&8){const J=I.dynamicProps;for(let ee=0;ee{Te&&kt(Te,_,I,E),ye&&ps(I,E,_,"updated")},B)},ie=(E,I,_,B,$,q,H)=>{for(let te=0;te{if(I!==_){if(I!==Be)for(const q in I)!li(q)&&!(q in _)&&n(E,q,I[q],null,$,B);for(const q in _){if(li(q))continue;const H=_[q],te=I[q];H!==te&&q!=="value"&&n(E,q,te,H,$,B)}"value"in _&&n(E,"value",I.value,_.value,$)}},k=(E,I,_,B,$,q,H,te,X)=>{const G=I.el=E?E.el:o(""),ye=I.anchor=E?E.anchor:o("");let{patchFlag:ae,dynamicChildren:de,slotScopeIds:Te}=I;Te&&(te=te?te.concat(Te):Te),E==null?(s(G,_,B),s(ye,_,B),g(I.children||[],_,ye,$,q,H,te,X)):ae>0&&ae&64&&de&&E.dynamicChildren?(ie(E.dynamicChildren,de,_,$,q,H,te),(I.key!=null||$&&I===$.subTree)&&Ol(E,I,!0)):C(E,I,_,ye,$,q,H,te,X)},Y=(E,I,_,B,$,q,H,te,X)=>{I.slotScopeIds=te,E==null?I.shapeFlag&512?$.ctx.activate(I,_,B,H,X):z(I,_,B,$,q,H,X):ue(E,I,X)},z=(E,I,_,B,$,q,H)=>{const te=E.component=af(E,B,$);if(bl(E)&&(te.ctx.renderer=ke),of(te,!1,H),te.asyncDep){if($&&$.registerDep(te,L,H),!E.el){const X=te.subTree=Je(As);P(null,X,I,_)}}else L(te,E,I,_,$,q,H)},ue=(E,I,_)=>{const B=I.component=E.component;if(zh(E,I,_))if(B.asyncDep&&!B.asyncResolved){x(B,I,_);return}else B.next=I,B.update();else I.el=E.el,B.vnode=I},L=(E,I,_,B,$,q,H)=>{const te=()=>{if(E.isMounted){let{next:ae,bu:de,u:Te,parent:J,vnode:ee}=E;{const Ke=Dl(E);if(Ke){ae&&(ae.el=ee.el,x(E,ae,H)),Ke.asyncDep.then(()=>{E.isUnmounted||te()});return}}let le=ae,xe;ds(E,!1),ae?(ae.el=ee.el,x(E,ae,H)):ae=ee,de&&Wi(de),(xe=ae.props&&ae.props.onVnodeBeforeUpdate)&&kt(xe,J,ae,ee),ds(E,!0);const Pe=Kr(E),_e=E.subTree;E.subTree=Pe,m(_e,Pe,d(_e.el),Z(_e),E,$,q),ae.el=Pe.el,le===null&&Jh(E,Pe.el),Te&&ft(Te,$),(xe=ae.props&&ae.props.onVnodeUpdated)&&ft(()=>kt(xe,J,ae,ee),$)}else{let ae;const{el:de,props:Te}=I,{bm:J,m:ee,parent:le,root:xe,type:Pe}=E,_e=hi(I);if(ds(E,!1),J&&Wi(J),!_e&&(ae=Te&&Te.onVnodeBeforeMount)&&kt(ae,le,I),ds(E,!0),de&&Ie){const Ke=()=>{E.subTree=Kr(E),Ie(de,E.subTree,E,$,null)};_e&&Pe.__asyncHydrate?Pe.__asyncHydrate(de,E,Ke):Ke()}else{xe.ce&&xe.ce._injectChildStyle(Pe);const Ke=E.subTree=Kr(E);m(null,Ke,_,B,E,$,q),I.el=Ke.el}if(ee&&ft(ee,$),!_e&&(ae=Te&&Te.onVnodeMounted)){const Ke=I;ft(()=>kt(ae,le,Ke),$)}(I.shapeFlag&256||le&&hi(le.vnode)&&le.vnode.shapeFlag&256)&&E.a&&ft(E.a,$),E.isMounted=!0,I=_=B=null}};E.scope.on();const X=E.effect=new Yo(te);E.scope.off();const G=E.update=X.run.bind(X),ye=E.job=X.runIfDirty.bind(X);ye.i=E,ye.id=E.uid,X.scheduler=()=>qn(ye),ds(E,!0),G()},x=(E,I,_)=>{I.component=E;const B=E.vnode.props;E.vnode=I,E.next=null,Nh(E,I.props,B,_),Dh(E,I.children,_),cs(),Ma(E),us()},C=(E,I,_,B,$,q,H,te,X=!1)=>{const G=E&&E.children,ye=E?E.shapeFlag:0,ae=I.children,{patchFlag:de,shapeFlag:Te}=I;if(de>0){if(de&128){re(G,ae,_,B,$,q,H,te,X);return}else if(de&256){R(G,ae,_,B,$,q,H,te,X);return}}Te&8?(ye&16&&Q(G,$,q),ae!==G&&u(_,ae)):ye&16?Te&16?re(G,ae,_,B,$,q,H,te,X):Q(G,$,q,!0):(ye&8&&u(_,""),Te&16&&g(ae,_,B,$,q,H,te,X))},R=(E,I,_,B,$,q,H,te,X)=>{E=E||Ds,I=I||Ds;const G=E.length,ye=I.length,ae=Math.min(G,ye);let de;for(de=0;deye?Q(E,$,q,!0,!1,ae):g(I,_,B,$,q,H,te,X,ae)},re=(E,I,_,B,$,q,H,te,X)=>{let G=0;const ye=I.length;let ae=E.length-1,de=ye-1;for(;G<=ae&&G<=de;){const Te=E[G],J=I[G]=X?rs(I[G]):It(I[G]);if(Js(Te,J))m(Te,J,_,null,$,q,H,te,X);else break;G++}for(;G<=ae&&G<=de;){const Te=E[ae],J=I[de]=X?rs(I[de]):It(I[de]);if(Js(Te,J))m(Te,J,_,null,$,q,H,te,X);else break;ae--,de--}if(G>ae){if(G<=de){const Te=de+1,J=Tede)for(;G<=ae;)F(E[G],$,q,!0),G++;else{const Te=G,J=G,ee=new Map;for(G=J;G<=de;G++){const Ze=I[G]=X?rs(I[G]):It(I[G]);Ze.key!=null&&ee.set(Ze.key,G)}let le,xe=0;const Pe=de-J+1;let _e=!1,Ke=0;const ht=new Array(Pe);for(G=0;G=Pe){F(Ze,$,q,!0);continue}let Ve;if(Ze.key!=null)Ve=ee.get(Ze.key);else for(le=J;le<=de;le++)if(ht[le-J]===0&&Js(Ze,I[le])){Ve=le;break}Ve===void 0?F(Ze,$,q,!0):(ht[Ve-J]=G+1,Ve>=Ke?Ke=Ve:_e=!0,m(Ze,I[Ve],_,null,$,q,H,te,X),xe++)}const fs=_e?jh(ht):Ds;for(le=fs.length-1,G=Pe-1;G>=0;G--){const Ze=J+G,Ve=I[Ze],qe=Ze+1{const{el:q,type:H,transition:te,children:X,shapeFlag:G}=E;if(G&6){M(E.component.subTree,I,_,B);return}if(G&128){E.suspense.move(I,_,B);return}if(G&64){H.move(E,I,_,ke);return}if(H===dt){s(q,I,_);for(let ae=0;aete.enter(q),$);else{const{leave:ae,delayLeave:de,afterLeave:Te}=te,J=()=>s(q,I,_),ee=()=>{ae(q,()=>{J(),Te&&Te()})};de?de(q,J,ee):ee()}else s(q,I,_)},F=(E,I,_,B=!1,$=!1)=>{const{type:q,props:H,ref:te,children:X,dynamicChildren:G,shapeFlag:ye,patchFlag:ae,dirs:de,cacheIndex:Te}=E;if(ae===-2&&($=!1),te!=null&&pn(te,null,_,E,!0),Te!=null&&(I.renderCache[Te]=void 0),ye&256){I.ctx.deactivate(E);return}const J=ye&1&&de,ee=!hi(E);let le;if(ee&&(le=H&&H.onVnodeBeforeUnmount)&&kt(le,I,E),ye&6)K(E.component,_,B);else{if(ye&128){E.suspense.unmount(_,B);return}J&&ps(E,null,I,"beforeUnmount"),ye&64?E.type.remove(E,I,_,ke,B):G&&!G.hasOnce&&(q!==dt||ae>0&&ae&64)?Q(G,I,_,!1,!0):(q===dt&&ae&384||!$&&ye&16)&&Q(X,I,_),B&&N(E)}(ee&&(le=H&&H.onVnodeUnmounted)||J)&&ft(()=>{le&&kt(le,I,E),J&&ps(E,null,I,"unmounted")},_)},N=E=>{const{type:I,el:_,anchor:B,transition:$}=E;if(I===dt){D(_,B);return}if(I===qr){O(E);return}const q=()=>{r(_),$&&!$.persisted&&$.afterLeave&&$.afterLeave()};if(E.shapeFlag&1&&$&&!$.persisted){const{leave:H,delayLeave:te}=$,X=()=>H(_,q);te?te(E.el,q,X):X()}else q()},D=(E,I)=>{let _;for(;E!==I;)_=c(E),r(E),E=_;r(I)},K=(E,I,_)=>{const{bum:B,scope:$,job:q,subTree:H,um:te,m:X,a:G}=E;ja(X),ja(G),B&&Wi(B),$.stop(),q&&(q.flags|=8,F(H,E,I,_)),te&&ft(te,I),ft(()=>{E.isUnmounted=!0},I),I&&I.pendingBranch&&!I.isUnmounted&&E.asyncDep&&!E.asyncResolved&&E.suspenseId===I.pendingId&&(I.deps--,I.deps===0&&I.resolve())},Q=(E,I,_,B=!1,$=!1,q=0)=>{for(let H=q;H{if(E.shapeFlag&6)return Z(E.component.subTree);if(E.shapeFlag&128)return E.suspense.next();const I=c(E.anchor||E.el),_=I&&I[ih];return _?c(_):I};let ce=!1;const pe=(E,I,_)=>{E==null?I._vnode&&F(I._vnode,null,null,!0):m(I._vnode||null,E,I,null,null,null,_),I._vnode=E,ce||(ce=!0,Ma(),ml(),ce=!1)},ke={p:m,um:F,m:M,r:N,mt:z,mc:g,pc:C,pbc:ie,n:Z,o:i};let ve,Ie;return t&&([ve,Ie]=t(ke)),{render:pe,hydrate:ve,createApp:vh(pe,ve)}}function Wr({type:i,props:t},e){return e==="svg"&&i==="foreignObject"||e==="mathml"&&i==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:e}function ds({effect:i,job:t},e){e?(i.flags|=32,t.flags|=4):(i.flags&=-33,t.flags&=-5)}function $h(i,t){return(!i||i&&!i.pendingBranch)&&t&&!t.persisted}function Ol(i,t,e=!1){const s=i.children,r=t.children;if(be(s)&&be(r))for(let n=0;n>1,i[e[o]]0&&(t[s]=e[n-1]),e[n]=s)}}for(n=e.length,a=e[n-1];n-- >0;)e[n]=a,a=t[a];return e}function Dl(i){const t=i.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Dl(t)}function ja(i){if(i)for(let t=0;tqi(Uh);function pi(i,t,e){return Fl(i,t,e)}function Fl(i,t,e=Be){const{immediate:s,deep:r,flush:n,once:a}=e,o=Xe({},e);let l;if(wr)if(n==="sync"){const c=Vh();l=c.__watcherHandles||(c.__watcherHandles=[])}else if(!t||s)o.once=!0;else{const c=()=>{};return c.stop=Et,c.resume=Et,c.pause=Et,c}const h=et;o.call=(c,f,p)=>_t(c,h,f,p);let u=!1;n==="post"?o.scheduler=c=>{ft(c,h&&h.suspense)}:n!=="sync"&&(u=!0,o.scheduler=(c,f)=>{f?c():qn(c)}),o.augmentJob=c=>{t&&(c.flags|=4),u&&(c.flags|=2,h&&(c.id=h.uid,c.i=h))};const d=Yu(i,t,o);return l&&l.push(d),d}function Hh(i,t,e){const s=this.proxy,r=We(i)?i.includes(".")?Bl(s,i):()=>s[i]:i.bind(s,s);let n;Ee(t)?n=t:(n=t.handler,e=t);const a=Ni(this),o=Fl(r,n.bind(s),e);return a(),o}function Bl(i,t){const e=t.split(".");return()=>{let s=i;for(let r=0;rt==="modelValue"||t==="model-value"?i.modelModifiers:i[`${t}Modifiers`]||i[`${xt(t)}Modifiers`]||i[`${ws(t)}Modifiers`];function Wh(i,t,...e){if(i.isUnmounted)return;const s=i.vnode.props||Be;let r=e;const n=t.startsWith("update:"),a=n&&Gh(s,t.slice(7));a&&(a.trim&&(r=e.map(u=>We(u)?u.trim():u)),a.number&&(r=e.map(cn)));let o,l=s[o=Rr(t)]||s[o=Rr(xt(t))];!l&&n&&(l=s[o=Rr(ws(t))]),l&&_t(l,i,6,r);const h=s[o+"Once"];if(h){if(!i.emitted)i.emitted={};else if(i.emitted[o])return;i.emitted[o]=!0,_t(h,i,6,r)}}function Rl(i,t,e=!1){const s=t.emitsCache,r=s.get(i);if(r!==void 0)return r;const n=i.emits;let a={},o=!1;if(!Ee(i)){const l=h=>{const u=Rl(h,t,!0);u&&(o=!0,Xe(a,u))};!e&&t.mixins.length&&t.mixins.forEach(l),i.extends&&l(i.extends),i.mixins&&i.mixins.forEach(l)}return!n&&!o?(je(i)&&s.set(i,null),null):(be(n)?n.forEach(l=>a[l]=null):Xe(a,n),je(i)&&s.set(i,a),a)}function Er(i,t){return!i||!pr(t)?!1:(t=t.slice(2).replace(/Once$/,""),Oe(i,t[0].toLowerCase()+t.slice(1))||Oe(i,ws(t))||Oe(i,t))}function Kr(i){const{type:t,vnode:e,proxy:s,withProxy:r,propsOptions:[n],slots:a,attrs:o,emit:l,render:h,renderCache:u,props:d,data:c,setupState:f,ctx:p,inheritAttrs:m}=i,b=ir(i);let P,A;try{if(e.shapeFlag&4){const O=r||s,S=O;P=It(h.call(S,O,u,d,f,c,p)),A=o}else{const O=t;P=It(O.length>1?O(d,{attrs:o,slots:a,emit:l}):O(d,null)),A=t.props?o:Kh(o)}}catch(O){di.length=0,Sr(O,i,1),P=Je(As)}let U=P;if(A&&m!==!1){const O=Object.keys(A),{shapeFlag:S}=U;O.length&&S&7&&(n&&O.some(Mn)&&(A=qh(A,n)),U=Hs(U,A,!1,!0))}return e.dirs&&(U=Hs(U,null,!1,!0),U.dirs=U.dirs?U.dirs.concat(e.dirs):e.dirs),e.transition&&zn(U,e.transition),P=U,ir(b),P}const Kh=i=>{let t;for(const e in i)(e==="class"||e==="style"||pr(e))&&((t||(t={}))[e]=i[e]);return t},qh=(i,t)=>{const e={};for(const s in i)(!Mn(s)||!(s.slice(9)in t))&&(e[s]=i[s]);return e};function zh(i,t,e){const{props:s,children:r,component:n}=i,{props:a,children:o,patchFlag:l}=t,h=n.emitsOptions;if(t.dirs||t.transition)return!0;if(e&&l>=0){if(l&1024)return!0;if(l&16)return s?Ua(s,a,h):!!a;if(l&8){const u=t.dynamicProps;for(let d=0;di.__isSuspense;function Xh(i,t){t&&t.pendingBranch?be(i)?t.effects.push(...i):t.effects.push(i):th(i)}const dt=Symbol.for("v-fgt"),Ar=Symbol.for("v-txt"),As=Symbol.for("v-cmt"),qr=Symbol.for("v-stc"),di=[];let yt=null;function St(i=!1){di.push(yt=i?null:[])}function Yh(){di.pop(),yt=di[di.length-1]||null}let Ei=1;function Va(i){Ei+=i,i<0&&yt&&(yt.hasOnce=!0)}function jl(i){return i.dynamicChildren=Ei>0?yt||Ds:null,Yh(),Ei>0&&yt&&yt.push(i),i}function Ct(i,t,e,s,r,n){return jl(Ae(i,t,e,s,r,n,!0))}function Zh(i,t,e,s,r){return jl(Je(i,t,e,s,r,!0))}function nr(i){return i?i.__v_isVNode===!0:!1}function Js(i,t){return i.type===t.type&&i.key===t.key}const Ul=({key:i})=>i!=null?i:null,zi=({ref:i,ref_key:t,ref_for:e})=>(typeof i=="number"&&(i=""+i),i!=null?We(i)||tt(i)||Ee(i)?{i:mt,r:i,k:t,f:!!e}:i:null);function Ae(i,t=null,e=null,s=0,r=null,n=i===dt?0:1,a=!1,o=!1){const l={__v_isVNode:!0,__v_skip:!0,type:i,props:t,key:t&&Ul(t),ref:t&&zi(t),scopeId:gl,slotScopeIds:null,children:e,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:n,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:mt};return o?(Yn(l,e),n&128&&i.normalize(l)):e&&(l.shapeFlag|=We(e)?8:16),Ei>0&&!a&&yt&&(l.patchFlag>0||n&6)&&l.patchFlag!==32&&yt.push(l),l}const Je=Qh;function Qh(i,t=null,e=null,s=0,r=null,n=!1){if((!i||i===bh)&&(i=As),nr(i)){const o=Hs(i,t,!0);return e&&Yn(o,e),Ei>0&&!n&&yt&&(o.shapeFlag&6?yt[yt.indexOf(i)]=o:yt.push(o)),o.patchFlag=-2,o}if(ff(i)&&(i=i.__vccOpts),t){t=ef(t);let{class:o,style:l}=t;o&&!We(o)&&(t.class=bi(o)),je(l)&&(Wn(l)&&!be(l)&&(l=Xe({},l)),t.style=Bn(l))}const a=We(i)?1:$l(i)?128:rh(i)?64:je(i)?4:Ee(i)?2:0;return Ae(i,t,e,s,r,a,n,!0)}function ef(i){return i?Wn(i)||kl(i)?Xe({},i):i:null}function Hs(i,t,e=!1,s=!1){const{props:r,ref:n,patchFlag:a,children:o,transition:l}=i,h=t?sf(r||{},t):r,u={__v_isVNode:!0,__v_skip:!0,type:i.type,props:h,key:h&&Ul(h),ref:t&&t.ref?e&&n?be(n)?n.concat(zi(t)):[n,zi(t)]:zi(t):n,scopeId:i.scopeId,slotScopeIds:i.slotScopeIds,children:o,target:i.target,targetStart:i.targetStart,targetAnchor:i.targetAnchor,staticCount:i.staticCount,shapeFlag:i.shapeFlag,patchFlag:t&&i.type!==dt?a===-1?16:a|16:a,dynamicProps:i.dynamicProps,dynamicChildren:i.dynamicChildren,appContext:i.appContext,dirs:i.dirs,transition:l,component:i.component,suspense:i.suspense,ssContent:i.ssContent&&Hs(i.ssContent),ssFallback:i.ssFallback&&Hs(i.ssFallback),el:i.el,anchor:i.anchor,ctx:i.ctx,ce:i.ce};return l&&s&&zn(u,l.clone(u)),u}function Tn(i=" ",t=0){return Je(Ar,null,i,t)}function tf(i="",t=!1){return t?(St(),Zh(As,null,i)):Je(As,null,i)}function It(i){return i==null||typeof i=="boolean"?Je(As):be(i)?Je(dt,null,i.slice()):nr(i)?rs(i):Je(Ar,null,String(i))}function rs(i){return i.el===null&&i.patchFlag!==-1||i.memo?i:Hs(i)}function Yn(i,t){let e=0;const{shapeFlag:s}=i;if(t==null)t=null;else if(be(t))e=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),Yn(i,r()),r._c&&(r._d=!0));return}else{e=32;const r=t._;!r&&!kl(t)?t._ctx=mt:r===3&&mt&&(mt.slots._===1?t._=1:(t._=2,i.patchFlag|=1024))}else Ee(t)?(t={default:t,_ctx:mt},e=32):(t=String(t),s&64?(e=16,t=[Tn(t)]):e=8);i.children=t,i.shapeFlag|=e}function sf(...i){const t={};for(let e=0;e{let r;return(r=i[e])||(r=i[e]=[]),r.push(s),n=>{r.length>1?r.forEach(a=>a(n)):r[0](n)}};ar=t("__VUE_INSTANCE_SETTERS__",e=>et=e),bn=t("__VUE_SSR_SETTERS__",e=>wr=e)}const Ni=i=>{const t=et;return ar(i),i.scope.on(),()=>{i.scope.off(),ar(t)}},Ha=()=>{et&&et.scope.off(),ar(null)};function Vl(i){return i.vnode.shapeFlag&4}let wr=!1;function of(i,t=!1,e=!1){t&&bn(t);const{props:s,children:r}=i.vnode,n=Vl(i);Ih(i,s,n,t),Oh(i,r,e);const a=n?lf(i,t):void 0;return t&&bn(!1),a}function lf(i,t){const e=i.type;i.accessCache=Object.create(null),i.proxy=new Proxy(i.ctx,Sh);const{setup:s}=e;if(s){const r=i.setupContext=s.length>1?uf(i):null,n=Ni(i);cs();const a=Ii(s,i,0,[i.props,r]);if(us(),n(),Ho(a)){if(hi(i)||Tl(i),a.then(Ha,Ha),t)return a.then(o=>{Ga(i,o,t)}).catch(o=>{Sr(o,i,0)});i.asyncDep=a}else Ga(i,a,t)}else Hl(i,t)}function Ga(i,t,e){Ee(t)?i.type.__ssrInlineRender?i.ssrRender=t:i.render=t:je(t)&&(i.setupState=fl(t)),Hl(i,e)}let Wa;function Hl(i,t,e){const s=i.type;if(!i.render){if(!t&&Wa&&!s.render){const r=s.template||Jn(i).template;if(r){const{isCustomElement:n,compilerOptions:a}=i.appContext.config,{delimiters:o,compilerOptions:l}=s,h=Xe(Xe({isCustomElement:n,delimiters:o},a),l);s.render=Wa(r,h)}}i.render=s.render||Et}{const r=Ni(i);cs();try{Ph(i)}finally{us(),r()}}}const cf={get(i,t){return st(i,"get",""),i[t]}};function uf(i){const t=e=>{i.exposed=e||{}};return{attrs:new Proxy(i.attrs,cf),slots:i.slots,emit:i.emit,expose:t}}function Cr(i){return i.exposed?i.exposeProxy||(i.exposeProxy=new Proxy(fl(Gu(i.exposed)),{get(t,e){if(e in t)return t[e];if(e in fi)return fi[e](i)},has(t,e){return e in t||e in fi}})):i.proxy}function hf(i,t=!0){return Ee(i)?i.displayName||i.name:i.name||t&&i.__name}function ff(i){return Ee(i)&&"__vccOpts"in i}const Ht=(i,t)=>Ju(i,t,wr);function Ka(i,t,e){const s=arguments.length;return s===2?je(t)&&!be(t)?nr(t)?Je(i,null,[t]):Je(i,t):Je(i,null,t):(s>3?e=Array.prototype.slice.call(arguments,2):s===3&&nr(e)&&(e=[e]),Je(i,t,e))}const pf="3.5.11";/** +**/function Ii(i,t,e,s){try{return s?i(...s):i()}catch(n){Pn(n,t,e)}}function _t(i,t,e,s){if(Ee(i)){const n=Ii(i,t,e,s);return n&&Ho(n)&&n.catch(r=>{Pn(r,t,e)}),n}if(be(i)){const n=[];for(let r=0;r>>1,n=at[s],r=Pi(n);r=Pi(e)?at.push(i):at.splice(eh(t),0,i),i.flags|=1,dl()}}function dl(){sn||(sn=pl.then(yl))}function th(i){be(i)?Rs.push(...i):is&&i.id===-1?is.splice(_s+1,0,i):i.flags&1||(Rs.push(i),i.flags|=1),dl()}function Ma(i,t,e=Lt+1){for(;ePi(e)-Pi(s));if(Rs.length=0,is){is.push(...t);return}for(is=t,_s=0;_si.id==null?i.flags&2?-1:1/0:i.id;function yl(i){const t=Et;try{for(Lt=0;Lt{s._d&&Va(-1);const r=nn(t);let a;try{a=i(...n)}finally{nn(r),s._d&&Va(1)}return a};return s._n=!0,s._c=!0,s._d=!0,s}function zs(i,t){if(mt===null)return i;const e=kn(mt),s=i.dirs||(i.dirs=[]);for(let n=0;ni.__isTeleport;function zr(i,t){i.shapeFlag&6&&i.component?(i.transition=t,zr(i.component.subTree,t)):i.shapeFlag&128?(i.ssContent.transition=t.clone(i.ssContent),i.ssFallback.transition=t.clone(i.ssFallback)):i.transition=t}/*! #__NO_SIDE_EFFECTS__ */function rh(i,t){return Ee(i)?(()=>Xe({name:i.name},t,{setup:i}))():i}function Tl(i){i.ids=[i.ids[0]+i.ids[2]+++"-",0,0]}function pr(i,t,e,s,n=!1){if(be(i)){i.forEach((p,m)=>pr(p,t&&(be(t)?t[m]:t),e,s,n));return}if(hi(s)&&!n)return;const r=s.shapeFlag&4?kn(s.component):s.el,a=n?null:r,{i:o,r:l}=i,h=t&&t.r,u=o.refs===Re?o.refs={}:o.refs,d=o.setupState,c=De(d),f=d===Re?()=>!1:p=>Oe(c,p);if(h!=null&&h!==l&&(We(h)?(u[h]=null,f(h)&&(d[h]=null)):tt(h)&&(h.value=null)),Ee(l))Ii(l,o,12,[a,u]);else{const p=We(l),m=tt(l);if(p||m){const b=()=>{if(i.f){const P=p?f(l)?d[l]:u[l]:l.value;n?be(P)&&Or(P,r):be(P)?P.includes(r)||P.push(r):p?(u[l]=[r],f(l)&&(d[l]=u[l])):(l.value=[r],i.k&&(u[i.k]=l.value))}else p?(u[l]=a,f(l)&&(d[l]=a)):m&&(l.value=a,i.k&&(u[i.k]=a))};a?(b.id=-1,ft(b,e)):b()}}}const hi=i=>!!i.type.__asyncLoader,bl=i=>i.type.__isKeepAlive;function ah(i,t){xl(i,"a",t)}function oh(i,t){xl(i,"da",t)}function xl(i,t,e=et){const s=i.__wdc||(i.__wdc=()=>{let n=e;for(;n;){if(n.isDeactivated)return;n=n.parent}return i()});if(En(t,s,e),e){let n=e.parent;for(;n&&n.parent;)bl(n.parent.vnode)&&lh(s,t,e,n),n=n.parent}}function lh(i,t,e,s){const n=En(t,i,s,!0);Sl(()=>{Or(s[t],n)},e)}function En(i,t,e=et,s=!1){if(e){const n=e[i]||(e[i]=[]),r=t.__weh||(t.__weh=(...a)=>{cs();const o=Ni(e),l=_t(t,e,i,a);return o(),us(),l});return s?n.unshift(r):n.push(r),r}}const Xt=i=>(t,e=et)=>{(!Cn||i==="sp")&&En(i,(...s)=>t(...s),e)},ch=Xt("bm"),uh=Xt("m"),hh=Xt("bu"),fh=Xt("u"),ph=Xt("bum"),Sl=Xt("um"),dh=Xt("sp"),mh=Xt("rtg"),yh=Xt("rtc");function gh(i,t=et){En("ec",i,t)}const Pl="components";function Th(i,t){return xh(Pl,i,!0,t)||i}const bh=Symbol.for("v-ndc");function xh(i,t,e=!0,s=!1){const n=mt||et;if(n){const r=n.type;if(i===Pl){const o=hf(r,!1);if(o&&(o===t||o===xt(t)||o===gn(xt(t))))return r}const a=Oa(n[i]||r[i],t)||Oa(n.appContext[i],t);return!a&&s?r:a}}function Oa(i,t){return i&&(i[t]||i[xt(t)]||i[gn(xt(t))])}function Gn(i,t,e,s){let n;const r=e&&e[s],a=be(i);if(a||We(i)){const o=a&&Bs(i);let l=!1;o&&(l=!bt(i),i=bn(i)),n=new Array(i.length);for(let h=0,u=i.length;ht(o,l,void 0,r&&r[l]));else{const o=Object.keys(i);n=new Array(o.length);for(let l=0,h=o.length;li?Vl(i)?kn(i):dr(i.parent):null,fi=Xe(Object.create(null),{$:i=>i,$el:i=>i.vnode.el,$data:i=>i.data,$props:i=>i.props,$attrs:i=>i.attrs,$slots:i=>i.slots,$refs:i=>i.refs,$parent:i=>dr(i.parent),$root:i=>dr(i.root),$host:i=>i.ce,$emit:i=>i.emit,$options:i=>Jr(i),$forceUpdate:i=>i.f||(i.f=()=>{qr(i.update)}),$nextTick:i=>i.n||(i.n=Qu.bind(i.proxy)),$watch:i=>Hh.bind(i)}),Wn=(i,t)=>i!==Re&&!i.__isScriptSetup&&Oe(i,t),Sh={get({_:i},t){if(t==="__v_skip")return!0;const{ctx:e,setupState:s,data:n,props:r,accessCache:a,type:o,appContext:l}=i;let h;if(t[0]!=="$"){const f=a[t];if(f!==void 0)switch(f){case 1:return s[t];case 2:return n[t];case 4:return e[t];case 3:return r[t]}else{if(Wn(s,t))return a[t]=1,s[t];if(n!==Re&&Oe(n,t))return a[t]=2,n[t];if((h=i.propsOptions[0])&&Oe(h,t))return a[t]=3,r[t];if(e!==Re&&Oe(e,t))return a[t]=4,e[t];mr&&(a[t]=0)}}const u=fi[t];let d,c;if(u)return t==="$attrs"&&st(i.attrs,"get",""),u(i);if((d=o.__cssModules)&&(d=d[t]))return d;if(e!==Re&&Oe(e,t))return a[t]=4,e[t];if(c=l.config.globalProperties,Oe(c,t))return c[t]},set({_:i},t,e){const{data:s,setupState:n,ctx:r}=i;return Wn(n,t)?(n[t]=e,!0):s!==Re&&Oe(s,t)?(s[t]=e,!0):Oe(i.props,t)||t[0]==="$"&&t.slice(1)in i?!1:(r[t]=e,!0)},has({_:{data:i,setupState:t,accessCache:e,ctx:s,appContext:n,propsOptions:r}},a){let o;return!!e[a]||i!==Re&&Oe(i,a)||Wn(t,a)||(o=r[0])&&Oe(o,a)||Oe(s,a)||Oe(fi,a)||Oe(n.config.globalProperties,a)},defineProperty(i,t,e){return e.get!=null?i._.accessCache[t]=0:Oe(e,"value")&&this.set(i,t,e.value,null),Reflect.defineProperty(i,t,e)}};function Da(i){return be(i)?i.reduce((t,e)=>(t[e]=null,t),{}):i}let mr=!0;function Ph(i){const t=Jr(i),e=i.proxy,s=i.ctx;mr=!1,t.beforeCreate&&Fa(t.beforeCreate,i,"bc");const{data:n,computed:r,methods:a,watch:o,provide:l,inject:h,created:u,beforeMount:d,mounted:c,beforeUpdate:f,updated:p,activated:m,deactivated:b,beforeDestroy:P,beforeUnmount:A,destroyed:U,unmounted:O,render:S,renderTracked:W,renderTriggered:fe,errorCaptured:g,serverPrefetch:se,expose:ie,inheritAttrs:T,components:k,directives:Y,filters:z}=t;if(h&&Eh(h,s,null),a)for(const x in a){const C=a[x];Ee(C)&&(s[x]=C.bind(e))}if(n){const x=n.call(e,e);je(x)&&(i.data=Sn(x))}if(mr=!0,r)for(const x in r){const C=r[x],R=Ee(C)?C.bind(e,e):Ee(C.get)?C.get.bind(e,e):Et,ne=!Ee(C)&&Ee(C.set)?C.set.bind(e):Et,M=Ht({get:R,set:ne});Object.defineProperty(s,x,{enumerable:!0,configurable:!0,get:()=>M.value,set:F=>M.value=F})}if(o)for(const x in o)El(o[x],s,e,x);if(l){const x=Ee(l)?l.call(e):l;Reflect.ownKeys(x).forEach(C=>{Lh(C,x[C])})}u&&Fa(u,i,"c");function L(x,C){be(C)?C.forEach(R=>x(R.bind(e))):C&&x(C.bind(e))}if(L(ch,d),L(uh,c),L(hh,f),L(fh,p),L(ah,m),L(oh,b),L(gh,g),L(yh,W),L(mh,fe),L(ph,A),L(Sl,O),L(dh,se),be(ie))if(ie.length){const x=i.exposed||(i.exposed={});ie.forEach(C=>{Object.defineProperty(x,C,{get:()=>e[C],set:R=>e[C]=R})})}else i.exposed||(i.exposed={});S&&i.render===Et&&(i.render=S),T!=null&&(i.inheritAttrs=T),k&&(i.components=k),Y&&(i.directives=Y),se&&Tl(i)}function Eh(i,t,e=Et){be(i)&&(i=yr(i));for(const s in i){const n=i[s];let r;je(n)?"default"in n?r=qi(n.from||s,n.default,!0):r=qi(n.from||s):r=qi(n),tt(r)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:a=>r.value=a}):t[s]=r}}function Fa(i,t,e){_t(be(i)?i.map(s=>s.bind(t.proxy)):i.bind(t.proxy),t,e)}function El(i,t,e,s){let n=s.includes(".")?Bl(e,s):()=>e[s];if(We(i)){const r=t[i];Ee(r)&&pi(n,r)}else if(Ee(i))pi(n,i.bind(e));else if(je(i))if(be(i))i.forEach(r=>El(r,t,e,s));else{const r=Ee(i.handler)?i.handler.bind(e):t[i.handler];Ee(r)&&pi(n,r,i)}}function Jr(i){const t=i.type,{mixins:e,extends:s}=t,{mixins:n,optionsCache:r,config:{optionMergeStrategies:a}}=i.appContext,o=r.get(t);let l;return o?l=o:!n.length&&!e&&!s?l=t:(l={},n.length&&n.forEach(h=>rn(l,h,a,!0)),rn(l,t,a)),je(t)&&r.set(t,l),l}function rn(i,t,e,s=!1){const{mixins:n,extends:r}=t;r&&rn(i,r,e,!0),n&&n.forEach(a=>rn(i,a,e,!0));for(const a in t)if(!(s&&a==="expose")){const o=Ah[a]||e&&e[a];i[a]=o?o(i[a],t[a]):t[a]}return i}const Ah={data:Ba,props:Ra,emits:Ra,methods:ii,computed:ii,beforeCreate:rt,created:rt,beforeMount:rt,mounted:rt,beforeUpdate:rt,updated:rt,beforeDestroy:rt,beforeUnmount:rt,destroyed:rt,unmounted:rt,activated:rt,deactivated:rt,errorCaptured:rt,serverPrefetch:rt,components:ii,directives:ii,watch:Ch,provide:Ba,inject:wh};function Ba(i,t){return t?i?function(){return Xe(Ee(i)?i.call(this,this):i,Ee(t)?t.call(this,this):t)}:t:i}function wh(i,t){return ii(yr(i),yr(t))}function yr(i){if(be(i)){const t={};for(let e=0;e1)return e&&Ee(t)?t.call(s&&s.proxy):t}}const wl={},Cl=()=>Object.create(wl),kl=i=>Object.getPrototypeOf(i)===wl;function Ih(i,t,e,s=!1){const n={},r=Cl();i.propsDefaults=Object.create(null),vl(i,t,n,r);for(const a in i.propsOptions[0])a in n||(n[a]=void 0);e?i.props=s?n:Hu(n):i.type.props?i.props=n:i.props=r,i.attrs=r}function Nh(i,t,e,s){const{props:n,attrs:r,vnode:{patchFlag:a}}=i,o=De(n),[l]=i.propsOptions;let h=!1;if((s||a>0)&&!(a&16)){if(a&8){const u=i.vnode.dynamicProps;for(let d=0;d{l=!0;const[c,f]=Ll(d,t,!0);Xe(a,c),f&&o.push(...f)};!e&&t.mixins.length&&t.mixins.forEach(u),i.extends&&u(i.extends),i.mixins&&i.mixins.forEach(u)}if(!r&&!l)return je(i)&&s.set(i,Ds),Ds;if(be(r))for(let u=0;ui[0]==="_"||i==="$stable",Xr=i=>be(i)?i.map(It):[It(i)],Mh=(i,t,e)=>{if(t._n)return t;const s=sh((...n)=>Xr(t(...n)),e);return s._c=!1,s},Nl=(i,t,e)=>{const s=i._ctx;for(const n in i){if(Il(n))continue;const r=i[n];if(Ee(r))t[n]=Mh(n,r,s);else if(r!=null){const a=Xr(r);t[n]=()=>a}}},_l=(i,t)=>{const e=Xr(t);i.slots.default=()=>e},Ml=(i,t,e)=>{for(const s in t)(e||s!=="_")&&(i[s]=t[s])},Oh=(i,t,e)=>{const s=i.slots=Cl();if(i.vnode.shapeFlag&32){const n=t._;n?(Ml(s,t,e),e&&Ko(s,"_",n,!0)):Nl(t,s)}else t&&_l(i,t)},Dh=(i,t,e)=>{const{vnode:s,slots:n}=i;let r=!0,a=Re;if(s.shapeFlag&32){const o=t._;o?e&&o===1?r=!1:Ml(n,t,e):(r=!t.$stable,Nl(t,n)),a=t}else t&&(_l(i,t),a={default:1});if(r)for(const o in n)!Il(o)&&a[o]==null&&delete n[o]};function Fh(){typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__!="boolean"&&(Fr().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!1)}const ft=Xh;function Bh(i){return Rh(i)}function Rh(i,t){Fh();const e=Fr();e.__VUE__=!0;const{insert:s,remove:n,patchProp:r,createElement:a,createText:o,createComment:l,setText:h,setElementText:u,parentNode:d,nextSibling:c,setScopeId:f=Et,insertStaticContent:p}=i,m=(E,I,_,B=null,$=null,q=null,H=void 0,te=null,X=!!I.dynamicChildren)=>{if(E===I)return;E&&!Js(E,I)&&(B=Z(E),F(E,$,q,!0),E=null),I.patchFlag===-2&&(X=!1,I.dynamicChildren=null);const{type:G,ref:ye,shapeFlag:ae}=I;switch(G){case wn:b(E,I,_,B);break;case As:P(E,I,_,B);break;case zn:E==null&&A(I,_,B,H);break;case dt:k(E,I,_,B,$,q,H,te,X);break;default:ae&1?S(E,I,_,B,$,q,H,te,X):ae&6?Y(E,I,_,B,$,q,H,te,X):(ae&64||ae&128)&&G.process(E,I,_,B,$,q,H,te,X,ke)}ye!=null&&$&&pr(ye,E&&E.ref,q,I||E,!I)},b=(E,I,_,B)=>{if(E==null)s(I.el=o(I.children),_,B);else{const $=I.el=E.el;I.children!==E.children&&h($,I.children)}},P=(E,I,_,B)=>{E==null?s(I.el=l(I.children||""),_,B):I.el=E.el},A=(E,I,_,B)=>{[E.el,E.anchor]=p(E.children,I,_,B,E.el,E.anchor)},U=({el:E,anchor:I},_,B)=>{let $;for(;E&&E!==I;)$=c(E),s(E,_,B),E=$;s(I,_,B)},O=({el:E,anchor:I})=>{let _;for(;E&&E!==I;)_=c(E),n(E),E=_;n(I)},S=(E,I,_,B,$,q,H,te,X)=>{I.type==="svg"?H="svg":I.type==="math"&&(H="mathml"),E==null?W(I,_,B,$,q,H,te,X):se(E,I,$,q,H,te,X)},W=(E,I,_,B,$,q,H,te)=>{let X,G;const{props:ye,shapeFlag:ae,transition:de,dirs:Te}=E;if(X=E.el=a(E.type,q,ye&&ye.is,ye),ae&8?u(X,E.children):ae&16&&g(E.children,X,null,B,$,Kn(E,q),H,te),Te&&ps(E,null,B,"created"),fe(X,E,E.scopeId,H,B),ye){for(const ee in ye)ee!=="value"&&!li(ee)&&r(X,ee,null,ye[ee],q,B);"value"in ye&&r(X,"value",null,ye.value,q),(G=ye.onVnodeBeforeMount)&&kt(G,B,E)}Te&&ps(E,null,B,"beforeMount");const J=$h($,de);J&&de.beforeEnter(X),s(X,I,_),((G=ye&&ye.onVnodeMounted)||J||Te)&&ft(()=>{G&&kt(G,B,E),J&&de.enter(X),Te&&ps(E,null,B,"mounted")},$)},fe=(E,I,_,B,$)=>{if(_&&f(E,_),B)for(let q=0;q{for(let G=X;G{const te=I.el=E.el;let{patchFlag:X,dynamicChildren:G,dirs:ye}=I;X|=E.patchFlag&16;const ae=E.props||Re,de=I.props||Re;let Te;if(_&&ds(_,!1),(Te=de.onVnodeBeforeUpdate)&&kt(Te,_,I,E),ye&&ps(I,E,_,"beforeUpdate"),_&&ds(_,!0),(ae.innerHTML&&de.innerHTML==null||ae.textContent&&de.textContent==null)&&u(te,""),G?ie(E.dynamicChildren,G,te,_,B,Kn(I,$),q):H||C(E,I,te,null,_,B,Kn(I,$),q,!1),X>0){if(X&16)T(te,ae,de,_,$);else if(X&2&&ae.class!==de.class&&r(te,"class",null,de.class,$),X&4&&r(te,"style",ae.style,de.style,$),X&8){const J=I.dynamicProps;for(let ee=0;ee{Te&&kt(Te,_,I,E),ye&&ps(I,E,_,"updated")},B)},ie=(E,I,_,B,$,q,H)=>{for(let te=0;te{if(I!==_){if(I!==Re)for(const q in I)!li(q)&&!(q in _)&&r(E,q,I[q],null,$,B);for(const q in _){if(li(q))continue;const H=_[q],te=I[q];H!==te&&q!=="value"&&r(E,q,te,H,$,B)}"value"in _&&r(E,"value",I.value,_.value,$)}},k=(E,I,_,B,$,q,H,te,X)=>{const G=I.el=E?E.el:o(""),ye=I.anchor=E?E.anchor:o("");let{patchFlag:ae,dynamicChildren:de,slotScopeIds:Te}=I;Te&&(te=te?te.concat(Te):Te),E==null?(s(G,_,B),s(ye,_,B),g(I.children||[],_,ye,$,q,H,te,X)):ae>0&&ae&64&&de&&E.dynamicChildren?(ie(E.dynamicChildren,de,_,$,q,H,te),(I.key!=null||$&&I===$.subTree)&&Ol(E,I,!0)):C(E,I,_,ye,$,q,H,te,X)},Y=(E,I,_,B,$,q,H,te,X)=>{I.slotScopeIds=te,E==null?I.shapeFlag&512?$.ctx.activate(I,_,B,H,X):z(I,_,B,$,q,H,X):ue(E,I,X)},z=(E,I,_,B,$,q,H)=>{const te=E.component=af(E,B,$);if(bl(E)&&(te.ctx.renderer=ke),of(te,!1,H),te.asyncDep){if($&&$.registerDep(te,L,H),!E.el){const X=te.subTree=Je(As);P(null,X,I,_)}}else L(te,E,I,_,$,q,H)},ue=(E,I,_)=>{const B=I.component=E.component;if(zh(E,I,_))if(B.asyncDep&&!B.asyncResolved){x(B,I,_);return}else B.next=I,B.update();else I.el=E.el,B.vnode=I},L=(E,I,_,B,$,q,H)=>{const te=()=>{if(E.isMounted){let{next:ae,bu:de,u:Te,parent:J,vnode:ee}=E;{const Ke=Dl(E);if(Ke){ae&&(ae.el=ee.el,x(E,ae,H)),Ke.asyncDep.then(()=>{E.isUnmounted||te()});return}}let le=ae,xe;ds(E,!1),ae?(ae.el=ee.el,x(E,ae,H)):ae=ee,de&&Wi(de),(xe=ae.props&&ae.props.onVnodeBeforeUpdate)&&kt(xe,J,ae,ee),ds(E,!0);const Pe=qn(E),_e=E.subTree;E.subTree=Pe,m(_e,Pe,d(_e.el),Z(_e),E,$,q),ae.el=Pe.el,le===null&&Jh(E,Pe.el),Te&&ft(Te,$),(xe=ae.props&&ae.props.onVnodeUpdated)&&ft(()=>kt(xe,J,ae,ee),$)}else{let ae;const{el:de,props:Te}=I,{bm:J,m:ee,parent:le,root:xe,type:Pe}=E,_e=hi(I);if(ds(E,!1),J&&Wi(J),!_e&&(ae=Te&&Te.onVnodeBeforeMount)&&kt(ae,le,I),ds(E,!0),de&&Ie){const Ke=()=>{E.subTree=qn(E),Ie(de,E.subTree,E,$,null)};_e&&Pe.__asyncHydrate?Pe.__asyncHydrate(de,E,Ke):Ke()}else{xe.ce&&xe.ce._injectChildStyle(Pe);const Ke=E.subTree=qn(E);m(null,Ke,_,B,E,$,q),I.el=Ke.el}if(ee&&ft(ee,$),!_e&&(ae=Te&&Te.onVnodeMounted)){const Ke=I;ft(()=>kt(ae,le,Ke),$)}(I.shapeFlag&256||le&&hi(le.vnode)&&le.vnode.shapeFlag&256)&&E.a&&ft(E.a,$),E.isMounted=!0,I=_=B=null}};E.scope.on();const X=E.effect=new Yo(te);E.scope.off();const G=E.update=X.run.bind(X),ye=E.job=X.runIfDirty.bind(X);ye.i=E,ye.id=E.uid,X.scheduler=()=>qr(ye),ds(E,!0),G()},x=(E,I,_)=>{I.component=E;const B=E.vnode.props;E.vnode=I,E.next=null,Nh(E,I.props,B,_),Dh(E,I.children,_),cs(),Ma(E),us()},C=(E,I,_,B,$,q,H,te,X=!1)=>{const G=E&&E.children,ye=E?E.shapeFlag:0,ae=I.children,{patchFlag:de,shapeFlag:Te}=I;if(de>0){if(de&128){ne(G,ae,_,B,$,q,H,te,X);return}else if(de&256){R(G,ae,_,B,$,q,H,te,X);return}}Te&8?(ye&16&&Q(G,$,q),ae!==G&&u(_,ae)):ye&16?Te&16?ne(G,ae,_,B,$,q,H,te,X):Q(G,$,q,!0):(ye&8&&u(_,""),Te&16&&g(ae,_,B,$,q,H,te,X))},R=(E,I,_,B,$,q,H,te,X)=>{E=E||Ds,I=I||Ds;const G=E.length,ye=I.length,ae=Math.min(G,ye);let de;for(de=0;deye?Q(E,$,q,!0,!1,ae):g(I,_,B,$,q,H,te,X,ae)},ne=(E,I,_,B,$,q,H,te,X)=>{let G=0;const ye=I.length;let ae=E.length-1,de=ye-1;for(;G<=ae&&G<=de;){const Te=E[G],J=I[G]=X?ns(I[G]):It(I[G]);if(Js(Te,J))m(Te,J,_,null,$,q,H,te,X);else break;G++}for(;G<=ae&&G<=de;){const Te=E[ae],J=I[de]=X?ns(I[de]):It(I[de]);if(Js(Te,J))m(Te,J,_,null,$,q,H,te,X);else break;ae--,de--}if(G>ae){if(G<=de){const Te=de+1,J=Tede)for(;G<=ae;)F(E[G],$,q,!0),G++;else{const Te=G,J=G,ee=new Map;for(G=J;G<=de;G++){const Ze=I[G]=X?ns(I[G]):It(I[G]);Ze.key!=null&&ee.set(Ze.key,G)}let le,xe=0;const Pe=de-J+1;let _e=!1,Ke=0;const ht=new Array(Pe);for(G=0;G=Pe){F(Ze,$,q,!0);continue}let Ve;if(Ze.key!=null)Ve=ee.get(Ze.key);else for(le=J;le<=de;le++)if(ht[le-J]===0&&Js(Ze,I[le])){Ve=le;break}Ve===void 0?F(Ze,$,q,!0):(ht[Ve-J]=G+1,Ve>=Ke?Ke=Ve:_e=!0,m(Ze,I[Ve],_,null,$,q,H,te,X),xe++)}const fs=_e?jh(ht):Ds;for(le=fs.length-1,G=Pe-1;G>=0;G--){const Ze=J+G,Ve=I[Ze],qe=Ze+1{const{el:q,type:H,transition:te,children:X,shapeFlag:G}=E;if(G&6){M(E.component.subTree,I,_,B);return}if(G&128){E.suspense.move(I,_,B);return}if(G&64){H.move(E,I,_,ke);return}if(H===dt){s(q,I,_);for(let ae=0;aete.enter(q),$);else{const{leave:ae,delayLeave:de,afterLeave:Te}=te,J=()=>s(q,I,_),ee=()=>{ae(q,()=>{J(),Te&&Te()})};de?de(q,J,ee):ee()}else s(q,I,_)},F=(E,I,_,B=!1,$=!1)=>{const{type:q,props:H,ref:te,children:X,dynamicChildren:G,shapeFlag:ye,patchFlag:ae,dirs:de,cacheIndex:Te}=E;if(ae===-2&&($=!1),te!=null&&pr(te,null,_,E,!0),Te!=null&&(I.renderCache[Te]=void 0),ye&256){I.ctx.deactivate(E);return}const J=ye&1&&de,ee=!hi(E);let le;if(ee&&(le=H&&H.onVnodeBeforeUnmount)&&kt(le,I,E),ye&6)K(E.component,_,B);else{if(ye&128){E.suspense.unmount(_,B);return}J&&ps(E,null,I,"beforeUnmount"),ye&64?E.type.remove(E,I,_,ke,B):G&&!G.hasOnce&&(q!==dt||ae>0&&ae&64)?Q(G,I,_,!1,!0):(q===dt&&ae&384||!$&&ye&16)&&Q(X,I,_),B&&N(E)}(ee&&(le=H&&H.onVnodeUnmounted)||J)&&ft(()=>{le&&kt(le,I,E),J&&ps(E,null,I,"unmounted")},_)},N=E=>{const{type:I,el:_,anchor:B,transition:$}=E;if(I===dt){D(_,B);return}if(I===zn){O(E);return}const q=()=>{n(_),$&&!$.persisted&&$.afterLeave&&$.afterLeave()};if(E.shapeFlag&1&&$&&!$.persisted){const{leave:H,delayLeave:te}=$,X=()=>H(_,q);te?te(E.el,q,X):X()}else q()},D=(E,I)=>{let _;for(;E!==I;)_=c(E),n(E),E=_;n(I)},K=(E,I,_)=>{const{bum:B,scope:$,job:q,subTree:H,um:te,m:X,a:G}=E;ja(X),ja(G),B&&Wi(B),$.stop(),q&&(q.flags|=8,F(H,E,I,_)),te&&ft(te,I),ft(()=>{E.isUnmounted=!0},I),I&&I.pendingBranch&&!I.isUnmounted&&E.asyncDep&&!E.asyncResolved&&E.suspenseId===I.pendingId&&(I.deps--,I.deps===0&&I.resolve())},Q=(E,I,_,B=!1,$=!1,q=0)=>{for(let H=q;H{if(E.shapeFlag&6)return Z(E.component.subTree);if(E.shapeFlag&128)return E.suspense.next();const I=c(E.anchor||E.el),_=I&&I[ih];return _?c(_):I};let ce=!1;const pe=(E,I,_)=>{E==null?I._vnode&&F(I._vnode,null,null,!0):m(I._vnode||null,E,I,null,null,null,_),I._vnode=E,ce||(ce=!0,Ma(),ml(),ce=!1)},ke={p:m,um:F,m:M,r:N,mt:z,mc:g,pc:C,pbc:ie,n:Z,o:i};let ve,Ie;return t&&([ve,Ie]=t(ke)),{render:pe,hydrate:ve,createApp:vh(pe,ve)}}function Kn({type:i,props:t},e){return e==="svg"&&i==="foreignObject"||e==="mathml"&&i==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:e}function ds({effect:i,job:t},e){e?(i.flags|=32,t.flags|=4):(i.flags&=-33,t.flags&=-5)}function $h(i,t){return(!i||i&&!i.pendingBranch)&&t&&!t.persisted}function Ol(i,t,e=!1){const s=i.children,n=t.children;if(be(s)&&be(n))for(let r=0;r>1,i[e[o]]0&&(t[s]=e[r-1]),e[r]=s)}}for(r=e.length,a=e[r-1];r-- >0;)e[r]=a,a=t[a];return e}function Dl(i){const t=i.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Dl(t)}function ja(i){if(i)for(let t=0;tqi(Uh);function pi(i,t,e){return Fl(i,t,e)}function Fl(i,t,e=Re){const{immediate:s,deep:n,flush:r,once:a}=e,o=Xe({},e);let l;if(Cn)if(r==="sync"){const c=Vh();l=c.__watcherHandles||(c.__watcherHandles=[])}else if(!t||s)o.once=!0;else{const c=()=>{};return c.stop=Et,c.resume=Et,c.pause=Et,c}const h=et;o.call=(c,f,p)=>_t(c,h,f,p);let u=!1;r==="post"?o.scheduler=c=>{ft(c,h&&h.suspense)}:r!=="sync"&&(u=!0,o.scheduler=(c,f)=>{f?c():qr(c)}),o.augmentJob=c=>{t&&(c.flags|=4),u&&(c.flags|=2,h&&(c.id=h.uid,c.i=h))};const d=Yu(i,t,o);return l&&l.push(d),d}function Hh(i,t,e){const s=this.proxy,n=We(i)?i.includes(".")?Bl(s,i):()=>s[i]:i.bind(s,s);let r;Ee(t)?r=t:(r=t.handler,e=t);const a=Ni(this),o=Fl(n,r.bind(s),e);return a(),o}function Bl(i,t){const e=t.split(".");return()=>{let s=i;for(let n=0;nt==="modelValue"||t==="model-value"?i.modelModifiers:i[`${t}Modifiers`]||i[`${xt(t)}Modifiers`]||i[`${ws(t)}Modifiers`];function Wh(i,t,...e){if(i.isUnmounted)return;const s=i.vnode.props||Re;let n=e;const r=t.startsWith("update:"),a=r&&Gh(s,t.slice(7));a&&(a.trim&&(n=e.map(u=>We(u)?u.trim():u)),a.number&&(n=e.map(cr)));let o,l=s[o=$n(t)]||s[o=$n(xt(t))];!l&&r&&(l=s[o=$n(ws(t))]),l&&_t(l,i,6,n);const h=s[o+"Once"];if(h){if(!i.emitted)i.emitted={};else if(i.emitted[o])return;i.emitted[o]=!0,_t(h,i,6,n)}}function Rl(i,t,e=!1){const s=t.emitsCache,n=s.get(i);if(n!==void 0)return n;const r=i.emits;let a={},o=!1;if(!Ee(i)){const l=h=>{const u=Rl(h,t,!0);u&&(o=!0,Xe(a,u))};!e&&t.mixins.length&&t.mixins.forEach(l),i.extends&&l(i.extends),i.mixins&&i.mixins.forEach(l)}return!r&&!o?(je(i)&&s.set(i,null),null):(be(r)?r.forEach(l=>a[l]=null):Xe(a,r),je(i)&&s.set(i,a),a)}function An(i,t){return!i||!dn(t)?!1:(t=t.slice(2).replace(/Once$/,""),Oe(i,t[0].toLowerCase()+t.slice(1))||Oe(i,ws(t))||Oe(i,t))}function qn(i){const{type:t,vnode:e,proxy:s,withProxy:n,propsOptions:[r],slots:a,attrs:o,emit:l,render:h,renderCache:u,props:d,data:c,setupState:f,ctx:p,inheritAttrs:m}=i,b=nn(i);let P,A;try{if(e.shapeFlag&4){const O=n||s,S=O;P=It(h.call(S,O,u,d,f,c,p)),A=o}else{const O=t;P=It(O.length>1?O(d,{attrs:o,slots:a,emit:l}):O(d,null)),A=t.props?o:Kh(o)}}catch(O){di.length=0,Pn(O,i,1),P=Je(As)}let U=P;if(A&&m!==!1){const O=Object.keys(A),{shapeFlag:S}=U;O.length&&S&7&&(r&&O.some(Mr)&&(A=qh(A,r)),U=Hs(U,A,!1,!0))}return e.dirs&&(U=Hs(U,null,!1,!0),U.dirs=U.dirs?U.dirs.concat(e.dirs):e.dirs),e.transition&&zr(U,e.transition),P=U,nn(b),P}const Kh=i=>{let t;for(const e in i)(e==="class"||e==="style"||dn(e))&&((t||(t={}))[e]=i[e]);return t},qh=(i,t)=>{const e={};for(const s in i)(!Mr(s)||!(s.slice(9)in t))&&(e[s]=i[s]);return e};function zh(i,t,e){const{props:s,children:n,component:r}=i,{props:a,children:o,patchFlag:l}=t,h=r.emitsOptions;if(t.dirs||t.transition)return!0;if(e&&l>=0){if(l&1024)return!0;if(l&16)return s?Ua(s,a,h):!!a;if(l&8){const u=t.dynamicProps;for(let d=0;di.__isSuspense;function Xh(i,t){t&&t.pendingBranch?be(i)?t.effects.push(...i):t.effects.push(i):th(i)}const dt=Symbol.for("v-fgt"),wn=Symbol.for("v-txt"),As=Symbol.for("v-cmt"),zn=Symbol.for("v-stc"),di=[];let yt=null;function St(i=!1){di.push(yt=i?null:[])}function Yh(){di.pop(),yt=di[di.length-1]||null}let Ei=1;function Va(i){Ei+=i,i<0&&yt&&(yt.hasOnce=!0)}function jl(i){return i.dynamicChildren=Ei>0?yt||Ds:null,Yh(),Ei>0&&yt&&yt.push(i),i}function Ct(i,t,e,s,n,r){return jl(Ae(i,t,e,s,n,r,!0))}function Zh(i,t,e,s,n){return jl(Je(i,t,e,s,n,!0))}function an(i){return i?i.__v_isVNode===!0:!1}function Js(i,t){return i.type===t.type&&i.key===t.key}const Ul=({key:i})=>i!=null?i:null,zi=({ref:i,ref_key:t,ref_for:e})=>(typeof i=="number"&&(i=""+i),i!=null?We(i)||tt(i)||Ee(i)?{i:mt,r:i,k:t,f:!!e}:i:null);function Ae(i,t=null,e=null,s=0,n=null,r=i===dt?0:1,a=!1,o=!1){const l={__v_isVNode:!0,__v_skip:!0,type:i,props:t,key:t&&Ul(t),ref:t&&zi(t),scopeId:gl,slotScopeIds:null,children:e,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:mt};return o?(Yr(l,e),r&128&&i.normalize(l)):e&&(l.shapeFlag|=We(e)?8:16),Ei>0&&!a&&yt&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&yt.push(l),l}const Je=Qh;function Qh(i,t=null,e=null,s=0,n=null,r=!1){if((!i||i===bh)&&(i=As),an(i)){const o=Hs(i,t,!0);return e&&Yr(o,e),Ei>0&&!r&&yt&&(o.shapeFlag&6?yt[yt.indexOf(i)]=o:yt.push(o)),o.patchFlag=-2,o}if(ff(i)&&(i=i.__vccOpts),t){t=ef(t);let{class:o,style:l}=t;o&&!We(o)&&(t.class=bi(o)),je(l)&&(Wr(l)&&!be(l)&&(l=Xe({},l)),t.style=Br(l))}const a=We(i)?1:$l(i)?128:nh(i)?64:je(i)?4:Ee(i)?2:0;return Ae(i,t,e,s,n,a,r,!0)}function ef(i){return i?Wr(i)||kl(i)?Xe({},i):i:null}function Hs(i,t,e=!1,s=!1){const{props:n,ref:r,patchFlag:a,children:o,transition:l}=i,h=t?sf(n||{},t):n,u={__v_isVNode:!0,__v_skip:!0,type:i.type,props:h,key:h&&Ul(h),ref:t&&t.ref?e&&r?be(r)?r.concat(zi(t)):[r,zi(t)]:zi(t):r,scopeId:i.scopeId,slotScopeIds:i.slotScopeIds,children:o,target:i.target,targetStart:i.targetStart,targetAnchor:i.targetAnchor,staticCount:i.staticCount,shapeFlag:i.shapeFlag,patchFlag:t&&i.type!==dt?a===-1?16:a|16:a,dynamicProps:i.dynamicProps,dynamicChildren:i.dynamicChildren,appContext:i.appContext,dirs:i.dirs,transition:l,component:i.component,suspense:i.suspense,ssContent:i.ssContent&&Hs(i.ssContent),ssFallback:i.ssFallback&&Hs(i.ssFallback),el:i.el,anchor:i.anchor,ctx:i.ctx,ce:i.ce};return l&&s&&zr(u,l.clone(u)),u}function Tr(i=" ",t=0){return Je(wn,null,i,t)}function tf(i="",t=!1){return t?(St(),Zh(As,null,i)):Je(As,null,i)}function It(i){return i==null||typeof i=="boolean"?Je(As):be(i)?Je(dt,null,i.slice()):an(i)?ns(i):Je(wn,null,String(i))}function ns(i){return i.el===null&&i.patchFlag!==-1||i.memo?i:Hs(i)}function Yr(i,t){let e=0;const{shapeFlag:s}=i;if(t==null)t=null;else if(be(t))e=16;else if(typeof t=="object")if(s&65){const n=t.default;n&&(n._c&&(n._d=!1),Yr(i,n()),n._c&&(n._d=!0));return}else{e=32;const n=t._;!n&&!kl(t)?t._ctx=mt:n===3&&mt&&(mt.slots._===1?t._=1:(t._=2,i.patchFlag|=1024))}else Ee(t)?(t={default:t,_ctx:mt},e=32):(t=String(t),s&64?(e=16,t=[Tr(t)]):e=8);i.children=t,i.shapeFlag|=e}function sf(...i){const t={};for(let e=0;e{let n;return(n=i[e])||(n=i[e]=[]),n.push(s),r=>{n.length>1?n.forEach(a=>a(r)):n[0](r)}};on=t("__VUE_INSTANCE_SETTERS__",e=>et=e),br=t("__VUE_SSR_SETTERS__",e=>Cn=e)}const Ni=i=>{const t=et;return on(i),i.scope.on(),()=>{i.scope.off(),on(t)}},Ha=()=>{et&&et.scope.off(),on(null)};function Vl(i){return i.vnode.shapeFlag&4}let Cn=!1;function of(i,t=!1,e=!1){t&&br(t);const{props:s,children:n}=i.vnode,r=Vl(i);Ih(i,s,r,t),Oh(i,n,e);const a=r?lf(i,t):void 0;return t&&br(!1),a}function lf(i,t){const e=i.type;i.accessCache=Object.create(null),i.proxy=new Proxy(i.ctx,Sh);const{setup:s}=e;if(s){const n=i.setupContext=s.length>1?uf(i):null,r=Ni(i);cs();const a=Ii(s,i,0,[i.props,n]);if(us(),r(),Ho(a)){if(hi(i)||Tl(i),a.then(Ha,Ha),t)return a.then(o=>{Ga(i,o,t)}).catch(o=>{Pn(o,i,0)});i.asyncDep=a}else Ga(i,a,t)}else Hl(i,t)}function Ga(i,t,e){Ee(t)?i.type.__ssrInlineRender?i.ssrRender=t:i.render=t:je(t)&&(i.setupState=fl(t)),Hl(i,e)}let Wa;function Hl(i,t,e){const s=i.type;if(!i.render){if(!t&&Wa&&!s.render){const n=s.template||Jr(i).template;if(n){const{isCustomElement:r,compilerOptions:a}=i.appContext.config,{delimiters:o,compilerOptions:l}=s,h=Xe(Xe({isCustomElement:r,delimiters:o},a),l);s.render=Wa(n,h)}}i.render=s.render||Et}{const n=Ni(i);cs();try{Ph(i)}finally{us(),n()}}}const cf={get(i,t){return st(i,"get",""),i[t]}};function uf(i){const t=e=>{i.exposed=e||{}};return{attrs:new Proxy(i.attrs,cf),slots:i.slots,emit:i.emit,expose:t}}function kn(i){return i.exposed?i.exposeProxy||(i.exposeProxy=new Proxy(fl(Gu(i.exposed)),{get(t,e){if(e in t)return t[e];if(e in fi)return fi[e](i)},has(t,e){return e in t||e in fi}})):i.proxy}function hf(i,t=!0){return Ee(i)?i.displayName||i.name:i.name||t&&i.__name}function ff(i){return Ee(i)&&"__vccOpts"in i}const Ht=(i,t)=>Ju(i,t,Cn);function Ka(i,t,e){const s=arguments.length;return s===2?je(t)&&!be(t)?an(t)?Je(i,null,[t]):Je(i,t):Je(i,null,t):(s>3?e=Array.prototype.slice.call(arguments,2):s===3&&an(e)&&(e=[e]),Je(i,t,e))}const pf="3.5.11";/** * @vue/runtime-dom v3.5.11 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let xn;const qa=typeof window!="undefined"&&window.trustedTypes;if(qa)try{xn=qa.createPolicy("vue",{createHTML:i=>i})}catch{}const Gl=xn?i=>xn.createHTML(i):i=>i,df="http://www.w3.org/2000/svg",mf="http://www.w3.org/1998/Math/MathML",Rt=typeof document!="undefined"?document:null,za=Rt&&Rt.createElement("template"),yf={insert:(i,t,e)=>{t.insertBefore(i,e||null)},remove:i=>{const t=i.parentNode;t&&t.removeChild(i)},createElement:(i,t,e,s)=>{const r=t==="svg"?Rt.createElementNS(df,i):t==="mathml"?Rt.createElementNS(mf,i):e?Rt.createElement(i,{is:e}):Rt.createElement(i);return i==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:i=>Rt.createTextNode(i),createComment:i=>Rt.createComment(i),setText:(i,t)=>{i.nodeValue=t},setElementText:(i,t)=>{i.textContent=t},parentNode:i=>i.parentNode,nextSibling:i=>i.nextSibling,querySelector:i=>Rt.querySelector(i),setScopeId(i,t){i.setAttribute(t,"")},insertStaticContent(i,t,e,s,r,n){const a=e?e.previousSibling:t.lastChild;if(r&&(r===n||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),e),!(r===n||!(r=r.nextSibling)););else{za.innerHTML=Gl(s==="svg"?`${i}`:s==="mathml"?`${i}`:i);const o=za.content;if(s==="svg"||s==="mathml"){const l=o.firstChild;for(;l.firstChild;)o.appendChild(l.firstChild);o.removeChild(l)}t.insertBefore(o,e)}return[a?a.nextSibling:t.firstChild,e?e.previousSibling:t.lastChild]}},gf=Symbol("_vtc");function Tf(i,t,e){const s=i[gf];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?i.removeAttribute("class"):e?i.setAttribute("class",t):i.className=t}const Ja=Symbol("_vod"),bf=Symbol("_vsh"),xf=Symbol(""),Sf=/(^|;)\s*display\s*:/;function Pf(i,t,e){const s=i.style,r=We(e);let n=!1;if(e&&!r){if(t)if(We(t))for(const a of t.split(";")){const o=a.slice(0,a.indexOf(":")).trim();e[o]==null&&Ji(s,o,"")}else for(const a in t)e[a]==null&&Ji(s,a,"");for(const a in e)a==="display"&&(n=!0),Ji(s,a,e[a])}else if(r){if(t!==e){const a=s[xf];a&&(e+=";"+a),s.cssText=e,n=Sf.test(e)}}else t&&i.removeAttribute("style");Ja in i&&(i[Ja]=n?s.display:"",i[bf]&&(s.display="none"))}const Xa=/\s*!important$/;function Ji(i,t,e){if(be(e))e.forEach(s=>Ji(i,t,s));else if(e==null&&(e=""),t.startsWith("--"))i.setProperty(t,e);else{const s=Ef(i,t);Xa.test(e)?i.setProperty(ws(s),e.replace(Xa,""),"important"):i[s]=e}}const Ya=["Webkit","Moz","ms"],zr={};function Ef(i,t){const e=zr[t];if(e)return e;let s=xt(t);if(s!=="filter"&&s in i)return zr[t]=s;s=yr(s);for(let r=0;rJr||(kf.then(()=>Jr=0),Jr=Date.now());function Lf(i,t){const e=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=e.attached)return;_t(If(s,e.value),t,5,[s])};return e.value=i,e.attached=vf(),e}function If(i,t){if(be(t)){const e=i.stopImmediatePropagation;return i.stopImmediatePropagation=()=>{e.call(i),i._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const io=i=>i.charCodeAt(0)===111&&i.charCodeAt(1)===110&&i.charCodeAt(2)>96&&i.charCodeAt(2)<123,Nf=(i,t,e,s,r,n)=>{const a=r==="svg";t==="class"?Tf(i,s,a):t==="style"?Pf(i,e,s):pr(t)?Mn(t)||wf(i,t,e,s,n):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):_f(i,t,s,a))?(eo(i,t,s),!i.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Qa(i,t,s,a,n,t!=="value")):i._isVueCE&&(/[A-Z]/.test(t)||!We(s))?eo(i,xt(t),s):(t==="true-value"?i._trueValue=s:t==="false-value"&&(i._falseValue=s),Qa(i,t,s,a))};function _f(i,t,e,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in i&&io(t)&&Ee(e));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&i.tagName==="INPUT"||t==="type"&&i.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=i.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return io(t)&&We(e)?!1:t in i}const or=i=>{const t=i.props["onUpdate:modelValue"]||!1;return be(t)?e=>Wi(t,e):t};function Mf(i){i.target.composing=!0}function ro(i){const t=i.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const js=Symbol("_assign"),no={created(i,{modifiers:{lazy:t,trim:e,number:s}},r){i[js]=or(r);const n=s||r.props&&r.props.type==="number";bs(i,t?"change":"input",a=>{if(a.target.composing)return;let o=i.value;e&&(o=o.trim()),n&&(o=cn(o)),i[js](o)}),e&&bs(i,"change",()=>{i.value=i.value.trim()}),t||(bs(i,"compositionstart",Mf),bs(i,"compositionend",ro),bs(i,"change",ro))},mounted(i,{value:t}){i.value=t==null?"":t},beforeUpdate(i,{value:t,oldValue:e,modifiers:{lazy:s,trim:r,number:n}},a){if(i[js]=or(a),i.composing)return;const o=(n||i.type==="number")&&!/^0\d/.test(i.value)?cn(i.value):i.value,l=t==null?"":t;o!==l&&(document.activeElement===i&&i.type!=="range"&&(s&&t===e||r&&i.value.trim()===l)||(i.value=l))}},Xr={deep:!0,created(i,t,e){i[js]=or(e),bs(i,"change",()=>{const s=i._modelValue,r=Of(i),n=i.checked,a=i[js];if(be(s)){const o=zo(s,r),l=o!==-1;if(n&&!l)a(s.concat(r));else if(!n&&l){const h=[...s];h.splice(o,1),a(h)}}else if(dr(s)){const o=new Set(s);n?o.add(r):o.delete(r),a(o)}else a(Wl(i,n))})},mounted:ao,beforeUpdate(i,t,e){i[js]=or(e),ao(i,t,e)}};function ao(i,{value:t},e){i._modelValue=t;let s;be(t)?s=zo(t,e.props.value)>-1:dr(t)?s=t.has(e.props.value):s=gr(t,Wl(i,!0)),i.checked!==s&&(i.checked=s)}function Of(i){return"_value"in i?i._value:i.value}function Wl(i,t){const e=t?"_trueValue":"_falseValue";return e in i?i[e]:t}const Df=Xe({patchProp:Nf},yf);let oo;function Ff(){return oo||(oo=Bh(Df))}const Bf=(...i)=>{const t=Ff().createApp(...i),{mount:e}=t;return t.mount=s=>{const r=$f(s);if(!r)return;const n=t._component;!Ee(n)&&!n.render&&!n.template&&(n.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const a=e(r,!1,Rf(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),a},t};function Rf(i){if(i instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&i instanceof MathMLElement)return"mathml"}function $f(i){return We(i)?document.querySelector(i):i}var Ut=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},kr={};Object.defineProperty(kr,"__esModule",{value:!0});function jf(i,t){if(i==null)return{};var e={};for(var s in i)if({}.hasOwnProperty.call(i,s)){if(t.includes(s))continue;e[s]=i[s]}return e}class as{constructor(t,e,s){this.line=void 0,this.column=void 0,this.index=void 0,this.line=t,this.column=e,this.index=s}}class lr{constructor(t,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=t,this.end=e}}function ot(i,t){const{line:e,column:s,index:r}=i;return new as(e,s+t,r+t)}const lo="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED";var Uf={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:lo},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:lo}};const co={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},Xi=i=>i.type==="UpdateExpression"?co.UpdateExpression[`${i.prefix}`]:co[i.type];var Vf={AccessorIsGenerator:({kind:i})=>`A ${i}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncFunction:"'await' is only allowed within async functions.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:i})=>`Missing initializer in ${i} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:i})=>`\`${i}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:i})=>`'import.${i}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:i,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`. +**/let xr;const qa=typeof window!="undefined"&&window.trustedTypes;if(qa)try{xr=qa.createPolicy("vue",{createHTML:i=>i})}catch{}const Gl=xr?i=>xr.createHTML(i):i=>i,df="http://www.w3.org/2000/svg",mf="http://www.w3.org/1998/Math/MathML",Rt=typeof document!="undefined"?document:null,za=Rt&&Rt.createElement("template"),yf={insert:(i,t,e)=>{t.insertBefore(i,e||null)},remove:i=>{const t=i.parentNode;t&&t.removeChild(i)},createElement:(i,t,e,s)=>{const n=t==="svg"?Rt.createElementNS(df,i):t==="mathml"?Rt.createElementNS(mf,i):e?Rt.createElement(i,{is:e}):Rt.createElement(i);return i==="select"&&s&&s.multiple!=null&&n.setAttribute("multiple",s.multiple),n},createText:i=>Rt.createTextNode(i),createComment:i=>Rt.createComment(i),setText:(i,t)=>{i.nodeValue=t},setElementText:(i,t)=>{i.textContent=t},parentNode:i=>i.parentNode,nextSibling:i=>i.nextSibling,querySelector:i=>Rt.querySelector(i),setScopeId(i,t){i.setAttribute(t,"")},insertStaticContent(i,t,e,s,n,r){const a=e?e.previousSibling:t.lastChild;if(n&&(n===r||n.nextSibling))for(;t.insertBefore(n.cloneNode(!0),e),!(n===r||!(n=n.nextSibling)););else{za.innerHTML=Gl(s==="svg"?`${i}`:s==="mathml"?`${i}`:i);const o=za.content;if(s==="svg"||s==="mathml"){const l=o.firstChild;for(;l.firstChild;)o.appendChild(l.firstChild);o.removeChild(l)}t.insertBefore(o,e)}return[a?a.nextSibling:t.firstChild,e?e.previousSibling:t.lastChild]}},gf=Symbol("_vtc");function Tf(i,t,e){const s=i[gf];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?i.removeAttribute("class"):e?i.setAttribute("class",t):i.className=t}const Ja=Symbol("_vod"),bf=Symbol("_vsh"),xf=Symbol(""),Sf=/(^|;)\s*display\s*:/;function Pf(i,t,e){const s=i.style,n=We(e);let r=!1;if(e&&!n){if(t)if(We(t))for(const a of t.split(";")){const o=a.slice(0,a.indexOf(":")).trim();e[o]==null&&Ji(s,o,"")}else for(const a in t)e[a]==null&&Ji(s,a,"");for(const a in e)a==="display"&&(r=!0),Ji(s,a,e[a])}else if(n){if(t!==e){const a=s[xf];a&&(e+=";"+a),s.cssText=e,r=Sf.test(e)}}else t&&i.removeAttribute("style");Ja in i&&(i[Ja]=r?s.display:"",i[bf]&&(s.display="none"))}const Xa=/\s*!important$/;function Ji(i,t,e){if(be(e))e.forEach(s=>Ji(i,t,s));else if(e==null&&(e=""),t.startsWith("--"))i.setProperty(t,e);else{const s=Ef(i,t);Xa.test(e)?i.setProperty(ws(s),e.replace(Xa,""),"important"):i[s]=e}}const Ya=["Webkit","Moz","ms"],Jn={};function Ef(i,t){const e=Jn[t];if(e)return e;let s=xt(t);if(s!=="filter"&&s in i)return Jn[t]=s;s=gn(s);for(let n=0;nXn||(kf.then(()=>Xn=0),Xn=Date.now());function Lf(i,t){const e=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=e.attached)return;_t(If(s,e.value),t,5,[s])};return e.value=i,e.attached=vf(),e}function If(i,t){if(be(t)){const e=i.stopImmediatePropagation;return i.stopImmediatePropagation=()=>{e.call(i),i._stopped=!0},t.map(s=>n=>!n._stopped&&s&&s(n))}else return t}const io=i=>i.charCodeAt(0)===111&&i.charCodeAt(1)===110&&i.charCodeAt(2)>96&&i.charCodeAt(2)<123,Nf=(i,t,e,s,n,r)=>{const a=n==="svg";t==="class"?Tf(i,s,a):t==="style"?Pf(i,e,s):dn(t)?Mr(t)||wf(i,t,e,s,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):_f(i,t,s,a))?(eo(i,t,s),!i.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Qa(i,t,s,a,r,t!=="value")):i._isVueCE&&(/[A-Z]/.test(t)||!We(s))?eo(i,xt(t),s):(t==="true-value"?i._trueValue=s:t==="false-value"&&(i._falseValue=s),Qa(i,t,s,a))};function _f(i,t,e,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in i&&io(t)&&Ee(e));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&i.tagName==="INPUT"||t==="type"&&i.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const n=i.tagName;if(n==="IMG"||n==="VIDEO"||n==="CANVAS"||n==="SOURCE")return!1}return io(t)&&We(e)?!1:t in i}const ln=i=>{const t=i.props["onUpdate:modelValue"]||!1;return be(t)?e=>Wi(t,e):t};function Mf(i){i.target.composing=!0}function no(i){const t=i.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const js=Symbol("_assign"),ro={created(i,{modifiers:{lazy:t,trim:e,number:s}},n){i[js]=ln(n);const r=s||n.props&&n.props.type==="number";bs(i,t?"change":"input",a=>{if(a.target.composing)return;let o=i.value;e&&(o=o.trim()),r&&(o=cr(o)),i[js](o)}),e&&bs(i,"change",()=>{i.value=i.value.trim()}),t||(bs(i,"compositionstart",Mf),bs(i,"compositionend",no),bs(i,"change",no))},mounted(i,{value:t}){i.value=t==null?"":t},beforeUpdate(i,{value:t,oldValue:e,modifiers:{lazy:s,trim:n,number:r}},a){if(i[js]=ln(a),i.composing)return;const o=(r||i.type==="number")&&!/^0\d/.test(i.value)?cr(i.value):i.value,l=t==null?"":t;o!==l&&(document.activeElement===i&&i.type!=="range"&&(s&&t===e||n&&i.value.trim()===l)||(i.value=l))}},Yn={deep:!0,created(i,t,e){i[js]=ln(e),bs(i,"change",()=>{const s=i._modelValue,n=Of(i),r=i.checked,a=i[js];if(be(s)){const o=zo(s,n),l=o!==-1;if(r&&!l)a(s.concat(n));else if(!r&&l){const h=[...s];h.splice(o,1),a(h)}}else if(mn(s)){const o=new Set(s);r?o.add(n):o.delete(n),a(o)}else a(Wl(i,r))})},mounted:ao,beforeUpdate(i,t,e){i[js]=ln(e),ao(i,t,e)}};function ao(i,{value:t},e){i._modelValue=t;let s;be(t)?s=zo(t,e.props.value)>-1:mn(t)?s=t.has(e.props.value):s=Tn(t,Wl(i,!0)),i.checked!==s&&(i.checked=s)}function Of(i){return"_value"in i?i._value:i.value}function Wl(i,t){const e=t?"_trueValue":"_falseValue";return e in i?i[e]:t}const Df=Xe({patchProp:Nf},yf);let oo;function Ff(){return oo||(oo=Bh(Df))}const Bf=(...i)=>{const t=Ff().createApp(...i),{mount:e}=t;return t.mount=s=>{const n=$f(s);if(!n)return;const r=t._component;!Ee(r)&&!r.render&&!r.template&&(r.template=n.innerHTML),n.nodeType===1&&(n.textContent="");const a=e(n,!1,Rf(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),a},t};function Rf(i){if(i instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&i instanceof MathMLElement)return"mathml"}function $f(i){return We(i)?document.querySelector(i):i}var Ut=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},vn={};Object.defineProperty(vn,"__esModule",{value:!0});function jf(i,t){if(i==null)return{};var e={};for(var s in i)if({}.hasOwnProperty.call(i,s)){if(t.includes(s))continue;e[s]=i[s]}return e}class as{constructor(t,e,s){this.line=void 0,this.column=void 0,this.index=void 0,this.line=t,this.column=e,this.index=s}}class cn{constructor(t,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=t,this.end=e}}function ot(i,t){const{line:e,column:s,index:n}=i;return new as(e,s+t,n+t)}const lo="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED";var Uf={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:lo},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:lo}};const co={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},Xi=i=>i.type==="UpdateExpression"?co.UpdateExpression[`${i.prefix}`]:co[i.type];var Vf={AccessorIsGenerator:({kind:i})=>`A ${i}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncFunction:"'await' is only allowed within async functions.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:i})=>`Missing initializer in ${i} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:i})=>`\`${i}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:i})=>`'import.${i}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:i,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`. - Did you mean \`export { '${i}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:i})=>`'${i==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:i})=>`Unsyntactic ${i==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.",ImportBindingIsString:({importName:i})=>`A string literal cannot be used as an imported binding. -- Did you mean \`import { "${i}" as foo }\`?`,ImportCallArgumentTrailingComma:"Trailing comma is disallowed inside import(...) arguments.",ImportCallArity:({maxArgumentCount:i})=>`\`import()\` requires exactly ${i===1?"one argument":"one or two arguments"}.`,ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:i})=>`Expected number in radix ${i}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:i})=>`Escape sequence in keyword ${i}.`,InvalidIdentifier:({identifierName:i})=>`Invalid identifier ${i}.`,InvalidLhs:({ancestor:i})=>`Invalid left-hand side in ${Xi(i)}.`,InvalidLhsBinding:({ancestor:i})=>`Binding invalid left-hand side in ${Xi(i)}.`,InvalidLhsOptionalChaining:({ancestor:i})=>`Invalid optional chaining in the left-hand side of ${Xi(i)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:i})=>`Unexpected character '${i}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:i})=>`Private name #${i} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:i})=>`Label '${i}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:i})=>`This experimental syntax requires enabling the parser plugin: ${i.map(t=>JSON.stringify(t)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:i})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${i.map(t=>JSON.stringify(t)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:i})=>`Duplicate key "${i}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:i})=>`An export name cannot include a lone surrogate, found '\\u${i.toString(16)}'.`,ModuleExportUndefined:({localName:i})=>`Export '${i}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:i})=>`Private names are only allowed in property accesses (\`obj.#${i}\`) or in \`in\` expressions (\`#${i} in obj\`).`,PrivateNameRedeclaration:({identifierName:i})=>`Duplicate private name #${i}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:i})=>`Unexpected keyword '${i}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:i})=>`Unexpected reserved word '${i}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:i,unexpected:t})=>`Unexpected token${t?` '${t}'.`:""}${i?`, expected "${i}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script`.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:i,onlyValidPropertyName:t})=>`The only valid meta property for ${i} is ${i}.${t}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:i})=>`Identifier '${i}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},Hf={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:i})=>`Assigning to '${i}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:i})=>`Binding '${i}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."};const Gf=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]);var Wf={PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:i})=>`Invalid topic token ${i}. In order to use ${i} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${i}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:i})=>`Hack-style pipe body cannot be an unparenthesized ${Xi({type:i})}; please wrap it in parentheses.`,PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'};const Kf=["message"];function uo(i,t,e){Object.defineProperty(i,t,{enumerable:!1,configurable:!0,value:e})}function qf({toMessage:i,code:t,reasonCode:e,syntaxPlugin:s}){const r=e==="MissingPlugin"||e==="MissingOneOfPlugins";{const n={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};n[e]&&(e=n[e])}return function n(a,o){const l=new SyntaxError;return l.code=t,l.reasonCode=e,l.loc=a,l.pos=a.index,l.syntaxPlugin=s,r&&(l.missingPlugin=o.missingPlugin),uo(l,"clone",function(u={}){var d;const{line:c,column:f,index:p}=(d=u.loc)!=null?d:a;return n(new as(c,f,p),Object.assign({},o,u.details))}),uo(l,"details",o),Object.defineProperty(l,"message",{configurable:!0,get(){const h=`${i(o)} (${a.line}:${a.column})`;return this.message=h,h},set(h){Object.defineProperty(this,"message",{value:h,writable:!0})}}),l}}function Gt(i,t){if(Array.isArray(i))return s=>Gt(s,i[0]);const e={};for(const s of Object.keys(i)){const r=i[s],n=typeof r=="string"?{message:()=>r}:typeof r=="function"?{message:r}:r,{message:a}=n,o=jf(n,Kf),l=typeof a=="string"?()=>a:a;e[s]=qf(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:s,toMessage:l},t?{syntaxPlugin:t}:{},o))}return e}const w=Object.assign({},Gt(Uf),Gt(Vf),Gt(Hf),Gt`pipelineOperator`(Wf)),{defineProperty:zf}=Object,ho=(i,t)=>{i&&zf(i,t,{enumerable:!1,value:i[t]})};function Xs(i){return ho(i.loc.start,"index"),ho(i.loc.end,"index"),i}var Jf=i=>class extends i{parse(){const e=Xs(super.parse());return this.options.tokens&&(e.tokens=e.tokens.map(Xs)),e}parseRegExpLiteral({pattern:e,flags:s}){let r=null;try{r=new RegExp(e,s)}catch{}const n=this.estreeParseLiteral(r);return n.regex={pattern:e,flags:s},n}parseBigIntLiteral(e){let s;try{s=BigInt(e)}catch{s=null}const r=this.estreeParseLiteral(s);return r.bigint=String(r.value||e),r}parseDecimalLiteral(e){const r=this.estreeParseLiteral(null);return r.decimal=String(r.value||e),r}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}directiveToStmt(e){const s=e.value;delete e.value,s.type="Literal",s.raw=s.extra.raw,s.value=s.extra.expressionValue;const r=e;return r.type="ExpressionStatement",r.expression=s,r.directive=s.extra.rawValue,delete s.extra,r}initFunction(e,s){super.initFunction(e,s),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){var s;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((s=e.expression.extra)!=null&&s.parenthesized)}parseBlockBody(e,s,r,n,a){super.parseBlockBody(e,s,r,n,a);const o=e.directives.map(l=>this.directiveToStmt(l));e.body=o.concat(e.body),delete e.directives}pushClassMethod(e,s,r,n,a,o){this.parseMethod(s,r,n,a,o,"ClassMethod",!0),s.typeParameters&&(s.value.typeParameters=s.typeParameters,delete s.typeParameters),e.body.push(s)}parsePrivateName(){const e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){const s=super.getPrivateNameSV(e);return e=e,delete e.id,e.name=s,e.type="PrivateIdentifier",e}isPrivateName(e){return this.getPluginOption("estree","classFeatures")?e.type==="PrivateIdentifier":super.isPrivateName(e)}getPrivateNameSV(e){return this.getPluginOption("estree","classFeatures")?e.name:super.getPrivateNameSV(e)}parseLiteral(e,s){const r=super.parseLiteral(e,s);return r.raw=r.extra.raw,delete r.extra,r}parseFunctionBody(e,s,r=!1){super.parseFunctionBody(e,s,r),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,s,r,n,a,o,l=!1){let h=this.startNode();return h.kind=e.kind,h=super.parseMethod(h,s,r,n,a,o,l),h.type="FunctionExpression",delete h.kind,e.value=h,o==="ClassPrivateMethod"&&(e.computed=!1),this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return e.type==="Literal"?e.value==="constructor":super.nameIsConstructor(e)}parseClassProperty(...e){const s=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&(s.type="PropertyDefinition"),s}parseClassPrivateProperty(...e){const s=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(s.type="PropertyDefinition",s.computed=!1),s}parseObjectMethod(e,s,r,n,a){const o=super.parseObjectMethod(e,s,r,n,a);return o&&(o.type="Property",o.kind==="method"&&(o.kind="init"),o.shorthand=!1),o}parseObjectProperty(e,s,r,n){const a=super.parseObjectProperty(e,s,r,n);return a&&(a.kind="init",a.type="Property"),a}isValidLVal(e,s,r){return e==="Property"?"value":super.isValidLVal(e,s,r)}isAssignable(e,s){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,s):super.isAssignable(e,s)}toAssignable(e,s=!1){if(e!=null&&this.isObjectProperty(e)){const{key:r,value:n}=e;this.isPrivateName(r)&&this.classScope.usePrivateName(this.getPrivateNameSV(r),r.loc.start),this.toAssignable(n,s)}else super.toAssignable(e,s)}toAssignableObjectExpressionProp(e,s,r){e.type==="Property"&&(e.kind==="get"||e.kind==="set")?this.raise(w.PatternHasAccessor,e.key):e.type==="Property"&&e.method?this.raise(w.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,s,r)}finishCallExpression(e,s){const r=super.finishCallExpression(e,s);if(r.callee.type==="Import"){if(r.type="ImportExpression",r.source=r.arguments[0],this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")){var n,a;r.options=(n=r.arguments[1])!=null?n:null,r.attributes=(a=r.arguments[1])!=null?a:null}delete r.arguments,delete r.callee}return r}toReferencedArguments(e){e.type!=="ImportExpression"&&super.toReferencedArguments(e)}parseExport(e,s){const r=this.state.lastTokStartLoc,n=super.parseExport(e,s);switch(n.type){case"ExportAllDeclaration":n.exported=null;break;case"ExportNamedDeclaration":n.specifiers.length===1&&n.specifiers[0].type==="ExportNamespaceSpecifier"&&(n.type="ExportAllDeclaration",n.exported=n.specifiers[0].exported,delete n.specifiers);case"ExportDefaultDeclaration":{var a;const{declaration:o}=n;(o==null?void 0:o.type)==="ClassDeclaration"&&((a=o.decorators)==null?void 0:a.length)>0&&o.start===n.start&&this.resetStartLocation(n,r)}break}return n}parseSubscript(e,s,r,n){const a=super.parseSubscript(e,s,r,n);if(n.optionalChainMember){if((a.type==="OptionalMemberExpression"||a.type==="OptionalCallExpression")&&(a.type=a.type.substring(8)),n.stop){const o=this.startNodeAtNode(a);return o.expression=a,this.finishNode(o,"ChainExpression")}}else(a.type==="MemberExpression"||a.type==="CallExpression")&&(a.optional=!1);return a}isOptionalMemberExpression(e){return e.type==="ChainExpression"?e.expression.type==="MemberExpression":super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return e.type==="ChainExpression"&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type==="Property"&&e.kind==="init"&&!e.method}isObjectMethod(e){return e.type==="Property"&&(e.method||e.kind==="get"||e.kind==="set")}finishNodeAt(e,s,r){return Xs(super.finishNodeAt(e,s,r))}resetStartLocation(e,s){super.resetStartLocation(e,s),Xs(e)}resetEndLocation(e,s=this.state.lastTokEndLoc){super.resetEndLocation(e,s),Xs(e)}};class ri{constructor(t,e){this.token=void 0,this.preserveSpace=void 0,this.token=t,this.preserveSpace=!!e}}const Fe={brace:new ri("{"),j_oTag:new ri("...",!0)};Fe.template=new ri("`",!0);const Ce=!0,oe=!0,Yr=!0,Ys=!0,Qt=!0,Xf=!0;class Kl{constructor(t,e={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.rightAssociative=!!e.rightAssociative,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop!=null?e.binop:null,this.updateContext=null}}const Zn=new Map;function Le(i,t={}){t.keyword=i;const e=me(i,t);return Zn.set(i,e),e}function rt(i,t){return me(i,{beforeExpr:Ce,binop:t})}let mi=-1;const $t=[],Qn=[],ea=[],ta=[],sa=[],ia=[];function me(i,t={}){var e,s,r,n;return++mi,Qn.push(i),ea.push((e=t.binop)!=null?e:-1),ta.push((s=t.beforeExpr)!=null?s:!1),sa.push((r=t.startsExpr)!=null?r:!1),ia.push((n=t.prefix)!=null?n:!1),$t.push(new Kl(i,t)),mi}function we(i,t={}){var e,s,r,n;return++mi,Zn.set(i,mi),Qn.push(i),ea.push((e=t.binop)!=null?e:-1),ta.push((s=t.beforeExpr)!=null?s:!1),sa.push((r=t.startsExpr)!=null?r:!1),ia.push((n=t.prefix)!=null?n:!1),$t.push(new Kl("name",t)),mi}const Yf={bracketL:me("[",{beforeExpr:Ce,startsExpr:oe}),bracketHashL:me("#[",{beforeExpr:Ce,startsExpr:oe}),bracketBarL:me("[|",{beforeExpr:Ce,startsExpr:oe}),bracketR:me("]"),bracketBarR:me("|]"),braceL:me("{",{beforeExpr:Ce,startsExpr:oe}),braceBarL:me("{|",{beforeExpr:Ce,startsExpr:oe}),braceHashL:me("#{",{beforeExpr:Ce,startsExpr:oe}),braceR:me("}"),braceBarR:me("|}"),parenL:me("(",{beforeExpr:Ce,startsExpr:oe}),parenR:me(")"),comma:me(",",{beforeExpr:Ce}),semi:me(";",{beforeExpr:Ce}),colon:me(":",{beforeExpr:Ce}),doubleColon:me("::",{beforeExpr:Ce}),dot:me("."),question:me("?",{beforeExpr:Ce}),questionDot:me("?."),arrow:me("=>",{beforeExpr:Ce}),template:me("template"),ellipsis:me("...",{beforeExpr:Ce}),backQuote:me("`",{startsExpr:oe}),dollarBraceL:me("${",{beforeExpr:Ce,startsExpr:oe}),templateTail:me("...`",{startsExpr:oe}),templateNonTail:me("...${",{beforeExpr:Ce,startsExpr:oe}),at:me("@"),hash:me("#",{startsExpr:oe}),interpreterDirective:me("#!..."),eq:me("=",{beforeExpr:Ce,isAssign:Ys}),assign:me("_=",{beforeExpr:Ce,isAssign:Ys}),slashAssign:me("_=",{beforeExpr:Ce,isAssign:Ys}),xorAssign:me("_=",{beforeExpr:Ce,isAssign:Ys}),moduloAssign:me("_=",{beforeExpr:Ce,isAssign:Ys}),incDec:me("++/--",{prefix:Qt,postfix:Xf,startsExpr:oe}),bang:me("!",{beforeExpr:Ce,prefix:Qt,startsExpr:oe}),tilde:me("~",{beforeExpr:Ce,prefix:Qt,startsExpr:oe}),doubleCaret:me("^^",{startsExpr:oe}),doubleAt:me("@@",{startsExpr:oe}),pipeline:rt("|>",0),nullishCoalescing:rt("??",1),logicalOR:rt("||",1),logicalAND:rt("&&",2),bitwiseOR:rt("|",3),bitwiseXOR:rt("^",4),bitwiseAND:rt("&",5),equality:rt("==/!=/===/!==",6),lt:rt("/<=/>=",7),gt:rt("/<=/>=",7),relational:rt("/<=/>=",7),bitShift:rt("<>/>>>",8),bitShiftL:rt("<>/>>>",8),bitShiftR:rt("<>/>>>",8),plusMin:me("+/-",{beforeExpr:Ce,binop:9,prefix:Qt,startsExpr:oe}),modulo:me("%",{binop:10,startsExpr:oe}),star:me("*",{binop:10}),slash:rt("/",10),exponent:me("**",{beforeExpr:Ce,binop:11,rightAssociative:!0}),_in:Le("in",{beforeExpr:Ce,binop:7}),_instanceof:Le("instanceof",{beforeExpr:Ce,binop:7}),_break:Le("break"),_case:Le("case",{beforeExpr:Ce}),_catch:Le("catch"),_continue:Le("continue"),_debugger:Le("debugger"),_default:Le("default",{beforeExpr:Ce}),_else:Le("else",{beforeExpr:Ce}),_finally:Le("finally"),_function:Le("function",{startsExpr:oe}),_if:Le("if"),_return:Le("return",{beforeExpr:Ce}),_switch:Le("switch"),_throw:Le("throw",{beforeExpr:Ce,prefix:Qt,startsExpr:oe}),_try:Le("try"),_var:Le("var"),_const:Le("const"),_with:Le("with"),_new:Le("new",{beforeExpr:Ce,startsExpr:oe}),_this:Le("this",{startsExpr:oe}),_super:Le("super",{startsExpr:oe}),_class:Le("class",{startsExpr:oe}),_extends:Le("extends",{beforeExpr:Ce}),_export:Le("export"),_import:Le("import",{startsExpr:oe}),_null:Le("null",{startsExpr:oe}),_true:Le("true",{startsExpr:oe}),_false:Le("false",{startsExpr:oe}),_typeof:Le("typeof",{beforeExpr:Ce,prefix:Qt,startsExpr:oe}),_void:Le("void",{beforeExpr:Ce,prefix:Qt,startsExpr:oe}),_delete:Le("delete",{beforeExpr:Ce,prefix:Qt,startsExpr:oe}),_do:Le("do",{isLoop:Yr,beforeExpr:Ce}),_for:Le("for",{isLoop:Yr}),_while:Le("while",{isLoop:Yr}),_as:we("as",{startsExpr:oe}),_assert:we("assert",{startsExpr:oe}),_async:we("async",{startsExpr:oe}),_await:we("await",{startsExpr:oe}),_defer:we("defer",{startsExpr:oe}),_from:we("from",{startsExpr:oe}),_get:we("get",{startsExpr:oe}),_let:we("let",{startsExpr:oe}),_meta:we("meta",{startsExpr:oe}),_of:we("of",{startsExpr:oe}),_sent:we("sent",{startsExpr:oe}),_set:we("set",{startsExpr:oe}),_source:we("source",{startsExpr:oe}),_static:we("static",{startsExpr:oe}),_using:we("using",{startsExpr:oe}),_yield:we("yield",{startsExpr:oe}),_asserts:we("asserts",{startsExpr:oe}),_checks:we("checks",{startsExpr:oe}),_exports:we("exports",{startsExpr:oe}),_global:we("global",{startsExpr:oe}),_implements:we("implements",{startsExpr:oe}),_intrinsic:we("intrinsic",{startsExpr:oe}),_infer:we("infer",{startsExpr:oe}),_is:we("is",{startsExpr:oe}),_mixins:we("mixins",{startsExpr:oe}),_proto:we("proto",{startsExpr:oe}),_require:we("require",{startsExpr:oe}),_satisfies:we("satisfies",{startsExpr:oe}),_keyof:we("keyof",{startsExpr:oe}),_readonly:we("readonly",{startsExpr:oe}),_unique:we("unique",{startsExpr:oe}),_abstract:we("abstract",{startsExpr:oe}),_declare:we("declare",{startsExpr:oe}),_enum:we("enum",{startsExpr:oe}),_module:we("module",{startsExpr:oe}),_namespace:we("namespace",{startsExpr:oe}),_interface:we("interface",{startsExpr:oe}),_type:we("type",{startsExpr:oe}),_opaque:we("opaque",{startsExpr:oe}),name:me("name",{startsExpr:oe}),string:me("string",{startsExpr:oe}),num:me("num",{startsExpr:oe}),bigint:me("bigint",{startsExpr:oe}),decimal:me("decimal",{startsExpr:oe}),regexp:me("regexp",{startsExpr:oe}),privateName:me("#name",{startsExpr:oe}),eof:me("eof"),jsxName:me("jsxName"),jsxText:me("jsxText",{beforeExpr:!0}),jsxTagStart:me("jsxTagStart",{startsExpr:!0}),jsxTagEnd:me("jsxTagEnd"),placeholder:me("%%",{startsExpr:!0})};function Me(i){return i>=93&&i<=132}function Zf(i){return i<=92}function Pt(i){return i>=58&&i<=132}function ql(i){return i>=58&&i<=136}function Qf(i){return ta[i]}function Sn(i){return sa[i]}function ep(i){return i>=29&&i<=33}function fo(i){return i>=129&&i<=131}function tp(i){return i>=90&&i<=92}function ra(i){return i>=58&&i<=92}function sp(i){return i>=39&&i<=59}function ip(i){return i===34}function rp(i){return ia[i]}function np(i){return i>=121&&i<=123}function ap(i){return i>=124&&i<=130}function os(i){return Qn[i]}function Yi(i){return ea[i]}function op(i){return i===57}function cr(i){return i>=24&&i<=25}function Bt(i){return $t[i]}$t[8].updateContext=i=>{i.pop()},$t[5].updateContext=$t[7].updateContext=$t[23].updateContext=i=>{i.push(Fe.brace)},$t[22].updateContext=i=>{i[i.length-1]===Fe.template?i.pop():i.push(Fe.template)},$t[142].updateContext=i=>{i.push(Fe.j_expr,Fe.j_oTag)};let na="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",zl="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65";const lp=new RegExp("["+na+"]"),cp=new RegExp("["+na+zl+"]");na=zl=null;const Jl=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],up=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function Pn(i,t){let e=65536;for(let s=0,r=t.length;si)return!1;if(e+=t[s+1],e>=i)return!0}return!1}function Vt(i){return i<65?i===36:i<=90?!0:i<97?i===95:i<=122?!0:i<=65535?i>=170&&lp.test(String.fromCharCode(i)):Pn(i,Jl)}function Us(i){return i<48?i===36:i<58?!0:i<65?!1:i<=90?!0:i<97?i===95:i<=122?!0:i<=65535?i>=170&&cp.test(String.fromCharCode(i)):Pn(i,Jl)||Pn(i,up)}const aa={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},hp=new Set(aa.keyword),fp=new Set(aa.strict),pp=new Set(aa.strictBind);function Xl(i,t){return t&&i==="await"||i==="enum"}function Yl(i,t){return Xl(i,t)||fp.has(i)}function Zl(i){return pp.has(i)}function Ql(i,t){return Yl(i,t)||Zl(i)}function dp(i){return hp.has(i)}function mp(i,t,e){return i===64&&t===64&&Vt(e)}const yp=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function gp(i){return yp.has(i)}class oa{constructor(t){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=t}}class la{constructor(t,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=t,this.inModule=e}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){const t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){const{flags:e}=this.scopeStack[t];if(e&128)return!0;if(e&451)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new oa(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,e,s){let r=this.currentScope();if(e&8||e&16){this.checkRedeclarationInScope(r,t,e,s);let n=r.names.get(t)||0;e&16?n=n|4:(r.firstLexicalName||(r.firstLexicalName=t),n=n|2),r.names.set(t,n),e&8&&this.maybeExportDefined(r,t)}else if(e&4)for(let n=this.scopeStack.length-1;n>=0&&(r=this.scopeStack[n],this.checkRedeclarationInScope(r,t,e,s),r.names.set(t,(r.names.get(t)||0)|1),this.maybeExportDefined(r,t),!(r.flags&387));--n);this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,e){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(t,e,s,r){this.isRedeclaredInScope(t,e,s)&&this.parser.raise(w.VarRedeclaration,r,{identifierName:e})}isRedeclaredInScope(t,e,s){if(!(s&1))return!1;if(s&8)return t.names.has(e);const r=t.names.get(e);return s&16?(r&2)>0||!this.treatFunctionsAsVarInScope(t)&&(r&1)>0:(r&2)>0&&!(t.flags&8&&t.firstLexicalName===e)||!this.treatFunctionsAsVarInScope(t)&&(r&4)>0}checkLocalExport(t){const{name:e}=t;this.scopeStack[0].names.has(e)||this.undefinedExports.set(e,t.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){const{flags:e}=this.scopeStack[t];if(e&387)return e}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){const{flags:e}=this.scopeStack[t];if(e&451&&!(e&4))return e}}}class Tp extends oa{constructor(...t){super(...t),this.declareFunctions=new Set}}class bp extends la{createScope(t){return new Tp(t)}declareName(t,e,s){const r=this.currentScope();if(e&2048){this.checkRedeclarationInScope(r,t,e,s),this.maybeExportDefined(r,t),r.declareFunctions.add(t);return}super.declareName(t,e,s)}isRedeclaredInScope(t,e,s){if(super.isRedeclaredInScope(t,e,s))return!0;if(s&2048&&!t.declareFunctions.has(e)){const r=t.names.get(e);return(r&4)>0||(r&2)>0}return!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}}class xp{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}hasPlugin(t){if(typeof t=="string")return this.plugins.has(t);{const[e,s]=t;if(!this.hasPlugin(e))return!1;const r=this.plugins.get(e);for(const n of Object.keys(s))if((r==null?void 0:r[n])!==s[n])return!1;return!0}}getPluginOption(t,e){var s;return(s=this.plugins.get(t))==null?void 0:s[e]}}function ec(i,t){i.trailingComments===void 0?i.trailingComments=t:i.trailingComments.unshift(...t)}function Sp(i,t){i.leadingComments===void 0?i.leadingComments=t:i.leadingComments.unshift(...t)}function Ai(i,t){i.innerComments===void 0?i.innerComments=t:i.innerComments.unshift(...t)}function Zs(i,t,e){let s=null,r=t.length;for(;s===null&&r>0;)s=t[--r];s===null||s.start>e.start?Ai(i,e.comments):ec(s,e.comments)}class Pp extends xp{addComment(t){this.filename&&(t.loc.filename=this.filename);const{commentsLen:e}=this.state;this.comments.length!==e&&(this.comments.length=e),this.comments.push(t),this.state.commentsLen++}processComment(t){const{commentStack:e}=this.state,s=e.length;if(s===0)return;let r=s-1;const n=e[r];n.start===t.end&&(n.leadingNode=t,r--);const{start:a}=t;for(;r>=0;r--){const o=e[r],l=o.end;if(l>a)o.containingNode=t,this.finalizeComment(o),e.splice(r,1);else{l===a&&(o.trailingNode=t);break}}}finalizeComment(t){const{comments:e}=t;if(t.leadingNode!==null||t.trailingNode!==null)t.leadingNode!==null&&ec(t.leadingNode,e),t.trailingNode!==null&&Sp(t.trailingNode,e);else{const{containingNode:s,start:r}=t;if(this.input.charCodeAt(r-1)===44)switch(s.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":Zs(s,s.properties,t);break;case"CallExpression":case"OptionalCallExpression":Zs(s,s.arguments,t);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":Zs(s,s.params,t);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":Zs(s,s.elements,t);break;case"ExportNamedDeclaration":case"ImportDeclaration":Zs(s,s.specifiers,t);break;default:Ai(s,e)}else Ai(s,e)}}finalizeRemainingComments(){const{commentStack:t}=this.state;for(let e=t.length-1;e>=0;e--)this.finalizeComment(t[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(t){const{commentStack:e}=this.state,{length:s}=e;if(s===0)return;const r=e[s-1];r.leadingNode===t&&(r.leadingNode=null)}resetPreviousIdentifierLeadingComments(t){const{commentStack:e}=this.state,{length:s}=e;s!==0&&(e[s-1].trailingNode===t?e[s-1].trailingNode=null:s>=2&&e[s-2].trailingNode===t&&(e[s-2].trailingNode=null))}takeSurroundingComments(t,e,s){const{commentStack:r}=this.state,n=r.length;if(n===0)return;let a=n-1;for(;a>=0;a--){const o=r[a],l=o.end;if(o.start===s)o.leadingNode=t;else if(l===e)o.trailingNode=t;else if(l0}set strict(t){t?this.flags|=1:this.flags&=-2}init({strictMode:t,sourceType:e,startLine:s,startColumn:r}){this.strict=t===!1?!1:t===!0?!0:e==="module",this.curLine=s,this.lineStart=-r,this.startLoc=this.endLoc=new as(s,r,0)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(t){t?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(t){t?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(t){t?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(t){t?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(t){t?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(t){t?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(t){t?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(t){t?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(t){t?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(t){t?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(t){t?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(t){t?this.flags|=4096:this.flags&=-4097}curPosition(){return new as(this.curLine,this.pos-this.lineStart,this.pos)}clone(){const t=new ca;return t.flags=this.flags,t.curLine=this.curLine,t.lineStart=this.lineStart,t.startLoc=this.startLoc,t.endLoc=this.endLoc,t.errors=this.errors.slice(),t.potentialArrowAt=this.potentialArrowAt,t.noArrowAt=this.noArrowAt.slice(),t.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),t.topicContext=this.topicContext,t.labels=this.labels.slice(),t.commentsLen=this.commentsLen,t.commentStack=this.commentStack.slice(),t.pos=this.pos,t.type=this.type,t.value=this.value,t.start=this.start,t.end=this.end,t.lastTokEndLoc=this.lastTokEndLoc,t.lastTokStartLoc=this.lastTokStartLoc,t.context=this.context.slice(),t.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,t.strictErrors=this.strictErrors,t.tokensLength=this.tokensLength,t}}var wp=function(t){return t>=48&&t<=57};const mo={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Vi={bin:i=>i===48||i===49,oct:i=>i>=48&&i<=55,dec:i=>i>=48&&i<=57,hex:i=>i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102};function yo(i,t,e,s,r,n){const a=e,o=s,l=r;let h="",u=null,d=e;const{length:c}=t;for(;;){if(e>=c){n.unterminated(a,o,l),h+=t.slice(d,e);break}const f=t.charCodeAt(e);if(Cp(i,f,t,e)){h+=t.slice(d,e);break}if(f===92){h+=t.slice(d,e);const p=kp(t,e,s,r,i==="template",n);p.ch===null&&!u?u={pos:e,lineStart:s,curLine:r}:h+=p.ch,{pos:e,lineStart:s,curLine:r}=p,d=e}else f===8232||f===8233?(++e,++r,s=e):f===10||f===13?i==="template"?(h+=t.slice(d,e)+` -`,++e,f===13&&t.charCodeAt(e)===10&&++e,++r,d=s=e):n.unterminated(a,o,l):++e}return{pos:e,str:h,firstInvalidLoc:u,lineStart:s,curLine:r,containsInvalid:!!u}}function Cp(i,t,e,s){return i==="template"?t===96||t===36&&e.charCodeAt(s+1)===123:t===(i==="double"?34:39)}function kp(i,t,e,s,r,n){const a=!r;t++;const o=h=>({pos:t,ch:h,lineStart:e,curLine:s}),l=i.charCodeAt(t++);switch(l){case 110:return o(` -`);case 114:return o("\r");case 120:{let h;return{code:h,pos:t}=En(i,t,e,s,2,!1,a,n),o(h===null?null:String.fromCharCode(h))}case 117:{let h;return{code:h,pos:t}=sc(i,t,e,s,a,n),o(h===null?null:String.fromCodePoint(h))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:i.charCodeAt(t)===10&&++t;case 10:e=t,++s;case 8232:case 8233:return o("");case 56:case 57:if(r)return o(null);n.strictNumericEscape(t-1,e,s);default:if(l>=48&&l<=55){const h=t-1;let d=/^[0-7]+/.exec(i.slice(h,t+2))[0],c=parseInt(d,8);c>255&&(d=d.slice(0,-1),c=parseInt(d,8)),t+=d.length-1;const f=i.charCodeAt(t);if(d!=="0"||f===56||f===57){if(r)return o(null);n.strictNumericEscape(h,e,s)}return o(String.fromCharCode(c))}return o(String.fromCharCode(l))}}function En(i,t,e,s,r,n,a,o){const l=t;let h;return{n:h,pos:t}=tc(i,t,e,s,16,r,n,!1,o,!a),h===null&&(a?o.invalidEscapeSequence(l,e,s):t=l-1),{code:h,pos:t}}function tc(i,t,e,s,r,n,a,o,l,h){const u=t,d=r===16?mo.hex:mo.decBinOct,c=r===16?Vi.hex:r===10?Vi.dec:r===8?Vi.oct:Vi.bin;let f=!1,p=0;for(let m=0,b=n==null?1/0:n;m=97?A=P-97+10:P>=65?A=P-65+10:wp(P)?A=P-48:A=1/0,A>=r){if(A<=9&&h)return{n:null,pos:t};if(A<=9&&l.invalidDigit(t,e,s,r))A=0;else if(a)A=0,f=!0;else break}++t,p=p*r+A}return t===u||n!=null&&t-u!==n||f?{n:null,pos:t}:{n:p,pos:t}}function sc(i,t,e,s,r,n){const a=i.charCodeAt(t);let o;if(a===123){if(++t,{code:o,pos:t}=En(i,t,e,s,i.indexOf("}",t)-t,!0,r,n),++t,o!==null&&o>1114111)if(r)n.invalidCodePoint(t,e,s);else return{code:null,pos:t}}else({code:o,pos:t}=En(i,t,e,s,4,!1,r,n));return{code:o,pos:t}}function Qs(i,t,e){return new as(e,i-t,i)}const vp=new Set([103,109,115,105,121,117,100,118]);class ts{constructor(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,this.loc=new lr(t.startLoc,t.endLoc)}}class Lp extends Pp{constructor(t,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(s,r,n,a)=>this.options.errorRecovery?(this.raise(w.InvalidDigit,Qs(s,r,n),{radix:a}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(w.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(w.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(w.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(w.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(s,r,n)=>{this.recordStrictModeErrors(w.StrictNumericEscape,Qs(s,r,n))},unterminated:(s,r,n)=>{throw this.raise(w.UnterminatedString,Qs(s-1,r,n))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(w.StrictNumericEscape),unterminated:(s,r,n)=>{throw this.raise(w.UnterminatedTemplate,Qs(s,r,n))}}),this.state=new ca,this.state.init(t),this.input=e,this.length=e.length,this.comments=[],this.isLookahead=!1}pushToken(t){this.tokens.length=this.state.tokensLength,this.tokens.push(t),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.options.tokens&&this.pushToken(new ts(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(t){return this.match(t)?(this.next(),!0):!1}match(t){return this.state.type===t}createLookaheadState(t){return{pos:t.pos,value:null,type:t.type,start:t.start,end:t.end,context:[this.curContext()],inType:t.inType,startLoc:t.startLoc,lastTokEndLoc:t.lastTokEndLoc,curLine:t.curLine,lineStart:t.lineStart,curPosition:t.curPosition}}lookahead(){const t=this.state;this.state=this.createLookaheadState(t),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;const e=this.state;return this.state=t,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(t){return Zr.lastIndex=t,Zr.test(this.input)?Zr.lastIndex:t}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(t){return Qr.lastIndex=t,Qr.test(this.input)?Qr.lastIndex:t}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(t){let e=this.input.charCodeAt(t);if((e&64512)===55296&&++tthis.raise(e,s)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(139);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(t){let e;this.isLookahead||(e=this.state.curPosition());const s=this.state.pos,r=this.input.indexOf(t,s+2);if(r===-1)throw this.raise(w.UnterminatedComment,this.state.curPosition());for(this.state.pos=r+t.length,Ui.lastIndex=s+2;Ui.test(this.input)&&Ui.lastIndex<=r;)++this.state.curLine,this.state.lineStart=Ui.lastIndex;if(this.isLookahead)return;const n={type:"CommentBlock",value:this.input.slice(s+2,r),start:s,end:r+t.length,loc:new lr(e,this.state.curPosition())};return this.options.tokens&&this.pushToken(n),n}skipLineComment(t){const e=this.state.pos;let s;this.isLookahead||(s=this.state.curPosition());let r=this.input.charCodeAt(this.state.pos+=t);if(this.state.post)){const n=this.skipLineComment(3);n!==void 0&&(this.addComment(n),this.options.attachComment&&e.push(n))}else break e}else if(s===60&&!this.inModule&&this.options.annexB){const r=this.state.pos;if(this.input.charCodeAt(r+1)===33&&this.input.charCodeAt(r+2)===45&&this.input.charCodeAt(r+3)===45){const n=this.skipLineComment(4);n!==void 0&&(this.addComment(n),this.options.attachComment&&e.push(n))}else break e}else break e}}if(e.length>0){const s=this.state.pos,r={start:t,end:s,comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(r)}}finishToken(t,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();const s=this.state.type;this.state.type=t,this.state.value=e,this.isLookahead||this.updateContext(s)}replaceToken(t){this.state.type=t,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;const t=this.state.pos+1,e=this.codePointAtPos(t);if(e>=48&&e<=57)throw this.raise(w.UnexpectedDigitAfterHash,this.state.curPosition());if(e===123||e===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(e===123?w.RecordExpressionHashIncorrectStartSyntaxType:w.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else Vt(e)?(++this.state.pos,this.finishToken(138,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(138,this.readWord1())):this.finishOp(27,1)}readToken_dot(){const t=this.input.charCodeAt(this.state.pos+1);if(t>=48&&t<=57){this.readNumber(!0);return}t===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let t=this.input.charCodeAt(this.state.pos+1);if(t!==33)return!1;const e=this.state.pos;for(this.state.pos+=1;!Vs(t)&&++this.state.pos=48&&e<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(t){switch(t){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(w.TupleExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(w.RecordExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{const e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(t);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(t);return;case 124:case 38:this.readToken_pipe_amp(t);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(t);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(t);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(Vt(t)){this.readWord(t);return}}throw this.raise(w.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(t)})}finishOp(t,e){const s=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(t,s)}readRegexp(){const t=this.state.startLoc,e=this.state.start+1;let s,r,{pos:n}=this.state;for(;;++n){if(n>=this.length)throw this.raise(w.UnterminatedRegExp,ot(t,1));const h=this.input.charCodeAt(n);if(Vs(h))throw this.raise(w.UnterminatedRegExp,ot(t,1));if(s)s=!1;else{if(h===91)r=!0;else if(h===93&&r)r=!1;else if(h===47&&!r)break;s=h===92}}const a=this.input.slice(e,n);++n;let o="";const l=()=>ot(t,n+2-e);for(;n=2&&this.input.charCodeAt(e)===48;if(l){const f=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(w.StrictOctalLiteral,s),!this.state.strict){const p=f.indexOf("_");p>0&&this.raise(w.ZeroDigitNumericSeparator,ot(s,p))}o=l&&!/[89]/.test(f)}let h=this.input.charCodeAt(this.state.pos);if(h===46&&!o&&(++this.state.pos,this.readInt(10),r=!0,h=this.input.charCodeAt(this.state.pos)),(h===69||h===101)&&!o&&(h=this.input.charCodeAt(++this.state.pos),(h===43||h===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(w.InvalidOrMissingExponent,s),r=!0,a=!0,h=this.input.charCodeAt(this.state.pos)),h===110&&((r||l)&&this.raise(w.InvalidBigIntLiteral,s),++this.state.pos,n=!0),h===109){this.expectPlugin("decimal",this.state.curPosition()),(a||l)&&this.raise(w.InvalidDecimal,s),++this.state.pos;var u=!0}if(Vt(this.codePointAtPos(this.state.pos)))throw this.raise(w.NumberIdentifier,this.state.curPosition());const d=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(n){this.finishToken(135,d);return}if(u){this.finishToken(136,d);return}const c=o?parseInt(d,8):parseFloat(d);this.finishToken(134,c)}readCodePoint(t){const{code:e,pos:s}=sc(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,this.errorHandlers_readCodePoint);return this.state.pos=s,e}readString(t){const{str:e,pos:s,curLine:r,lineStart:n}=yo(t===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=s+1,this.state.lineStart=n,this.state.curLine=r,this.finishToken(133,e)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){const t=this.input[this.state.pos],{str:e,firstInvalidLoc:s,pos:r,curLine:n,lineStart:a}=yo("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=r+1,this.state.lineStart=a,this.state.curLine=n,s&&(this.state.firstInvalidTemplateEscapePos=new as(s.curLine,s.pos-s.lineStart,s.pos)),this.input.codePointAt(r)===96?this.finishToken(24,s?null:t+e+"`"):(this.state.pos++,this.finishToken(25,s?null:t+e+"${"))}recordStrictModeErrors(t,e){const s=e.index;this.state.strict&&!this.state.strictErrors.has(s)?this.raise(t,e):this.state.strictErrors.set(s,[t,e])}readWord1(t){this.state.containsEsc=!1;let e="";const s=this.state.pos;let r=this.state.pos;for(t!==void 0&&(this.state.pos+=t<=65535?1:2);this.state.pos=0;o--){const l=a[o];if(l.loc.index===n)return a[o]=t(r,s);if(l.loc.indexthis.hasPlugin(e)))throw this.raise(w.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:t})}errorBuilder(t){return(e,s,r)=>{this.raise(t,Qs(e,s,r))}}}class Ip{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}}class Np{constructor(t){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=t}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new Ip)}exit(){const t=this.stack.pop(),e=this.current();for(const[s,r]of Array.from(t.undefinedPrivateNames))e?e.undefinedPrivateNames.has(s)||e.undefinedPrivateNames.set(s,r):this.parser.raise(w.InvalidPrivateFieldResolution,r,{identifierName:s})}declarePrivateName(t,e,s){const{privateNames:r,loneAccessors:n,undefinedPrivateNames:a}=this.current();let o=r.has(t);if(e&3){const l=o&&n.get(t);if(l){const h=l&4,u=e&4,d=l&3,c=e&3;o=d===c||h!==u,o||n.delete(t)}else o||n.set(t,e)}o&&this.parser.raise(w.PrivateNameRedeclaration,s,{identifierName:t}),r.add(t),a.delete(t)}usePrivateName(t,e){let s;for(s of this.stack)if(s.privateNames.has(t))return;s?s.undefinedPrivateNames.set(t,e):this.parser.raise(w.InvalidPrivateFieldResolution,e,{identifierName:t})}}class vr{constructor(t=0){this.type=t}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}}class ic extends vr{constructor(t){super(t),this.declarationErrors=new Map}recordDeclarationError(t,e){const s=e.index;this.declarationErrors.set(s,[t,e])}clearDeclarationError(t){this.declarationErrors.delete(t)}iterateErrors(t){this.declarationErrors.forEach(t)}}class _p{constructor(t){this.parser=void 0,this.stack=[new vr],this.parser=t}enter(t){this.stack.push(t)}exit(){this.stack.pop()}recordParameterInitializerError(t,e){const s=e.loc.start,{stack:r}=this;let n=r.length-1,a=r[n];for(;!a.isCertainlyParameterDeclaration();){if(a.canBeArrowParameterDeclaration())a.recordDeclarationError(t,s);else return;a=r[--n]}this.parser.raise(t,s)}recordArrowParameterBindingError(t,e){const{stack:s}=this,r=s[s.length-1],n=e.loc.start;if(r.isCertainlyParameterDeclaration())this.parser.raise(t,n);else if(r.canBeArrowParameterDeclaration())r.recordDeclarationError(t,n);else return}recordAsyncArrowParametersError(t){const{stack:e}=this;let s=e.length-1,r=e[s];for(;r.canBeArrowParameterDeclaration();)r.type===2&&r.recordDeclarationError(w.AwaitBindingIdentifier,t),r=e[--s]}validateAsPattern(){const{stack:t}=this,e=t[t.length-1];!e.canBeArrowParameterDeclaration()||e.iterateErrors(([s,r])=>{this.parser.raise(s,r);let n=t.length-2,a=t[n];for(;a.canBeArrowParameterDeclaration();)a.clearDeclarationError(r.index),a=t[--n]})}}function Mp(){return new vr(3)}function Op(){return new ic(1)}function Dp(){return new ic(2)}function rc(){return new vr}class Fp{constructor(){this.stacks=[]}enter(t){this.stacks.push(t)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}}function Zi(i,t){return(i?2:0)|(t?1:0)}class Bp extends Lp{addExtra(t,e,s,r=!0){if(!t)return;let{extra:n}=t;n==null&&(n={},t.extra=n),r?n[e]=s:Object.defineProperty(n,e,{enumerable:r,value:s})}isContextual(t){return this.state.type===t&&!this.state.containsEsc}isUnparsedContextual(t,e){const s=t+e.length;if(this.input.slice(t,s)===e){const r=this.input.charCodeAt(s);return!(Us(r)||(r&64512)===55296)}return!1}isLookaheadContextual(t){const e=this.nextTokenStart();return this.isUnparsedContextual(e,t)}eatContextual(t){return this.isContextual(t)?(this.next(),!0):!1}expectContextual(t,e){if(!this.eatContextual(t)){if(e!=null)throw this.raise(e,this.state.startLoc);this.unexpected(null,t)}}canInsertSemicolon(){return this.match(139)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return po(this.input,this.state.lastTokEndLoc.index,this.state.start)}hasFollowingLineBreak(){return po(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(t=!0){(t?this.isLineTerminator():this.eat(13))||this.raise(w.MissingSemicolon,this.state.lastTokEndLoc)}expect(t,e){this.eat(t)||this.unexpected(e,t)}tryParse(t,e=this.state.clone()){const s={node:null};try{const r=t((n=null)=>{throw s.node=n,s});if(this.state.errors.length>e.errors.length){const n=this.state;return this.state=e,this.state.tokensLength=n.tokensLength,{node:r,error:n.errors[e.errors.length],thrown:!1,aborted:!1,failState:n}}return{node:r,error:null,thrown:!1,aborted:!1,failState:null}}catch(r){const n=this.state;if(this.state=e,r instanceof SyntaxError)return{node:null,error:r,thrown:!0,aborted:!1,failState:n};if(r===s)return{node:s.node,error:null,thrown:!1,aborted:!0,failState:n};throw r}}checkExpressionErrors(t,e){if(!t)return!1;const{shorthandAssignLoc:s,doubleProtoLoc:r,privateKeyLoc:n,optionalParametersLoc:a}=t,o=!!s||!!r||!!a||!!n;if(!e)return o;s!=null&&this.raise(w.InvalidCoverInitializedName,s),r!=null&&this.raise(w.DuplicateProto,r),n!=null&&this.raise(w.UnexpectedPrivateField,n),a!=null&&this.unexpected(a)}isLiteralPropertyName(){return ql(this.state.type)}isPrivateName(t){return t.type==="PrivateName"}getPrivateNameSV(t){return t.id.name}hasPropertyAsPrivateName(t){return(t.type==="MemberExpression"||t.type==="OptionalMemberExpression")&&this.isPrivateName(t.property)}isObjectProperty(t){return t.type==="ObjectProperty"}isObjectMethod(t){return t.type==="ObjectMethod"}initializeScopes(t=this.options.sourceType==="module"){const e=this.state.labels;this.state.labels=[];const s=this.exportedIdentifiers;this.exportedIdentifiers=new Set;const r=this.inModule;this.inModule=t;const n=this.scope,a=this.getScopeHandler();this.scope=new a(this,t);const o=this.prodParam;this.prodParam=new Fp;const l=this.classScope;this.classScope=new Np(this);const h=this.expressionScope;return this.expressionScope=new _p(this),()=>{this.state.labels=e,this.exportedIdentifiers=s,this.inModule=r,this.scope=n,this.prodParam=o,this.classScope=l,this.expressionScope=h}}enterInitialScopes(){let t=0;this.inModule&&(t|=2),this.scope.enter(1),this.prodParam.enter(t)}checkDestructuringPrivate(t){const{privateKeyLoc:e}=t;e!==null&&this.expectPlugin("destructuringPrivate",e)}}class Qi{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}}class ur{constructor(t,e,s){this.type="",this.start=e,this.end=0,this.loc=new lr(s),t!=null&&t.options.ranges&&(this.range=[e,0]),t!=null&&t.filename&&(this.loc.filename=t.filename)}}const ua=ur.prototype;ua.__clone=function(){const i=new ur(void 0,this.start,this.loc.start),t=Object.keys(this);for(let e=0,s=t.length;e`Cannot overwrite reserved type ${i}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:i,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${i} = true,\` or \`${i} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:i,enumName:t})=>`Enum member names need to be unique, but the name \`${i}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:i})=>`Enum \`${i}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:i,enumName:t})=>`Enum type \`${i}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:i})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${i}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:i,memberName:t,explicitType:e})=>`Enum \`${i}\` has type \`${e}\`, so the initializer of \`${t}\` needs to be a ${e} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:i,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${i}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:i,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${i}\`.`,EnumInvalidMemberName:({enumName:i,memberName:t,suggestion:e})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${e}\`, in enum \`${i}\`.`,EnumNumberMemberNotInitialized:({enumName:i,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${i}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:i})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${i}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:i})=>`Unexpected reserved type ${i}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:i,suggestion:t})=>`\`declare export ${i}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function Vp(i){return i.type==="DeclareExportAllDeclaration"||i.type==="DeclareExportDeclaration"&&(!i.declaration||i.declaration.type!=="TypeAlias"&&i.declaration.type!=="InterfaceDeclaration")}function go(i){return i.importKind==="type"||i.importKind==="typeof"}const Hp={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function Gp(i,t){const e=[],s=[];for(let r=0;rclass extends i{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return bp}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,s){e!==133&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,s)}addComment(e){if(this.flowPragma===void 0){const s=Wp.exec(e.value);if(s)if(s[1]==="flow")this.flowPragma="flow";else if(s[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){const s=this.state.inType;this.state.inType=!0,this.expect(e||14);const r=this.flowParseType();return this.state.inType=s,r}flowParsePredicate(){const e=this.startNode(),s=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>s.index+1&&this.raise(ge.UnexpectedSpaceBetweenModuloChecks,s),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){const e=this.state.inType;this.state.inType=!0,this.expect(14);let s=null,r=null;return this.match(54)?(this.state.inType=e,r=this.flowParsePredicate()):(s=this.flowParseType(),this.state.inType=e,this.match(54)&&(r=this.flowParsePredicate())),[s,r]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();const s=e.id=this.parseIdentifier(),r=this.startNode(),n=this.startNode();this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,this.expect(10);const a=this.flowParseFunctionTypeParams();return r.params=a.params,r.rest=a.rest,r.this=a._this,this.expect(11),[r.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),n.typeAnnotation=this.finishNode(r,"FunctionTypeAnnotation"),s.typeAnnotation=this.finishNode(n,"TypeAnnotation"),this.resetEndLocation(s),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,s){if(this.match(80))return this.flowParseDeclareClass(e);if(this.match(68))return this.flowParseDeclareFunction(e);if(this.match(74))return this.flowParseDeclareVariable(e);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(e):(s&&this.raise(ge.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(129))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,s);this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(133)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();const s=e.body=this.startNode(),r=s.body=[];for(this.expect(5);!this.match(8);){let o=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(ge.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(o)):(this.expectContextual(125,ge.UnsupportedStatementInDeclareModule),o=this.flowParseDeclare(o,!0)),r.push(o)}this.scope.exit(),this.expect(8),this.finishNode(s,"BlockStatement");let n=null,a=!1;return r.forEach(o=>{Vp(o)?(n==="CommonJS"&&this.raise(ge.AmbiguousDeclareModuleKind,o),n="ES"):o.type==="DeclareModuleExports"&&(a&&this.raise(ge.DuplicateDeclareModuleExports,o),n==="ES"&&this.raise(ge.AmbiguousDeclareModuleKind,o),n="CommonJS",a=!0)}),e.kind=n||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,s){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!s){const r=this.state.value;throw this.raise(ge.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:r,suggestion:Hp[r]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return e=this.parseExport(e,null),e.type==="ExportNamedDeclaration"&&(e.type="ExportDeclaration",e.default=!1,delete e.exportKind),e.type="Declare"+e.type,e;this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();const s=this.flowParseTypeAlias(e);return s.type="DeclareTypeAlias",s}flowParseDeclareOpaqueType(e){this.next();const s=this.flowParseOpaqueType(e,!0);return s.type="DeclareOpaqueType",s}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,s){if(e.id=this.flowParseRestrictedIdentifier(!s,!0),this.scope.declareName(e.id.name,s?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(!s&&this.eat(12));if(s){if(e.implements=[],e.mixins=[],this.eatContextual(117))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:s,allowExact:!1,allowSpread:!1,allowProto:s,allowInexact:!1})}flowParseInterfaceExtends(){const e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(ge.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,s,r){!Up.has(e)||this.raise(r?ge.AssignReservedType:ge.UnexpectedReservedType,s,{reservedType:e})}flowParseRestrictedIdentifier(e,s){return this.checkReservedType(this.state.value,this.state.startLoc,s),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,s){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,s||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){const s=this.state.startLoc,r=this.startNode(),n=this.flowParseVariance(),a=this.flowParseTypeAnnotatableIdentifier();return r.name=a.name,r.variance=n,r.bound=a.typeAnnotation,this.match(29)?(this.eat(29),r.default=this.flowParseType()):e&&this.raise(ge.MissingTypeParamDefault,s),this.finishNode(r,"TypeParameter")}flowParseTypeParameterDeclaration(){const e=this.state.inType,s=this.startNode();s.params=[],this.state.inType=!0,this.match(47)||this.match(142)?this.next():this.unexpected();let r=!1;do{const n=this.flowParseTypeParameter(r);s.params.push(n),n.default&&(r=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(s,"TypeParameterDeclaration")}flowParseTypeParameterInstantiation(){const e=this.startNode(),s=this.state.inType;e.params=[],this.state.inType=!0,this.expect(47);const r=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);return this.state.noAnonFunctionType=r,this.expect(48),this.state.inType=s,this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){const e=this.startNode(),s=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=s,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){const e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(134)||this.match(133)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,s,r){return e.static=s,this.lookahead().type===14?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=r,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,s){return e.static=s,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,s){const r=this.startNode();return e.static=s,e.value=this.flowParseObjectTypeMethodish(r),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:s,allowSpread:r,allowProto:n,allowInexact:a}){const o=this.state.inType;this.state.inType=!0;const l=this.startNode();l.callProperties=[],l.properties=[],l.indexers=[],l.internalSlots=[];let h,u,d=!1;for(s&&this.match(6)?(this.expect(6),h=9,u=!0):(this.expect(5),h=8,u=!1),l.exact=u;!this.match(h);){let f=!1,p=null,m=null;const b=this.startNode();if(n&&this.isContextual(118)){const A=this.lookahead();A.type!==14&&A.type!==17&&(this.next(),p=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){const A=this.lookahead();A.type!==14&&A.type!==17&&(this.next(),f=!0)}const P=this.flowParseVariance();if(this.eat(0))p!=null&&this.unexpected(p),this.eat(0)?(P&&this.unexpected(P.loc.start),l.internalSlots.push(this.flowParseObjectTypeInternalSlot(b,f))):l.indexers.push(this.flowParseObjectTypeIndexer(b,f,P));else if(this.match(10)||this.match(47))p!=null&&this.unexpected(p),P&&this.unexpected(P.loc.start),l.callProperties.push(this.flowParseObjectTypeCallProperty(b,f));else{let A="init";if(this.isContextual(99)||this.isContextual(104)){const O=this.lookahead();ql(O.type)&&(A=this.state.value,this.next())}const U=this.flowParseObjectTypeProperty(b,f,p,P,A,r,a!=null?a:!u);U===null?(d=!0,m=this.state.lastTokStartLoc):l.properties.push(U)}this.flowObjectTypeSemicolon(),m&&!this.match(8)&&!this.match(9)&&this.raise(ge.UnexpectedExplicitInexactInObject,m)}this.expect(h),r&&(l.inexact=d);const c=this.finishNode(l,"ObjectTypeAnnotation");return this.state.inType=o,c}flowParseObjectTypeProperty(e,s,r,n,a,o,l){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(o?l||this.raise(ge.InexactInsideExact,this.state.lastTokStartLoc):this.raise(ge.InexactInsideNonObject,this.state.lastTokStartLoc),n&&this.raise(ge.InexactVariance,n),null):(o||this.raise(ge.UnexpectedSpreadType,this.state.lastTokStartLoc),r!=null&&this.unexpected(r),n&&this.raise(ge.SpreadVariance,n),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=s,e.proto=r!=null,e.kind=a;let h=!1;return this.match(47)||this.match(10)?(e.method=!0,r!=null&&this.unexpected(r),n&&this.unexpected(n.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(a==="get"||a==="set")&&this.flowCheckGetterSetterParams(e),!o&&e.key.name==="constructor"&&e.value.this&&this.raise(ge.ThisParamBannedInConstructor,e.value.this)):(a!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(h=!0),e.value=this.flowParseTypeInitialiser(),e.variance=n),e.optional=h,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){const s=e.kind==="get"?0:1,r=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?ge.GetterMayNotHaveThisParam:ge.SetterMayNotHaveThisParam,e.value.this),r!==s&&this.raise(e.kind==="get"?w.BadGetterArity:w.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(w.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,s){var r;(r=e)!=null||(e=this.state.startLoc);let n=s||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){const a=this.startNodeAt(e);a.qualification=n,a.id=this.flowParseRestrictedIdentifier(!0),n=this.finishNode(a,"QualifiedTypeIdentifier")}return n}flowParseGenericType(e,s){const r=this.startNodeAt(e);return r.typeParameters=null,r.id=this.flowParseQualifiedTypeIdentifier(e,s),this.match(47)&&(r.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(r,"GenericTypeAnnotation")}flowParseTypeofType(){const e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){const e=this.startNode();for(e.types=[],this.expect(0);this.state.possuper.parseFunctionBody(e,!0,r));return}super.parseFunctionBody(e,!1,r)}parseFunctionBodyAndFinish(e,s,r=!1){if(this.match(14)){const n=this.startNode();[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=n.typeAnnotation?this.finishNode(n,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,s,r)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){const r=this.lookahead();if(Pt(r.type)){const n=this.startNode();return this.next(),this.flowParseInterface(n)}}else if(this.plugins.get("flow").enums&&this.isContextual(126)){const r=this.startNode();return this.next(),this.flowParseEnumDeclaration(r)}const s=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(s)&&(this.flowPragma=null),s}parseExpressionStatement(e,s,r){if(s.type==="Identifier"){if(s.name==="declare"){if(this.match(80)||Me(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(Me(this.state.type)){if(s.name==="interface")return this.flowParseInterface(e);if(s.name==="type")return this.flowParseTypeAlias(e);if(s.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,s,r)}shouldParseExportDeclaration(){const{type:e}=this.state;return fo(e)||this.plugins.get("flow").enums&&e===126?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){const{type:e}=this.state;return fo(e)||this.plugins.get("flow").enums&&e===126?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.plugins.get("flow").enums&&this.isContextual(126)){const e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,s,r){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){const c=this.lookaheadCharCode();if(c===44||c===61||c===58||c===41)return this.setOptionalParametersError(r),e}this.expect(17);const n=this.state.clone(),a=this.state.noArrowAt,o=this.startNodeAt(s);let{consequent:l,failed:h}=this.tryParseConditionalConsequent(),[u,d]=this.getArrowLikeExpressions(l);if(h||d.length>0){const c=[...a];if(d.length>0){this.state=n,this.state.noArrowAt=c;for(let f=0;f1&&this.raise(ge.AmbiguousConditionalArrow,n.startLoc),h&&u.length===1&&(this.state=n,c.push(u[0].start),this.state.noArrowAt=c,{consequent:l,failed:h}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(l,!0),this.state.noArrowAt=a,this.expect(14),o.test=e,o.consequent=l,o.alternate=this.forwardNoArrowParamsConversionAt(o,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(o,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);const e=this.parseMaybeAssignAllowIn(),s=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:s}}getArrowLikeExpressions(e,s){const r=[e],n=[];for(;r.length!==0;){const a=r.pop();a.type==="ArrowFunctionExpression"&&a.body.type!=="BlockStatement"?(a.typeParameters||!a.returnType?this.finishArrowValidation(a):n.push(a),r.push(a.body)):a.type==="ConditionalExpression"&&(r.push(a.consequent),r.push(a.alternate))}return s?(n.forEach(a=>this.finishArrowValidation(a)),[n,[]]):Gp(n,a=>a.params.every(o=>this.isAssignable(o,!0)))}finishArrowValidation(e){var s;this.toAssignableList(e.params,(s=e.extra)==null?void 0:s.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,s){let r;return this.state.noArrowParamsConversionAt.includes(e.start)?(this.state.noArrowParamsConversionAt.push(this.state.start),r=s(),this.state.noArrowParamsConversionAt.pop()):r=s(),r}parseParenItem(e,s){const r=super.parseParenItem(e,s);if(this.eat(17)&&(r.optional=!0,this.resetEndLocation(e)),this.match(14)){const n=this.startNodeAt(s);return n.expression=r,n.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(n,"TypeCastExpression")}return r}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";const s=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(s)}else if(this.isContextual(131)){e.exportKind="type";const s=this.startNode();return this.next(),this.flowParseOpaqueType(s,!1)}else if(this.isContextual(129)){e.exportKind="type";const s=this.startNode();return this.next(),this.flowParseInterface(s)}else if(this.plugins.get("flow").enums&&this.isContextual(126)){e.exportKind="value";const s=this.startNode();return this.next(),this.flowParseEnumDeclaration(s)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(130)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){const{startLoc:s}=this.state,r=super.maybeParseExportNamespaceSpecifier(e);return r&&e.exportKind==="type"&&this.unexpected(s),r}parseClassId(e,s,r){super.parseClassId(e,s,r),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,s,r){const{startLoc:n}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,s))return;s.declare=!0}super.parseClassMember(e,s,r),s.declare&&(s.type!=="ClassProperty"&&s.type!=="ClassPrivateProperty"&&s.type!=="PropertyDefinition"?this.raise(ge.DeclareClassElement,n):s.value&&this.raise(ge.DeclareClassFieldInitializer,s.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){const e=super.readWord1(),s="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(w.InvalidIdentifier,this.state.curPosition(),{identifierName:s}),this.finishToken(132,s)}getTokenFromCode(e){const s=this.input.charCodeAt(this.state.pos+1);e===123&&s===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?s===46?this.finishOp(18,2):this.finishOp(17,1):mp(e,s,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,s){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,s):super.isAssignable(e,s)}toAssignable(e,s=!1){!s&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,s)}toAssignableList(e,s,r){for(let n=0;n1||!s)&&this.raise(ge.TypeCastInPattern,a.typeAnnotation)}return e}parseArrayLike(e,s,r,n){const a=super.parseArrayLike(e,s,r,n);return s&&!this.state.maybeInArrowParameters&&this.toReferencedList(a.elements),a}isValidLVal(e,s,r){return e==="TypeCastExpression"||super.isValidLVal(e,s,r)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,s,r,n,a,o){if(s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,s,r,n,a,o),s.params&&a){const l=s.params;l.length>0&&this.isThisParam(l[0])&&this.raise(ge.ThisParamBannedInConstructor,s)}else if(s.type==="MethodDefinition"&&a&&s.value.params){const l=s.value.params;l.length>0&&this.isThisParam(l[0])&&this.raise(ge.ThisParamBannedInConstructor,s)}}pushClassPrivateMethod(e,s,r,n){s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,s,r,n)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&this.match(47)&&(e.superTypeParameters=this.flowParseTypeParameterInstantiation()),this.isContextual(113)){this.next();const s=e.implements=[];do{const r=this.startNode();r.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?r.typeParameters=this.flowParseTypeParameterInstantiation():r.typeParameters=null,s.push(this.finishNode(r,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);const s=this.getObjectOrClassMethodParams(e);if(s.length>0){const r=s[0];this.isThisParam(r)&&e.kind==="get"?this.raise(ge.GetterMayNotHaveThisParam,r):this.isThisParam(r)&&this.raise(ge.SetterMayNotHaveThisParam,r)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,s,r,n,a,o,l){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let h;this.match(47)&&!o&&(h=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());const u=super.parseObjPropValue(e,s,r,n,a,o,l);return h&&((u.value||u).typeParameters=h),u}parseFunctionParamType(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(ge.PatternIsOptional,e),this.isThisParam(e)&&this.raise(ge.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(ge.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(ge.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,s){const r=super.parseMaybeDefault(e,s);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.startsuper.parseMaybeAssign(e,s),n),!a.error)return a.node;const{context:h}=this.state,u=h[h.length-1];(u===Fe.j_oTag||u===Fe.j_expr)&&h.pop()}if((r=a)!=null&&r.error||this.match(47)){var o,l;n=n||this.state.clone();let h;const u=this.tryParse(c=>{var f;h=this.flowParseTypeParameterDeclaration();const p=this.forwardNoArrowParamsConversionAt(h,()=>{const b=super.parseMaybeAssign(e,s);return this.resetStartLocationFromNode(b,h),b});(f=p.extra)!=null&&f.parenthesized&&c();const m=this.maybeUnwrapTypeCastExpression(p);return m.type!=="ArrowFunctionExpression"&&c(),m.typeParameters=h,this.resetStartLocationFromNode(m,h),p},n);let d=null;if(u.node&&this.maybeUnwrapTypeCastExpression(u.node).type==="ArrowFunctionExpression"){if(!u.error&&!u.aborted)return u.node.async&&this.raise(ge.UnexpectedTypeParameterBeforeAsyncArrowFunction,h),u.node;d=u.node}if((o=a)!=null&&o.node)return this.state=a.failState,a.node;if(d)return this.state=u.failState,d;throw(l=a)!=null&&l.thrown?a.error:u.thrown?u.error:this.raise(ge.UnexpectedTokenAfterTypeParameter,h)}return super.parseMaybeAssign(e,s)}parseArrow(e){if(this.match(14)){const s=this.tryParse(()=>{const r=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;const n=this.startNode();return[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=r,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),n});if(s.thrown)return null;s.error&&(this.state=s.failState),e.returnType=s.node.typeAnnotation?this.finishNode(s.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,s){this.state.noArrowParamsConversionAt.includes(e.start)?e.params=s:super.setArrowFunctionParameters(e,s)}checkParams(e,s,r,n=!0){if(!(r&&this.state.noArrowParamsConversionAt.includes(e.start))){for(let a=0;a0&&this.raise(ge.ThisParamMustBeFirst,e.params[a]);super.checkParams(e,s,r,n)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.state.start))}parseSubscripts(e,s,r){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(s.index)){this.next();const n=this.startNodeAt(s);n.callee=e,n.arguments=super.parseCallExpressionArguments(11,!1),e=this.finishNode(n,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){const n=this.state.clone(),a=this.tryParse(l=>this.parseAsyncArrowWithTypeParameters(s)||l(),n);if(!a.error&&!a.aborted)return a.node;const o=this.tryParse(()=>super.parseSubscripts(e,s,r),n);if(o.node&&!o.error)return o.node;if(a.node)return this.state=a.failState,a.node;if(o.node)return this.state=o.failState,o.node;throw a.error||o.error}return super.parseSubscripts(e,s,r)}parseSubscript(e,s,r,n){if(this.match(18)&&this.isLookaheadToken_lt()){if(n.optionalChainMember=!0,r)return n.stop=!0,e;this.next();const a=this.startNodeAt(s);return a.callee=e,a.typeArguments=this.flowParseTypeParameterInstantiation(),this.expect(10),a.arguments=this.parseCallExpressionArguments(11,!1),a.optional=!0,this.finishCallExpression(a,!0)}else if(!r&&this.shouldParseTypes()&&this.match(47)){const a=this.startNodeAt(s);a.callee=e;const o=this.tryParse(()=>(a.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),a.arguments=super.parseCallExpressionArguments(11,!1),n.optionalChainMember&&(a.optional=!1),this.finishCallExpression(a,n.optionalChainMember)));if(o.node)return o.error&&(this.state=o.failState),o.node}return super.parseSubscript(e,s,r,n)}parseNewCallee(e){super.parseNewCallee(e);let s=null;this.shouldParseTypes()&&this.match(47)&&(s=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=s}parseAsyncArrowWithTypeParameters(e){const s=this.startNodeAt(e);if(this.parseFunctionParams(s,!1),!!this.parseArrow(s))return super.parseArrowExpression(s,void 0,!0)}readToken_mult_modulo(e){const s=this.input.charCodeAt(this.state.pos+1);if(e===42&&s===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){const s=this.input.charCodeAt(this.state.pos+1);if(e===124&&s===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,s){const r=super.parseTopLevel(e,s);return this.state.hasFlowComment&&this.raise(ge.UnterminatedFlowComment,this.state.curPosition()),r}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(ge.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();const e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){const{pos:e}=this.state;let s=2;for(;[32,9].includes(this.input.charCodeAt(e+s));)s++;const r=this.input.charCodeAt(s+e),n=this.input.charCodeAt(s+e+1);return r===58&&n===58?s+2:this.input.slice(s+e,s+e+12)==="flow-include"?s+12:r===58&&n!==58?s:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(w.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:s,memberName:r}){this.raise(ge.EnumBooleanMemberNotInitialized,e,{memberName:r,enumName:s})}flowEnumErrorInvalidMemberInitializer(e,s){return this.raise(s.explicitType?s.explicitType==="symbol"?ge.EnumInvalidMemberInitializerSymbolType:ge.EnumInvalidMemberInitializerPrimaryType:ge.EnumInvalidMemberInitializerUnknownType,e,s)}flowEnumErrorNumberMemberNotInitialized(e,s){this.raise(ge.EnumNumberMemberNotInitialized,e,s)}flowEnumErrorStringMemberInconsistentlyInitialized(e,s){this.raise(ge.EnumStringMemberInconsistentlyInitialized,e,s)}flowEnumMemberInit(){const e=this.state.startLoc,s=()=>this.match(12)||this.match(8);switch(this.state.type){case 134:{const r=this.parseNumericLiteral(this.state.value);return s()?{type:"number",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 133:{const r=this.parseStringLiteral(this.state.value);return s()?{type:"string",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 85:case 86:{const r=this.parseBooleanLiteral(this.match(85));return s()?{type:"boolean",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){const e=this.state.startLoc,s=this.parseIdentifier(!0),r=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:s,init:r}}flowEnumCheckExplicitTypeMismatch(e,s,r){const{explicitType:n}=s;n!==null&&n!==r&&this.flowEnumErrorInvalidMemberInitializer(e,s)}flowEnumMembers({enumName:e,explicitType:s}){const r=new Set,n={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]};let a=!1;for(;!this.match(8);){if(this.eat(21)){a=!0;break}const o=this.startNode(),{id:l,init:h}=this.flowEnumMemberRaw(),u=l.name;if(u==="")continue;/^[a-z]/.test(u)&&this.raise(ge.EnumInvalidMemberName,l,{memberName:u,suggestion:u[0].toUpperCase()+u.slice(1),enumName:e}),r.has(u)&&this.raise(ge.EnumDuplicateMemberName,l,{memberName:u,enumName:e}),r.add(u);const d={enumName:e,explicitType:s,memberName:u};switch(o.id=l,h.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(h.loc,d,"boolean"),o.init=h.value,n.booleanMembers.push(this.finishNode(o,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(h.loc,d,"number"),o.init=h.value,n.numberMembers.push(this.finishNode(o,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(h.loc,d,"string"),o.init=h.value,n.stringMembers.push(this.finishNode(o,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(h.loc,d);case"none":switch(s){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(h.loc,d);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(h.loc,d);break;default:n.defaultedMembers.push(this.finishNode(o,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:n,hasUnknownMembers:a}}flowEnumStringMembers(e,s,{enumName:r}){if(e.length===0)return s;if(s.length===0)return e;if(s.length>e.length){for(const n of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(n,{enumName:r});return s}else{for(const n of s)this.flowEnumErrorStringMemberInconsistentlyInitialized(n,{enumName:r});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!Me(this.state.type))throw this.raise(ge.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});const{value:s}=this.state;return this.next(),s!=="boolean"&&s!=="number"&&s!=="string"&&s!=="symbol"&&this.raise(ge.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:s}),s}flowEnumBody(e,s){const r=s.name,n=s.loc.start,a=this.flowEnumParseExplicitType({enumName:r});this.expect(5);const{members:o,hasUnknownMembers:l}=this.flowEnumMembers({enumName:r,explicitType:a});switch(e.hasUnknownMembers=l,a){case"boolean":return e.explicitType=!0,e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=o.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{const h=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;const u=o.booleanMembers.length,d=o.numberMembers.length,c=o.stringMembers.length,f=o.defaultedMembers.length;if(!u&&!d&&!c&&!f)return h();if(!u&&!d)return e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!d&&!c&&u>=f){for(const p of o.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(p.loc.start,{enumName:r,memberName:p.id.name});return e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!u&&!c&&d>=f){for(const p of o.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(p.loc.start,{enumName:r,memberName:p.id.name});return e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(ge.EnumInconsistentMemberValues,n,{enumName:r}),h()}}}flowParseEnumDeclaration(e){const s=this.parseIdentifier();return e.id=s,e.body=this.flowEnumBody(this.startNode(),s),this.finishNode(e,"EnumDeclaration")}isLookaheadToken_lt(){const e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){const s=this.input.charCodeAt(e+1);return s!==60&&s!==61}return!1}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}};const qp={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"},ms=Gt`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:i})=>`Expected corresponding JSX closing tag for <${i}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:i,HTMLEntity:t})=>`Unexpected token \`${i}\`. Did you mean \`${t}\` or \`{'${i}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?"});function es(i){return i?i.type==="JSXOpeningFragment"||i.type==="JSXClosingFragment":!1}function Ms(i){if(i.type==="JSXIdentifier")return i.name;if(i.type==="JSXNamespacedName")return i.namespace.name+":"+i.name.name;if(i.type==="JSXMemberExpression")return Ms(i.object)+"."+Ms(i.property);throw new Error("Node had unexpected type: "+i.type)}var zp=i=>class extends i{jsxReadToken(){let e="",s=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(ms.UnterminatedJsxContent,this.state.startLoc);const r=this.input.charCodeAt(this.state.pos);switch(r){case 60:case 123:if(this.state.pos===this.state.start){r===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(142)):super.getTokenFromCode(r);return}e+=this.input.slice(s,this.state.pos),this.finishToken(141,e);return;case 38:e+=this.input.slice(s,this.state.pos),e+=this.jsxReadEntity(),s=this.state.pos;break;case 62:case 125:default:Vs(r)?(e+=this.input.slice(s,this.state.pos),e+=this.jsxReadNewLine(!0),s=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){const s=this.input.charCodeAt(this.state.pos);let r;return++this.state.pos,s===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,r=e?` +- Did you mean \`import { "${i}" as foo }\`?`,ImportCallArgumentTrailingComma:"Trailing comma is disallowed inside import(...) arguments.",ImportCallArity:({maxArgumentCount:i})=>`\`import()\` requires exactly ${i===1?"one argument":"one or two arguments"}.`,ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:i})=>`Expected number in radix ${i}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:i})=>`Escape sequence in keyword ${i}.`,InvalidIdentifier:({identifierName:i})=>`Invalid identifier ${i}.`,InvalidLhs:({ancestor:i})=>`Invalid left-hand side in ${Xi(i)}.`,InvalidLhsBinding:({ancestor:i})=>`Binding invalid left-hand side in ${Xi(i)}.`,InvalidLhsOptionalChaining:({ancestor:i})=>`Invalid optional chaining in the left-hand side of ${Xi(i)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:i})=>`Unexpected character '${i}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:i})=>`Private name #${i} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:i})=>`Label '${i}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:i})=>`This experimental syntax requires enabling the parser plugin: ${i.map(t=>JSON.stringify(t)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:i})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${i.map(t=>JSON.stringify(t)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:i})=>`Duplicate key "${i}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:i})=>`An export name cannot include a lone surrogate, found '\\u${i.toString(16)}'.`,ModuleExportUndefined:({localName:i})=>`Export '${i}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:i})=>`Private names are only allowed in property accesses (\`obj.#${i}\`) or in \`in\` expressions (\`#${i} in obj\`).`,PrivateNameRedeclaration:({identifierName:i})=>`Duplicate private name #${i}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:i})=>`Unexpected keyword '${i}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:i})=>`Unexpected reserved word '${i}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:i,unexpected:t})=>`Unexpected token${t?` '${t}'.`:""}${i?`, expected "${i}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script`.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:i,onlyValidPropertyName:t})=>`The only valid meta property for ${i} is ${i}.${t}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:i})=>`Identifier '${i}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},Hf={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:i})=>`Assigning to '${i}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:i})=>`Binding '${i}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."};const Gf=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]);var Wf={PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:i})=>`Invalid topic token ${i}. In order to use ${i} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${i}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:i})=>`Hack-style pipe body cannot be an unparenthesized ${Xi({type:i})}; please wrap it in parentheses.`,PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'};const Kf=["message"];function uo(i,t,e){Object.defineProperty(i,t,{enumerable:!1,configurable:!0,value:e})}function qf({toMessage:i,code:t,reasonCode:e,syntaxPlugin:s}){const n=e==="MissingPlugin"||e==="MissingOneOfPlugins";{const r={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};r[e]&&(e=r[e])}return function r(a,o){const l=new SyntaxError;return l.code=t,l.reasonCode=e,l.loc=a,l.pos=a.index,l.syntaxPlugin=s,n&&(l.missingPlugin=o.missingPlugin),uo(l,"clone",function(u={}){var d;const{line:c,column:f,index:p}=(d=u.loc)!=null?d:a;return r(new as(c,f,p),Object.assign({},o,u.details))}),uo(l,"details",o),Object.defineProperty(l,"message",{configurable:!0,get(){const h=`${i(o)} (${a.line}:${a.column})`;return this.message=h,h},set(h){Object.defineProperty(this,"message",{value:h,writable:!0})}}),l}}function Gt(i,t){if(Array.isArray(i))return s=>Gt(s,i[0]);const e={};for(const s of Object.keys(i)){const n=i[s],r=typeof n=="string"?{message:()=>n}:typeof n=="function"?{message:n}:n,{message:a}=r,o=jf(r,Kf),l=typeof a=="string"?()=>a:a;e[s]=qf(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:s,toMessage:l},t?{syntaxPlugin:t}:{},o))}return e}const w=Object.assign({},Gt(Uf),Gt(Vf),Gt(Hf),Gt`pipelineOperator`(Wf)),{defineProperty:zf}=Object,ho=(i,t)=>{i&&zf(i,t,{enumerable:!1,value:i[t]})};function Xs(i){return ho(i.loc.start,"index"),ho(i.loc.end,"index"),i}var Jf=i=>class extends i{parse(){const e=Xs(super.parse());return this.options.tokens&&(e.tokens=e.tokens.map(Xs)),e}parseRegExpLiteral({pattern:e,flags:s}){let n=null;try{n=new RegExp(e,s)}catch{}const r=this.estreeParseLiteral(n);return r.regex={pattern:e,flags:s},r}parseBigIntLiteral(e){let s;try{s=BigInt(e)}catch{s=null}const n=this.estreeParseLiteral(s);return n.bigint=String(n.value||e),n}parseDecimalLiteral(e){const n=this.estreeParseLiteral(null);return n.decimal=String(n.value||e),n}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}directiveToStmt(e){const s=e.value;delete e.value,s.type="Literal",s.raw=s.extra.raw,s.value=s.extra.expressionValue;const n=e;return n.type="ExpressionStatement",n.expression=s,n.directive=s.extra.rawValue,delete s.extra,n}initFunction(e,s){super.initFunction(e,s),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){var s;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((s=e.expression.extra)!=null&&s.parenthesized)}parseBlockBody(e,s,n,r,a){super.parseBlockBody(e,s,n,r,a);const o=e.directives.map(l=>this.directiveToStmt(l));e.body=o.concat(e.body),delete e.directives}pushClassMethod(e,s,n,r,a,o){this.parseMethod(s,n,r,a,o,"ClassMethod",!0),s.typeParameters&&(s.value.typeParameters=s.typeParameters,delete s.typeParameters),e.body.push(s)}parsePrivateName(){const e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){const s=super.getPrivateNameSV(e);return e=e,delete e.id,e.name=s,e.type="PrivateIdentifier",e}isPrivateName(e){return this.getPluginOption("estree","classFeatures")?e.type==="PrivateIdentifier":super.isPrivateName(e)}getPrivateNameSV(e){return this.getPluginOption("estree","classFeatures")?e.name:super.getPrivateNameSV(e)}parseLiteral(e,s){const n=super.parseLiteral(e,s);return n.raw=n.extra.raw,delete n.extra,n}parseFunctionBody(e,s,n=!1){super.parseFunctionBody(e,s,n),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,s,n,r,a,o,l=!1){let h=this.startNode();return h.kind=e.kind,h=super.parseMethod(h,s,n,r,a,o,l),h.type="FunctionExpression",delete h.kind,e.value=h,o==="ClassPrivateMethod"&&(e.computed=!1),this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return e.type==="Literal"?e.value==="constructor":super.nameIsConstructor(e)}parseClassProperty(...e){const s=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&(s.type="PropertyDefinition"),s}parseClassPrivateProperty(...e){const s=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(s.type="PropertyDefinition",s.computed=!1),s}parseObjectMethod(e,s,n,r,a){const o=super.parseObjectMethod(e,s,n,r,a);return o&&(o.type="Property",o.kind==="method"&&(o.kind="init"),o.shorthand=!1),o}parseObjectProperty(e,s,n,r){const a=super.parseObjectProperty(e,s,n,r);return a&&(a.kind="init",a.type="Property"),a}isValidLVal(e,s,n){return e==="Property"?"value":super.isValidLVal(e,s,n)}isAssignable(e,s){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,s):super.isAssignable(e,s)}toAssignable(e,s=!1){if(e!=null&&this.isObjectProperty(e)){const{key:n,value:r}=e;this.isPrivateName(n)&&this.classScope.usePrivateName(this.getPrivateNameSV(n),n.loc.start),this.toAssignable(r,s)}else super.toAssignable(e,s)}toAssignableObjectExpressionProp(e,s,n){e.type==="Property"&&(e.kind==="get"||e.kind==="set")?this.raise(w.PatternHasAccessor,e.key):e.type==="Property"&&e.method?this.raise(w.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,s,n)}finishCallExpression(e,s){const n=super.finishCallExpression(e,s);if(n.callee.type==="Import"){if(n.type="ImportExpression",n.source=n.arguments[0],this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")){var r,a;n.options=(r=n.arguments[1])!=null?r:null,n.attributes=(a=n.arguments[1])!=null?a:null}delete n.arguments,delete n.callee}return n}toReferencedArguments(e){e.type!=="ImportExpression"&&super.toReferencedArguments(e)}parseExport(e,s){const n=this.state.lastTokStartLoc,r=super.parseExport(e,s);switch(r.type){case"ExportAllDeclaration":r.exported=null;break;case"ExportNamedDeclaration":r.specifiers.length===1&&r.specifiers[0].type==="ExportNamespaceSpecifier"&&(r.type="ExportAllDeclaration",r.exported=r.specifiers[0].exported,delete r.specifiers);case"ExportDefaultDeclaration":{var a;const{declaration:o}=r;(o==null?void 0:o.type)==="ClassDeclaration"&&((a=o.decorators)==null?void 0:a.length)>0&&o.start===r.start&&this.resetStartLocation(r,n)}break}return r}parseSubscript(e,s,n,r){const a=super.parseSubscript(e,s,n,r);if(r.optionalChainMember){if((a.type==="OptionalMemberExpression"||a.type==="OptionalCallExpression")&&(a.type=a.type.substring(8)),r.stop){const o=this.startNodeAtNode(a);return o.expression=a,this.finishNode(o,"ChainExpression")}}else(a.type==="MemberExpression"||a.type==="CallExpression")&&(a.optional=!1);return a}isOptionalMemberExpression(e){return e.type==="ChainExpression"?e.expression.type==="MemberExpression":super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return e.type==="ChainExpression"&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type==="Property"&&e.kind==="init"&&!e.method}isObjectMethod(e){return e.type==="Property"&&(e.method||e.kind==="get"||e.kind==="set")}finishNodeAt(e,s,n){return Xs(super.finishNodeAt(e,s,n))}resetStartLocation(e,s){super.resetStartLocation(e,s),Xs(e)}resetEndLocation(e,s=this.state.lastTokEndLoc){super.resetEndLocation(e,s),Xs(e)}};class ni{constructor(t,e){this.token=void 0,this.preserveSpace=void 0,this.token=t,this.preserveSpace=!!e}}const Be={brace:new ni("{"),j_oTag:new ni("...",!0)};Be.template=new ni("`",!0);const Ce=!0,oe=!0,Zn=!0,Ys=!0,Qt=!0,Xf=!0;class Kl{constructor(t,e={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.rightAssociative=!!e.rightAssociative,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop!=null?e.binop:null,this.updateContext=null}}const Zr=new Map;function Le(i,t={}){t.keyword=i;const e=me(i,t);return Zr.set(i,e),e}function nt(i,t){return me(i,{beforeExpr:Ce,binop:t})}let mi=-1;const $t=[],Qr=[],ea=[],ta=[],sa=[],ia=[];function me(i,t={}){var e,s,n,r;return++mi,Qr.push(i),ea.push((e=t.binop)!=null?e:-1),ta.push((s=t.beforeExpr)!=null?s:!1),sa.push((n=t.startsExpr)!=null?n:!1),ia.push((r=t.prefix)!=null?r:!1),$t.push(new Kl(i,t)),mi}function we(i,t={}){var e,s,n,r;return++mi,Zr.set(i,mi),Qr.push(i),ea.push((e=t.binop)!=null?e:-1),ta.push((s=t.beforeExpr)!=null?s:!1),sa.push((n=t.startsExpr)!=null?n:!1),ia.push((r=t.prefix)!=null?r:!1),$t.push(new Kl("name",t)),mi}const Yf={bracketL:me("[",{beforeExpr:Ce,startsExpr:oe}),bracketHashL:me("#[",{beforeExpr:Ce,startsExpr:oe}),bracketBarL:me("[|",{beforeExpr:Ce,startsExpr:oe}),bracketR:me("]"),bracketBarR:me("|]"),braceL:me("{",{beforeExpr:Ce,startsExpr:oe}),braceBarL:me("{|",{beforeExpr:Ce,startsExpr:oe}),braceHashL:me("#{",{beforeExpr:Ce,startsExpr:oe}),braceR:me("}"),braceBarR:me("|}"),parenL:me("(",{beforeExpr:Ce,startsExpr:oe}),parenR:me(")"),comma:me(",",{beforeExpr:Ce}),semi:me(";",{beforeExpr:Ce}),colon:me(":",{beforeExpr:Ce}),doubleColon:me("::",{beforeExpr:Ce}),dot:me("."),question:me("?",{beforeExpr:Ce}),questionDot:me("?."),arrow:me("=>",{beforeExpr:Ce}),template:me("template"),ellipsis:me("...",{beforeExpr:Ce}),backQuote:me("`",{startsExpr:oe}),dollarBraceL:me("${",{beforeExpr:Ce,startsExpr:oe}),templateTail:me("...`",{startsExpr:oe}),templateNonTail:me("...${",{beforeExpr:Ce,startsExpr:oe}),at:me("@"),hash:me("#",{startsExpr:oe}),interpreterDirective:me("#!..."),eq:me("=",{beforeExpr:Ce,isAssign:Ys}),assign:me("_=",{beforeExpr:Ce,isAssign:Ys}),slashAssign:me("_=",{beforeExpr:Ce,isAssign:Ys}),xorAssign:me("_=",{beforeExpr:Ce,isAssign:Ys}),moduloAssign:me("_=",{beforeExpr:Ce,isAssign:Ys}),incDec:me("++/--",{prefix:Qt,postfix:Xf,startsExpr:oe}),bang:me("!",{beforeExpr:Ce,prefix:Qt,startsExpr:oe}),tilde:me("~",{beforeExpr:Ce,prefix:Qt,startsExpr:oe}),doubleCaret:me("^^",{startsExpr:oe}),doubleAt:me("@@",{startsExpr:oe}),pipeline:nt("|>",0),nullishCoalescing:nt("??",1),logicalOR:nt("||",1),logicalAND:nt("&&",2),bitwiseOR:nt("|",3),bitwiseXOR:nt("^",4),bitwiseAND:nt("&",5),equality:nt("==/!=/===/!==",6),lt:nt("/<=/>=",7),gt:nt("/<=/>=",7),relational:nt("/<=/>=",7),bitShift:nt("<>/>>>",8),bitShiftL:nt("<>/>>>",8),bitShiftR:nt("<>/>>>",8),plusMin:me("+/-",{beforeExpr:Ce,binop:9,prefix:Qt,startsExpr:oe}),modulo:me("%",{binop:10,startsExpr:oe}),star:me("*",{binop:10}),slash:nt("/",10),exponent:me("**",{beforeExpr:Ce,binop:11,rightAssociative:!0}),_in:Le("in",{beforeExpr:Ce,binop:7}),_instanceof:Le("instanceof",{beforeExpr:Ce,binop:7}),_break:Le("break"),_case:Le("case",{beforeExpr:Ce}),_catch:Le("catch"),_continue:Le("continue"),_debugger:Le("debugger"),_default:Le("default",{beforeExpr:Ce}),_else:Le("else",{beforeExpr:Ce}),_finally:Le("finally"),_function:Le("function",{startsExpr:oe}),_if:Le("if"),_return:Le("return",{beforeExpr:Ce}),_switch:Le("switch"),_throw:Le("throw",{beforeExpr:Ce,prefix:Qt,startsExpr:oe}),_try:Le("try"),_var:Le("var"),_const:Le("const"),_with:Le("with"),_new:Le("new",{beforeExpr:Ce,startsExpr:oe}),_this:Le("this",{startsExpr:oe}),_super:Le("super",{startsExpr:oe}),_class:Le("class",{startsExpr:oe}),_extends:Le("extends",{beforeExpr:Ce}),_export:Le("export"),_import:Le("import",{startsExpr:oe}),_null:Le("null",{startsExpr:oe}),_true:Le("true",{startsExpr:oe}),_false:Le("false",{startsExpr:oe}),_typeof:Le("typeof",{beforeExpr:Ce,prefix:Qt,startsExpr:oe}),_void:Le("void",{beforeExpr:Ce,prefix:Qt,startsExpr:oe}),_delete:Le("delete",{beforeExpr:Ce,prefix:Qt,startsExpr:oe}),_do:Le("do",{isLoop:Zn,beforeExpr:Ce}),_for:Le("for",{isLoop:Zn}),_while:Le("while",{isLoop:Zn}),_as:we("as",{startsExpr:oe}),_assert:we("assert",{startsExpr:oe}),_async:we("async",{startsExpr:oe}),_await:we("await",{startsExpr:oe}),_defer:we("defer",{startsExpr:oe}),_from:we("from",{startsExpr:oe}),_get:we("get",{startsExpr:oe}),_let:we("let",{startsExpr:oe}),_meta:we("meta",{startsExpr:oe}),_of:we("of",{startsExpr:oe}),_sent:we("sent",{startsExpr:oe}),_set:we("set",{startsExpr:oe}),_source:we("source",{startsExpr:oe}),_static:we("static",{startsExpr:oe}),_using:we("using",{startsExpr:oe}),_yield:we("yield",{startsExpr:oe}),_asserts:we("asserts",{startsExpr:oe}),_checks:we("checks",{startsExpr:oe}),_exports:we("exports",{startsExpr:oe}),_global:we("global",{startsExpr:oe}),_implements:we("implements",{startsExpr:oe}),_intrinsic:we("intrinsic",{startsExpr:oe}),_infer:we("infer",{startsExpr:oe}),_is:we("is",{startsExpr:oe}),_mixins:we("mixins",{startsExpr:oe}),_proto:we("proto",{startsExpr:oe}),_require:we("require",{startsExpr:oe}),_satisfies:we("satisfies",{startsExpr:oe}),_keyof:we("keyof",{startsExpr:oe}),_readonly:we("readonly",{startsExpr:oe}),_unique:we("unique",{startsExpr:oe}),_abstract:we("abstract",{startsExpr:oe}),_declare:we("declare",{startsExpr:oe}),_enum:we("enum",{startsExpr:oe}),_module:we("module",{startsExpr:oe}),_namespace:we("namespace",{startsExpr:oe}),_interface:we("interface",{startsExpr:oe}),_type:we("type",{startsExpr:oe}),_opaque:we("opaque",{startsExpr:oe}),name:me("name",{startsExpr:oe}),string:me("string",{startsExpr:oe}),num:me("num",{startsExpr:oe}),bigint:me("bigint",{startsExpr:oe}),decimal:me("decimal",{startsExpr:oe}),regexp:me("regexp",{startsExpr:oe}),privateName:me("#name",{startsExpr:oe}),eof:me("eof"),jsxName:me("jsxName"),jsxText:me("jsxText",{beforeExpr:!0}),jsxTagStart:me("jsxTagStart",{startsExpr:!0}),jsxTagEnd:me("jsxTagEnd"),placeholder:me("%%",{startsExpr:!0})};function Me(i){return i>=93&&i<=132}function Zf(i){return i<=92}function Pt(i){return i>=58&&i<=132}function ql(i){return i>=58&&i<=136}function Qf(i){return ta[i]}function Sr(i){return sa[i]}function ep(i){return i>=29&&i<=33}function fo(i){return i>=129&&i<=131}function tp(i){return i>=90&&i<=92}function na(i){return i>=58&&i<=92}function sp(i){return i>=39&&i<=59}function ip(i){return i===34}function np(i){return ia[i]}function rp(i){return i>=121&&i<=123}function ap(i){return i>=124&&i<=130}function os(i){return Qr[i]}function Yi(i){return ea[i]}function op(i){return i===57}function un(i){return i>=24&&i<=25}function Bt(i){return $t[i]}$t[8].updateContext=i=>{i.pop()},$t[5].updateContext=$t[7].updateContext=$t[23].updateContext=i=>{i.push(Be.brace)},$t[22].updateContext=i=>{i[i.length-1]===Be.template?i.pop():i.push(Be.template)},$t[142].updateContext=i=>{i.push(Be.j_expr,Be.j_oTag)};let ra="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",zl="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65";const lp=new RegExp("["+ra+"]"),cp=new RegExp("["+ra+zl+"]");ra=zl=null;const Jl=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],up=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function Pr(i,t){let e=65536;for(let s=0,n=t.length;si)return!1;if(e+=t[s+1],e>=i)return!0}return!1}function Vt(i){return i<65?i===36:i<=90?!0:i<97?i===95:i<=122?!0:i<=65535?i>=170&&lp.test(String.fromCharCode(i)):Pr(i,Jl)}function Us(i){return i<48?i===36:i<58?!0:i<65?!1:i<=90?!0:i<97?i===95:i<=122?!0:i<=65535?i>=170&&cp.test(String.fromCharCode(i)):Pr(i,Jl)||Pr(i,up)}const aa={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},hp=new Set(aa.keyword),fp=new Set(aa.strict),pp=new Set(aa.strictBind);function Xl(i,t){return t&&i==="await"||i==="enum"}function Yl(i,t){return Xl(i,t)||fp.has(i)}function Zl(i){return pp.has(i)}function Ql(i,t){return Yl(i,t)||Zl(i)}function dp(i){return hp.has(i)}function mp(i,t,e){return i===64&&t===64&&Vt(e)}const yp=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function gp(i){return yp.has(i)}class oa{constructor(t){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=t}}class la{constructor(t,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=t,this.inModule=e}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){const t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){const{flags:e}=this.scopeStack[t];if(e&128)return!0;if(e&451)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new oa(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,e,s){let n=this.currentScope();if(e&8||e&16){this.checkRedeclarationInScope(n,t,e,s);let r=n.names.get(t)||0;e&16?r=r|4:(n.firstLexicalName||(n.firstLexicalName=t),r=r|2),n.names.set(t,r),e&8&&this.maybeExportDefined(n,t)}else if(e&4)for(let r=this.scopeStack.length-1;r>=0&&(n=this.scopeStack[r],this.checkRedeclarationInScope(n,t,e,s),n.names.set(t,(n.names.get(t)||0)|1),this.maybeExportDefined(n,t),!(n.flags&387));--r);this.parser.inModule&&n.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,e){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(t,e,s,n){this.isRedeclaredInScope(t,e,s)&&this.parser.raise(w.VarRedeclaration,n,{identifierName:e})}isRedeclaredInScope(t,e,s){if(!(s&1))return!1;if(s&8)return t.names.has(e);const n=t.names.get(e);return s&16?(n&2)>0||!this.treatFunctionsAsVarInScope(t)&&(n&1)>0:(n&2)>0&&!(t.flags&8&&t.firstLexicalName===e)||!this.treatFunctionsAsVarInScope(t)&&(n&4)>0}checkLocalExport(t){const{name:e}=t;this.scopeStack[0].names.has(e)||this.undefinedExports.set(e,t.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){const{flags:e}=this.scopeStack[t];if(e&387)return e}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){const{flags:e}=this.scopeStack[t];if(e&451&&!(e&4))return e}}}class Tp extends oa{constructor(...t){super(...t),this.declareFunctions=new Set}}class bp extends la{createScope(t){return new Tp(t)}declareName(t,e,s){const n=this.currentScope();if(e&2048){this.checkRedeclarationInScope(n,t,e,s),this.maybeExportDefined(n,t),n.declareFunctions.add(t);return}super.declareName(t,e,s)}isRedeclaredInScope(t,e,s){if(super.isRedeclaredInScope(t,e,s))return!0;if(s&2048&&!t.declareFunctions.has(e)){const n=t.names.get(e);return(n&4)>0||(n&2)>0}return!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}}class xp{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}hasPlugin(t){if(typeof t=="string")return this.plugins.has(t);{const[e,s]=t;if(!this.hasPlugin(e))return!1;const n=this.plugins.get(e);for(const r of Object.keys(s))if((n==null?void 0:n[r])!==s[r])return!1;return!0}}getPluginOption(t,e){var s;return(s=this.plugins.get(t))==null?void 0:s[e]}}function ec(i,t){i.trailingComments===void 0?i.trailingComments=t:i.trailingComments.unshift(...t)}function Sp(i,t){i.leadingComments===void 0?i.leadingComments=t:i.leadingComments.unshift(...t)}function Ai(i,t){i.innerComments===void 0?i.innerComments=t:i.innerComments.unshift(...t)}function Zs(i,t,e){let s=null,n=t.length;for(;s===null&&n>0;)s=t[--n];s===null||s.start>e.start?Ai(i,e.comments):ec(s,e.comments)}class Pp extends xp{addComment(t){this.filename&&(t.loc.filename=this.filename);const{commentsLen:e}=this.state;this.comments.length!==e&&(this.comments.length=e),this.comments.push(t),this.state.commentsLen++}processComment(t){const{commentStack:e}=this.state,s=e.length;if(s===0)return;let n=s-1;const r=e[n];r.start===t.end&&(r.leadingNode=t,n--);const{start:a}=t;for(;n>=0;n--){const o=e[n],l=o.end;if(l>a)o.containingNode=t,this.finalizeComment(o),e.splice(n,1);else{l===a&&(o.trailingNode=t);break}}}finalizeComment(t){const{comments:e}=t;if(t.leadingNode!==null||t.trailingNode!==null)t.leadingNode!==null&&ec(t.leadingNode,e),t.trailingNode!==null&&Sp(t.trailingNode,e);else{const{containingNode:s,start:n}=t;if(this.input.charCodeAt(n-1)===44)switch(s.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":Zs(s,s.properties,t);break;case"CallExpression":case"OptionalCallExpression":Zs(s,s.arguments,t);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":Zs(s,s.params,t);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":Zs(s,s.elements,t);break;case"ExportNamedDeclaration":case"ImportDeclaration":Zs(s,s.specifiers,t);break;default:Ai(s,e)}else Ai(s,e)}}finalizeRemainingComments(){const{commentStack:t}=this.state;for(let e=t.length-1;e>=0;e--)this.finalizeComment(t[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(t){const{commentStack:e}=this.state,{length:s}=e;if(s===0)return;const n=e[s-1];n.leadingNode===t&&(n.leadingNode=null)}resetPreviousIdentifierLeadingComments(t){const{commentStack:e}=this.state,{length:s}=e;s!==0&&(e[s-1].trailingNode===t?e[s-1].trailingNode=null:s>=2&&e[s-2].trailingNode===t&&(e[s-2].trailingNode=null))}takeSurroundingComments(t,e,s){const{commentStack:n}=this.state,r=n.length;if(r===0)return;let a=r-1;for(;a>=0;a--){const o=n[a],l=o.end;if(o.start===s)o.leadingNode=t;else if(l===e)o.trailingNode=t;else if(l0}set strict(t){t?this.flags|=1:this.flags&=-2}init({strictMode:t,sourceType:e,startLine:s,startColumn:n}){this.strict=t===!1?!1:t===!0?!0:e==="module",this.curLine=s,this.lineStart=-n,this.startLoc=this.endLoc=new as(s,n,0)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(t){t?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(t){t?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(t){t?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(t){t?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(t){t?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(t){t?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(t){t?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(t){t?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(t){t?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(t){t?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(t){t?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(t){t?this.flags|=4096:this.flags&=-4097}curPosition(){return new as(this.curLine,this.pos-this.lineStart,this.pos)}clone(){const t=new ca;return t.flags=this.flags,t.curLine=this.curLine,t.lineStart=this.lineStart,t.startLoc=this.startLoc,t.endLoc=this.endLoc,t.errors=this.errors.slice(),t.potentialArrowAt=this.potentialArrowAt,t.noArrowAt=this.noArrowAt.slice(),t.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),t.topicContext=this.topicContext,t.labels=this.labels.slice(),t.commentsLen=this.commentsLen,t.commentStack=this.commentStack.slice(),t.pos=this.pos,t.type=this.type,t.value=this.value,t.start=this.start,t.end=this.end,t.lastTokEndLoc=this.lastTokEndLoc,t.lastTokStartLoc=this.lastTokStartLoc,t.context=this.context.slice(),t.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,t.strictErrors=this.strictErrors,t.tokensLength=this.tokensLength,t}}var wp=function(t){return t>=48&&t<=57};const mo={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Vi={bin:i=>i===48||i===49,oct:i=>i>=48&&i<=55,dec:i=>i>=48&&i<=57,hex:i=>i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102};function yo(i,t,e,s,n,r){const a=e,o=s,l=n;let h="",u=null,d=e;const{length:c}=t;for(;;){if(e>=c){r.unterminated(a,o,l),h+=t.slice(d,e);break}const f=t.charCodeAt(e);if(Cp(i,f,t,e)){h+=t.slice(d,e);break}if(f===92){h+=t.slice(d,e);const p=kp(t,e,s,n,i==="template",r);p.ch===null&&!u?u={pos:e,lineStart:s,curLine:n}:h+=p.ch,{pos:e,lineStart:s,curLine:n}=p,d=e}else f===8232||f===8233?(++e,++n,s=e):f===10||f===13?i==="template"?(h+=t.slice(d,e)+` +`,++e,f===13&&t.charCodeAt(e)===10&&++e,++n,d=s=e):r.unterminated(a,o,l):++e}return{pos:e,str:h,firstInvalidLoc:u,lineStart:s,curLine:n,containsInvalid:!!u}}function Cp(i,t,e,s){return i==="template"?t===96||t===36&&e.charCodeAt(s+1)===123:t===(i==="double"?34:39)}function kp(i,t,e,s,n,r){const a=!n;t++;const o=h=>({pos:t,ch:h,lineStart:e,curLine:s}),l=i.charCodeAt(t++);switch(l){case 110:return o(` +`);case 114:return o("\r");case 120:{let h;return{code:h,pos:t}=Er(i,t,e,s,2,!1,a,r),o(h===null?null:String.fromCharCode(h))}case 117:{let h;return{code:h,pos:t}=sc(i,t,e,s,a,r),o(h===null?null:String.fromCodePoint(h))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:i.charCodeAt(t)===10&&++t;case 10:e=t,++s;case 8232:case 8233:return o("");case 56:case 57:if(n)return o(null);r.strictNumericEscape(t-1,e,s);default:if(l>=48&&l<=55){const h=t-1;let d=/^[0-7]+/.exec(i.slice(h,t+2))[0],c=parseInt(d,8);c>255&&(d=d.slice(0,-1),c=parseInt(d,8)),t+=d.length-1;const f=i.charCodeAt(t);if(d!=="0"||f===56||f===57){if(n)return o(null);r.strictNumericEscape(h,e,s)}return o(String.fromCharCode(c))}return o(String.fromCharCode(l))}}function Er(i,t,e,s,n,r,a,o){const l=t;let h;return{n:h,pos:t}=tc(i,t,e,s,16,n,r,!1,o,!a),h===null&&(a?o.invalidEscapeSequence(l,e,s):t=l-1),{code:h,pos:t}}function tc(i,t,e,s,n,r,a,o,l,h){const u=t,d=n===16?mo.hex:mo.decBinOct,c=n===16?Vi.hex:n===10?Vi.dec:n===8?Vi.oct:Vi.bin;let f=!1,p=0;for(let m=0,b=r==null?1/0:r;m=97?A=P-97+10:P>=65?A=P-65+10:wp(P)?A=P-48:A=1/0,A>=n){if(A<=9&&h)return{n:null,pos:t};if(A<=9&&l.invalidDigit(t,e,s,n))A=0;else if(a)A=0,f=!0;else break}++t,p=p*n+A}return t===u||r!=null&&t-u!==r||f?{n:null,pos:t}:{n:p,pos:t}}function sc(i,t,e,s,n,r){const a=i.charCodeAt(t);let o;if(a===123){if(++t,{code:o,pos:t}=Er(i,t,e,s,i.indexOf("}",t)-t,!0,n,r),++t,o!==null&&o>1114111)if(n)r.invalidCodePoint(t,e,s);else return{code:null,pos:t}}else({code:o,pos:t}=Er(i,t,e,s,4,!1,n,r));return{code:o,pos:t}}function Qs(i,t,e){return new as(e,i-t,i)}const vp=new Set([103,109,115,105,121,117,100,118]);class ts{constructor(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,this.loc=new cn(t.startLoc,t.endLoc)}}class Lp extends Pp{constructor(t,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(s,n,r,a)=>this.options.errorRecovery?(this.raise(w.InvalidDigit,Qs(s,n,r),{radix:a}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(w.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(w.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(w.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(w.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(s,n,r)=>{this.recordStrictModeErrors(w.StrictNumericEscape,Qs(s,n,r))},unterminated:(s,n,r)=>{throw this.raise(w.UnterminatedString,Qs(s-1,n,r))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(w.StrictNumericEscape),unterminated:(s,n,r)=>{throw this.raise(w.UnterminatedTemplate,Qs(s,n,r))}}),this.state=new ca,this.state.init(t),this.input=e,this.length=e.length,this.comments=[],this.isLookahead=!1}pushToken(t){this.tokens.length=this.state.tokensLength,this.tokens.push(t),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.options.tokens&&this.pushToken(new ts(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(t){return this.match(t)?(this.next(),!0):!1}match(t){return this.state.type===t}createLookaheadState(t){return{pos:t.pos,value:null,type:t.type,start:t.start,end:t.end,context:[this.curContext()],inType:t.inType,startLoc:t.startLoc,lastTokEndLoc:t.lastTokEndLoc,curLine:t.curLine,lineStart:t.lineStart,curPosition:t.curPosition}}lookahead(){const t=this.state;this.state=this.createLookaheadState(t),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;const e=this.state;return this.state=t,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(t){return Qn.lastIndex=t,Qn.test(this.input)?Qn.lastIndex:t}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(t){return er.lastIndex=t,er.test(this.input)?er.lastIndex:t}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(t){let e=this.input.charCodeAt(t);if((e&64512)===55296&&++tthis.raise(e,s)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(139);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(t){let e;this.isLookahead||(e=this.state.curPosition());const s=this.state.pos,n=this.input.indexOf(t,s+2);if(n===-1)throw this.raise(w.UnterminatedComment,this.state.curPosition());for(this.state.pos=n+t.length,Ui.lastIndex=s+2;Ui.test(this.input)&&Ui.lastIndex<=n;)++this.state.curLine,this.state.lineStart=Ui.lastIndex;if(this.isLookahead)return;const r={type:"CommentBlock",value:this.input.slice(s+2,n),start:s,end:n+t.length,loc:new cn(e,this.state.curPosition())};return this.options.tokens&&this.pushToken(r),r}skipLineComment(t){const e=this.state.pos;let s;this.isLookahead||(s=this.state.curPosition());let n=this.input.charCodeAt(this.state.pos+=t);if(this.state.post)){const r=this.skipLineComment(3);r!==void 0&&(this.addComment(r),this.options.attachComment&&e.push(r))}else break e}else if(s===60&&!this.inModule&&this.options.annexB){const n=this.state.pos;if(this.input.charCodeAt(n+1)===33&&this.input.charCodeAt(n+2)===45&&this.input.charCodeAt(n+3)===45){const r=this.skipLineComment(4);r!==void 0&&(this.addComment(r),this.options.attachComment&&e.push(r))}else break e}else break e}}if(e.length>0){const s=this.state.pos,n={start:t,end:s,comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(n)}}finishToken(t,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();const s=this.state.type;this.state.type=t,this.state.value=e,this.isLookahead||this.updateContext(s)}replaceToken(t){this.state.type=t,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;const t=this.state.pos+1,e=this.codePointAtPos(t);if(e>=48&&e<=57)throw this.raise(w.UnexpectedDigitAfterHash,this.state.curPosition());if(e===123||e===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(e===123?w.RecordExpressionHashIncorrectStartSyntaxType:w.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else Vt(e)?(++this.state.pos,this.finishToken(138,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(138,this.readWord1())):this.finishOp(27,1)}readToken_dot(){const t=this.input.charCodeAt(this.state.pos+1);if(t>=48&&t<=57){this.readNumber(!0);return}t===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let t=this.input.charCodeAt(this.state.pos+1);if(t!==33)return!1;const e=this.state.pos;for(this.state.pos+=1;!Vs(t)&&++this.state.pos=48&&e<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(t){switch(t){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(w.TupleExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(w.RecordExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{const e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(t);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(t);return;case 124:case 38:this.readToken_pipe_amp(t);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(t);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(t);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(Vt(t)){this.readWord(t);return}}throw this.raise(w.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(t)})}finishOp(t,e){const s=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(t,s)}readRegexp(){const t=this.state.startLoc,e=this.state.start+1;let s,n,{pos:r}=this.state;for(;;++r){if(r>=this.length)throw this.raise(w.UnterminatedRegExp,ot(t,1));const h=this.input.charCodeAt(r);if(Vs(h))throw this.raise(w.UnterminatedRegExp,ot(t,1));if(s)s=!1;else{if(h===91)n=!0;else if(h===93&&n)n=!1;else if(h===47&&!n)break;s=h===92}}const a=this.input.slice(e,r);++r;let o="";const l=()=>ot(t,r+2-e);for(;r=2&&this.input.charCodeAt(e)===48;if(l){const f=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(w.StrictOctalLiteral,s),!this.state.strict){const p=f.indexOf("_");p>0&&this.raise(w.ZeroDigitNumericSeparator,ot(s,p))}o=l&&!/[89]/.test(f)}let h=this.input.charCodeAt(this.state.pos);if(h===46&&!o&&(++this.state.pos,this.readInt(10),n=!0,h=this.input.charCodeAt(this.state.pos)),(h===69||h===101)&&!o&&(h=this.input.charCodeAt(++this.state.pos),(h===43||h===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(w.InvalidOrMissingExponent,s),n=!0,a=!0,h=this.input.charCodeAt(this.state.pos)),h===110&&((n||l)&&this.raise(w.InvalidBigIntLiteral,s),++this.state.pos,r=!0),h===109){this.expectPlugin("decimal",this.state.curPosition()),(a||l)&&this.raise(w.InvalidDecimal,s),++this.state.pos;var u=!0}if(Vt(this.codePointAtPos(this.state.pos)))throw this.raise(w.NumberIdentifier,this.state.curPosition());const d=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(r){this.finishToken(135,d);return}if(u){this.finishToken(136,d);return}const c=o?parseInt(d,8):parseFloat(d);this.finishToken(134,c)}readCodePoint(t){const{code:e,pos:s}=sc(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,this.errorHandlers_readCodePoint);return this.state.pos=s,e}readString(t){const{str:e,pos:s,curLine:n,lineStart:r}=yo(t===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=s+1,this.state.lineStart=r,this.state.curLine=n,this.finishToken(133,e)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){const t=this.input[this.state.pos],{str:e,firstInvalidLoc:s,pos:n,curLine:r,lineStart:a}=yo("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=n+1,this.state.lineStart=a,this.state.curLine=r,s&&(this.state.firstInvalidTemplateEscapePos=new as(s.curLine,s.pos-s.lineStart,s.pos)),this.input.codePointAt(n)===96?this.finishToken(24,s?null:t+e+"`"):(this.state.pos++,this.finishToken(25,s?null:t+e+"${"))}recordStrictModeErrors(t,e){const s=e.index;this.state.strict&&!this.state.strictErrors.has(s)?this.raise(t,e):this.state.strictErrors.set(s,[t,e])}readWord1(t){this.state.containsEsc=!1;let e="";const s=this.state.pos;let n=this.state.pos;for(t!==void 0&&(this.state.pos+=t<=65535?1:2);this.state.pos=0;o--){const l=a[o];if(l.loc.index===r)return a[o]=t(n,s);if(l.loc.indexthis.hasPlugin(e)))throw this.raise(w.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:t})}errorBuilder(t){return(e,s,n)=>{this.raise(t,Qs(e,s,n))}}}class Ip{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}}class Np{constructor(t){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=t}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new Ip)}exit(){const t=this.stack.pop(),e=this.current();for(const[s,n]of Array.from(t.undefinedPrivateNames))e?e.undefinedPrivateNames.has(s)||e.undefinedPrivateNames.set(s,n):this.parser.raise(w.InvalidPrivateFieldResolution,n,{identifierName:s})}declarePrivateName(t,e,s){const{privateNames:n,loneAccessors:r,undefinedPrivateNames:a}=this.current();let o=n.has(t);if(e&3){const l=o&&r.get(t);if(l){const h=l&4,u=e&4,d=l&3,c=e&3;o=d===c||h!==u,o||r.delete(t)}else o||r.set(t,e)}o&&this.parser.raise(w.PrivateNameRedeclaration,s,{identifierName:t}),n.add(t),a.delete(t)}usePrivateName(t,e){let s;for(s of this.stack)if(s.privateNames.has(t))return;s?s.undefinedPrivateNames.set(t,e):this.parser.raise(w.InvalidPrivateFieldResolution,e,{identifierName:t})}}class Ln{constructor(t=0){this.type=t}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}}class ic extends Ln{constructor(t){super(t),this.declarationErrors=new Map}recordDeclarationError(t,e){const s=e.index;this.declarationErrors.set(s,[t,e])}clearDeclarationError(t){this.declarationErrors.delete(t)}iterateErrors(t){this.declarationErrors.forEach(t)}}class _p{constructor(t){this.parser=void 0,this.stack=[new Ln],this.parser=t}enter(t){this.stack.push(t)}exit(){this.stack.pop()}recordParameterInitializerError(t,e){const s=e.loc.start,{stack:n}=this;let r=n.length-1,a=n[r];for(;!a.isCertainlyParameterDeclaration();){if(a.canBeArrowParameterDeclaration())a.recordDeclarationError(t,s);else return;a=n[--r]}this.parser.raise(t,s)}recordArrowParameterBindingError(t,e){const{stack:s}=this,n=s[s.length-1],r=e.loc.start;if(n.isCertainlyParameterDeclaration())this.parser.raise(t,r);else if(n.canBeArrowParameterDeclaration())n.recordDeclarationError(t,r);else return}recordAsyncArrowParametersError(t){const{stack:e}=this;let s=e.length-1,n=e[s];for(;n.canBeArrowParameterDeclaration();)n.type===2&&n.recordDeclarationError(w.AwaitBindingIdentifier,t),n=e[--s]}validateAsPattern(){const{stack:t}=this,e=t[t.length-1];!e.canBeArrowParameterDeclaration()||e.iterateErrors(([s,n])=>{this.parser.raise(s,n);let r=t.length-2,a=t[r];for(;a.canBeArrowParameterDeclaration();)a.clearDeclarationError(n.index),a=t[--r]})}}function Mp(){return new Ln(3)}function Op(){return new ic(1)}function Dp(){return new ic(2)}function nc(){return new Ln}class Fp{constructor(){this.stacks=[]}enter(t){this.stacks.push(t)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}}function Zi(i,t){return(i?2:0)|(t?1:0)}class Bp extends Lp{addExtra(t,e,s,n=!0){if(!t)return;let{extra:r}=t;r==null&&(r={},t.extra=r),n?r[e]=s:Object.defineProperty(r,e,{enumerable:n,value:s})}isContextual(t){return this.state.type===t&&!this.state.containsEsc}isUnparsedContextual(t,e){const s=t+e.length;if(this.input.slice(t,s)===e){const n=this.input.charCodeAt(s);return!(Us(n)||(n&64512)===55296)}return!1}isLookaheadContextual(t){const e=this.nextTokenStart();return this.isUnparsedContextual(e,t)}eatContextual(t){return this.isContextual(t)?(this.next(),!0):!1}expectContextual(t,e){if(!this.eatContextual(t)){if(e!=null)throw this.raise(e,this.state.startLoc);this.unexpected(null,t)}}canInsertSemicolon(){return this.match(139)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return po(this.input,this.state.lastTokEndLoc.index,this.state.start)}hasFollowingLineBreak(){return po(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(t=!0){(t?this.isLineTerminator():this.eat(13))||this.raise(w.MissingSemicolon,this.state.lastTokEndLoc)}expect(t,e){this.eat(t)||this.unexpected(e,t)}tryParse(t,e=this.state.clone()){const s={node:null};try{const n=t((r=null)=>{throw s.node=r,s});if(this.state.errors.length>e.errors.length){const r=this.state;return this.state=e,this.state.tokensLength=r.tokensLength,{node:n,error:r.errors[e.errors.length],thrown:!1,aborted:!1,failState:r}}return{node:n,error:null,thrown:!1,aborted:!1,failState:null}}catch(n){const r=this.state;if(this.state=e,n instanceof SyntaxError)return{node:null,error:n,thrown:!0,aborted:!1,failState:r};if(n===s)return{node:s.node,error:null,thrown:!1,aborted:!0,failState:r};throw n}}checkExpressionErrors(t,e){if(!t)return!1;const{shorthandAssignLoc:s,doubleProtoLoc:n,privateKeyLoc:r,optionalParametersLoc:a}=t,o=!!s||!!n||!!a||!!r;if(!e)return o;s!=null&&this.raise(w.InvalidCoverInitializedName,s),n!=null&&this.raise(w.DuplicateProto,n),r!=null&&this.raise(w.UnexpectedPrivateField,r),a!=null&&this.unexpected(a)}isLiteralPropertyName(){return ql(this.state.type)}isPrivateName(t){return t.type==="PrivateName"}getPrivateNameSV(t){return t.id.name}hasPropertyAsPrivateName(t){return(t.type==="MemberExpression"||t.type==="OptionalMemberExpression")&&this.isPrivateName(t.property)}isObjectProperty(t){return t.type==="ObjectProperty"}isObjectMethod(t){return t.type==="ObjectMethod"}initializeScopes(t=this.options.sourceType==="module"){const e=this.state.labels;this.state.labels=[];const s=this.exportedIdentifiers;this.exportedIdentifiers=new Set;const n=this.inModule;this.inModule=t;const r=this.scope,a=this.getScopeHandler();this.scope=new a(this,t);const o=this.prodParam;this.prodParam=new Fp;const l=this.classScope;this.classScope=new Np(this);const h=this.expressionScope;return this.expressionScope=new _p(this),()=>{this.state.labels=e,this.exportedIdentifiers=s,this.inModule=n,this.scope=r,this.prodParam=o,this.classScope=l,this.expressionScope=h}}enterInitialScopes(){let t=0;this.inModule&&(t|=2),this.scope.enter(1),this.prodParam.enter(t)}checkDestructuringPrivate(t){const{privateKeyLoc:e}=t;e!==null&&this.expectPlugin("destructuringPrivate",e)}}class Qi{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}}class hn{constructor(t,e,s){this.type="",this.start=e,this.end=0,this.loc=new cn(s),t!=null&&t.options.ranges&&(this.range=[e,0]),t!=null&&t.filename&&(this.loc.filename=t.filename)}}const ua=hn.prototype;ua.__clone=function(){const i=new hn(void 0,this.start,this.loc.start),t=Object.keys(this);for(let e=0,s=t.length;e`Cannot overwrite reserved type ${i}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:i,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${i} = true,\` or \`${i} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:i,enumName:t})=>`Enum member names need to be unique, but the name \`${i}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:i})=>`Enum \`${i}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:i,enumName:t})=>`Enum type \`${i}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:i})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${i}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:i,memberName:t,explicitType:e})=>`Enum \`${i}\` has type \`${e}\`, so the initializer of \`${t}\` needs to be a ${e} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:i,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${i}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:i,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${i}\`.`,EnumInvalidMemberName:({enumName:i,memberName:t,suggestion:e})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${e}\`, in enum \`${i}\`.`,EnumNumberMemberNotInitialized:({enumName:i,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${i}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:i})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${i}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:i})=>`Unexpected reserved type ${i}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:i,suggestion:t})=>`\`declare export ${i}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function Vp(i){return i.type==="DeclareExportAllDeclaration"||i.type==="DeclareExportDeclaration"&&(!i.declaration||i.declaration.type!=="TypeAlias"&&i.declaration.type!=="InterfaceDeclaration")}function go(i){return i.importKind==="type"||i.importKind==="typeof"}const Hp={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function Gp(i,t){const e=[],s=[];for(let n=0;nclass extends i{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return bp}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,s){e!==133&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,s)}addComment(e){if(this.flowPragma===void 0){const s=Wp.exec(e.value);if(s)if(s[1]==="flow")this.flowPragma="flow";else if(s[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){const s=this.state.inType;this.state.inType=!0,this.expect(e||14);const n=this.flowParseType();return this.state.inType=s,n}flowParsePredicate(){const e=this.startNode(),s=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>s.index+1&&this.raise(ge.UnexpectedSpaceBetweenModuloChecks,s),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){const e=this.state.inType;this.state.inType=!0,this.expect(14);let s=null,n=null;return this.match(54)?(this.state.inType=e,n=this.flowParsePredicate()):(s=this.flowParseType(),this.state.inType=e,this.match(54)&&(n=this.flowParsePredicate())),[s,n]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();const s=e.id=this.parseIdentifier(),n=this.startNode(),r=this.startNode();this.match(47)?n.typeParameters=this.flowParseTypeParameterDeclaration():n.typeParameters=null,this.expect(10);const a=this.flowParseFunctionTypeParams();return n.params=a.params,n.rest=a.rest,n.this=a._this,this.expect(11),[n.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),r.typeAnnotation=this.finishNode(n,"FunctionTypeAnnotation"),s.typeAnnotation=this.finishNode(r,"TypeAnnotation"),this.resetEndLocation(s),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,s){if(this.match(80))return this.flowParseDeclareClass(e);if(this.match(68))return this.flowParseDeclareFunction(e);if(this.match(74))return this.flowParseDeclareVariable(e);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(e):(s&&this.raise(ge.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(129))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,s);this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(133)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();const s=e.body=this.startNode(),n=s.body=[];for(this.expect(5);!this.match(8);){let o=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(ge.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(o)):(this.expectContextual(125,ge.UnsupportedStatementInDeclareModule),o=this.flowParseDeclare(o,!0)),n.push(o)}this.scope.exit(),this.expect(8),this.finishNode(s,"BlockStatement");let r=null,a=!1;return n.forEach(o=>{Vp(o)?(r==="CommonJS"&&this.raise(ge.AmbiguousDeclareModuleKind,o),r="ES"):o.type==="DeclareModuleExports"&&(a&&this.raise(ge.DuplicateDeclareModuleExports,o),r==="ES"&&this.raise(ge.AmbiguousDeclareModuleKind,o),r="CommonJS",a=!0)}),e.kind=r||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,s){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!s){const n=this.state.value;throw this.raise(ge.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:n,suggestion:Hp[n]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return e=this.parseExport(e,null),e.type==="ExportNamedDeclaration"&&(e.type="ExportDeclaration",e.default=!1,delete e.exportKind),e.type="Declare"+e.type,e;this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();const s=this.flowParseTypeAlias(e);return s.type="DeclareTypeAlias",s}flowParseDeclareOpaqueType(e){this.next();const s=this.flowParseOpaqueType(e,!0);return s.type="DeclareOpaqueType",s}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,s){if(e.id=this.flowParseRestrictedIdentifier(!s,!0),this.scope.declareName(e.id.name,s?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(!s&&this.eat(12));if(s){if(e.implements=[],e.mixins=[],this.eatContextual(117))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:s,allowExact:!1,allowSpread:!1,allowProto:s,allowInexact:!1})}flowParseInterfaceExtends(){const e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(ge.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,s,n){!Up.has(e)||this.raise(n?ge.AssignReservedType:ge.UnexpectedReservedType,s,{reservedType:e})}flowParseRestrictedIdentifier(e,s){return this.checkReservedType(this.state.value,this.state.startLoc,s),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,s){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,s||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){const s=this.state.startLoc,n=this.startNode(),r=this.flowParseVariance(),a=this.flowParseTypeAnnotatableIdentifier();return n.name=a.name,n.variance=r,n.bound=a.typeAnnotation,this.match(29)?(this.eat(29),n.default=this.flowParseType()):e&&this.raise(ge.MissingTypeParamDefault,s),this.finishNode(n,"TypeParameter")}flowParseTypeParameterDeclaration(){const e=this.state.inType,s=this.startNode();s.params=[],this.state.inType=!0,this.match(47)||this.match(142)?this.next():this.unexpected();let n=!1;do{const r=this.flowParseTypeParameter(n);s.params.push(r),r.default&&(n=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(s,"TypeParameterDeclaration")}flowParseTypeParameterInstantiation(){const e=this.startNode(),s=this.state.inType;e.params=[],this.state.inType=!0,this.expect(47);const n=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);return this.state.noAnonFunctionType=n,this.expect(48),this.state.inType=s,this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){const e=this.startNode(),s=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=s,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){const e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(134)||this.match(133)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,s,n){return e.static=s,this.lookahead().type===14?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=n,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,s){return e.static=s,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,s){const n=this.startNode();return e.static=s,e.value=this.flowParseObjectTypeMethodish(n),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:s,allowSpread:n,allowProto:r,allowInexact:a}){const o=this.state.inType;this.state.inType=!0;const l=this.startNode();l.callProperties=[],l.properties=[],l.indexers=[],l.internalSlots=[];let h,u,d=!1;for(s&&this.match(6)?(this.expect(6),h=9,u=!0):(this.expect(5),h=8,u=!1),l.exact=u;!this.match(h);){let f=!1,p=null,m=null;const b=this.startNode();if(r&&this.isContextual(118)){const A=this.lookahead();A.type!==14&&A.type!==17&&(this.next(),p=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){const A=this.lookahead();A.type!==14&&A.type!==17&&(this.next(),f=!0)}const P=this.flowParseVariance();if(this.eat(0))p!=null&&this.unexpected(p),this.eat(0)?(P&&this.unexpected(P.loc.start),l.internalSlots.push(this.flowParseObjectTypeInternalSlot(b,f))):l.indexers.push(this.flowParseObjectTypeIndexer(b,f,P));else if(this.match(10)||this.match(47))p!=null&&this.unexpected(p),P&&this.unexpected(P.loc.start),l.callProperties.push(this.flowParseObjectTypeCallProperty(b,f));else{let A="init";if(this.isContextual(99)||this.isContextual(104)){const O=this.lookahead();ql(O.type)&&(A=this.state.value,this.next())}const U=this.flowParseObjectTypeProperty(b,f,p,P,A,n,a!=null?a:!u);U===null?(d=!0,m=this.state.lastTokStartLoc):l.properties.push(U)}this.flowObjectTypeSemicolon(),m&&!this.match(8)&&!this.match(9)&&this.raise(ge.UnexpectedExplicitInexactInObject,m)}this.expect(h),n&&(l.inexact=d);const c=this.finishNode(l,"ObjectTypeAnnotation");return this.state.inType=o,c}flowParseObjectTypeProperty(e,s,n,r,a,o,l){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(o?l||this.raise(ge.InexactInsideExact,this.state.lastTokStartLoc):this.raise(ge.InexactInsideNonObject,this.state.lastTokStartLoc),r&&this.raise(ge.InexactVariance,r),null):(o||this.raise(ge.UnexpectedSpreadType,this.state.lastTokStartLoc),n!=null&&this.unexpected(n),r&&this.raise(ge.SpreadVariance,r),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=s,e.proto=n!=null,e.kind=a;let h=!1;return this.match(47)||this.match(10)?(e.method=!0,n!=null&&this.unexpected(n),r&&this.unexpected(r.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(a==="get"||a==="set")&&this.flowCheckGetterSetterParams(e),!o&&e.key.name==="constructor"&&e.value.this&&this.raise(ge.ThisParamBannedInConstructor,e.value.this)):(a!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(h=!0),e.value=this.flowParseTypeInitialiser(),e.variance=r),e.optional=h,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){const s=e.kind==="get"?0:1,n=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?ge.GetterMayNotHaveThisParam:ge.SetterMayNotHaveThisParam,e.value.this),n!==s&&this.raise(e.kind==="get"?w.BadGetterArity:w.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(w.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,s){var n;(n=e)!=null||(e=this.state.startLoc);let r=s||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){const a=this.startNodeAt(e);a.qualification=r,a.id=this.flowParseRestrictedIdentifier(!0),r=this.finishNode(a,"QualifiedTypeIdentifier")}return r}flowParseGenericType(e,s){const n=this.startNodeAt(e);return n.typeParameters=null,n.id=this.flowParseQualifiedTypeIdentifier(e,s),this.match(47)&&(n.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(n,"GenericTypeAnnotation")}flowParseTypeofType(){const e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){const e=this.startNode();for(e.types=[],this.expect(0);this.state.possuper.parseFunctionBody(e,!0,n));return}super.parseFunctionBody(e,!1,n)}parseFunctionBodyAndFinish(e,s,n=!1){if(this.match(14)){const r=this.startNode();[r.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=r.typeAnnotation?this.finishNode(r,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,s,n)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){const n=this.lookahead();if(Pt(n.type)){const r=this.startNode();return this.next(),this.flowParseInterface(r)}}else if(this.plugins.get("flow").enums&&this.isContextual(126)){const n=this.startNode();return this.next(),this.flowParseEnumDeclaration(n)}const s=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(s)&&(this.flowPragma=null),s}parseExpressionStatement(e,s,n){if(s.type==="Identifier"){if(s.name==="declare"){if(this.match(80)||Me(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(Me(this.state.type)){if(s.name==="interface")return this.flowParseInterface(e);if(s.name==="type")return this.flowParseTypeAlias(e);if(s.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,s,n)}shouldParseExportDeclaration(){const{type:e}=this.state;return fo(e)||this.plugins.get("flow").enums&&e===126?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){const{type:e}=this.state;return fo(e)||this.plugins.get("flow").enums&&e===126?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.plugins.get("flow").enums&&this.isContextual(126)){const e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,s,n){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){const c=this.lookaheadCharCode();if(c===44||c===61||c===58||c===41)return this.setOptionalParametersError(n),e}this.expect(17);const r=this.state.clone(),a=this.state.noArrowAt,o=this.startNodeAt(s);let{consequent:l,failed:h}=this.tryParseConditionalConsequent(),[u,d]=this.getArrowLikeExpressions(l);if(h||d.length>0){const c=[...a];if(d.length>0){this.state=r,this.state.noArrowAt=c;for(let f=0;f1&&this.raise(ge.AmbiguousConditionalArrow,r.startLoc),h&&u.length===1&&(this.state=r,c.push(u[0].start),this.state.noArrowAt=c,{consequent:l,failed:h}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(l,!0),this.state.noArrowAt=a,this.expect(14),o.test=e,o.consequent=l,o.alternate=this.forwardNoArrowParamsConversionAt(o,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(o,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);const e=this.parseMaybeAssignAllowIn(),s=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:s}}getArrowLikeExpressions(e,s){const n=[e],r=[];for(;n.length!==0;){const a=n.pop();a.type==="ArrowFunctionExpression"&&a.body.type!=="BlockStatement"?(a.typeParameters||!a.returnType?this.finishArrowValidation(a):r.push(a),n.push(a.body)):a.type==="ConditionalExpression"&&(n.push(a.consequent),n.push(a.alternate))}return s?(r.forEach(a=>this.finishArrowValidation(a)),[r,[]]):Gp(r,a=>a.params.every(o=>this.isAssignable(o,!0)))}finishArrowValidation(e){var s;this.toAssignableList(e.params,(s=e.extra)==null?void 0:s.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,s){let n;return this.state.noArrowParamsConversionAt.includes(e.start)?(this.state.noArrowParamsConversionAt.push(this.state.start),n=s(),this.state.noArrowParamsConversionAt.pop()):n=s(),n}parseParenItem(e,s){const n=super.parseParenItem(e,s);if(this.eat(17)&&(n.optional=!0,this.resetEndLocation(e)),this.match(14)){const r=this.startNodeAt(s);return r.expression=n,r.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(r,"TypeCastExpression")}return n}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";const s=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(s)}else if(this.isContextual(131)){e.exportKind="type";const s=this.startNode();return this.next(),this.flowParseOpaqueType(s,!1)}else if(this.isContextual(129)){e.exportKind="type";const s=this.startNode();return this.next(),this.flowParseInterface(s)}else if(this.plugins.get("flow").enums&&this.isContextual(126)){e.exportKind="value";const s=this.startNode();return this.next(),this.flowParseEnumDeclaration(s)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(130)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){const{startLoc:s}=this.state,n=super.maybeParseExportNamespaceSpecifier(e);return n&&e.exportKind==="type"&&this.unexpected(s),n}parseClassId(e,s,n){super.parseClassId(e,s,n),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,s,n){const{startLoc:r}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,s))return;s.declare=!0}super.parseClassMember(e,s,n),s.declare&&(s.type!=="ClassProperty"&&s.type!=="ClassPrivateProperty"&&s.type!=="PropertyDefinition"?this.raise(ge.DeclareClassElement,r):s.value&&this.raise(ge.DeclareClassFieldInitializer,s.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){const e=super.readWord1(),s="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(w.InvalidIdentifier,this.state.curPosition(),{identifierName:s}),this.finishToken(132,s)}getTokenFromCode(e){const s=this.input.charCodeAt(this.state.pos+1);e===123&&s===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?s===46?this.finishOp(18,2):this.finishOp(17,1):mp(e,s,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,s){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,s):super.isAssignable(e,s)}toAssignable(e,s=!1){!s&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,s)}toAssignableList(e,s,n){for(let r=0;r1||!s)&&this.raise(ge.TypeCastInPattern,a.typeAnnotation)}return e}parseArrayLike(e,s,n,r){const a=super.parseArrayLike(e,s,n,r);return s&&!this.state.maybeInArrowParameters&&this.toReferencedList(a.elements),a}isValidLVal(e,s,n){return e==="TypeCastExpression"||super.isValidLVal(e,s,n)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,s,n,r,a,o){if(s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,s,n,r,a,o),s.params&&a){const l=s.params;l.length>0&&this.isThisParam(l[0])&&this.raise(ge.ThisParamBannedInConstructor,s)}else if(s.type==="MethodDefinition"&&a&&s.value.params){const l=s.value.params;l.length>0&&this.isThisParam(l[0])&&this.raise(ge.ThisParamBannedInConstructor,s)}}pushClassPrivateMethod(e,s,n,r){s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,s,n,r)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&this.match(47)&&(e.superTypeParameters=this.flowParseTypeParameterInstantiation()),this.isContextual(113)){this.next();const s=e.implements=[];do{const n=this.startNode();n.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?n.typeParameters=this.flowParseTypeParameterInstantiation():n.typeParameters=null,s.push(this.finishNode(n,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);const s=this.getObjectOrClassMethodParams(e);if(s.length>0){const n=s[0];this.isThisParam(n)&&e.kind==="get"?this.raise(ge.GetterMayNotHaveThisParam,n):this.isThisParam(n)&&this.raise(ge.SetterMayNotHaveThisParam,n)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,s,n,r,a,o,l){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let h;this.match(47)&&!o&&(h=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());const u=super.parseObjPropValue(e,s,n,r,a,o,l);return h&&((u.value||u).typeParameters=h),u}parseFunctionParamType(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(ge.PatternIsOptional,e),this.isThisParam(e)&&this.raise(ge.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(ge.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(ge.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,s){const n=super.parseMaybeDefault(e,s);return n.type==="AssignmentPattern"&&n.typeAnnotation&&n.right.startsuper.parseMaybeAssign(e,s),r),!a.error)return a.node;const{context:h}=this.state,u=h[h.length-1];(u===Be.j_oTag||u===Be.j_expr)&&h.pop()}if((n=a)!=null&&n.error||this.match(47)){var o,l;r=r||this.state.clone();let h;const u=this.tryParse(c=>{var f;h=this.flowParseTypeParameterDeclaration();const p=this.forwardNoArrowParamsConversionAt(h,()=>{const b=super.parseMaybeAssign(e,s);return this.resetStartLocationFromNode(b,h),b});(f=p.extra)!=null&&f.parenthesized&&c();const m=this.maybeUnwrapTypeCastExpression(p);return m.type!=="ArrowFunctionExpression"&&c(),m.typeParameters=h,this.resetStartLocationFromNode(m,h),p},r);let d=null;if(u.node&&this.maybeUnwrapTypeCastExpression(u.node).type==="ArrowFunctionExpression"){if(!u.error&&!u.aborted)return u.node.async&&this.raise(ge.UnexpectedTypeParameterBeforeAsyncArrowFunction,h),u.node;d=u.node}if((o=a)!=null&&o.node)return this.state=a.failState,a.node;if(d)return this.state=u.failState,d;throw(l=a)!=null&&l.thrown?a.error:u.thrown?u.error:this.raise(ge.UnexpectedTokenAfterTypeParameter,h)}return super.parseMaybeAssign(e,s)}parseArrow(e){if(this.match(14)){const s=this.tryParse(()=>{const n=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;const r=this.startNode();return[r.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=n,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),r});if(s.thrown)return null;s.error&&(this.state=s.failState),e.returnType=s.node.typeAnnotation?this.finishNode(s.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,s){this.state.noArrowParamsConversionAt.includes(e.start)?e.params=s:super.setArrowFunctionParameters(e,s)}checkParams(e,s,n,r=!0){if(!(n&&this.state.noArrowParamsConversionAt.includes(e.start))){for(let a=0;a0&&this.raise(ge.ThisParamMustBeFirst,e.params[a]);super.checkParams(e,s,n,r)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.state.start))}parseSubscripts(e,s,n){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(s.index)){this.next();const r=this.startNodeAt(s);r.callee=e,r.arguments=super.parseCallExpressionArguments(11,!1),e=this.finishNode(r,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){const r=this.state.clone(),a=this.tryParse(l=>this.parseAsyncArrowWithTypeParameters(s)||l(),r);if(!a.error&&!a.aborted)return a.node;const o=this.tryParse(()=>super.parseSubscripts(e,s,n),r);if(o.node&&!o.error)return o.node;if(a.node)return this.state=a.failState,a.node;if(o.node)return this.state=o.failState,o.node;throw a.error||o.error}return super.parseSubscripts(e,s,n)}parseSubscript(e,s,n,r){if(this.match(18)&&this.isLookaheadToken_lt()){if(r.optionalChainMember=!0,n)return r.stop=!0,e;this.next();const a=this.startNodeAt(s);return a.callee=e,a.typeArguments=this.flowParseTypeParameterInstantiation(),this.expect(10),a.arguments=this.parseCallExpressionArguments(11,!1),a.optional=!0,this.finishCallExpression(a,!0)}else if(!n&&this.shouldParseTypes()&&this.match(47)){const a=this.startNodeAt(s);a.callee=e;const o=this.tryParse(()=>(a.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),a.arguments=super.parseCallExpressionArguments(11,!1),r.optionalChainMember&&(a.optional=!1),this.finishCallExpression(a,r.optionalChainMember)));if(o.node)return o.error&&(this.state=o.failState),o.node}return super.parseSubscript(e,s,n,r)}parseNewCallee(e){super.parseNewCallee(e);let s=null;this.shouldParseTypes()&&this.match(47)&&(s=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=s}parseAsyncArrowWithTypeParameters(e){const s=this.startNodeAt(e);if(this.parseFunctionParams(s,!1),!!this.parseArrow(s))return super.parseArrowExpression(s,void 0,!0)}readToken_mult_modulo(e){const s=this.input.charCodeAt(this.state.pos+1);if(e===42&&s===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){const s=this.input.charCodeAt(this.state.pos+1);if(e===124&&s===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,s){const n=super.parseTopLevel(e,s);return this.state.hasFlowComment&&this.raise(ge.UnterminatedFlowComment,this.state.curPosition()),n}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(ge.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();const e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){const{pos:e}=this.state;let s=2;for(;[32,9].includes(this.input.charCodeAt(e+s));)s++;const n=this.input.charCodeAt(s+e),r=this.input.charCodeAt(s+e+1);return n===58&&r===58?s+2:this.input.slice(s+e,s+e+12)==="flow-include"?s+12:n===58&&r!==58?s:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(w.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:s,memberName:n}){this.raise(ge.EnumBooleanMemberNotInitialized,e,{memberName:n,enumName:s})}flowEnumErrorInvalidMemberInitializer(e,s){return this.raise(s.explicitType?s.explicitType==="symbol"?ge.EnumInvalidMemberInitializerSymbolType:ge.EnumInvalidMemberInitializerPrimaryType:ge.EnumInvalidMemberInitializerUnknownType,e,s)}flowEnumErrorNumberMemberNotInitialized(e,s){this.raise(ge.EnumNumberMemberNotInitialized,e,s)}flowEnumErrorStringMemberInconsistentlyInitialized(e,s){this.raise(ge.EnumStringMemberInconsistentlyInitialized,e,s)}flowEnumMemberInit(){const e=this.state.startLoc,s=()=>this.match(12)||this.match(8);switch(this.state.type){case 134:{const n=this.parseNumericLiteral(this.state.value);return s()?{type:"number",loc:n.loc.start,value:n}:{type:"invalid",loc:e}}case 133:{const n=this.parseStringLiteral(this.state.value);return s()?{type:"string",loc:n.loc.start,value:n}:{type:"invalid",loc:e}}case 85:case 86:{const n=this.parseBooleanLiteral(this.match(85));return s()?{type:"boolean",loc:n.loc.start,value:n}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){const e=this.state.startLoc,s=this.parseIdentifier(!0),n=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:s,init:n}}flowEnumCheckExplicitTypeMismatch(e,s,n){const{explicitType:r}=s;r!==null&&r!==n&&this.flowEnumErrorInvalidMemberInitializer(e,s)}flowEnumMembers({enumName:e,explicitType:s}){const n=new Set,r={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]};let a=!1;for(;!this.match(8);){if(this.eat(21)){a=!0;break}const o=this.startNode(),{id:l,init:h}=this.flowEnumMemberRaw(),u=l.name;if(u==="")continue;/^[a-z]/.test(u)&&this.raise(ge.EnumInvalidMemberName,l,{memberName:u,suggestion:u[0].toUpperCase()+u.slice(1),enumName:e}),n.has(u)&&this.raise(ge.EnumDuplicateMemberName,l,{memberName:u,enumName:e}),n.add(u);const d={enumName:e,explicitType:s,memberName:u};switch(o.id=l,h.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(h.loc,d,"boolean"),o.init=h.value,r.booleanMembers.push(this.finishNode(o,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(h.loc,d,"number"),o.init=h.value,r.numberMembers.push(this.finishNode(o,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(h.loc,d,"string"),o.init=h.value,r.stringMembers.push(this.finishNode(o,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(h.loc,d);case"none":switch(s){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(h.loc,d);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(h.loc,d);break;default:r.defaultedMembers.push(this.finishNode(o,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:r,hasUnknownMembers:a}}flowEnumStringMembers(e,s,{enumName:n}){if(e.length===0)return s;if(s.length===0)return e;if(s.length>e.length){for(const r of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(r,{enumName:n});return s}else{for(const r of s)this.flowEnumErrorStringMemberInconsistentlyInitialized(r,{enumName:n});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!Me(this.state.type))throw this.raise(ge.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});const{value:s}=this.state;return this.next(),s!=="boolean"&&s!=="number"&&s!=="string"&&s!=="symbol"&&this.raise(ge.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:s}),s}flowEnumBody(e,s){const n=s.name,r=s.loc.start,a=this.flowEnumParseExplicitType({enumName:n});this.expect(5);const{members:o,hasUnknownMembers:l}=this.flowEnumMembers({enumName:n,explicitType:a});switch(e.hasUnknownMembers=l,a){case"boolean":return e.explicitType=!0,e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:n}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=o.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{const h=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;const u=o.booleanMembers.length,d=o.numberMembers.length,c=o.stringMembers.length,f=o.defaultedMembers.length;if(!u&&!d&&!c&&!f)return h();if(!u&&!d)return e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:n}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!d&&!c&&u>=f){for(const p of o.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(p.loc.start,{enumName:n,memberName:p.id.name});return e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!u&&!c&&d>=f){for(const p of o.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(p.loc.start,{enumName:n,memberName:p.id.name});return e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(ge.EnumInconsistentMemberValues,r,{enumName:n}),h()}}}flowParseEnumDeclaration(e){const s=this.parseIdentifier();return e.id=s,e.body=this.flowEnumBody(this.startNode(),s),this.finishNode(e,"EnumDeclaration")}isLookaheadToken_lt(){const e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){const s=this.input.charCodeAt(e+1);return s!==60&&s!==61}return!1}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}};const qp={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"},ms=Gt`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:i})=>`Expected corresponding JSX closing tag for <${i}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:i,HTMLEntity:t})=>`Unexpected token \`${i}\`. Did you mean \`${t}\` or \`{'${i}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?"});function es(i){return i?i.type==="JSXOpeningFragment"||i.type==="JSXClosingFragment":!1}function Ms(i){if(i.type==="JSXIdentifier")return i.name;if(i.type==="JSXNamespacedName")return i.namespace.name+":"+i.name.name;if(i.type==="JSXMemberExpression")return Ms(i.object)+"."+Ms(i.property);throw new Error("Node had unexpected type: "+i.type)}var zp=i=>class extends i{jsxReadToken(){let e="",s=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(ms.UnterminatedJsxContent,this.state.startLoc);const n=this.input.charCodeAt(this.state.pos);switch(n){case 60:case 123:if(this.state.pos===this.state.start){n===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(142)):super.getTokenFromCode(n);return}e+=this.input.slice(s,this.state.pos),this.finishToken(141,e);return;case 38:e+=this.input.slice(s,this.state.pos),e+=this.jsxReadEntity(),s=this.state.pos;break;case 62:case 125:default:Vs(n)?(e+=this.input.slice(s,this.state.pos),e+=this.jsxReadNewLine(!0),s=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){const s=this.input.charCodeAt(this.state.pos);let n;return++this.state.pos,s===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,n=e?` `:`\r -`):r=String.fromCharCode(s),++this.state.curLine,this.state.lineStart=this.state.pos,r}jsxReadString(e){let s="",r=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(w.UnterminatedString,this.state.startLoc);const n=this.input.charCodeAt(this.state.pos);if(n===e)break;n===38?(s+=this.input.slice(r,this.state.pos),s+=this.jsxReadEntity(),r=this.state.pos):Vs(n)?(s+=this.input.slice(r,this.state.pos),s+=this.jsxReadNewLine(!1),r=this.state.pos):++this.state.pos}s+=this.input.slice(r,this.state.pos++),this.finishToken(133,s)}jsxReadEntity(){const e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let s=10;this.codePointAtPos(this.state.pos)===120&&(s=16,++this.state.pos);const r=this.readInt(s,void 0,!1,"bail");if(r!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(r)}else{let s=0,r=!1;for(;s++<10&&this.state.pos1){for(let r=0;r0){if(s&256){const n=!!(s&512),a=(r&4)>0;return n!==a}return!0}return s&128&&(r&8)>0?t.names.get(e)&2?!!(s&1):!1:s&2&&(r&1)>0?!0:super.isRedeclaredInScope(t,e,s)}checkLocalExport(t){const{name:e}=t;if(this.hasImport(e))return;const s=this.scopeStack.length;for(let r=s-1;r>=0;r--){const a=this.scopeStack[r].tsNames.get(e);if((a&1)>0||(a&16)>0)return}super.checkLocalExport(t)}}const nc=i=>i.type==="ParenthesizedExpression"?nc(i.expression):i;class Yp extends jp{toAssignable(t,e=!1){var s,r;let n;switch((t.type==="ParenthesizedExpression"||(s=t.extra)!=null&&s.parenthesized)&&(n=nc(t),e?n.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(w.InvalidParenthesizedAssignment,t):n.type!=="MemberExpression"&&!this.isOptionalMemberExpression(n)&&this.raise(w.InvalidParenthesizedAssignment,t):this.raise(w.InvalidParenthesizedAssignment,t)),t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern";for(let o=0,l=t.properties.length,h=l-1;or.type!=="ObjectMethod"&&(n===s||r.type!=="SpreadElement")&&this.isAssignable(r))}case"ObjectProperty":return this.isAssignable(t.value);case"SpreadElement":return this.isAssignable(t.argument);case"ArrayExpression":return t.elements.every(s=>s===null||this.isAssignable(s));case"AssignmentExpression":return t.operator==="=";case"ParenthesizedExpression":return this.isAssignable(t.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(t,e){return t}toReferencedListDeep(t,e){this.toReferencedList(t,e);for(const s of t)(s==null?void 0:s.type)==="ArrayExpression"&&this.toReferencedListDeep(s.elements)}parseSpread(t){const e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(t,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){const t=this.startNode();return this.next(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{const t=this.startNode();return this.next(),t.elements=this.parseBindingList(3,93,1),this.finishNode(t,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(t,e,s){const r=s&1,n=[];let a=!0;for(;!this.eat(t);)if(a?a=!1:this.expect(12),r&&this.match(12))n.push(null);else{if(this.eat(t))break;if(this.match(21)){let o=this.parseRestBinding();if((this.hasPlugin("flow")||s&2)&&(o=this.parseFunctionParamType(o)),n.push(o),!this.checkCommaAfterRest(e)){this.expect(t);break}}else{const o=[];for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(w.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)o.push(this.parseDecorator());n.push(this.parseAssignableListItem(s,o))}}return n}parseBindingRestProperty(t){return this.next(),t.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(t,"RestElement")}parseBindingProperty(){const{type:t,startLoc:e}=this.state;if(t===21)return this.parseBindingRestProperty(this.startNode());const s=this.startNode();return t===138?(this.expectPlugin("destructuringPrivate",e),this.classScope.usePrivateName(this.state.value,e),s.key=this.parsePrivateName()):this.parsePropertyName(s),s.method=!1,this.parseObjPropValue(s,e,!1,!1,!0,!1)}parseAssignableListItem(t,e){const s=this.parseMaybeDefault();(this.hasPlugin("flow")||t&2)&&this.parseFunctionParamType(s);const r=this.parseMaybeDefault(s.loc.start,s);return e.length&&(s.decorators=e),r}parseFunctionParamType(t){return t}parseMaybeDefault(t,e){var s,r;if((s=t)!=null||(t=this.state.startLoc),e=(r=e)!=null?r:this.parseBindingAtom(),!this.eat(29))return e;const n=this.startNodeAt(t);return n.left=e,n.right=this.parseMaybeAssignAllowIn(),this.finishNode(n,"AssignmentPattern")}isValidLVal(t,e,s){switch(t){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties"}return!1}isOptionalMemberExpression(t){return t.type==="OptionalMemberExpression"}checkLVal(t,e,s=64,r=!1,n=!1,a=!1){var o;const l=t.type;if(this.isObjectMethod(t))return;const h=this.isOptionalMemberExpression(t);if(h||l==="MemberExpression"){h&&(this.expectPlugin("optionalChainingAssign",t.loc.start),e.type!=="AssignmentExpression"&&this.raise(w.InvalidLhsOptionalChaining,t,{ancestor:e})),s!==64&&this.raise(w.InvalidPropertyBindingPattern,t);return}if(l==="Identifier"){this.checkIdentifier(t,s,n);const{name:m}=t;r&&(r.has(m)?this.raise(w.ParamDupe,t):r.add(m));return}const u=this.isValidLVal(l,!(a||(o=t.extra)!=null&&o.parenthesized)&&e.type==="AssignmentExpression",s);if(u===!0)return;if(u===!1){const m=s===64?w.InvalidLhs:w.InvalidLhsBinding;this.raise(m,t,{ancestor:e});return}let d,c;typeof u=="string"?(d=u,c=l==="ParenthesizedExpression"):[d,c]=u;const f=l==="ArrayPattern"||l==="ObjectPattern"?{type:l}:e,p=t[d];if(Array.isArray(p))for(const m of p)m&&this.checkLVal(m,f,s,r,n,c);else p&&this.checkLVal(p,f,s,r,n,c)}checkIdentifier(t,e,s=!1){this.state.strict&&(s?Ql(t.name,this.inModule):Zl(t.name))&&(e===64?this.raise(w.StrictEvalArguments,t,{referenceName:t.name}):this.raise(w.StrictEvalArgumentsBinding,t,{bindingName:t.name})),e&8192&&t.name==="let"&&this.raise(w.LetInLexicalBinding,t),e&64||this.declareNameFromIdentifier(t,e)}declareNameFromIdentifier(t,e){this.scope.declareName(t.name,e,t.loc.start)}checkToRestConversion(t,e){switch(t.type){case"ParenthesizedExpression":this.checkToRestConversion(t.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(w.InvalidRestAssignmentPattern,t)}}checkCommaAfterRest(t){return this.match(12)?(this.raise(this.lookaheadCharCode()===t?w.RestTrailingComma:w.ElementAfterRest,this.state.startLoc),!0):!1}}function Zp(i){if(i==null)throw new Error(`Unexpected ${i} value.`);return i}function To(i){if(!i)throw new Error("Assert fail")}const he=Gt`typescript`({AbstractMethodHasImplementation:({methodName:i})=>`Method '${i}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:i})=>`Property '${i}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:i})=>`'declare' is not allowed in ${i}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:i})=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:i})=>`Duplicate modifier: '${i}'.`,EmptyHeritageClauseType:({token:i})=>`'${i}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:i})=>`'${i[0]}' modifier cannot be used with '${i[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:i})=>`Index signatures cannot have an accessibility modifier ('${i}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:({modifier:i})=>`'${i}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:i})=>`'${i}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:i})=>`'${i}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:i})=>`'${i[0]}' modifier must precede '${i[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:i})=>`Private elements cannot have an accessibility modifier ('${i}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:i})=>`Single type parameter ${i} should have a trailing comma. Example usage: <${i},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:i})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${i}.`});function Qp(i){switch(i){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function bo(i){return i==="private"||i==="public"||i==="protected"}function ed(i){return i==="in"||i==="out"}var td=i=>class extends i{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:he.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:he.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:he.InvalidModifierOnTypeParameter})}getScopeHandler(){return Xp}tsIsIdentifier(){return Me(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(138)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,s){if(!Me(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;const r=this.state.value;if(e.includes(r)){if(s&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return r}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:s,stopOnStartOfClassStaticBlock:r,errorTemplate:n=he.InvalidModifierOnTypeMember},a){const o=(h,u,d,c)=>{u===d&&a[c]&&this.raise(he.InvalidModifiersOrder,h,{orderedModifiers:[d,c]})},l=(h,u,d,c)=>{(a[d]&&u===c||a[c]&&u===d)&&this.raise(he.IncompatibleModifiers,h,{modifiers:[d,c]})};for(;;){const{startLoc:h}=this.state,u=this.tsParseModifier(e.concat(s!=null?s:[]),r);if(!u)break;bo(u)?a.accessibility?this.raise(he.DuplicateAccessibilityModifier,h,{modifier:u}):(o(h,u,u,"override"),o(h,u,u,"static"),o(h,u,u,"readonly"),a.accessibility=u):ed(u)?(a[u]&&this.raise(he.DuplicateModifier,h,{modifier:u}),a[u]=!0,o(h,u,"in","out")):(hasOwnProperty.call(a,u)?this.raise(he.DuplicateModifier,h,{modifier:u}):(o(h,u,"static","readonly"),o(h,u,"static","override"),o(h,u,"override","readonly"),o(h,u,"abstract","override"),l(h,u,"declare","override"),l(h,u,"static","abstract")),a[u]=!0),s!=null&&s.includes(u)&&this.raise(n,h,{modifier:u})}}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(e,s){const r=[];for(;!this.tsIsListTerminator(e);)r.push(s());return r}tsParseDelimitedList(e,s,r){return Zp(this.tsParseDelimitedListWorker(e,s,!0,r))}tsParseDelimitedListWorker(e,s,r,n){const a=[];let o=-1;for(;!this.tsIsListTerminator(e);){o=-1;const l=s();if(l==null)return;if(a.push(l),this.eat(12)){o=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;r&&this.expect(12);return}return n&&(n.value=o),a}tsParseBracketedList(e,s,r,n,a){n||(r?this.expect(0):this.expect(47));const o=this.tsParseDelimitedList(e,s,a);return r?this.expect(3):this.expect(48),o}tsParseImportType(){const e=this.startNode();return this.expect(83),this.expect(10),this.match(133)||this.raise(he.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=super.parseExprAtom(),(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))&&(e.options=null),this.eat(12)&&(this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes"),this.match(11)||(e.options=super.parseMaybeAssignAllowIn(),this.eat(12))),this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName()),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseEntityName(e=!0){let s=this.parseIdentifier(e);for(;this.eat(16);){const r=this.startNodeAtNode(s);r.left=s,r.right=this.parseIdentifier(e),s=this.finishNode(r,"TSQualifiedName")}return s}tsParseTypeReference(){const e=this.startNode();return e.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();const s=this.startNodeAtNode(e);return s.parameterName=e,s.typeAnnotation=this.tsParseTypeAnnotation(!1),s.asserts=!1,this.finishNode(s,"TSTypePredicate")}tsParseThisTypeNode(){const e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){const e=this.startNode();return this.expect(87),this.match(83)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseTypeParameter(e){const s=this.startNode();return e(s),s.name=this.tsParseTypeParameterName(),s.constraint=this.tsEatThenParseType(81),s.default=this.tsEatThenParseType(29),this.finishNode(s,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){const s=this.startNode();this.match(47)||this.match(142)?this.next():this.unexpected();const r={value:-1};return s.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,r),s.params.length===0&&this.raise(he.EmptyTypeParameters,s),r.value!==-1&&this.addExtra(s,"trailingComma",r.value),this.finishNode(s,"TSTypeParameterDeclaration")}tsFillSignature(e,s){const r=e===19,n="parameters",a="typeAnnotation";s.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),s[n]=this.tsParseBindingListForSignature(),r?s[a]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(s[a]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){const e=super.parseBindingList(11,41,2);for(const s of e){const{type:r}=s;(r==="AssignmentPattern"||r==="TSParameterProperty")&&this.raise(he.UnsupportedSignatureParameterKind,s,{type:r})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,s){return this.tsFillSignature(14,s),this.tsParseTypeMemberSemicolon(),this.finishNode(s,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),Me(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);const s=this.parseIdentifier();s.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(s),this.expect(3),e.parameters=[s];const r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,s){this.eat(17)&&(e.optional=!0);const r=e;if(this.match(10)||this.match(47)){s&&this.raise(he.ReadonlyForMethodSignature,e);const n=r;n.kind&&this.match(47)&&this.raise(he.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,n),this.tsParseTypeMemberSemicolon();const a="parameters",o="typeAnnotation";if(n.kind==="get")n[a].length>0&&(this.raise(w.BadGetterArity,this.state.curPosition()),this.isThisParam(n[a][0])&&this.raise(he.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(n.kind==="set"){if(n[a].length!==1)this.raise(w.BadSetterArity,this.state.curPosition());else{const l=n[a][0];this.isThisParam(l)&&this.raise(he.AccessorCannotDeclareThisParameter,this.state.curPosition()),l.type==="Identifier"&&l.optional&&this.raise(he.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),l.type==="RestElement"&&this.raise(he.SetAccessorCannotHaveRestParameter,this.state.curPosition())}n[o]&&this.raise(he.SetAccessorCannotHaveReturnType,n[o])}else n.kind="method";return this.finishNode(n,"TSMethodSignature")}else{const n=r;s&&(n.readonly=!0);const a=this.tsTryParseTypeAnnotation();return a&&(n.typeAnnotation=a),this.tsParseTypeMemberSemicolon(),this.finishNode(n,"TSPropertySignature")}}tsParseTypeMember(){const e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){const r=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(r,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e);const s=this.tsTryParseIndexSignature(e);return s||(super.parsePropertyName(e),!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){const e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);const e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),e}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedType(){const e=this.startNode();this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(e.readonly=!0),this.expect(0);{const s=this.startNode();s.name=this.tsParseTypeParameterName(),s.constraint=this.tsExpectThenParseType(58),e.typeParameter=this.finishNode(s,"TSTypeParameter")}return e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){const e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let s=!1;return e.elementTypes.forEach(r=>{const{type:n}=r;s&&n!=="TSRestType"&&n!=="TSOptionalType"&&!(n==="TSNamedTupleMember"&&r.optional)&&this.raise(he.OptionalTypeBeforeRequired,r),s||(s=n==="TSNamedTupleMember"&&r.optional||n==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){const{startLoc:e}=this.state,s=this.eat(21);let r,n,a,o;const h=Pt(this.state.type)?this.lookaheadCharCode():null;if(h===58)r=!0,a=!1,n=this.parseIdentifier(!0),this.expect(14),o=this.tsParseType();else if(h===63){a=!0;const u=this.state.startLoc,d=this.state.value,c=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(r=!0,n=this.createIdentifier(this.startNodeAt(u),d),this.expect(17),this.expect(14),o=this.tsParseType()):(r=!1,o=c,this.expect(17))}else o=this.tsParseType(),a=this.eat(17),r=this.eat(14);if(r){let u;n?(u=this.startNodeAtNode(n),u.optional=a,u.label=n,u.elementType=o,this.eat(17)&&(u.optional=!0,this.raise(he.TupleOptionalAfterType,this.state.lastTokStartLoc))):(u=this.startNodeAtNode(o),u.optional=a,this.raise(he.InvalidTupleMemberLabel,o),u.label=o,u.elementType=this.tsParseType()),o=this.finishNode(u,"TSNamedTupleMember")}else if(a){const u=this.startNodeAtNode(o);u.typeAnnotation=o,o=this.finishNode(u,"TSOptionalType")}if(s){const u=this.startNodeAt(e);u.typeAnnotation=o,o=this.finishNode(u,"TSRestType")}return o}tsParseParenthesizedType(){const e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,s){const r=this.startNode();return e==="TSConstructorType"&&(r.abstract=!!s,s&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,r)),this.finishNode(r,e)}tsParseLiteralTypeNode(){const e=this.startNode();switch(this.state.type){case 134:case 135:case 133:case 85:case 86:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){const e=this.startNode();return e.literal=super.parseTemplate(!1),this.finishNode(e,"TSLiteralType")}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){const e=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 133:case 134:case 135:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){const e=this.startNode(),s=this.lookahead();return s.type!==134&&s.type!==135&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{const{type:e}=this.state;if(Me(e)||e===88||e===84){const s=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":Qp(this.state.value);if(s!==void 0&&this.lookaheadCharCode()!==46){const r=this.startNode();return this.next(),this.finishNode(r,s)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let e=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){const s=this.startNodeAtNode(e);s.elementType=e,this.expect(3),e=this.finishNode(s,"TSArrayType")}else{const s=this.startNodeAtNode(e);s.objectType=e,s.indexType=this.tsParseType(),this.expect(3),e=this.finishNode(s,"TSIndexedAccessType")}return e}tsParseTypeOperator(){const e=this.startNode(),s=this.state.value;return this.next(),e.operator=s,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),s==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(he.UnexpectedReadonly,e)}}tsParseInferType(){const e=this.startNode();this.expectContextual(115);const s=this.startNode();return s.name=this.tsParseTypeParameterName(),s.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(s,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){const e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){return np(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,s,r){const n=this.startNode(),a=this.eat(r),o=[];do o.push(s());while(this.eat(r));return o.length===1&&!a?o[0]:(n.types=o,this.finishNode(n,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(Me(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){const{errors:e}=this.state,s=e.length;try{return this.parseObjectLike(8,!0),e.length===s}catch{return!1}}if(this.match(0)){this.next();const{errors:e}=this.state,s=e.length;try{return super.parseBindingList(3,93,1),e.length===s}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{const s=this.startNode();this.expect(e);const r=this.startNode(),n=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(n&&this.match(78)){let l=this.tsParseThisTypeOrThisTypePredicate();return l.type==="TSThisType"?(r.parameterName=l,r.asserts=!0,r.typeAnnotation=null,l=this.finishNode(r,"TSTypePredicate")):(this.resetStartLocationFromNode(l,r),l.asserts=!0),s.typeAnnotation=l,this.finishNode(s,"TSTypeAnnotation")}const a=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!a)return n?(r.parameterName=this.parseIdentifier(),r.asserts=n,r.typeAnnotation=null,s.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,s);const o=this.tsParseTypeAnnotation(!1);return r.parameterName=a,r.typeAnnotation=o,r.asserts=n,s.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){const e=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;const e=this.state.containsEsc;return this.next(),!Me(this.state.type)&&!this.match(78)?!1:(e&&this.raise(w.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,s=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),s.typeAnnotation=this.tsParseType()}),this.finishNode(s,"TSTypeAnnotation")}tsParseType(){To(this.state.inType);const e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;const s=this.startNodeAtNode(e);return s.checkType=e,s.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),s.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),s.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(s,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.lookahead().type===77}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(he.ReservedTypeAssertion,this.state.startLoc);const e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){const s=this.state.startLoc,r=this.tsParseDelimitedList("HeritageClauseElement",()=>{const n=this.startNode();return n.expression=this.tsParseEntityName(),this.match(47)&&(n.typeParameters=this.tsParseTypeArguments()),this.finishNode(n,"TSExpressionWithTypeArguments")});return r.length||this.raise(he.EmptyHeritageClauseType,s,{token:e}),r}tsParseInterfaceDeclaration(e,s={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),s.declare&&(e.declare=!0),Me(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(he.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));const r=this.startNode();return r.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(r,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookahead().type!==16){const s=this.startNode();return this.next(),this.finishNode(s,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInNoContext(e){const s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}tsInType(e){const s=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=s}}tsInDisallowConditionalTypesContext(e){const s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsInAllowConditionalTypesContext(e){const s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){const e=this.startNode();return e.id=this.match(133)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,s={}){return s.const&&(e.const=!0),s.declare&&(e.declare=!0),this.expectContextual(126),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumDeclaration")}tsParseModuleBlock(){const e=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,s=!1){if(e.id=this.parseIdentifier(),s||this.checkIdentifier(e.id,1024),this.eat(16)){const r=this.startNode();this.tsParseModuleOrNamespaceDeclaration(r,!0),e.body=r}else this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(112)?(e.global=!0,e.id=this.parseIdentifier()):this.match(133)?e.id=super.parseStringLiteral(this.state.value):this.unexpected(),this.match(5)?(this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,s,r){e.isExport=r||!1,e.id=s||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);const n=this.tsParseModuleReference();return e.importKind==="type"&&n.type!=="TSExternalModuleReference"&&this.raise(he.ImportAliasHasImportType,n),e.moduleReference=n,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsParseExternalModuleReference(){const e=this.startNode();return this.expectContextual(119),this.expect(10),this.match(133)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){const s=this.state.clone(),r=e();return this.state=s,r}tsTryParseAndCatch(e){const s=this.tryParse(r=>e()||r());if(!(s.aborted||!s.node))return s.error&&(this.state=s.failState),s.node}tsTryParse(e){const s=this.state.clone(),r=e();if(r!==void 0&&r!==!1)return r;this.state=s}tsTryParseDeclare(e){if(this.isLineTerminator())return;let s=this.state.type,r;return this.isContextual(100)&&(s=74,r="let"),this.tsInAmbientContext(()=>{switch(s){case 68:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 80:return e.declare=!0,this.parseClass(e,!0,!1);case 126:return this.tsParseEnumDeclaration(e,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(e);case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,r||this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 129:{const n=this.tsParseInterfaceDeclaration(e,{declare:!0});if(n)return n}default:if(Me(s))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,s,r){switch(s.name){case"declare":{const n=this.tsTryParseDeclare(e);return n&&(n.declare=!0),n}case"global":if(this.match(5)){this.scope.enter(256),this.prodParam.enter(0);const n=e;return n.global=!0,n.id=s,n.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(n,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,s.name,!1,r)}}tsParseDeclaration(e,s,r,n){switch(s){case"abstract":if(this.tsCheckLineTerminator(r)&&(this.match(80)||Me(this.state.type)))return this.tsParseAbstractDeclaration(e,n);break;case"module":if(this.tsCheckLineTerminator(r)){if(this.match(133))return this.tsParseAmbientExternalModuleDeclaration(e);if(Me(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(r)&&Me(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(r)&&Me(this.state.type))return this.tsParseTypeAliasDeclaration(e);break}}tsCheckLineTerminator(e){return e?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(47))return;const s=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;const r=this.tsTryParseAndCatch(()=>{const n=this.startNodeAt(e);return n.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(n),n.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),n});if(this.state.maybeInArrowParameters=s,!!r)return super.parseArrowExpression(r,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){const e=this.startNode();return e.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),e.params.length===0?this.raise(he.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===Fe.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return ap(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseAssignableListItem(e,s){const r=this.state.startLoc,n={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},n);const a=n.accessibility,o=n.override,l=n.readonly;!(e&4)&&(a||l||o)&&this.raise(he.UnexpectedParameterModifier,r);const h=this.parseMaybeDefault();e&2&&this.parseFunctionParamType(h);const u=this.parseMaybeDefault(h.loc.start,h);if(a||l||o){const d=this.startNodeAt(r);return s.length&&(d.decorators=s),a&&(d.accessibility=a),l&&(d.readonly=l),o&&(d.override=o),u.type!=="Identifier"&&u.type!=="AssignmentPattern"&&this.raise(he.UnsupportedParameterPropertyKind,d),d.parameter=u,this.finishNode(d,"TSParameterProperty")}return s.length&&(h.decorators=s),u}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(const s of e.params)s.type!=="Identifier"&&s.optional&&!this.state.isAmbientContext&&this.raise(he.PatternIsOptional,s)}setArrowFunctionParameters(e,s,r){super.setArrowFunctionParameters(e,s,r),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,s,r=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));const n=s==="FunctionDeclaration"?"TSDeclareFunction":s==="ClassMethod"||s==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return n&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,n):n==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(he.DeclareFunctionHasImplementation,e),e.declare)?super.parseFunctionBodyAndFinish(e,n,r):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,s,r))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(s=>{(s==null?void 0:s.type)==="TSTypeCastExpression"&&this.raise(he.UnexpectedTypeAnnotation,s.typeAnnotation)})}toReferencedList(e,s){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,s,r,n){const a=super.parseArrayLike(e,s,r,n);return a.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(a.elements),a}parseSubscript(e,s,r,n){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();const o=this.startNodeAt(s);return o.expression=e,this.finishNode(o,"TSNonNullExpression")}let a=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(r)return n.stop=!0,e;n.optionalChainMember=a=!0,this.next()}if(this.match(47)||this.match(51)){let o;const l=this.tsTryParseAndCatch(()=>{if(!r&&this.atPossibleAsyncArrow(e)){const c=this.tsTryParseGenericAsyncArrowFunction(s);if(c)return c}const h=this.tsParseTypeArgumentsInExpression();if(!h)return;if(a&&!this.match(10)){o=this.state.curPosition();return}if(cr(this.state.type)){const c=super.parseTaggedTemplateExpression(e,s,n);return c.typeParameters=h,c}if(!r&&this.eat(10)){const c=this.startNodeAt(s);return c.callee=e,c.arguments=this.parseCallExpressionArguments(11,!1),this.tsCheckForInvalidTypeCasts(c.arguments),c.typeParameters=h,n.optionalChainMember&&(c.optional=a),this.finishCallExpression(c,n.optionalChainMember)}const u=this.state.type;if(u===48||u===52||u!==10&&Sn(u)&&!this.hasPrecedingLineBreak())return;const d=this.startNodeAt(s);return d.expression=e,d.typeParameters=h,this.finishNode(d,"TSInstantiationExpression")});if(o&&this.unexpected(o,10),l)return l.type==="TSInstantiationExpression"&&(this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(he.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),l}return super.parseSubscript(e,s,r,n)}parseNewCallee(e){var s;super.parseNewCallee(e);const{callee:r}=e;r.type==="TSInstantiationExpression"&&!((s=r.extra)!=null&&s.parenthesized)&&(e.typeParameters=r.typeParameters,e.callee=r.expression)}parseExprOp(e,s,r){let n;if(Yi(58)>r&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(n=this.isContextual(120)))){const a=this.startNodeAt(s);return a.expression=e,a.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(n&&this.raise(w.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(a,n?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(a,s,r)}return super.parseExprOp(e,s,r)}checkReservedWord(e,s,r,n){this.state.isAmbientContext||super.checkReservedWord(e,s,r,n)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(he.ImportReflectionHasImportType,e.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){const s=this.lookaheadCharCode();return e?s===123||s===42:s!==61}return!e&&this.isContextual(87)}applyImportPhase(e,s,r,n){super.applyImportPhase(e,s,r,n),s?e.exportKind=r==="type"?"type":"value":e.importKind=r==="type"||r==="typeof"?r:"value"}parseImport(e){if(this.match(133))return e.importKind="value",super.parseImport(e);let s;if(Me(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){const r=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,r);s=super.parseImportSpecifiersAndAfter(e,r)}else s=super.parseImport(e);return s.importKind==="type"&&s.specifiers.length>1&&s.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(he.TypeImportCannotSpecifyDefaultAndNamed,s),s}parseExport(e,s){if(this.match(83)){this.next();const r=e;let n=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?n=this.parseMaybeImportPhase(r,!1):r.importKind="value",this.tsParseImportEqualsDeclaration(r,n,!0)}else if(this.eat(29)){const r=e;return r.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(r,"TSExportAssignment")}else if(this.eatContextual(93)){const r=e;return this.expectContextual(128),r.id=this.parseIdentifier(),this.semicolon(),this.finishNode(r,"TSNamespaceExportDeclaration")}else return super.parseExport(e,s)}isAbstractClass(){return this.isContextual(124)&&this.lookahead().type===80}parseExportDefaultExpression(){if(this.isAbstractClass()){const e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(129)){const e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,s,r=!1){const{isAmbientContext:n}=this.state,a=super.parseVarStatement(e,s,r||n);if(!n)return a;for(const{id:o,init:l}of a.declarations)!l||(s!=="const"||!!o.typeAnnotation?this.raise(he.InitializerNotAllowedInAmbientContext,l):id(l,this.hasPlugin("estree"))||this.raise(he.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,l));return a}parseStatementContent(e,s){if(this.match(75)&&this.isLookaheadContextual("enum")){const r=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(r,{const:!0})}if(this.isContextual(126))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(129)){const r=this.tsParseInterfaceDeclaration(this.startNode());if(r)return r}return super.parseStatementContent(e,s)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,s){return s.some(r=>bo(r)?e.accessibility===r:!!e[r])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(e,s,r){const n=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:n,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:he.InvalidModifierOnTypeParameterPositions},s);const a=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(s,n)&&this.raise(he.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,s)):this.parseClassMemberWithIsStatic(e,s,r,!!s.static)};s.declare?this.tsInAmbientContext(a):a()}parseClassMemberWithIsStatic(e,s,r,n){const a=this.tsTryParseIndexSignature(s);if(a){e.body.push(a),s.abstract&&this.raise(he.IndexSignatureHasAbstract,s),s.accessibility&&this.raise(he.IndexSignatureHasAccessibility,s,{modifier:s.accessibility}),s.declare&&this.raise(he.IndexSignatureHasDeclare,s),s.override&&this.raise(he.IndexSignatureHasOverride,s);return}!this.state.inAbstractClass&&s.abstract&&this.raise(he.NonAbstractClassHasAbstractMethod,s),s.override&&(r.hadSuperClass||this.raise(he.OverrideNotInSubClass,s)),super.parseClassMemberWithIsStatic(e,s,r,n)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(he.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(he.ClassMethodHasDeclare,e)}parseExpressionStatement(e,s,r){return(s.type==="Identifier"?this.tsParseExpressionStatement(e,s,r):void 0)||super.parseExpressionStatement(e,s,r)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,s,r){if(!this.state.maybeInArrowParameters||!this.match(17))return super.parseConditional(e,s,r);const n=this.tryParse(()=>super.parseConditional(e,s));return n.node?(n.error&&(this.state=n.failState),n.node):(n.error&&super.setOptionalParametersError(r,n.error),e)}parseParenItem(e,s){const r=super.parseParenItem(e,s);if(this.eat(17)&&(r.optional=!0,this.resetEndLocation(e)),this.match(14)){const n=this.startNodeAt(s);return n.expression=e,n.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(n,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));const s=this.state.startLoc,r=this.eatContextual(125);if(r&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(he.ExpectedAmbientAfterExportDeclare,this.state.startLoc);const a=Me(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return a?((a.type==="TSInterfaceDeclaration"||a.type==="TSTypeAliasDeclaration"||r)&&(e.exportKind="type"),r&&(this.resetStartLocation(a,s),a.declare=!0),a):null}parseClassId(e,s,r,n){if((!s||r)&&this.isContextual(113))return;super.parseClassId(e,s,r,e.declare?1024:8331);const a=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);a&&(e.typeParameters=a)}parseClassPropertyAnnotation(e){e.optional||(this.eat(35)?e.definite=!0:this.eat(17)&&(e.optional=!0));const s=this.tsTryParseTypeAnnotation();s&&(e.typeAnnotation=s)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(he.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){const{key:s}=e;this.raise(he.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:s.type==="Identifier"&&!e.computed?s.name:`[${this.input.slice(s.start,s.end)}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(he.PrivateElementHasAbstract,e),e.accessibility&&this.raise(he.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(he.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,s,r,n,a,o){const l=this.tsTryParseTypeParameters(this.tsParseConstModifier);l&&a&&this.raise(he.ConstructorHasTypeParameters,l);const{declare:h=!1,kind:u}=s;h&&(u==="get"||u==="set")&&this.raise(he.DeclareAccessor,s,{kind:u}),l&&(s.typeParameters=l),super.pushClassMethod(e,s,r,n,a,o)}pushClassPrivateMethod(e,s,r,n){const a=this.tsTryParseTypeParameters(this.tsParseConstModifier);a&&(s.typeParameters=a),super.pushClassPrivateMethod(e,s,r,n)}declareClassPrivateMethodInScope(e,s){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&!hasOwnProperty.call(e.value,"body")||super.declareClassPrivateMethodInScope(e,s))}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual(113)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,s,r,n,a,o,l){const h=this.tsTryParseTypeParameters(this.tsParseConstModifier);return h&&(e.typeParameters=h),super.parseObjPropValue(e,s,r,n,a,o,l)}parseFunctionParams(e,s){const r=this.tsTryParseTypeParameters(this.tsParseConstModifier);r&&(e.typeParameters=r),super.parseFunctionParams(e,s)}parseVarId(e,s){super.parseVarId(e,s),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);const r=this.tsTryParseTypeAnnotation();r&&(e.id.typeAnnotation=r,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,s){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,s)}parseMaybeAssign(e,s){var r,n,a,o,l;let h,u,d;if(this.hasPlugin("jsx")&&(this.match(142)||this.match(47))){if(h=this.state.clone(),u=this.tryParse(()=>super.parseMaybeAssign(e,s),h),!u.error)return u.node;const{context:p}=this.state,m=p[p.length-1];(m===Fe.j_oTag||m===Fe.j_expr)&&p.pop()}if(!((r=u)!=null&&r.error)&&!this.match(47))return super.parseMaybeAssign(e,s);(!h||h===this.state)&&(h=this.state.clone());let c;const f=this.tryParse(p=>{var m,b;c=this.tsParseTypeParameters(this.tsParseConstModifier);const P=super.parseMaybeAssign(e,s);return(P.type!=="ArrowFunctionExpression"||(m=P.extra)!=null&&m.parenthesized)&&p(),((b=c)==null?void 0:b.params.length)!==0&&this.resetStartLocationFromNode(P,c),P.typeParameters=c,P},h);if(!f.error&&!f.aborted)return c&&this.reportReservedArrowTypeParam(c),f.node;if(!u&&(To(!this.hasPlugin("jsx")),d=this.tryParse(()=>super.parseMaybeAssign(e,s),h),!d.error))return d.node;if((n=u)!=null&&n.node)return this.state=u.failState,u.node;if(f.node)return this.state=f.failState,c&&this.reportReservedArrowTypeParam(c),f.node;if((a=d)!=null&&a.node)return this.state=d.failState,d.node;throw((o=u)==null?void 0:o.error)||f.error||((l=d)==null?void 0:l.error)}reportReservedArrowTypeParam(e){var s;e.params.length===1&&!e.params[0].constraint&&!((s=e.extra)!=null&&s.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(he.ReservedArrowTypeParam,e)}parseMaybeUnary(e,s){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,s)}parseArrow(e){if(this.match(14)){const s=this.tryParse(r=>{const n=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&r(),n});if(s.aborted)return;s.thrown||(s.error&&(this.state=s.failState),e.returnType=s.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(17)&&(e.optional=!0);const s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s),this.resetEndLocation(e),e}isAssignable(e,s){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,s);case"TSParameterProperty":return!0;default:return super.isAssignable(e,s)}}toAssignable(e,s=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,s);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":s?this.expressionScope.recordArrowParameterBindingError(he.UnexpectedTypeCastInParameter,e):this.raise(he.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,s);break;case"AssignmentExpression":!s&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,s)}}toAssignableParenthesizedExpression(e,s){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,s);break;default:super.toAssignable(e,s)}}checkToRestConversion(e,s){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,s)}}isValidLVal(e,s,r){switch(e){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":case"TSInstantiationExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(r!==64||!s)&&["expression",!0];default:return super.isValidLVal(e,s,r)}}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e){if(this.match(47)||this.match(51)){const s=this.tsParseTypeArgumentsInExpression();if(this.match(10)){const r=super.parseMaybeDecoratorArguments(e);return r.typeParameters=s,r}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(e)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(e,s){const r=super.parseMaybeDefault(e,s);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.startthis.isAssignable(s,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(47)||this.match(51)){const s=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());s&&(e.typeParameters=s)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){const s=super.getGetterSetterExpectedParamCount(e),n=this.getObjectOrClassMethodParams(e)[0];return n&&this.isThisParam(n)?s+1:s}parseCatchClauseParam(){const e=super.parseCatchClauseParam(),s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s,this.resetEndLocation(e)),e}tsInAmbientContext(e){const{isAmbientContext:s,strict:r}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=s,this.state.strict=r}}parseClass(e,s,r){const n=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,s,r)}finally{this.state.inAbstractClass=n}}tsParseAbstractDeclaration(e,s){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(s,this.parseClass(e,!0,!1));if(this.isContextual(129)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(he.NonClassMethodPropertyHasAbstractModifer,e),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,s,r,n,a,o,l){const h=super.parseMethod(e,s,r,n,a,o,l);if(h.abstract&&(this.hasPlugin("estree")?!!h.value.body:!!h.body)){const{key:d}=h;this.raise(he.AbstractMethodHasImplementation,h,{methodName:d.type==="Identifier"&&!h.computed?d.name:`[${this.input.slice(d.start,d.end)}]`})}return h}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,s,r,n){return!s&&n?(this.parseTypeOnlyImportExportSpecifier(e,!1,r),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,s,r,n))}parseImportSpecifier(e,s,r,n,a){return!s&&n?(this.parseTypeOnlyImportExportSpecifier(e,!0,r),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,s,r,n,r?4098:4096))}parseTypeOnlyImportExportSpecifier(e,s,r){const n=s?"imported":"local",a=s?"local":"exported";let o=e[n],l,h=!1,u=!0;const d=o.loc.start;if(this.isContextual(93)){const f=this.parseIdentifier();if(this.isContextual(93)){const p=this.parseIdentifier();Pt(this.state.type)?(h=!0,o=f,l=s?this.parseIdentifier():this.parseModuleExportName(),u=!1):(l=p,u=!1)}else Pt(this.state.type)?(u=!1,l=s?this.parseIdentifier():this.parseModuleExportName()):(h=!0,o=f)}else Pt(this.state.type)&&(h=!0,s?(o=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(o.name,o.loc.start,!0,!0)):o=this.parseModuleExportName());h&&r&&this.raise(s?he.TypeModifierIsUsedInTypeImports:he.TypeModifierIsUsedInTypeExports,d),e[n]=o,e[a]=l;const c=s?"importKind":"exportKind";e[c]=h?"type":"value",u&&this.eatContextual(93)&&(e[a]=s?this.parseIdentifier():this.parseModuleExportName()),e[a]||(e[a]=zt(e[n])),s&&this.checkIdentifier(e[a],h?4098:4096)}};function sd(i){if(i.type!=="MemberExpression")return!1;const{computed:t,property:e}=i;return t&&e.type!=="StringLiteral"&&(e.type!=="TemplateLiteral"||e.expressions.length>0)?!1:oc(i.object)}function id(i,t){var e;const{type:s}=i;if((e=i.extra)!=null&&e.parenthesized)return!1;if(t){if(s==="Literal"){const{value:r}=i;if(typeof r=="string"||typeof r=="boolean")return!0}}else if(s==="StringLiteral"||s==="BooleanLiteral")return!0;return!!(ac(i,t)||rd(i,t)||s==="TemplateLiteral"&&i.expressions.length===0||sd(i))}function ac(i,t){return t?i.type==="Literal"&&(typeof i.value=="number"||"bigint"in i):i.type==="NumericLiteral"||i.type==="BigIntLiteral"}function rd(i,t){if(i.type==="UnaryExpression"){const{operator:e,argument:s}=i;if(e==="-"&&ac(s,t))return!0}return!1}function oc(i){return i.type==="Identifier"?!0:i.type!=="MemberExpression"||i.computed?!1:oc(i.object)}const xo=Gt`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."});var nd=i=>class extends i{parsePlaceholder(e){if(this.match(144)){const s=this.startNode();return this.next(),this.assertNoSpace(),s.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(144),this.finishPlaceholder(s,e)}}finishPlaceholder(e,s){let r=e;return(!r.expectedNode||!r.type)&&(r=this.finishNode(r,"Placeholder")),r.expectedNode=s,r}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(144,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder("Expression")||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder("Identifier")||super.parseIdentifier(e)}checkReservedWord(e,s,r,n){e!==void 0&&super.checkReservedWord(e,s,r,n)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,s,r){return e==="Placeholder"||super.isValidLVal(e,s,r)}toAssignable(e,s){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,s)}chStartsBindingIdentifier(e,s){return!!(super.chStartsBindingIdentifier(e,s)||this.lookahead().type===144)}verifyBreakContinue(e,s){e.label&&e.label.type==="Placeholder"||super.verifyBreakContinue(e,s)}parseExpressionStatement(e,s){var r;if(s.type!=="Placeholder"||(r=s.extra)!=null&&r.parenthesized)return super.parseExpressionStatement(e,s);if(this.match(14)){const a=e;return a.label=this.finishPlaceholder(s,"Identifier"),this.next(),a.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(a,"LabeledStatement")}this.semicolon();const n=e;return n.name=s.name,this.finishPlaceholder(n,"Statement")}parseBlock(e,s,r){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,s,r)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,s,r){const n=s?"ClassDeclaration":"ClassExpression";this.next();const a=this.state.strict,o=this.parsePlaceholder("Identifier");if(o)if(this.match(81)||this.match(144)||this.match(5))e.id=o;else{if(r||!s)return e.id=null,e.body=this.finishPlaceholder(o,"ClassBody"),this.finishNode(e,n);throw this.raise(xo.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(e,s,r);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,a),this.finishNode(e,n)}parseExport(e,s){const r=this.parsePlaceholder("Identifier");if(!r)return super.parseExport(e,s);const n=e;if(!this.isContextual(98)&&!this.match(12))return n.specifiers=[],n.source=null,n.declaration=this.finishPlaceholder(r,"Declaration"),this.finishNode(n,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");const a=this.startNode();return a.exported=r,n.specifiers=[this.finishNode(a,"ExportDefaultSpecifier")],super.parseExport(n,s)}isExportDefaultSpecifier(){if(this.match(65)){const e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(os(144),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,s){var r;return(r=e.specifiers)!=null&&r.length?!0:super.maybeParseExportDefaultSpecifier(e,s)}checkExport(e){const{specifiers:s}=e;s!=null&&s.length&&(e.specifiers=s.filter(r=>r.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=s}parseImport(e){const s=this.parsePlaceholder("Identifier");if(!s)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(98)&&!this.match(12))return e.source=this.finishPlaceholder(s,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");const r=this.startNodeAtNode(s);return r.local=s,e.specifiers.push(this.finishNode(r,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(98),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.state.lastTokEndLoc.index&&this.raise(xo.UnexpectedSpace,this.state.lastTokEndLoc)}},ad=i=>class extends i{parseV8Intrinsic(){if(this.match(54)){const e=this.state.startLoc,s=this.startNode();if(this.next(),Me(this.state.type)){const r=this.parseIdentifierName(),n=this.createIdentifier(s,r);if(n.type="V8IntrinsicIdentifier",this.match(10))return n}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}};const So=["minimal","fsharp","hack","smart"],Po=["^^","@@","^","%","#"];function od(i){if(i.has("decorators")){if(i.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");const e=i.get("decorators").decoratorsBeforeExport;if(e!=null&&typeof e!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");const s=i.get("decorators").allowCallParenthesized;if(s!=null&&typeof s!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(i.has("flow")&&i.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(i.has("placeholders")&&i.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(i.has("pipelineOperator")){var t;const e=i.get("pipelineOperator").proposal;if(!So.includes(e)){const r=So.map(n=>`"${n}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${r}.`)}const s=((t=i.get("recordAndTuple"))==null?void 0:t.syntaxType)==="hash";if(e==="hack"){if(i.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(i.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");const r=i.get("pipelineOperator").topicToken;if(!Po.includes(r)){const n=Po.map(a=>`"${a}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${n}.`)}if(r==="#"&&s)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",i.get("recordAndTuple")])}\`.`)}else if(e==="smart"&&s)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",i.get("recordAndTuple")])}\`.`)}if(i.has("moduleAttributes")){if(i.has("importAttributes")||i.has("importAssertions"))throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins.");if(i.get("moduleAttributes").version!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(i.has("importAssertions")&&i.has("importAttributes"))throw new Error("Cannot combine importAssertions and importAttributes plugins.");if(i.has("recordAndTuple")){const e=i.get("recordAndTuple").syntaxType;if(e!=null){const s=["hash","bar"];if(!s.includes(e))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+s.map(r=>`'${r}'`).join(", "))}}if(i.has("asyncDoExpressions")&&!i.has("doExpressions")){const e=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw e.missingPlugins="doExpressions",e}if(i.has("optionalChainingAssign")&&i.get("optionalChainingAssign").version!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.")}const lc={estree:Jf,jsx:zp,flow:Kp,typescript:td,v8intrinsic:ad,placeholders:nd},ld=Object.keys(lc),en={sourceType:"script",sourceFilename:void 0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0};function cd(i){if(i==null)return Object.assign({},en);if(i.annexB!=null&&i.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");const t={};for(const s of Object.keys(en)){var e;t[s]=(e=i[s])!=null?e:en[s]}return t}class ud extends Yp{checkProto(t,e,s,r){if(t.type==="SpreadElement"||this.isObjectMethod(t)||t.computed||t.shorthand)return;const n=t.key;if((n.type==="Identifier"?n.name:n.value)==="__proto__"){if(e){this.raise(w.RecordNoProto,n);return}s.used&&(r?r.doubleProtoLoc===null&&(r.doubleProtoLoc=n.loc.start):this.raise(w.DuplicateProto,n)),s.used=!0}}shouldExitDescending(t,e){return t.type==="ArrowFunctionExpression"&&t.start===e}getExpression(){this.enterInitialScopes(),this.nextToken();const t=this.parseExpression();return this.match(139)||this.unexpected(),this.finalizeRemainingComments(),t.comments=this.comments,t.errors=this.state.errors,this.options.tokens&&(t.tokens=this.tokens),t}parseExpression(t,e){return t?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(t){const e=this.state.startLoc,s=this.parseMaybeAssign(t);if(this.match(12)){const r=this.startNodeAt(e);for(r.expressions=[s];this.eat(12);)r.expressions.push(this.parseMaybeAssign(t));return this.toReferencedList(r.expressions),this.finishNode(r,"SequenceExpression")}return s}parseMaybeAssignDisallowIn(t,e){return this.disallowInAnd(()=>this.parseMaybeAssign(t,e))}parseMaybeAssignAllowIn(t,e){return this.allowInAnd(()=>this.parseMaybeAssign(t,e))}setOptionalParametersError(t,e){var s;t.optionalParametersLoc=(s=e==null?void 0:e.loc)!=null?s:this.state.startLoc}parseMaybeAssign(t,e){const s=this.state.startLoc;if(this.isContextual(108)&&this.prodParam.hasYield){let o=this.parseYield();return e&&(o=e.call(this,o,s)),o}let r;t?r=!1:(t=new Qi,r=!0);const{type:n}=this.state;(n===10||Me(n))&&(this.state.potentialArrowAt=this.state.start);let a=this.parseMaybeConditional(t);if(e&&(a=e.call(this,a,s)),ep(this.state.type)){const o=this.startNodeAt(s),l=this.state.value;if(o.operator=l,this.match(29)){this.toAssignable(a,!0),o.left=a;const h=s.index;t.doubleProtoLoc!=null&&t.doubleProtoLoc.index>=h&&(t.doubleProtoLoc=null),t.shorthandAssignLoc!=null&&t.shorthandAssignLoc.index>=h&&(t.shorthandAssignLoc=null),t.privateKeyLoc!=null&&t.privateKeyLoc.index>=h&&(this.checkDestructuringPrivate(t),t.privateKeyLoc=null)}else o.left=a;return this.next(),o.right=this.parseMaybeAssign(),this.checkLVal(a,this.finishNode(o,"AssignmentExpression")),o}else r&&this.checkExpressionErrors(t,!0);return a}parseMaybeConditional(t){const e=this.state.startLoc,s=this.state.potentialArrowAt,r=this.parseExprOps(t);return this.shouldExitDescending(r,s)?r:this.parseConditional(r,e,t)}parseConditional(t,e,s){if(this.eat(17)){const r=this.startNodeAt(e);return r.test=t,r.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),r.alternate=this.parseMaybeAssign(),this.finishNode(r,"ConditionalExpression")}return t}parseMaybeUnaryOrPrivate(t){return this.match(138)?this.parsePrivateName():this.parseMaybeUnary(t)}parseExprOps(t){const e=this.state.startLoc,s=this.state.potentialArrowAt,r=this.parseMaybeUnaryOrPrivate(t);return this.shouldExitDescending(r,s)?r:this.parseExprOp(r,e,-1)}parseExprOp(t,e,s){if(this.isPrivateName(t)){const n=this.getPrivateNameSV(t);(s>=Yi(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(w.PrivateInExpectedIn,t,{identifierName:n}),this.classScope.usePrivateName(n,t.loc.start)}const r=this.state.type;if(sp(r)&&(this.prodParam.hasIn||!this.match(58))){let n=Yi(r);if(n>s){if(r===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return t;this.checkPipelineAtInfixOperator(t,e)}const a=this.startNodeAt(e);a.left=t,a.operator=this.state.value;const o=r===41||r===42,l=r===40;if(l&&(n=Yi(42)),this.next(),r===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(w.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);a.right=this.parseExprOpRightExpr(r,n);const h=this.finishNode(a,o||l?"LogicalExpression":"BinaryExpression"),u=this.state.type;if(l&&(u===41||u===42)||o&&u===40)throw this.raise(w.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(h,e,s)}}return t}parseExprOpRightExpr(t,e){const s=this.state.startLoc;switch(t){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"smart":return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(w.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(t,e),s)});case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}default:return this.parseExprOpBaseRightExpr(t,e)}}parseExprOpBaseRightExpr(t,e){const s=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),s,op(t)?e-1:e)}parseHackPipeBody(){var t;const{startLoc:e}=this.state,s=this.parseMaybeAssign();return Gf.has(s.type)&&!((t=s.extra)!=null&&t.parenthesized)&&this.raise(w.PipeUnparenthesizedBody,e,{type:s.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(w.PipeTopicUnused,e),s}checkExponentialAfterUnary(t){this.match(57)&&this.raise(w.UnexpectedTokenUnaryExponentiation,t.argument)}parseMaybeUnary(t,e){const s=this.state.startLoc,r=this.isContextual(96);if(r&&this.recordAwaitIfAllowed()){this.next();const l=this.parseAwait(s);return e||this.checkExponentialAfterUnary(l),l}const n=this.match(34),a=this.startNode();if(rp(this.state.type)){a.operator=this.state.value,a.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");const l=this.match(89);if(this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),this.state.strict&&l){const h=a.argument;h.type==="Identifier"?this.raise(w.StrictDelete,a):this.hasPropertyAsPrivateName(h)&&this.raise(w.DeletePrivateField,a)}if(!n)return e||this.checkExponentialAfterUnary(a),this.finishNode(a,"UnaryExpression")}const o=this.parseUpdate(a,n,t);if(r){const{type:l}=this.state;if((this.hasPlugin("v8intrinsic")?Sn(l):Sn(l)&&!this.match(54))&&!this.isAmbiguousAwait())return this.raiseOverwrite(w.AwaitNotInAsyncContext,s),this.parseAwait(s)}return o}parseUpdate(t,e,s){if(e){const a=t;return this.checkLVal(a.argument,this.finishNode(a,"UpdateExpression")),t}const r=this.state.startLoc;let n=this.parseExprSubscripts(s);if(this.checkExpressionErrors(s,!1))return n;for(;ip(this.state.type)&&!this.canInsertSemicolon();){const a=this.startNodeAt(r);a.operator=this.state.value,a.prefix=!1,a.argument=n,this.next(),this.checkLVal(n,n=this.finishNode(a,"UpdateExpression"))}return n}parseExprSubscripts(t){const e=this.state.startLoc,s=this.state.potentialArrowAt,r=this.parseExprAtom(t);return this.shouldExitDescending(r,s)?r:this.parseSubscripts(r,e)}parseSubscripts(t,e,s){const r={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(t),stop:!1};do t=this.parseSubscript(t,e,s,r),r.maybeAsyncArrow=!1;while(!r.stop);return t}parseSubscript(t,e,s,r){const{type:n}=this.state;if(!s&&n===15)return this.parseBind(t,e,s,r);if(cr(n))return this.parseTaggedTemplateExpression(t,e,r);let a=!1;if(n===18){if(s&&(this.raise(w.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return r.stop=!0,t;r.optionalChainMember=a=!0,this.next()}if(!s&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(t,e,r,a);{const o=this.eat(0);return o||a||this.eat(16)?this.parseMember(t,e,r,o,a):(r.stop=!0,t)}}parseMember(t,e,s,r,n){const a=this.startNodeAt(e);return a.object=t,a.computed=r,r?(a.property=this.parseExpression(),this.expect(3)):this.match(138)?(t.type==="Super"&&this.raise(w.SuperPrivateField,e),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),s.optionalChainMember?(a.optional=n,this.finishNode(a,"OptionalMemberExpression")):this.finishNode(a,"MemberExpression")}parseBind(t,e,s,r){const n=this.startNodeAt(e);return n.object=t,this.next(),n.callee=this.parseNoCallExpr(),r.stop=!0,this.parseSubscripts(this.finishNode(n,"BindExpression"),e,s)}parseCoverCallAndAsyncArrowHead(t,e,s,r){const n=this.state.maybeInArrowParameters;let a=null;this.state.maybeInArrowParameters=!0,this.next();const o=this.startNodeAt(e);o.callee=t;const{maybeAsyncArrow:l,optionalChainMember:h}=s;l&&(this.expressionScope.enter(Dp()),a=new Qi),h&&(o.optional=r),r?o.arguments=this.parseCallExpressionArguments(11):o.arguments=this.parseCallExpressionArguments(11,t.type==="Import",t.type!=="Super",o,a);let u=this.finishCallExpression(o,h);return l&&this.shouldParseAsyncArrow()&&!r?(s.stop=!0,this.checkDestructuringPrivate(a),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),u=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),u)):(l&&(this.checkExpressionErrors(a,!0),this.expressionScope.exit()),this.toReferencedArguments(u)),this.state.maybeInArrowParameters=n,u}toReferencedArguments(t,e){this.toReferencedListDeep(t.arguments,e)}parseTaggedTemplateExpression(t,e,s){const r=this.startNodeAt(e);return r.tag=t,r.quasi=this.parseTemplate(!0),s.optionalChainMember&&this.raise(w.OptionalChainingNoTemplate,e),this.finishNode(r,"TaggedTemplateExpression")}atPossibleAsyncArrow(t){return t.type==="Identifier"&&t.name==="async"&&this.state.lastTokEndLoc.index===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&t.start===this.state.potentialArrowAt}finishCallExpression(t,e){if(t.callee.type==="Import")if(t.arguments.length===2&&(this.hasPlugin("moduleAttributes")||this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes")),t.arguments.length===0||t.arguments.length>2)this.raise(w.ImportCallArity,t,{maxArgumentCount:this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")||this.hasPlugin("moduleAttributes")?2:1});else for(const s of t.arguments)s.type==="SpreadElement"&&this.raise(w.ImportCallSpreadArgument,s);return this.finishNode(t,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(t,e,s,r,n){const a=[];let o=!0;const l=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(t);){if(o)o=!1;else if(this.expect(12),this.match(t)){e&&!this.hasPlugin("importAttributes")&&!this.hasPlugin("importAssertions")&&!this.hasPlugin("moduleAttributes")&&this.raise(w.ImportCallArgumentTrailingComma,this.state.lastTokStartLoc),r&&this.addTrailingCommaExtraToNode(r),this.next();break}a.push(this.parseExprListItem(!1,n,s))}return this.state.inFSharpPipelineDirectBody=l,a}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(t,e){var s;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(t,e.arguments,!0,(s=e.extra)==null?void 0:s.trailingCommaLoc),e.innerComments&&Ai(t,e.innerComments),e.callee.trailingComments&&Ai(t,e.callee.trailingComments),t}parseNoCallExpr(){const t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),t,!0)}parseExprAtom(t){let e,s=null;const{type:r}=this.state;switch(r){case 79:return this.parseSuper();case 83:return e=this.startNode(),this.next(),this.match(16)?this.parseImportMetaProperty(e):this.match(10)?this.options.createImportExpressions?this.parseImportCall(e):this.finishNode(e,"Import"):(this.raise(w.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(e,"Import"));case 78:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 134:return this.parseNumericLiteral(this.state.value);case 135:return this.parseBigIntLiteral(this.state.value);case 133:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{const n=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(n)}case 2:case 1:return this.parseArrayLike(this.state.type===2?4:3,!1,!0);case 0:return this.parseArrayLike(3,!0,!1,t);case 6:case 7:return this.parseObjectLike(this.state.type===6?9:8,!1,!0);case 5:return this.parseObjectLike(8,!1,!1,t);case 68:return this.parseFunctionOrFunctionSent();case 26:s=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(s,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{e=this.startNode(),this.next(),e.object=null;const n=e.callee=this.parseNoCallExpr();if(n.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(w.UnsupportedBind,n)}case 138:return this.raise(w.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{const n=this.getPluginOption("pipelineOperator","proposal");if(n)return this.parseTopicReference(n);this.unexpected();break}case 47:{const n=this.input.codePointAt(this.nextTokenStart());Vt(n)||n===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(r===136)return this.parseDecimalLiteral(this.state.value);if(Me(r)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();const n=this.state.potentialArrowAt===this.state.start,a=this.state.containsEsc,o=this.parseIdentifier();if(!a&&o.name==="async"&&!this.canInsertSemicolon()){const{type:l}=this.state;if(l===68)return this.resetPreviousNodeTrailingComments(o),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(o));if(Me(l))return this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(o)):o;if(l===90)return this.resetPreviousNodeTrailingComments(o),this.parseDo(this.startNodeAtNode(o),!0)}return n&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(o),[o],!1)):o}else this.unexpected()}}parseTopicReferenceThenEqualsSign(t,e){const s=this.getPluginOption("pipelineOperator","proposal");if(s)return this.state.type=t,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=ot(this.state.endLoc,-1),this.parseTopicReference(s);this.unexpected()}parseTopicReference(t){const e=this.startNode(),s=this.state.startLoc,r=this.state.type;return this.next(),this.finishTopicReference(e,s,t,r)}finishTopicReference(t,e,s,r){if(this.testTopicReferenceConfiguration(s,e,r)){const n=s==="smart"?"PipelinePrimaryTopicReference":"TopicReference";return this.topicReferenceIsAllowedInCurrentContext()||this.raise(s==="smart"?w.PrimaryTopicNotAllowed:w.PipeTopicUnbound,e),this.registerTopicReference(),this.finishNode(t,n)}else throw this.raise(w.PipeTopicUnconfiguredToken,e,{token:os(r)})}testTopicReferenceConfiguration(t,e,s){switch(t){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:os(s)}]);case"smart":return s===27;default:throw this.raise(w.PipeTopicRequiresHackPipes,e)}}parseAsyncArrowUnaryFunction(t){this.prodParam.enter(Zi(!0,this.prodParam.hasYield));const e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(w.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(t,e,!0)}parseDo(t,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),t.async=e,this.next();const s=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(2),t.body=this.parseBlock(),this.prodParam.exit()):t.body=this.parseBlock(),this.state.labels=s,this.finishNode(t,"DoExpression")}parseSuper(){const t=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!this.options.allowSuperOutsideMethod?this.raise(w.SuperNotAllowed,t):!this.scope.allowSuper&&!this.options.allowSuperOutsideMethod&&this.raise(w.UnexpectedSuper,t),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(w.UnsupportedSuper,t),this.finishNode(t,"Super")}parsePrivateName(){const t=this.startNode(),e=this.startNodeAt(ot(this.state.startLoc,1)),s=this.state.value;return this.next(),t.id=this.createIdentifier(e,s),this.finishNode(t,"PrivateName")}parseFunctionOrFunctionSent(){const t=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){const e=this.createIdentifier(this.startNodeAtNode(t),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(t,e,"sent")}return this.parseFunction(t)}parseMetaProperty(t,e,s){t.meta=e;const r=this.state.containsEsc;return t.property=this.parseIdentifier(!0),(t.property.name!==s||r)&&this.raise(w.UnsupportedMetaProperty,t.property,{target:e.name,onlyValidPropertyName:s}),this.finishNode(t,"MetaProperty")}parseImportMetaProperty(t){const e=this.createIdentifier(this.startNodeAtNode(t),"import");if(this.next(),this.isContextual(101))this.inModule||this.raise(w.ImportMetaOutsideModule,e),this.sawUnambiguousESM=!0;else if(this.isContextual(105)||this.isContextual(97)){const s=this.isContextual(105);if(s||this.unexpected(),this.expectPlugin(s?"sourcePhaseImports":"deferredImportEvaluation"),!this.options.createImportExpressions)throw this.raise(w.DynamicImportPhaseRequiresImportExpressions,this.state.startLoc,{phase:this.state.value});return this.next(),t.phase=s?"source":"defer",this.parseImportCall(t)}return this.parseMetaProperty(t,e,"meta")}parseLiteralAtNode(t,e,s){return this.addExtra(s,"rawValue",t),this.addExtra(s,"raw",this.input.slice(s.start,this.state.end)),s.value=t,this.next(),this.finishNode(s,e)}parseLiteral(t,e){const s=this.startNode();return this.parseLiteralAtNode(t,e,s)}parseStringLiteral(t){return this.parseLiteral(t,"StringLiteral")}parseNumericLiteral(t){return this.parseLiteral(t,"NumericLiteral")}parseBigIntLiteral(t){return this.parseLiteral(t,"BigIntLiteral")}parseDecimalLiteral(t){return this.parseLiteral(t,"DecimalLiteral")}parseRegExpLiteral(t){const e=this.startNode();return this.addExtra(e,"raw",this.input.slice(e.start,this.state.end)),e.pattern=t.pattern,e.flags=t.flags,this.next(),this.finishNode(e,"RegExpLiteral")}parseBooleanLiteral(t){const e=this.startNode();return e.value=t,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){const t=this.startNode();return this.next(),this.finishNode(t,"NullLiteral")}parseParenAndDistinguishExpression(t){const e=this.state.startLoc;let s;this.next(),this.expressionScope.enter(Op());const r=this.state.maybeInArrowParameters,n=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;const a=this.state.startLoc,o=[],l=new Qi;let h=!0,u,d;for(;!this.match(11);){if(h)h=!1;else if(this.expect(12,l.optionalParametersLoc===null?null:l.optionalParametersLoc),this.match(11)){d=this.state.startLoc;break}if(this.match(21)){const p=this.state.startLoc;if(u=this.state.startLoc,o.push(this.parseParenItem(this.parseRestBinding(),p)),!this.checkCommaAfterRest(41))break}else o.push(this.parseMaybeAssignAllowIn(l,this.parseParenItem))}const c=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=r,this.state.inFSharpPipelineDirectBody=n;let f=this.startNodeAt(e);return t&&this.shouldParseArrow(o)&&(f=this.parseArrow(f))?(this.checkDestructuringPrivate(l),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(f,o,!1),f):(this.expressionScope.exit(),o.length||this.unexpected(this.state.lastTokStartLoc),d&&this.unexpected(d),u&&this.unexpected(u),this.checkExpressionErrors(l,!0),this.toReferencedListDeep(o,!0),o.length>1?(s=this.startNodeAt(a),s.expressions=o,this.finishNode(s,"SequenceExpression"),this.resetEndLocation(s,c)):s=o[0],this.wrapParenthesis(e,s))}wrapParenthesis(t,e){if(!this.options.createParenthesizedExpressions)return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",t.index),this.takeSurroundingComments(e,t.index,this.state.lastTokEndLoc.index),e;const s=this.startNodeAt(t);return s.expression=e,this.finishNode(s,"ParenthesizedExpression")}shouldParseArrow(t){return!this.canInsertSemicolon()}parseArrow(t){if(this.eat(19))return t}parseParenItem(t,e){return t}parseNewOrNewTarget(){const t=this.startNode();if(this.next(),this.match(16)){const e=this.createIdentifier(this.startNodeAtNode(t),"new");this.next();const s=this.parseMetaProperty(t,e,"target");return!this.scope.inNonArrowFunction&&!this.scope.inClass&&!this.options.allowNewTargetOutsideFunction&&this.raise(w.UnexpectedNewTarget,s),s}return this.parseNew(t)}parseNew(t){if(this.parseNewCallee(t),this.eat(10)){const e=this.parseExprList(11);this.toReferencedList(e),t.arguments=e}else t.arguments=[];return this.finishNode(t,"NewExpression")}parseNewCallee(t){const e=this.match(83),s=this.parseNoCallExpr();t.callee=s,e&&(s.type==="Import"||s.type==="ImportExpression")&&this.raise(w.ImportCallNotNewExpression,s)}parseTemplateElement(t){const{start:e,startLoc:s,end:r,value:n}=this.state,a=e+1,o=this.startNodeAt(ot(s,1));n===null&&(t||this.raise(w.InvalidEscapeSequenceTemplate,ot(this.state.firstInvalidTemplateEscapePos,1)));const l=this.match(24),h=l?-1:-2,u=r+h;o.value={raw:this.input.slice(a,u).replace(/\r\n?/g,` -`),cooked:n===null?null:n.slice(1,h)},o.tail=l,this.next();const d=this.finishNode(o,"TemplateElement");return this.resetEndLocation(d,ot(this.state.lastTokEndLoc,h)),d}parseTemplate(t){const e=this.startNode();let s=this.parseTemplateElement(t);const r=[s],n=[];for(;!s.tail;)n.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),r.push(s=this.parseTemplateElement(t));return e.expressions=n,e.quasis=r,this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(t,e,s,r){s&&this.expectPlugin("recordAndTuple");const n=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;const a=Object.create(null);let o=!0;const l=this.startNode();for(l.properties=[],this.next();!this.match(t);){if(o)o=!1;else if(this.expect(12),this.match(t)){this.addTrailingCommaExtraToNode(l);break}let u;e?u=this.parseBindingProperty():(u=this.parsePropertyDefinition(r),this.checkProto(u,s,a,r)),s&&!this.isObjectProperty(u)&&u.type!=="SpreadElement"&&this.raise(w.InvalidRecordProperty,u),u.shorthand&&this.addExtra(u,"shorthand",!0),l.properties.push(u)}this.next(),this.state.inFSharpPipelineDirectBody=n;let h="ObjectExpression";return e?h="ObjectPattern":s&&(h="RecordExpression"),this.finishNode(l,h)}addTrailingCommaExtraToNode(t){this.addExtra(t,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(t,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(t){return!t.computed&&t.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(t){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(w.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)e.push(this.parseDecorator());const s=this.startNode();let r=!1,n=!1,a;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(s.decorators=e,e=[]),s.method=!1,t&&(a=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(s);const l=this.state.containsEsc;if(this.parsePropertyName(s,t),!o&&!l&&this.maybeAsyncOrAccessorProp(s)){const{key:h}=s,u=h.name;u==="async"&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(h),o=this.eat(55),this.parsePropertyName(s)),(u==="get"||u==="set")&&(n=!0,this.resetPreviousNodeTrailingComments(h),s.kind=u,this.match(55)&&(o=!0,this.raise(w.AccessorIsGenerator,this.state.curPosition(),{kind:u}),this.next()),this.parsePropertyName(s))}return this.parseObjPropValue(s,a,o,r,!1,n,t)}getGetterSetterExpectedParamCount(t){return t.kind==="get"?0:1}getObjectOrClassMethodParams(t){return t.params}checkGetterSetterParams(t){var e;const s=this.getGetterSetterExpectedParamCount(t),r=this.getObjectOrClassMethodParams(t);r.length!==s&&this.raise(t.kind==="get"?w.BadGetterArity:w.BadSetterArity,t),t.kind==="set"&&((e=r[r.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(w.BadSetterRestParameter,t)}parseObjectMethod(t,e,s,r,n){if(n){const a=this.parseMethod(t,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(a),a}if(s||e||this.match(10))return r&&this.unexpected(),t.kind="method",t.method=!0,this.parseMethod(t,e,s,!1,!1,"ObjectMethod")}parseObjectProperty(t,e,s,r){if(t.shorthand=!1,this.eat(14))return t.value=s?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(r),this.finishNode(t,"ObjectProperty");if(!t.computed&&t.key.type==="Identifier"){if(this.checkReservedWord(t.key.name,t.key.loc.start,!0,!1),s)t.value=this.parseMaybeDefault(e,zt(t.key));else if(this.match(29)){const n=this.state.startLoc;r!=null?r.shorthandAssignLoc===null&&(r.shorthandAssignLoc=n):this.raise(w.InvalidCoverInitializedName,n),t.value=this.parseMaybeDefault(e,zt(t.key))}else t.value=zt(t.key);return t.shorthand=!0,this.finishNode(t,"ObjectProperty")}}parseObjPropValue(t,e,s,r,n,a,o){const l=this.parseObjectMethod(t,s,r,n,a)||this.parseObjectProperty(t,e,n,o);return l||this.unexpected(),l}parsePropertyName(t,e){if(this.eat(0))t.computed=!0,t.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{const{type:s,value:r}=this.state;let n;if(Pt(s))n=this.parseIdentifier(!0);else switch(s){case 134:n=this.parseNumericLiteral(r);break;case 133:n=this.parseStringLiteral(r);break;case 135:n=this.parseBigIntLiteral(r);break;case 138:{const a=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=a):this.raise(w.UnexpectedPrivateField,a),n=this.parsePrivateName();break}default:if(s===136){n=this.parseDecimalLiteral(r);break}this.unexpected()}t.key=n,s!==138&&(t.computed=!1)}}initFunction(t,e){t.id=null,t.generator=!1,t.async=e}parseMethod(t,e,s,r,n,a,o=!1){this.initFunction(t,s),t.generator=e,this.scope.enter(18|(o?64:0)|(n?32:0)),this.prodParam.enter(Zi(s,t.generator)),this.parseFunctionParams(t,r);const l=this.parseFunctionBodyAndFinish(t,a,!0);return this.prodParam.exit(),this.scope.exit(),l}parseArrayLike(t,e,s,r){s&&this.expectPlugin("recordAndTuple");const n=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;const a=this.startNode();return this.next(),a.elements=this.parseExprList(t,!s,r,a),this.state.inFSharpPipelineDirectBody=n,this.finishNode(a,s?"TupleExpression":"ArrayExpression")}parseArrowExpression(t,e,s,r){this.scope.enter(6);let n=Zi(s,!1);!this.match(5)&&this.prodParam.hasIn&&(n|=8),this.prodParam.enter(n),this.initFunction(t,s);const a=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(t,e,r)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(t,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=a,this.finishNode(t,"ArrowFunctionExpression")}setArrowFunctionParameters(t,e,s){this.toAssignableList(e,s,!1),t.params=e}parseFunctionBodyAndFinish(t,e,s=!1){return this.parseFunctionBody(t,!1,s),this.finishNode(t,e)}parseFunctionBody(t,e,s=!1){const r=e&&!this.match(5);if(this.expressionScope.enter(rc()),r)t.body=this.parseMaybeAssign(),this.checkParams(t,!1,e,!1);else{const n=this.state.strict,a=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),t.body=this.parseBlock(!0,!1,o=>{const l=!this.isSimpleParamList(t.params);o&&l&&this.raise(w.IllegalLanguageModeDirective,(t.kind==="method"||t.kind==="constructor")&&!!t.key?t.key.loc.end:t);const h=!n&&this.state.strict;this.checkParams(t,!this.state.strict&&!e&&!s&&!l,e,h),this.state.strict&&t.id&&this.checkIdentifier(t.id,65,h)}),this.prodParam.exit(),this.state.labels=a}this.expressionScope.exit()}isSimpleParameter(t){return t.type==="Identifier"}isSimpleParamList(t){for(let e=0,s=t.length;e10||!gp(t))return;if(s&&dp(t)){this.raise(w.UnexpectedKeyword,e,{keyword:t});return}if((this.state.strict?r?Ql:Yl:Xl)(t,this.inModule)){this.raise(w.UnexpectedReservedWord,e,{reservedWord:t});return}else if(t==="yield"){if(this.prodParam.hasYield){this.raise(w.YieldBindingIdentifier,e);return}}else if(t==="await"){if(this.prodParam.hasAwait){this.raise(w.AwaitBindingIdentifier,e);return}if(this.scope.inStaticBlock){this.raise(w.AwaitBindingIdentifierInStaticBlock,e);return}this.expressionScope.recordAsyncArrowParametersError(e)}else if(t==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(w.ArgumentsInClass,e);return}}recordAwaitIfAllowed(){const t=this.prodParam.hasAwait||this.options.allowAwaitOutsideFunction&&!this.scope.inFunction;return t&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),t}parseAwait(t){const e=this.startNodeAt(t);return this.expressionScope.recordParameterInitializerError(w.AwaitExpressionFormalParameter,e),this.eat(55)&&this.raise(w.ObsoleteAwaitStar,e),!this.scope.inFunction&&!this.options.allowAwaitOutsideFunction&&(this.isAmbiguousAwait()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(e.argument=this.parseMaybeUnary(null,!0)),this.finishNode(e,"AwaitExpression")}isAmbiguousAwait(){if(this.hasPrecedingLineBreak())return!0;const{type:t}=this.state;return t===53||t===10||t===0||cr(t)||t===102&&!this.state.containsEsc||t===137||t===56||this.hasPlugin("v8intrinsic")&&t===54}parseYield(){const t=this.startNode();this.expressionScope.recordParameterInitializerError(w.YieldInParameter,t),this.next();let e=!1,s=null;if(!this.hasPrecedingLineBreak())switch(e=this.eat(55),this.state.type){case 13:case 139:case 8:case 11:case 3:case 9:case 14:case 12:if(!e)break;default:s=this.parseMaybeAssign()}return t.delegate=e,t.argument=s,this.finishNode(t,"YieldExpression")}parseImportCall(t){return this.next(),t.source=this.parseMaybeAssignAllowIn(),(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))&&(t.options=null),this.eat(12)&&(this.hasPlugin("moduleAttributes")||this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes"),this.match(11)||(t.options=this.parseMaybeAssignAllowIn(),this.eat(12))),this.expect(11),this.finishNode(t,"ImportExpression")}checkPipelineAtInfixOperator(t,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&t.type==="SequenceExpression"&&this.raise(w.PipelineHeadSequenceExpression,e)}parseSmartPipelineBodyInStyle(t,e){if(this.isSimpleReference(t)){const s=this.startNodeAt(e);return s.callee=t,this.finishNode(s,"PipelineBareFunction")}else{const s=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),s.expression=t,this.finishNode(s,"PipelineTopicExpression")}}isSimpleReference(t){switch(t.type){case"MemberExpression":return!t.computed&&this.isSimpleReference(t.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(t){if(this.match(19))throw this.raise(w.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(w.PipelineTopicUnused,t)}withTopicBindingContext(t){const e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(t){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){const e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}else return t()}withSoloAwaitPermittingContext(t){const e=this.state.soloAwait;this.state.soloAwait=!0;try{return t()}finally{this.state.soloAwait=e}}allowInAnd(t){const e=this.prodParam.currentFlags();if(8&~e){this.prodParam.enter(e|8);try{return t()}finally{this.prodParam.exit()}}return t()}disallowInAnd(t){const e=this.prodParam.currentFlags();if(8&e){this.prodParam.enter(e&-9);try{return t()}finally{this.prodParam.exit()}}return t()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(t){const e=this.state.startLoc;this.state.potentialArrowAt=this.state.start;const s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;const r=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,t);return this.state.inFSharpPipelineDirectBody=s,r}parseModuleExpression(){this.expectPlugin("moduleBlocks");const t=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);const e=this.startNodeAt(this.state.endLoc);this.next();const s=this.initializeScopes(!0);this.enterInitialScopes();try{t.body=this.parseProgram(e,8,"module")}finally{s()}return this.finishNode(t,"ModuleExpression")}parsePropertyNamePrefixOperator(t){}}const tn={kind:1},hd={kind:2},fd=/[\uD800-\uDFFF]/u,sn=/in(?:stanceof)?/y;function pd(i,t){for(let e=0;e0)for(const[n,a]of Array.from(this.scope.undefinedExports))this.raise(w.ModuleExportUndefined,a,{localName:n});this.addExtra(t,"topLevelAwait",this.state.hasTopLevelAwait)}let r;return e===139?r=this.finishNode(t,"Program"):r=this.finishNodeAt(t,"Program",ot(this.state.startLoc,-1)),r}stmtToDirective(t){const e=t;e.type="Directive",e.value=e.expression,delete e.expression;const s=e.value,r=s.value,n=this.input.slice(s.start,s.end),a=s.value=n.slice(1,-1);return this.addExtra(s,"raw",n),this.addExtra(s,"rawValue",a),this.addExtra(s,"expressionValue",r),s.type="DirectiveLiteral",e}parseInterpreterDirective(){if(!this.match(28))return null;const t=this.startNode();return t.value=this.state.value,this.next(),this.finishNode(t,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(t,e){if(Vt(t)){if(sn.lastIndex=e,sn.test(this.input)){const s=this.codePointAtPos(sn.lastIndex);if(!Us(s)&&s!==92)return!1}return!0}else return t===92}chStartsBindingPattern(t){return t===91||t===123}hasFollowingBindingAtom(){const t=this.nextTokenStart(),e=this.codePointAtPos(t);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,t)}hasInLineFollowingBindingIdentifierOrBrace(){const t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return e===123||this.chStartsBindingIdentifier(e,t)}startsUsingForOf(){const{type:t,containsEsc:e}=this.lookahead();if(t===102&&!e)return!1;if(Me(t)&&!this.hasFollowingLineBreak())return this.expectPlugin("explicitResourceManagement"),!0}startsAwaitUsing(){let t=this.nextTokenInLineStart();if(this.isUnparsedContextual(t,"using")){t=this.nextTokenInLineStartSince(t+5);const e=this.codePointAtPos(t);if(this.chStartsBindingIdentifier(e,t))return this.expectPlugin("explicitResourceManagement"),!0}return!1}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(t=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,t&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(t){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(t,e)}parseStatementContent(t,e){const s=this.state.type,r=this.startNode(),n=!!(t&2),a=!!(t&4),o=t&1;switch(s){case 60:return this.parseBreakContinueStatement(r,!0);case 63:return this.parseBreakContinueStatement(r,!1);case 64:return this.parseDebuggerStatement(r);case 90:return this.parseDoWhileStatement(r);case 91:return this.parseForStatement(r);case 68:if(this.lookaheadCharCode()===46)break;return a||this.raise(this.state.strict?w.StrictFunction:this.options.annexB?w.SloppyFunctionAnnexB:w.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(r,!1,!n&&a);case 80:return n||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,r),!0);case 69:return this.parseIfStatement(r);case 70:return this.parseReturnStatement(r);case 71:return this.parseSwitchStatement(r);case 72:return this.parseThrowStatement(r);case 73:return this.parseTryStatement(r);case 96:if(!this.state.containsEsc&&this.startsAwaitUsing())return this.recordAwaitIfAllowed()?n||this.raise(w.UnexpectedLexicalDeclaration,r):this.raise(w.AwaitUsingNotInAsyncContext,r),this.next(),this.parseVarStatement(r,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel?this.raise(w.UnexpectedUsingDeclaration,this.state.startLoc):n||this.raise(w.UnexpectedLexicalDeclaration,this.state.startLoc),this.parseVarStatement(r,"using");case 100:{if(this.state.containsEsc)break;const u=this.nextTokenStart(),d=this.codePointAtPos(u);if(d!==91&&(!n&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(d,u)&&d!==123))break}case 75:n||this.raise(w.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{const u=this.state.value;return this.parseVarStatement(r,u)}case 92:return this.parseWhileStatement(r);case 76:return this.parseWithStatement(r);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(r);case 83:{const u=this.lookaheadCharCode();if(u===40||u===46)break}case 82:{!this.options.allowImportExportEverywhere&&!o&&this.raise(w.UnexpectedImportExport,this.state.startLoc),this.next();let u;return s===83?(u=this.parseImport(r),u.type==="ImportDeclaration"&&(!u.importKind||u.importKind==="value")&&(this.sawUnambiguousESM=!0)):(u=this.parseExport(r,e),(u.type==="ExportNamedDeclaration"&&(!u.exportKind||u.exportKind==="value")||u.type==="ExportAllDeclaration"&&(!u.exportKind||u.exportKind==="value")||u.type==="ExportDefaultDeclaration")&&(this.sawUnambiguousESM=!0)),this.assertModuleNodeAllowed(u),u}default:if(this.isAsyncFunction())return n||this.raise(w.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(r,!0,!n&&a)}const l=this.state.value,h=this.parseExpression();return Me(s)&&h.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(r,l,h,t):this.parseExpressionStatement(r,h,e)}assertModuleNodeAllowed(t){!this.options.allowImportExportEverywhere&&!this.inModule&&this.raise(w.ImportOutsideModule,t)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(t,e,s){return t&&(e.decorators&&e.decorators.length>0?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(w.DecoratorsBeforeAfterExport,e.decorators[0]),e.decorators.unshift(...t)):e.decorators=t,this.resetStartLocationFromNode(e,t[0]),s&&this.resetStartLocationFromNode(s,e)),e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(t){const e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))t||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(w.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(w.UnexpectedLeadingDecorator,this.state.startLoc);return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);const t=this.startNode();if(this.next(),this.hasPlugin("decorators")){const e=this.state.startLoc;let s;if(this.match(10)){const r=this.state.startLoc;this.next(),s=this.parseExpression(),this.expect(11),s=this.wrapParenthesis(r,s);const n=this.state.startLoc;t.expression=this.parseMaybeDecoratorArguments(s),this.getPluginOption("decorators","allowCallParenthesized")===!1&&t.expression!==s&&this.raise(w.DecoratorArgumentsOutsideParentheses,n)}else{for(s=this.parseIdentifier(!1);this.eat(16);){const r=this.startNodeAt(e);r.object=s,this.match(138)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),r.property=this.parsePrivateName()):r.property=this.parseIdentifier(!0),r.computed=!1,s=this.finishNode(r,"MemberExpression")}t.expression=this.parseMaybeDecoratorArguments(s)}}else t.expression=this.parseExprSubscripts();return this.finishNode(t,"Decorator")}parseMaybeDecoratorArguments(t){if(this.eat(10)){const e=this.startNodeAtNode(t);return e.callee=t,e.arguments=this.parseCallExpressionArguments(11,!1),this.toReferencedList(e.arguments),this.finishNode(e,"CallExpression")}return t}parseBreakContinueStatement(t,e){return this.next(),this.isLineTerminator()?t.label=null:(t.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(t,e),this.finishNode(t,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(t,e){let s;for(s=0;sthis.parseStatement()),this.state.labels.pop(),this.expect(92),t.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(t,"DoWhileStatement")}parseForStatement(t){this.next(),this.state.labels.push(tn);let e=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(e=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(t,null);const s=this.isContextual(100);{const l=this.isContextual(96)&&this.startsAwaitUsing(),h=l||this.isContextual(107)&&this.startsUsingForOf(),u=s&&this.hasFollowingBindingAtom()||h;if(this.match(74)||this.match(75)||u){const d=this.startNode();let c;l?(c="await using",this.recordAwaitIfAllowed()||this.raise(w.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):c=this.state.value,this.next(),this.parseVar(d,!0,c);const f=this.finishNode(d,"VariableDeclaration"),p=this.match(58);return p&&h&&this.raise(w.ForInUsing,f),(p||this.isContextual(102))&&f.declarations.length===1?this.parseForIn(t,f,e):(e!==null&&this.unexpected(e),this.parseFor(t,f))}}const r=this.isContextual(95),n=new Qi,a=this.parseExpression(!0,n),o=this.isContextual(102);if(o&&(s&&this.raise(w.ForOfLet,a),e===null&&r&&a.type==="Identifier"&&this.raise(w.ForOfAsync,a)),o||this.match(58)){this.checkDestructuringPrivate(n),this.toAssignable(a,!0);const l=o?"ForOfStatement":"ForInStatement";return this.checkLVal(a,{type:l}),this.parseForIn(t,a,e)}else this.checkExpressionErrors(n,!0);return e!==null&&this.unexpected(e),this.parseFor(t,a)}parseFunctionStatement(t,e,s){return this.next(),this.parseFunction(t,1|(s?2:0)|(e?8:0))}parseIfStatement(t){return this.next(),t.test=this.parseHeaderExpression(),t.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),t.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(t,"IfStatement")}parseReturnStatement(t){return!this.prodParam.hasReturn&&!this.options.allowReturnOutsideFunction&&this.raise(w.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")}parseSwitchStatement(t){this.next(),t.discriminant=this.parseHeaderExpression();const e=t.cases=[];this.expect(5),this.state.labels.push(hd),this.scope.enter(0);let s;for(let r;!this.match(8);)if(this.match(61)||this.match(65)){const n=this.match(61);s&&this.finishNode(s,"SwitchCase"),e.push(s=this.startNode()),s.consequent=[],this.next(),n?s.test=this.parseExpression():(r&&this.raise(w.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),r=!0,s.test=null),this.expect(14)}else s?s.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),s&&this.finishNode(s,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(t,"SwitchStatement")}parseThrowStatement(t){return this.next(),this.hasPrecedingLineBreak()&&this.raise(w.NewlineAfterThrow,this.state.lastTokEndLoc),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")}parseCatchClauseParam(){const t=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&t.type==="Identifier"?8:0),this.checkLVal(t,{type:"CatchClause"},9),t}parseTryStatement(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.match(62)){const e=this.startNode();this.next(),this.match(10)?(this.expect(10),e.param=this.parseCatchClauseParam(),this.expect(11)):(e.param=null,this.scope.enter(0)),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(67)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(w.NoCatchOrFinally,t),this.finishNode(t,"TryStatement")}parseVarStatement(t,e,s=!1){return this.next(),this.parseVar(t,!1,e,s),this.semicolon(),this.finishNode(t,"VariableDeclaration")}parseWhileStatement(t){return this.next(),t.test=this.parseHeaderExpression(),this.state.labels.push(tn),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(t,"WhileStatement")}parseWithStatement(t){return this.state.strict&&this.raise(w.StrictWith,this.state.startLoc),this.next(),t.object=this.parseHeaderExpression(),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(t,"WithStatement")}parseEmptyStatement(t){return this.next(),this.finishNode(t,"EmptyStatement")}parseLabeledStatement(t,e,s,r){for(const a of this.state.labels)a.name===e&&this.raise(w.LabelRedeclaration,s,{labelName:e});const n=tp(this.state.type)?1:this.match(71)?2:null;for(let a=this.state.labels.length-1;a>=0;a--){const o=this.state.labels[a];if(o.statementStart===t.start)o.statementStart=this.state.start,o.kind=n;else break}return this.state.labels.push({name:e,kind:n,statementStart:this.state.start}),t.body=r&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),t.label=s,this.finishNode(t,"LabeledStatement")}parseExpressionStatement(t,e,s){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")}parseBlock(t=!1,e=!0,s){const r=this.startNode();return t&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(r,t,!1,8,s),e&&this.scope.exit(),this.finishNode(r,"BlockStatement")}isValidDirective(t){return t.type==="ExpressionStatement"&&t.expression.type==="StringLiteral"&&!t.expression.extra.parenthesized}parseBlockBody(t,e,s,r,n){const a=t.body=[],o=t.directives=[];this.parseBlockOrModuleBlockBody(a,e?o:void 0,s,r,n)}parseBlockOrModuleBlockBody(t,e,s,r,n){const a=this.state.strict;let o=!1,l=!1;for(;!this.match(r);){const h=s?this.parseModuleItem():this.parseStatementListItem();if(e&&!l){if(this.isValidDirective(h)){const u=this.stmtToDirective(h);e.push(u),!o&&u.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}l=!0,this.state.strictErrors.clear()}t.push(h)}n==null||n.call(this,o),a||this.setStrict(!1),this.next()}parseFor(t,e){return t.init=e,this.semicolon(!1),t.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),t.update=this.match(11)?null:this.parseExpression(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,"ForStatement")}parseForIn(t,e,s){const r=this.match(58);return this.next(),r?s!==null&&this.unexpected(s):t.await=s!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!r||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(w.ForInOfLoopInitializer,e,{type:r?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(w.InvalidLhs,e,{ancestor:{type:"ForStatement"}}),t.left=e,t.right=r?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,r?"ForInStatement":"ForOfStatement")}parseVar(t,e,s,r=!1){const n=t.declarations=[];for(t.kind=s;;){const a=this.startNode();if(this.parseVarId(a,s),a.init=this.eat(29)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,a.init===null&&!r&&(a.id.type!=="Identifier"&&!(e&&(this.match(58)||this.isContextual(102)))?this.raise(w.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(s==="const"||s==="using"||s==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(w.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:s})),n.push(this.finishNode(a,"VariableDeclarator")),!this.eat(12))break}return t}parseVarId(t,e){const s=this.parseBindingAtom();(e==="using"||e==="await using")&&(s.type==="ArrayPattern"||s.type==="ObjectPattern")&&this.raise(w.UsingDeclarationHasBindingPattern,s.loc.start),this.checkLVal(s,{type:"VariableDeclarator"},e==="var"?5:8201),t.id=s}parseAsyncFunctionExpression(t){return this.parseFunction(t,8)}parseFunction(t,e=0){const s=e&2,r=!!(e&1),n=r&&!(e&4),a=!!(e&8);this.initFunction(t,a),this.match(55)&&(s&&this.raise(w.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),t.generator=!0),r&&(t.id=this.parseFunctionId(n));const o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(Zi(a,t.generator)),r||(t.id=this.parseFunctionId()),this.parseFunctionParams(t,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(t,r?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),r&&!s&&this.registerFunctionStatementId(t),this.state.maybeInArrowParameters=o,t}parseFunctionId(t){return t||Me(this.state.type)?this.parseIdentifier():null}parseFunctionParams(t,e){this.expect(10),this.expressionScope.enter(Mp()),t.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(t){!t.id||this.scope.declareName(t.id.name,!this.options.annexB||this.state.strict||t.generator||t.async?this.scope.treatFunctionsAsVar?5:8201:17,t.id.loc.start)}parseClass(t,e,s){this.next();const r=this.state.strict;return this.state.strict=!0,this.parseClassId(t,e,s),this.parseClassSuper(t),t.body=this.parseClassBody(!!t.superClass,r),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(t){return t.type==="Identifier"&&t.name==="constructor"||t.type==="StringLiteral"&&t.value==="constructor"}isNonstaticConstructor(t){return!t.computed&&!t.static&&this.nameIsConstructor(t.key)}parseClassBody(t,e){this.classScope.enter();const s={hadConstructor:!1,hadSuperClass:t};let r=[];const n=this.startNode();if(n.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(r.length>0)throw this.raise(w.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){r.push(this.parseDecorator());continue}const a=this.startNode();r.length&&(a.decorators=r,this.resetStartLocationFromNode(a,r[0]),r=[]),this.parseClassMember(n,a,s),a.kind==="constructor"&&a.decorators&&a.decorators.length>0&&this.raise(w.DecoratorConstructor,a)}}),this.state.strict=e,this.next(),r.length)throw this.raise(w.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(n,"ClassBody")}parseClassMemberFromModifier(t,e){const s=this.parseIdentifier(!0);if(this.isClassMethod()){const r=e;return r.kind="method",r.computed=!1,r.key=s,r.static=!1,this.pushClassMethod(t,r,!1,!1,!1,!1),!0}else if(this.isClassProperty()){const r=e;return r.computed=!1,r.key=s,r.static=!1,t.body.push(this.parseClassProperty(r)),!0}return this.resetPreviousNodeTrailingComments(s),!1}parseClassMember(t,e,s){const r=this.isContextual(106);if(r){if(this.parseClassMemberFromModifier(t,e))return;if(this.eat(5)){this.parseClassStaticBlock(t,e);return}}this.parseClassMemberWithIsStatic(t,e,s,r)}parseClassMemberWithIsStatic(t,e,s,r){const n=e,a=e,o=e,l=e,h=e,u=n,d=n;if(e.static=r,this.parsePropertyNamePrefixOperator(e),this.eat(55)){u.kind="method";const P=this.match(138);if(this.parseClassElementName(u),P){this.pushClassPrivateMethod(t,a,!0,!1);return}this.isNonstaticConstructor(n)&&this.raise(w.ConstructorIsGenerator,n.key),this.pushClassMethod(t,n,!0,!1,!1,!1);return}const c=!this.state.containsEsc&&Me(this.state.type),f=this.parseClassElementName(e),p=c?f.name:null,m=this.isPrivateName(f),b=this.state.startLoc;if(this.parsePostMemberNameModifiers(d),this.isClassMethod()){if(u.kind="method",m){this.pushClassPrivateMethod(t,a,!1,!1);return}const P=this.isNonstaticConstructor(n);let A=!1;P&&(n.kind="constructor",s.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(w.DuplicateConstructor,f),P&&this.hasPlugin("typescript")&&e.override&&this.raise(w.OverrideOnConstructor,f),s.hadConstructor=!0,A=s.hadSuperClass),this.pushClassMethod(t,n,!1,!1,P,A)}else if(this.isClassProperty())m?this.pushClassPrivateProperty(t,l):this.pushClassProperty(t,o);else if(p==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(f);const P=this.eat(55);d.optional&&this.unexpected(b),u.kind="method";const A=this.match(138);this.parseClassElementName(u),this.parsePostMemberNameModifiers(d),A?this.pushClassPrivateMethod(t,a,P,!0):(this.isNonstaticConstructor(n)&&this.raise(w.ConstructorIsAsync,n.key),this.pushClassMethod(t,n,P,!0,!1,!1))}else if((p==="get"||p==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(f),u.kind=p;const P=this.match(138);this.parseClassElementName(n),P?this.pushClassPrivateMethod(t,a,!1,!1):(this.isNonstaticConstructor(n)&&this.raise(w.ConstructorIsAccessor,n.key),this.pushClassMethod(t,n,!1,!1,!1,!1)),this.checkGetterSetterParams(n)}else if(p==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(f);const P=this.match(138);this.parseClassElementName(o),this.pushClassAccessorProperty(t,h,P)}else this.isLineTerminator()?m?this.pushClassPrivateProperty(t,l):this.pushClassProperty(t,o):this.unexpected()}parseClassElementName(t){const{type:e,value:s}=this.state;if((e===132||e===133)&&t.static&&s==="prototype"&&this.raise(w.StaticPrototype,this.state.startLoc),e===138){s==="constructor"&&this.raise(w.ConstructorClassPrivateField,this.state.startLoc);const r=this.parsePrivateName();return t.key=r,r}return this.parsePropertyName(t),t.key}parseClassStaticBlock(t,e){var s;this.scope.enter(208);const r=this.state.labels;this.state.labels=[],this.prodParam.enter(0);const n=e.body=[];this.parseBlockOrModuleBlockBody(n,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=r,t.body.push(this.finishNode(e,"StaticBlock")),(s=e.decorators)!=null&&s.length&&this.raise(w.DecoratorStaticBlock,e)}pushClassProperty(t,e){!e.computed&&this.nameIsConstructor(e.key)&&this.raise(w.ConstructorClassField,e.key),t.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(t,e){const s=this.parseClassPrivateProperty(e);t.body.push(s),this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),0,s.key.loc.start)}pushClassAccessorProperty(t,e,s){!s&&!e.computed&&this.nameIsConstructor(e.key)&&this.raise(w.ConstructorClassField,e.key);const r=this.parseClassAccessorProperty(e);t.body.push(r),s&&this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.loc.start)}pushClassMethod(t,e,s,r,n,a){t.body.push(this.parseMethod(e,s,r,n,a,"ClassMethod",!0))}pushClassPrivateMethod(t,e,s,r){const n=this.parseMethod(e,s,r,!1,!1,"ClassPrivateMethod",!0);t.body.push(n);const a=n.kind==="get"?n.static?6:2:n.kind==="set"?n.static?5:1:0;this.declareClassPrivateMethodInScope(n,a)}declareClassPrivateMethodInScope(t,e){this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),e,t.key.loc.start)}parsePostMemberNameModifiers(t){}parseClassPrivateProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassPrivateProperty")}parseClassProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassProperty")}parseClassAccessorProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassAccessorProperty")}parseInitializer(t){this.scope.enter(80),this.expressionScope.enter(rc()),this.prodParam.enter(0),t.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(t,e,s,r=8331){if(Me(this.state.type))t.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(t.id,r);else if(s||!e)t.id=null;else throw this.raise(w.MissingClassName,this.state.startLoc)}parseClassSuper(t){t.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(t,e){const s=this.parseMaybeImportPhase(t,!0),r=this.maybeParseExportDefaultSpecifier(t,s),n=!r||this.eat(12),a=n&&this.eatExportStar(t),o=a&&this.maybeParseExportNamespaceSpecifier(t),l=n&&(!o||this.eat(12)),h=r||a;if(a&&!o){if(r&&this.unexpected(),e)throw this.raise(w.UnsupportedDecoratorExport,t);return this.parseExportFrom(t,!0),this.finishNode(t,"ExportAllDeclaration")}const u=this.maybeParseExportNamedSpecifiers(t);r&&n&&!a&&!u&&this.unexpected(null,5),o&&l&&this.unexpected(null,98);let d;if(h||u){if(d=!1,e)throw this.raise(w.UnsupportedDecoratorExport,t);this.parseExportFrom(t,h)}else d=this.maybeParseExportDeclaration(t);if(h||u||d){var c;const f=t;if(this.checkExport(f,!0,!1,!!f.source),((c=f.declaration)==null?void 0:c.type)==="ClassDeclaration")this.maybeTakeDecorators(e,f.declaration,f);else if(e)throw this.raise(w.UnsupportedDecoratorExport,t);return this.finishNode(f,"ExportNamedDeclaration")}if(this.eat(65)){const f=t,p=this.parseExportDefaultExpression();if(f.declaration=p,p.type==="ClassDeclaration")this.maybeTakeDecorators(e,p,f);else if(e)throw this.raise(w.UnsupportedDecoratorExport,t);return this.checkExport(f,!0,!0),this.finishNode(f,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(t){return this.eat(55)}maybeParseExportDefaultSpecifier(t,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e==null?void 0:e.loc.start);const s=e||this.parseIdentifier(!0),r=this.startNodeAtNode(s);return r.exported=s,t.specifiers=[this.finishNode(r,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(t){if(this.isContextual(93)){var e,s;(s=(e=t).specifiers)!=null||(e.specifiers=[]);const r=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),r.exported=this.parseModuleExportName(),t.specifiers.push(this.finishNode(r,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(t){if(this.match(5)){const e=t;e.specifiers||(e.specifiers=[]);const s=e.exportKind==="type";return e.specifiers.push(...this.parseExportSpecifiers(s)),e.source=null,e.declaration=null,this.hasPlugin("importAssertions")&&(e.assertions=[]),!0}return!1}maybeParseExportDeclaration(t){return this.shouldParseExportDeclaration()?(t.specifiers=[],t.source=null,this.hasPlugin("importAssertions")&&(t.assertions=[]),t.declaration=this.parseExportDeclaration(t),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;const t=this.nextTokenInLineStart();return this.isUnparsedContextual(t,"function")}parseExportDefaultExpression(){const t=this.startNode();if(this.match(68))return this.next(),this.parseFunction(t,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(t,13);if(this.match(80))return this.parseClass(t,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(w.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet())throw this.raise(w.UnsupportedDefaultExport,this.state.startLoc);const e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(t){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){const{type:t}=this.state;if(Me(t)){if(t===95&&!this.state.containsEsc||t===100)return!1;if((t===130||t===129)&&!this.state.containsEsc){const{type:r}=this.lookahead();if(Me(r)&&r!==98||r===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;const e=this.nextTokenStart(),s=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||Me(this.state.type)&&s)return!0;if(this.match(65)&&s){const r=this.input.charCodeAt(this.nextTokenStartSince(e+4));return r===34||r===39}return!1}parseExportFrom(t,e){this.eatContextual(98)?(t.source=this.parseImportSource(),this.checkExport(t),this.maybeParseImportAttributes(t),this.checkJSONModuleImport(t)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){const{type:t}=this.state;return t===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(w.DecoratorBeforeExport,this.state.startLoc),!0):this.isContextual(107)?(this.raise(w.UsingDeclarationExport,this.state.startLoc),!0):this.isContextual(96)&&this.startsAwaitUsing()?(this.raise(w.UsingDeclarationExport,this.state.startLoc),!0):t===74||t===75||t===68||t===80||this.isLet()||this.isAsyncFunction()}checkExport(t,e,s,r){if(e){var n;if(s){if(this.checkDuplicateExports(t,"default"),this.hasPlugin("exportDefaultFrom")){var a;const o=t.declaration;o.type==="Identifier"&&o.name==="from"&&o.end-o.start===4&&!((a=o.extra)!=null&&a.parenthesized)&&this.raise(w.ExportDefaultFromAsIdentifier,o)}}else if((n=t.specifiers)!=null&&n.length)for(const o of t.specifiers){const{exported:l}=o,h=l.type==="Identifier"?l.name:l.value;if(this.checkDuplicateExports(o,h),!r&&o.local){const{local:u}=o;u.type!=="Identifier"?this.raise(w.ExportBindingIsString,o,{localName:u.value,exportName:h}):(this.checkReservedWord(u.name,u.loc.start,!0,!1),this.scope.checkLocalExport(u))}}else if(t.declaration){const o=t.declaration;if(o.type==="FunctionDeclaration"||o.type==="ClassDeclaration"){const{id:l}=o;if(!l)throw new Error("Assertion failure");this.checkDuplicateExports(t,l.name)}else if(o.type==="VariableDeclaration")for(const l of o.declarations)this.checkDeclaration(l.id)}}}checkDeclaration(t){if(t.type==="Identifier")this.checkDuplicateExports(t,t.name);else if(t.type==="ObjectPattern")for(const e of t.properties)this.checkDeclaration(e);else if(t.type==="ArrayPattern")for(const e of t.elements)e&&this.checkDeclaration(e);else t.type==="ObjectProperty"?this.checkDeclaration(t.value):t.type==="RestElement"?this.checkDeclaration(t.argument):t.type==="AssignmentPattern"&&this.checkDeclaration(t.left)}checkDuplicateExports(t,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(w.DuplicateDefaultExport,t):this.raise(w.DuplicateExport,t,{exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(t){const e=[];let s=!0;for(this.expect(5);!this.eat(8);){if(s)s=!1;else if(this.expect(12),this.eat(8))break;const r=this.isContextual(130),n=this.match(133),a=this.startNode();a.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(a,n,t,r))}return e}parseExportSpecifier(t,e,s,r){return this.eatContextual(93)?t.exported=this.parseModuleExportName():e?t.exported=$p(t.local):t.exported||(t.exported=zt(t.local)),this.finishNode(t,"ExportSpecifier")}parseModuleExportName(){if(this.match(133)){const t=this.parseStringLiteral(this.state.value),e=fd.exec(t.value);return e&&this.raise(w.ModuleExportNameHasLoneSurrogate,t,{surrogateCharCode:e[0].charCodeAt(0)}),t}return this.parseIdentifier(!0)}isJSONModuleImport(t){return t.assertions!=null?t.assertions.some(({key:e,value:s})=>s.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(t){const{specifiers:e}=t,s=e.length===1?e[0].type:null;if(t.phase==="source")s!=="ImportDefaultSpecifier"&&this.raise(w.SourcePhaseImportRequiresDefault,e[0].loc.start);else if(t.phase==="defer")s!=="ImportNamespaceSpecifier"&&this.raise(w.DeferImportRequiresNamespace,e[0].loc.start);else if(t.module){var r;s!=="ImportDefaultSpecifier"&&this.raise(w.ImportReflectionNotBinding,e[0].loc.start),((r=t.assertions)==null?void 0:r.length)>0&&this.raise(w.ImportReflectionHasAssertion,e[0].loc.start)}}checkJSONModuleImport(t){if(this.isJSONModuleImport(t)&&t.type!=="ExportAllDeclaration"){const{specifiers:e}=t;if(e!=null){const s=e.find(r=>{let n;if(r.type==="ExportSpecifier"?n=r.local:r.type==="ImportSpecifier"&&(n=r.imported),n!==void 0)return n.type==="Identifier"?n.name!=="default":n.value!=="default"});s!==void 0&&this.raise(w.ImportJSONBindingNotDefault,s.loc.start)}}}isPotentialImportPhase(t){return t?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(t,e,s,r){e||(s==="module"?(this.expectPlugin("importReflection",r),t.module=!0):this.hasPlugin("importReflection")&&(t.module=!1),s==="source"?(this.expectPlugin("sourcePhaseImports",r),t.phase="source"):s==="defer"?(this.expectPlugin("deferredImportEvaluation",r),t.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(t.phase=null))}parseMaybeImportPhase(t,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(t,e,null),null;const s=this.parseIdentifier(!0),{type:r}=this.state;return(Pt(r)?r!==98||this.lookaheadCharCode()===102:r!==12)?(this.resetPreviousIdentifierLeadingComments(s),this.applyImportPhase(t,e,s.name,s.loc.start),null):(this.applyImportPhase(t,e,null),s)}isPrecedingIdImportPhase(t){const{type:e}=this.state;return Me(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(t){return this.match(133)?this.parseImportSourceAndAttributes(t):this.parseImportSpecifiersAndAfter(t,this.parseMaybeImportPhase(t,!1))}parseImportSpecifiersAndAfter(t,e){t.specifiers=[];const r=!this.maybeParseDefaultImportSpecifier(t,e)||this.eat(12),n=r&&this.maybeParseStarImportSpecifier(t);return r&&!n&&this.parseNamedImportSpecifiers(t),this.expectContextual(98),this.parseImportSourceAndAttributes(t)}parseImportSourceAndAttributes(t){var e;return(e=t.specifiers)!=null||(t.specifiers=[]),t.source=this.parseImportSource(),this.maybeParseImportAttributes(t),this.checkImportReflection(t),this.checkJSONModuleImport(t),this.semicolon(),this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.match(133)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(t,e,s){e.local=this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(e,s))}finishImportSpecifier(t,e,s=8201){return this.checkLVal(t.local,{type:e},s),this.finishNode(t,e)}parseImportAttributes(){this.expect(5);const t=[],e=new Set;do{if(this.match(8))break;const s=this.startNode(),r=this.state.value;if(e.has(r)&&this.raise(w.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:r}),e.add(r),this.match(133)?s.key=this.parseStringLiteral(r):s.key=this.parseIdentifier(!0),this.expect(14),!this.match(133))throw this.raise(w.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return this.expect(8),t}parseModuleAttributes(){const t=[],e=new Set;do{const s=this.startNode();if(s.key=this.parseIdentifier(!0),s.key.name!=="type"&&this.raise(w.ModuleAttributeDifferentFromType,s.key),e.has(s.key.name)&&this.raise(w.ModuleAttributesWithDuplicateKeys,s.key,{key:s.key.name}),e.add(s.key.name),this.expect(14),!this.match(133))throw this.raise(w.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return t}maybeParseImportAttributes(t){let e;var s=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?e=this.parseModuleAttributes():(this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes"),e=this.parseImportAttributes()),s=!0}else if(this.isContextual(94)&&!this.hasPrecedingLineBreak())this.hasPlugin("importAttributes")?(this.getPluginOption("importAttributes","deprecatedAssertSyntax")!==!0&&this.raise(w.ImportAttributesUseAssert,this.state.startLoc),this.addExtra(t,"deprecatedAssertSyntax",!0)):this.expectOnePlugin(["importAttributes","importAssertions"]),this.next(),e=this.parseImportAttributes();else if(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))e=[];else if(this.hasPlugin("moduleAttributes"))e=[];else return;!s&&this.hasPlugin("importAssertions")?t.assertions=e:t.attributes=e}maybeParseDefaultImportSpecifier(t,e){if(e){const s=this.startNodeAtNode(e);return s.local=e,t.specifiers.push(this.finishImportSpecifier(s,"ImportDefaultSpecifier")),!0}else if(Pt(this.state.type))return this.parseImportSpecifierLocal(t,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(t){if(this.match(55)){const e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(t,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(t){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(w.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}const s=this.startNode(),r=this.match(133),n=this.isContextual(130);s.imported=this.parseModuleExportName();const a=this.parseImportSpecifier(s,r,t.importKind==="type"||t.importKind==="typeof",n,void 0);t.specifiers.push(a)}}parseImportSpecifier(t,e,s,r,n){if(this.eatContextual(93))t.local=this.parseIdentifier();else{const{imported:a}=t;if(e)throw this.raise(w.ImportBindingIsString,t,{importName:a.value});this.checkReservedWord(a.name,t.loc.start,!0,!0),t.local||(t.local=zt(a))}return this.finishImportSpecifier(t,"ImportSpecifier",n)}isThisParam(t){return t.type==="Identifier"&&t.name==="this"}}class cc extends dd{constructor(t,e,s){t=cd(t),super(t,e),this.options=t,this.initializeScopes(),this.plugins=s,this.filename=t.sourceFilename}getScopeHandler(){return la}parse(){this.enterInitialScopes();const t=this.startNode(),e=this.startNode();return this.nextToken(),t.errors=null,this.parseTopLevel(t,e),t.errors=this.state.errors,t.comments.length=this.state.commentsLen,t}}function md(i,t){var e;if(((e=t)==null?void 0:e.sourceType)==="unambiguous"){t=Object.assign({},t);try{t.sourceType="module";const s=ni(t,i),r=s.parse();if(s.sawUnambiguousESM)return r;if(s.ambiguousScriptDifferentAst)try{return t.sourceType="script",ni(t,i).parse()}catch{}else r.program.sourceType="script";return r}catch(s){try{return t.sourceType="script",ni(t,i).parse()}catch{}throw s}}else return ni(t,i).parse()}function yd(i,t){const e=ni(t,i);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function gd(i){const t={};for(const e of Object.keys(i))t[e]=Bt(i[e]);return t}const Td=gd(Yf);function ni(i,t){let e=cc;const s=new Map;if(i!=null&&i.plugins){for(const r of i.plugins){let n,a;typeof r=="string"?n=r:[n,a]=r,s.has(n)||s.set(n,a||{})}od(s),e=bd(s)}return new e(i,t,s)}const Eo=new Map;function bd(i){const t=[];for(const r of ld)i.has(r)&&t.push(r);const e=t.join("|");let s=Eo.get(e);if(!s){s=cc;for(const r of t)s=lc[r](s);Eo.set(e,s)}return s}var xd=kr.parse=md;kr.parseExpression=yd;kr.tokTypes=Td;var _i={},hs={},gt={};Object.defineProperty(gt,"__esModule",{value:!0});function uc(i){return{type:"concat",parts:i}}gt.concat=uc;function Sd(i,t){const e=[];return t.forEach((s,r)=>{r>0&&e.push(i),e.push(s)}),uc(e)}gt.join=Sd;gt.line={type:"line",hard:!1,soft:!1};gt.hardline={type:"line",hard:!0,soft:!1};gt.softline={type:"line",hard:!1,soft:!0};function Pd(i){return{type:"indent",content:i}}gt.indent=Pd;function Ed(i){return{type:"lineSuffix",content:i}}gt.lineSuffix=Ed;function Ad(i,t=!1){return{type:"group",content:i,willBreak:t}}gt.group=Ad;gt.breakParent={type:"breakParent"};function wd(i){return typeof i=="string"&&i.length===0}gt.isEmpty=wd;var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});function Cd(i){return i.range[0]}Ye.locStart=Cd;function kd(i){return i.range[1]}Ye.locEnd=kd;function vd(i){if(!i||typeof i.type!="string")return!1;switch(i.type){case"LabelStatement":case"BreakStatement":case"GotoStatement":case"ReturnStatement":case"IfStatement":case"IfClause":case"ElseifClause":case"ElseClause":case"WhileStatement":case"DoStatement":case"RepeatStatement":case"LocalStatement":case"AssignmentStatement":case"CallStatement":case"FunctionDeclaration":case"ForNumericStatement":case"ForGenericStatement":case"Chunk":case"Identifier":case"BooleanLiteral":case"NilLiteral":case"NumericLiteral":case"StringLiteral":case"VarargLiteral":case"TableKey":case"TableKeyString":case"TableValue":case"TableConstructorExpression":case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"MemberExpression":case"IndexExpression":case"CallExpression":case"TableCallExpression":case"StringCallExpression":case"Comment":return!0;default:return!1}}Ye.isNode=vd;function ha(i,t,e,s={}){let r=0;return e.forEach(n=>{if((s.searchBackwards?i.substring(t-n.length,t):i.substring(t,t+n.length))===n){r=n.length;return}}),t+(s.searchBackwards?-r:r)}Ye.skipOnce=ha;function fa(i,t,e,s={}){let r=null;for(;r!==t;)r=t,t=ha(i,t,e,s);return t}Ye.skipMany=fa;function wi(i,t,e={}){return ha(i,t,[` +`):n=String.fromCharCode(s),++this.state.curLine,this.state.lineStart=this.state.pos,n}jsxReadString(e){let s="",n=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(w.UnterminatedString,this.state.startLoc);const r=this.input.charCodeAt(this.state.pos);if(r===e)break;r===38?(s+=this.input.slice(n,this.state.pos),s+=this.jsxReadEntity(),n=this.state.pos):Vs(r)?(s+=this.input.slice(n,this.state.pos),s+=this.jsxReadNewLine(!1),n=this.state.pos):++this.state.pos}s+=this.input.slice(n,this.state.pos++),this.finishToken(133,s)}jsxReadEntity(){const e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let s=10;this.codePointAtPos(this.state.pos)===120&&(s=16,++this.state.pos);const n=this.readInt(s,void 0,!1,"bail");if(n!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(n)}else{let s=0,n=!1;for(;s++<10&&this.state.pos1){for(let n=0;n0){if(s&256){const r=!!(s&512),a=(n&4)>0;return r!==a}return!0}return s&128&&(n&8)>0?t.names.get(e)&2?!!(s&1):!1:s&2&&(n&1)>0?!0:super.isRedeclaredInScope(t,e,s)}checkLocalExport(t){const{name:e}=t;if(this.hasImport(e))return;const s=this.scopeStack.length;for(let n=s-1;n>=0;n--){const a=this.scopeStack[n].tsNames.get(e);if((a&1)>0||(a&16)>0)return}super.checkLocalExport(t)}}const rc=i=>i.type==="ParenthesizedExpression"?rc(i.expression):i;class Yp extends jp{toAssignable(t,e=!1){var s,n;let r;switch((t.type==="ParenthesizedExpression"||(s=t.extra)!=null&&s.parenthesized)&&(r=rc(t),e?r.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(w.InvalidParenthesizedAssignment,t):r.type!=="MemberExpression"&&!this.isOptionalMemberExpression(r)&&this.raise(w.InvalidParenthesizedAssignment,t):this.raise(w.InvalidParenthesizedAssignment,t)),t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern";for(let o=0,l=t.properties.length,h=l-1;on.type!=="ObjectMethod"&&(r===s||n.type!=="SpreadElement")&&this.isAssignable(n))}case"ObjectProperty":return this.isAssignable(t.value);case"SpreadElement":return this.isAssignable(t.argument);case"ArrayExpression":return t.elements.every(s=>s===null||this.isAssignable(s));case"AssignmentExpression":return t.operator==="=";case"ParenthesizedExpression":return this.isAssignable(t.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(t,e){return t}toReferencedListDeep(t,e){this.toReferencedList(t,e);for(const s of t)(s==null?void 0:s.type)==="ArrayExpression"&&this.toReferencedListDeep(s.elements)}parseSpread(t){const e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(t,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){const t=this.startNode();return this.next(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{const t=this.startNode();return this.next(),t.elements=this.parseBindingList(3,93,1),this.finishNode(t,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(t,e,s){const n=s&1,r=[];let a=!0;for(;!this.eat(t);)if(a?a=!1:this.expect(12),n&&this.match(12))r.push(null);else{if(this.eat(t))break;if(this.match(21)){let o=this.parseRestBinding();if((this.hasPlugin("flow")||s&2)&&(o=this.parseFunctionParamType(o)),r.push(o),!this.checkCommaAfterRest(e)){this.expect(t);break}}else{const o=[];for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(w.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)o.push(this.parseDecorator());r.push(this.parseAssignableListItem(s,o))}}return r}parseBindingRestProperty(t){return this.next(),t.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(t,"RestElement")}parseBindingProperty(){const{type:t,startLoc:e}=this.state;if(t===21)return this.parseBindingRestProperty(this.startNode());const s=this.startNode();return t===138?(this.expectPlugin("destructuringPrivate",e),this.classScope.usePrivateName(this.state.value,e),s.key=this.parsePrivateName()):this.parsePropertyName(s),s.method=!1,this.parseObjPropValue(s,e,!1,!1,!0,!1)}parseAssignableListItem(t,e){const s=this.parseMaybeDefault();(this.hasPlugin("flow")||t&2)&&this.parseFunctionParamType(s);const n=this.parseMaybeDefault(s.loc.start,s);return e.length&&(s.decorators=e),n}parseFunctionParamType(t){return t}parseMaybeDefault(t,e){var s,n;if((s=t)!=null||(t=this.state.startLoc),e=(n=e)!=null?n:this.parseBindingAtom(),!this.eat(29))return e;const r=this.startNodeAt(t);return r.left=e,r.right=this.parseMaybeAssignAllowIn(),this.finishNode(r,"AssignmentPattern")}isValidLVal(t,e,s){switch(t){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties"}return!1}isOptionalMemberExpression(t){return t.type==="OptionalMemberExpression"}checkLVal(t,e,s=64,n=!1,r=!1,a=!1){var o;const l=t.type;if(this.isObjectMethod(t))return;const h=this.isOptionalMemberExpression(t);if(h||l==="MemberExpression"){h&&(this.expectPlugin("optionalChainingAssign",t.loc.start),e.type!=="AssignmentExpression"&&this.raise(w.InvalidLhsOptionalChaining,t,{ancestor:e})),s!==64&&this.raise(w.InvalidPropertyBindingPattern,t);return}if(l==="Identifier"){this.checkIdentifier(t,s,r);const{name:m}=t;n&&(n.has(m)?this.raise(w.ParamDupe,t):n.add(m));return}const u=this.isValidLVal(l,!(a||(o=t.extra)!=null&&o.parenthesized)&&e.type==="AssignmentExpression",s);if(u===!0)return;if(u===!1){const m=s===64?w.InvalidLhs:w.InvalidLhsBinding;this.raise(m,t,{ancestor:e});return}let d,c;typeof u=="string"?(d=u,c=l==="ParenthesizedExpression"):[d,c]=u;const f=l==="ArrayPattern"||l==="ObjectPattern"?{type:l}:e,p=t[d];if(Array.isArray(p))for(const m of p)m&&this.checkLVal(m,f,s,n,r,c);else p&&this.checkLVal(p,f,s,n,r,c)}checkIdentifier(t,e,s=!1){this.state.strict&&(s?Ql(t.name,this.inModule):Zl(t.name))&&(e===64?this.raise(w.StrictEvalArguments,t,{referenceName:t.name}):this.raise(w.StrictEvalArgumentsBinding,t,{bindingName:t.name})),e&8192&&t.name==="let"&&this.raise(w.LetInLexicalBinding,t),e&64||this.declareNameFromIdentifier(t,e)}declareNameFromIdentifier(t,e){this.scope.declareName(t.name,e,t.loc.start)}checkToRestConversion(t,e){switch(t.type){case"ParenthesizedExpression":this.checkToRestConversion(t.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(w.InvalidRestAssignmentPattern,t)}}checkCommaAfterRest(t){return this.match(12)?(this.raise(this.lookaheadCharCode()===t?w.RestTrailingComma:w.ElementAfterRest,this.state.startLoc),!0):!1}}function Zp(i){if(i==null)throw new Error(`Unexpected ${i} value.`);return i}function To(i){if(!i)throw new Error("Assert fail")}const he=Gt`typescript`({AbstractMethodHasImplementation:({methodName:i})=>`Method '${i}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:i})=>`Property '${i}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:i})=>`'declare' is not allowed in ${i}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:i})=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:i})=>`Duplicate modifier: '${i}'.`,EmptyHeritageClauseType:({token:i})=>`'${i}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:i})=>`'${i[0]}' modifier cannot be used with '${i[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:i})=>`Index signatures cannot have an accessibility modifier ('${i}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:({modifier:i})=>`'${i}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:i})=>`'${i}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:i})=>`'${i}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:i})=>`'${i[0]}' modifier must precede '${i[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:i})=>`Private elements cannot have an accessibility modifier ('${i}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:i})=>`Single type parameter ${i} should have a trailing comma. Example usage: <${i},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:i})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${i}.`});function Qp(i){switch(i){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function bo(i){return i==="private"||i==="public"||i==="protected"}function ed(i){return i==="in"||i==="out"}var td=i=>class extends i{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:he.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:he.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:he.InvalidModifierOnTypeParameter})}getScopeHandler(){return Xp}tsIsIdentifier(){return Me(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(138)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,s){if(!Me(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;const n=this.state.value;if(e.includes(n)){if(s&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return n}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:s,stopOnStartOfClassStaticBlock:n,errorTemplate:r=he.InvalidModifierOnTypeMember},a){const o=(h,u,d,c)=>{u===d&&a[c]&&this.raise(he.InvalidModifiersOrder,h,{orderedModifiers:[d,c]})},l=(h,u,d,c)=>{(a[d]&&u===c||a[c]&&u===d)&&this.raise(he.IncompatibleModifiers,h,{modifiers:[d,c]})};for(;;){const{startLoc:h}=this.state,u=this.tsParseModifier(e.concat(s!=null?s:[]),n);if(!u)break;bo(u)?a.accessibility?this.raise(he.DuplicateAccessibilityModifier,h,{modifier:u}):(o(h,u,u,"override"),o(h,u,u,"static"),o(h,u,u,"readonly"),a.accessibility=u):ed(u)?(a[u]&&this.raise(he.DuplicateModifier,h,{modifier:u}),a[u]=!0,o(h,u,"in","out")):(hasOwnProperty.call(a,u)?this.raise(he.DuplicateModifier,h,{modifier:u}):(o(h,u,"static","readonly"),o(h,u,"static","override"),o(h,u,"override","readonly"),o(h,u,"abstract","override"),l(h,u,"declare","override"),l(h,u,"static","abstract")),a[u]=!0),s!=null&&s.includes(u)&&this.raise(r,h,{modifier:u})}}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(e,s){const n=[];for(;!this.tsIsListTerminator(e);)n.push(s());return n}tsParseDelimitedList(e,s,n){return Zp(this.tsParseDelimitedListWorker(e,s,!0,n))}tsParseDelimitedListWorker(e,s,n,r){const a=[];let o=-1;for(;!this.tsIsListTerminator(e);){o=-1;const l=s();if(l==null)return;if(a.push(l),this.eat(12)){o=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;n&&this.expect(12);return}return r&&(r.value=o),a}tsParseBracketedList(e,s,n,r,a){r||(n?this.expect(0):this.expect(47));const o=this.tsParseDelimitedList(e,s,a);return n?this.expect(3):this.expect(48),o}tsParseImportType(){const e=this.startNode();return this.expect(83),this.expect(10),this.match(133)||this.raise(he.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=super.parseExprAtom(),(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))&&(e.options=null),this.eat(12)&&(this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes"),this.match(11)||(e.options=super.parseMaybeAssignAllowIn(),this.eat(12))),this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName()),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseEntityName(e=!0){let s=this.parseIdentifier(e);for(;this.eat(16);){const n=this.startNodeAtNode(s);n.left=s,n.right=this.parseIdentifier(e),s=this.finishNode(n,"TSQualifiedName")}return s}tsParseTypeReference(){const e=this.startNode();return e.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();const s=this.startNodeAtNode(e);return s.parameterName=e,s.typeAnnotation=this.tsParseTypeAnnotation(!1),s.asserts=!1,this.finishNode(s,"TSTypePredicate")}tsParseThisTypeNode(){const e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){const e=this.startNode();return this.expect(87),this.match(83)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseTypeParameter(e){const s=this.startNode();return e(s),s.name=this.tsParseTypeParameterName(),s.constraint=this.tsEatThenParseType(81),s.default=this.tsEatThenParseType(29),this.finishNode(s,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){const s=this.startNode();this.match(47)||this.match(142)?this.next():this.unexpected();const n={value:-1};return s.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,n),s.params.length===0&&this.raise(he.EmptyTypeParameters,s),n.value!==-1&&this.addExtra(s,"trailingComma",n.value),this.finishNode(s,"TSTypeParameterDeclaration")}tsFillSignature(e,s){const n=e===19,r="parameters",a="typeAnnotation";s.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),s[r]=this.tsParseBindingListForSignature(),n?s[a]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(s[a]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){const e=super.parseBindingList(11,41,2);for(const s of e){const{type:n}=s;(n==="AssignmentPattern"||n==="TSParameterProperty")&&this.raise(he.UnsupportedSignatureParameterKind,s,{type:n})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,s){return this.tsFillSignature(14,s),this.tsParseTypeMemberSemicolon(),this.finishNode(s,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),Me(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);const s=this.parseIdentifier();s.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(s),this.expect(3),e.parameters=[s];const n=this.tsTryParseTypeAnnotation();return n&&(e.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,s){this.eat(17)&&(e.optional=!0);const n=e;if(this.match(10)||this.match(47)){s&&this.raise(he.ReadonlyForMethodSignature,e);const r=n;r.kind&&this.match(47)&&this.raise(he.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,r),this.tsParseTypeMemberSemicolon();const a="parameters",o="typeAnnotation";if(r.kind==="get")r[a].length>0&&(this.raise(w.BadGetterArity,this.state.curPosition()),this.isThisParam(r[a][0])&&this.raise(he.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(r.kind==="set"){if(r[a].length!==1)this.raise(w.BadSetterArity,this.state.curPosition());else{const l=r[a][0];this.isThisParam(l)&&this.raise(he.AccessorCannotDeclareThisParameter,this.state.curPosition()),l.type==="Identifier"&&l.optional&&this.raise(he.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),l.type==="RestElement"&&this.raise(he.SetAccessorCannotHaveRestParameter,this.state.curPosition())}r[o]&&this.raise(he.SetAccessorCannotHaveReturnType,r[o])}else r.kind="method";return this.finishNode(r,"TSMethodSignature")}else{const r=n;s&&(r.readonly=!0);const a=this.tsTryParseTypeAnnotation();return a&&(r.typeAnnotation=a),this.tsParseTypeMemberSemicolon(),this.finishNode(r,"TSPropertySignature")}}tsParseTypeMember(){const e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){const n=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(n,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e);const s=this.tsTryParseIndexSignature(e);return s||(super.parsePropertyName(e),!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){const e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);const e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),e}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedType(){const e=this.startNode();this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(e.readonly=!0),this.expect(0);{const s=this.startNode();s.name=this.tsParseTypeParameterName(),s.constraint=this.tsExpectThenParseType(58),e.typeParameter=this.finishNode(s,"TSTypeParameter")}return e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){const e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let s=!1;return e.elementTypes.forEach(n=>{const{type:r}=n;s&&r!=="TSRestType"&&r!=="TSOptionalType"&&!(r==="TSNamedTupleMember"&&n.optional)&&this.raise(he.OptionalTypeBeforeRequired,n),s||(s=r==="TSNamedTupleMember"&&n.optional||r==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){const{startLoc:e}=this.state,s=this.eat(21);let n,r,a,o;const h=Pt(this.state.type)?this.lookaheadCharCode():null;if(h===58)n=!0,a=!1,r=this.parseIdentifier(!0),this.expect(14),o=this.tsParseType();else if(h===63){a=!0;const u=this.state.startLoc,d=this.state.value,c=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(n=!0,r=this.createIdentifier(this.startNodeAt(u),d),this.expect(17),this.expect(14),o=this.tsParseType()):(n=!1,o=c,this.expect(17))}else o=this.tsParseType(),a=this.eat(17),n=this.eat(14);if(n){let u;r?(u=this.startNodeAtNode(r),u.optional=a,u.label=r,u.elementType=o,this.eat(17)&&(u.optional=!0,this.raise(he.TupleOptionalAfterType,this.state.lastTokStartLoc))):(u=this.startNodeAtNode(o),u.optional=a,this.raise(he.InvalidTupleMemberLabel,o),u.label=o,u.elementType=this.tsParseType()),o=this.finishNode(u,"TSNamedTupleMember")}else if(a){const u=this.startNodeAtNode(o);u.typeAnnotation=o,o=this.finishNode(u,"TSOptionalType")}if(s){const u=this.startNodeAt(e);u.typeAnnotation=o,o=this.finishNode(u,"TSRestType")}return o}tsParseParenthesizedType(){const e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,s){const n=this.startNode();return e==="TSConstructorType"&&(n.abstract=!!s,s&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,n)),this.finishNode(n,e)}tsParseLiteralTypeNode(){const e=this.startNode();switch(this.state.type){case 134:case 135:case 133:case 85:case 86:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){const e=this.startNode();return e.literal=super.parseTemplate(!1),this.finishNode(e,"TSLiteralType")}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){const e=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 133:case 134:case 135:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){const e=this.startNode(),s=this.lookahead();return s.type!==134&&s.type!==135&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{const{type:e}=this.state;if(Me(e)||e===88||e===84){const s=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":Qp(this.state.value);if(s!==void 0&&this.lookaheadCharCode()!==46){const n=this.startNode();return this.next(),this.finishNode(n,s)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let e=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){const s=this.startNodeAtNode(e);s.elementType=e,this.expect(3),e=this.finishNode(s,"TSArrayType")}else{const s=this.startNodeAtNode(e);s.objectType=e,s.indexType=this.tsParseType(),this.expect(3),e=this.finishNode(s,"TSIndexedAccessType")}return e}tsParseTypeOperator(){const e=this.startNode(),s=this.state.value;return this.next(),e.operator=s,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),s==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(he.UnexpectedReadonly,e)}}tsParseInferType(){const e=this.startNode();this.expectContextual(115);const s=this.startNode();return s.name=this.tsParseTypeParameterName(),s.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(s,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){const e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){return rp(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,s,n){const r=this.startNode(),a=this.eat(n),o=[];do o.push(s());while(this.eat(n));return o.length===1&&!a?o[0]:(r.types=o,this.finishNode(r,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(Me(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){const{errors:e}=this.state,s=e.length;try{return this.parseObjectLike(8,!0),e.length===s}catch{return!1}}if(this.match(0)){this.next();const{errors:e}=this.state,s=e.length;try{return super.parseBindingList(3,93,1),e.length===s}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{const s=this.startNode();this.expect(e);const n=this.startNode(),r=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(r&&this.match(78)){let l=this.tsParseThisTypeOrThisTypePredicate();return l.type==="TSThisType"?(n.parameterName=l,n.asserts=!0,n.typeAnnotation=null,l=this.finishNode(n,"TSTypePredicate")):(this.resetStartLocationFromNode(l,n),l.asserts=!0),s.typeAnnotation=l,this.finishNode(s,"TSTypeAnnotation")}const a=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!a)return r?(n.parameterName=this.parseIdentifier(),n.asserts=r,n.typeAnnotation=null,s.typeAnnotation=this.finishNode(n,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,s);const o=this.tsParseTypeAnnotation(!1);return n.parameterName=a,n.typeAnnotation=o,n.asserts=r,s.typeAnnotation=this.finishNode(n,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){const e=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;const e=this.state.containsEsc;return this.next(),!Me(this.state.type)&&!this.match(78)?!1:(e&&this.raise(w.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,s=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),s.typeAnnotation=this.tsParseType()}),this.finishNode(s,"TSTypeAnnotation")}tsParseType(){To(this.state.inType);const e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;const s=this.startNodeAtNode(e);return s.checkType=e,s.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),s.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),s.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(s,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.lookahead().type===77}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(he.ReservedTypeAssertion,this.state.startLoc);const e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){const s=this.state.startLoc,n=this.tsParseDelimitedList("HeritageClauseElement",()=>{const r=this.startNode();return r.expression=this.tsParseEntityName(),this.match(47)&&(r.typeParameters=this.tsParseTypeArguments()),this.finishNode(r,"TSExpressionWithTypeArguments")});return n.length||this.raise(he.EmptyHeritageClauseType,s,{token:e}),n}tsParseInterfaceDeclaration(e,s={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),s.declare&&(e.declare=!0),Me(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(he.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));const n=this.startNode();return n.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(n,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookahead().type!==16){const s=this.startNode();return this.next(),this.finishNode(s,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInNoContext(e){const s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}tsInType(e){const s=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=s}}tsInDisallowConditionalTypesContext(e){const s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsInAllowConditionalTypesContext(e){const s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){const e=this.startNode();return e.id=this.match(133)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,s={}){return s.const&&(e.const=!0),s.declare&&(e.declare=!0),this.expectContextual(126),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumDeclaration")}tsParseModuleBlock(){const e=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,s=!1){if(e.id=this.parseIdentifier(),s||this.checkIdentifier(e.id,1024),this.eat(16)){const n=this.startNode();this.tsParseModuleOrNamespaceDeclaration(n,!0),e.body=n}else this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(112)?(e.global=!0,e.id=this.parseIdentifier()):this.match(133)?e.id=super.parseStringLiteral(this.state.value):this.unexpected(),this.match(5)?(this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,s,n){e.isExport=n||!1,e.id=s||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);const r=this.tsParseModuleReference();return e.importKind==="type"&&r.type!=="TSExternalModuleReference"&&this.raise(he.ImportAliasHasImportType,r),e.moduleReference=r,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsParseExternalModuleReference(){const e=this.startNode();return this.expectContextual(119),this.expect(10),this.match(133)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){const s=this.state.clone(),n=e();return this.state=s,n}tsTryParseAndCatch(e){const s=this.tryParse(n=>e()||n());if(!(s.aborted||!s.node))return s.error&&(this.state=s.failState),s.node}tsTryParse(e){const s=this.state.clone(),n=e();if(n!==void 0&&n!==!1)return n;this.state=s}tsTryParseDeclare(e){if(this.isLineTerminator())return;let s=this.state.type,n;return this.isContextual(100)&&(s=74,n="let"),this.tsInAmbientContext(()=>{switch(s){case 68:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 80:return e.declare=!0,this.parseClass(e,!0,!1);case 126:return this.tsParseEnumDeclaration(e,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(e);case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,n||this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 129:{const r=this.tsParseInterfaceDeclaration(e,{declare:!0});if(r)return r}default:if(Me(s))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,s,n){switch(s.name){case"declare":{const r=this.tsTryParseDeclare(e);return r&&(r.declare=!0),r}case"global":if(this.match(5)){this.scope.enter(256),this.prodParam.enter(0);const r=e;return r.global=!0,r.id=s,r.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(r,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,s.name,!1,n)}}tsParseDeclaration(e,s,n,r){switch(s){case"abstract":if(this.tsCheckLineTerminator(n)&&(this.match(80)||Me(this.state.type)))return this.tsParseAbstractDeclaration(e,r);break;case"module":if(this.tsCheckLineTerminator(n)){if(this.match(133))return this.tsParseAmbientExternalModuleDeclaration(e);if(Me(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(n)&&Me(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(n)&&Me(this.state.type))return this.tsParseTypeAliasDeclaration(e);break}}tsCheckLineTerminator(e){return e?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(47))return;const s=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;const n=this.tsTryParseAndCatch(()=>{const r=this.startNodeAt(e);return r.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(r),r.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),r});if(this.state.maybeInArrowParameters=s,!!n)return super.parseArrowExpression(n,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){const e=this.startNode();return e.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),e.params.length===0?this.raise(he.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===Be.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return ap(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseAssignableListItem(e,s){const n=this.state.startLoc,r={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},r);const a=r.accessibility,o=r.override,l=r.readonly;!(e&4)&&(a||l||o)&&this.raise(he.UnexpectedParameterModifier,n);const h=this.parseMaybeDefault();e&2&&this.parseFunctionParamType(h);const u=this.parseMaybeDefault(h.loc.start,h);if(a||l||o){const d=this.startNodeAt(n);return s.length&&(d.decorators=s),a&&(d.accessibility=a),l&&(d.readonly=l),o&&(d.override=o),u.type!=="Identifier"&&u.type!=="AssignmentPattern"&&this.raise(he.UnsupportedParameterPropertyKind,d),d.parameter=u,this.finishNode(d,"TSParameterProperty")}return s.length&&(h.decorators=s),u}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(const s of e.params)s.type!=="Identifier"&&s.optional&&!this.state.isAmbientContext&&this.raise(he.PatternIsOptional,s)}setArrowFunctionParameters(e,s,n){super.setArrowFunctionParameters(e,s,n),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,s,n=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));const r=s==="FunctionDeclaration"?"TSDeclareFunction":s==="ClassMethod"||s==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return r&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,r):r==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(he.DeclareFunctionHasImplementation,e),e.declare)?super.parseFunctionBodyAndFinish(e,r,n):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,s,n))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(s=>{(s==null?void 0:s.type)==="TSTypeCastExpression"&&this.raise(he.UnexpectedTypeAnnotation,s.typeAnnotation)})}toReferencedList(e,s){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,s,n,r){const a=super.parseArrayLike(e,s,n,r);return a.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(a.elements),a}parseSubscript(e,s,n,r){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();const o=this.startNodeAt(s);return o.expression=e,this.finishNode(o,"TSNonNullExpression")}let a=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(n)return r.stop=!0,e;r.optionalChainMember=a=!0,this.next()}if(this.match(47)||this.match(51)){let o;const l=this.tsTryParseAndCatch(()=>{if(!n&&this.atPossibleAsyncArrow(e)){const c=this.tsTryParseGenericAsyncArrowFunction(s);if(c)return c}const h=this.tsParseTypeArgumentsInExpression();if(!h)return;if(a&&!this.match(10)){o=this.state.curPosition();return}if(un(this.state.type)){const c=super.parseTaggedTemplateExpression(e,s,r);return c.typeParameters=h,c}if(!n&&this.eat(10)){const c=this.startNodeAt(s);return c.callee=e,c.arguments=this.parseCallExpressionArguments(11,!1),this.tsCheckForInvalidTypeCasts(c.arguments),c.typeParameters=h,r.optionalChainMember&&(c.optional=a),this.finishCallExpression(c,r.optionalChainMember)}const u=this.state.type;if(u===48||u===52||u!==10&&Sr(u)&&!this.hasPrecedingLineBreak())return;const d=this.startNodeAt(s);return d.expression=e,d.typeParameters=h,this.finishNode(d,"TSInstantiationExpression")});if(o&&this.unexpected(o,10),l)return l.type==="TSInstantiationExpression"&&(this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(he.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),l}return super.parseSubscript(e,s,n,r)}parseNewCallee(e){var s;super.parseNewCallee(e);const{callee:n}=e;n.type==="TSInstantiationExpression"&&!((s=n.extra)!=null&&s.parenthesized)&&(e.typeParameters=n.typeParameters,e.callee=n.expression)}parseExprOp(e,s,n){let r;if(Yi(58)>n&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(r=this.isContextual(120)))){const a=this.startNodeAt(s);return a.expression=e,a.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(r&&this.raise(w.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(a,r?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(a,s,n)}return super.parseExprOp(e,s,n)}checkReservedWord(e,s,n,r){this.state.isAmbientContext||super.checkReservedWord(e,s,n,r)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(he.ImportReflectionHasImportType,e.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){const s=this.lookaheadCharCode();return e?s===123||s===42:s!==61}return!e&&this.isContextual(87)}applyImportPhase(e,s,n,r){super.applyImportPhase(e,s,n,r),s?e.exportKind=n==="type"?"type":"value":e.importKind=n==="type"||n==="typeof"?n:"value"}parseImport(e){if(this.match(133))return e.importKind="value",super.parseImport(e);let s;if(Me(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){const n=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,n);s=super.parseImportSpecifiersAndAfter(e,n)}else s=super.parseImport(e);return s.importKind==="type"&&s.specifiers.length>1&&s.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(he.TypeImportCannotSpecifyDefaultAndNamed,s),s}parseExport(e,s){if(this.match(83)){this.next();const n=e;let r=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?r=this.parseMaybeImportPhase(n,!1):n.importKind="value",this.tsParseImportEqualsDeclaration(n,r,!0)}else if(this.eat(29)){const n=e;return n.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(n,"TSExportAssignment")}else if(this.eatContextual(93)){const n=e;return this.expectContextual(128),n.id=this.parseIdentifier(),this.semicolon(),this.finishNode(n,"TSNamespaceExportDeclaration")}else return super.parseExport(e,s)}isAbstractClass(){return this.isContextual(124)&&this.lookahead().type===80}parseExportDefaultExpression(){if(this.isAbstractClass()){const e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(129)){const e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,s,n=!1){const{isAmbientContext:r}=this.state,a=super.parseVarStatement(e,s,n||r);if(!r)return a;for(const{id:o,init:l}of a.declarations)!l||(s!=="const"||!!o.typeAnnotation?this.raise(he.InitializerNotAllowedInAmbientContext,l):id(l,this.hasPlugin("estree"))||this.raise(he.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,l));return a}parseStatementContent(e,s){if(this.match(75)&&this.isLookaheadContextual("enum")){const n=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(n,{const:!0})}if(this.isContextual(126))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(129)){const n=this.tsParseInterfaceDeclaration(this.startNode());if(n)return n}return super.parseStatementContent(e,s)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,s){return s.some(n=>bo(n)?e.accessibility===n:!!e[n])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(e,s,n){const r=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:r,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:he.InvalidModifierOnTypeParameterPositions},s);const a=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(s,r)&&this.raise(he.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,s)):this.parseClassMemberWithIsStatic(e,s,n,!!s.static)};s.declare?this.tsInAmbientContext(a):a()}parseClassMemberWithIsStatic(e,s,n,r){const a=this.tsTryParseIndexSignature(s);if(a){e.body.push(a),s.abstract&&this.raise(he.IndexSignatureHasAbstract,s),s.accessibility&&this.raise(he.IndexSignatureHasAccessibility,s,{modifier:s.accessibility}),s.declare&&this.raise(he.IndexSignatureHasDeclare,s),s.override&&this.raise(he.IndexSignatureHasOverride,s);return}!this.state.inAbstractClass&&s.abstract&&this.raise(he.NonAbstractClassHasAbstractMethod,s),s.override&&(n.hadSuperClass||this.raise(he.OverrideNotInSubClass,s)),super.parseClassMemberWithIsStatic(e,s,n,r)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(he.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(he.ClassMethodHasDeclare,e)}parseExpressionStatement(e,s,n){return(s.type==="Identifier"?this.tsParseExpressionStatement(e,s,n):void 0)||super.parseExpressionStatement(e,s,n)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,s,n){if(!this.state.maybeInArrowParameters||!this.match(17))return super.parseConditional(e,s,n);const r=this.tryParse(()=>super.parseConditional(e,s));return r.node?(r.error&&(this.state=r.failState),r.node):(r.error&&super.setOptionalParametersError(n,r.error),e)}parseParenItem(e,s){const n=super.parseParenItem(e,s);if(this.eat(17)&&(n.optional=!0,this.resetEndLocation(e)),this.match(14)){const r=this.startNodeAt(s);return r.expression=e,r.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(r,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));const s=this.state.startLoc,n=this.eatContextual(125);if(n&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(he.ExpectedAmbientAfterExportDeclare,this.state.startLoc);const a=Me(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return a?((a.type==="TSInterfaceDeclaration"||a.type==="TSTypeAliasDeclaration"||n)&&(e.exportKind="type"),n&&(this.resetStartLocation(a,s),a.declare=!0),a):null}parseClassId(e,s,n,r){if((!s||n)&&this.isContextual(113))return;super.parseClassId(e,s,n,e.declare?1024:8331);const a=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);a&&(e.typeParameters=a)}parseClassPropertyAnnotation(e){e.optional||(this.eat(35)?e.definite=!0:this.eat(17)&&(e.optional=!0));const s=this.tsTryParseTypeAnnotation();s&&(e.typeAnnotation=s)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(he.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){const{key:s}=e;this.raise(he.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:s.type==="Identifier"&&!e.computed?s.name:`[${this.input.slice(s.start,s.end)}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(he.PrivateElementHasAbstract,e),e.accessibility&&this.raise(he.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(he.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,s,n,r,a,o){const l=this.tsTryParseTypeParameters(this.tsParseConstModifier);l&&a&&this.raise(he.ConstructorHasTypeParameters,l);const{declare:h=!1,kind:u}=s;h&&(u==="get"||u==="set")&&this.raise(he.DeclareAccessor,s,{kind:u}),l&&(s.typeParameters=l),super.pushClassMethod(e,s,n,r,a,o)}pushClassPrivateMethod(e,s,n,r){const a=this.tsTryParseTypeParameters(this.tsParseConstModifier);a&&(s.typeParameters=a),super.pushClassPrivateMethod(e,s,n,r)}declareClassPrivateMethodInScope(e,s){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&!hasOwnProperty.call(e.value,"body")||super.declareClassPrivateMethodInScope(e,s))}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual(113)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,s,n,r,a,o,l){const h=this.tsTryParseTypeParameters(this.tsParseConstModifier);return h&&(e.typeParameters=h),super.parseObjPropValue(e,s,n,r,a,o,l)}parseFunctionParams(e,s){const n=this.tsTryParseTypeParameters(this.tsParseConstModifier);n&&(e.typeParameters=n),super.parseFunctionParams(e,s)}parseVarId(e,s){super.parseVarId(e,s),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);const n=this.tsTryParseTypeAnnotation();n&&(e.id.typeAnnotation=n,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,s){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,s)}parseMaybeAssign(e,s){var n,r,a,o,l;let h,u,d;if(this.hasPlugin("jsx")&&(this.match(142)||this.match(47))){if(h=this.state.clone(),u=this.tryParse(()=>super.parseMaybeAssign(e,s),h),!u.error)return u.node;const{context:p}=this.state,m=p[p.length-1];(m===Be.j_oTag||m===Be.j_expr)&&p.pop()}if(!((n=u)!=null&&n.error)&&!this.match(47))return super.parseMaybeAssign(e,s);(!h||h===this.state)&&(h=this.state.clone());let c;const f=this.tryParse(p=>{var m,b;c=this.tsParseTypeParameters(this.tsParseConstModifier);const P=super.parseMaybeAssign(e,s);return(P.type!=="ArrowFunctionExpression"||(m=P.extra)!=null&&m.parenthesized)&&p(),((b=c)==null?void 0:b.params.length)!==0&&this.resetStartLocationFromNode(P,c),P.typeParameters=c,P},h);if(!f.error&&!f.aborted)return c&&this.reportReservedArrowTypeParam(c),f.node;if(!u&&(To(!this.hasPlugin("jsx")),d=this.tryParse(()=>super.parseMaybeAssign(e,s),h),!d.error))return d.node;if((r=u)!=null&&r.node)return this.state=u.failState,u.node;if(f.node)return this.state=f.failState,c&&this.reportReservedArrowTypeParam(c),f.node;if((a=d)!=null&&a.node)return this.state=d.failState,d.node;throw((o=u)==null?void 0:o.error)||f.error||((l=d)==null?void 0:l.error)}reportReservedArrowTypeParam(e){var s;e.params.length===1&&!e.params[0].constraint&&!((s=e.extra)!=null&&s.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(he.ReservedArrowTypeParam,e)}parseMaybeUnary(e,s){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,s)}parseArrow(e){if(this.match(14)){const s=this.tryParse(n=>{const r=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&n(),r});if(s.aborted)return;s.thrown||(s.error&&(this.state=s.failState),e.returnType=s.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(17)&&(e.optional=!0);const s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s),this.resetEndLocation(e),e}isAssignable(e,s){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,s);case"TSParameterProperty":return!0;default:return super.isAssignable(e,s)}}toAssignable(e,s=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,s);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":s?this.expressionScope.recordArrowParameterBindingError(he.UnexpectedTypeCastInParameter,e):this.raise(he.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,s);break;case"AssignmentExpression":!s&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,s)}}toAssignableParenthesizedExpression(e,s){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,s);break;default:super.toAssignable(e,s)}}checkToRestConversion(e,s){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,s)}}isValidLVal(e,s,n){switch(e){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":case"TSInstantiationExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(n!==64||!s)&&["expression",!0];default:return super.isValidLVal(e,s,n)}}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e){if(this.match(47)||this.match(51)){const s=this.tsParseTypeArgumentsInExpression();if(this.match(10)){const n=super.parseMaybeDecoratorArguments(e);return n.typeParameters=s,n}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(e)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(e,s){const n=super.parseMaybeDefault(e,s);return n.type==="AssignmentPattern"&&n.typeAnnotation&&n.right.startthis.isAssignable(s,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(47)||this.match(51)){const s=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());s&&(e.typeParameters=s)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){const s=super.getGetterSetterExpectedParamCount(e),r=this.getObjectOrClassMethodParams(e)[0];return r&&this.isThisParam(r)?s+1:s}parseCatchClauseParam(){const e=super.parseCatchClauseParam(),s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s,this.resetEndLocation(e)),e}tsInAmbientContext(e){const{isAmbientContext:s,strict:n}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=s,this.state.strict=n}}parseClass(e,s,n){const r=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,s,n)}finally{this.state.inAbstractClass=r}}tsParseAbstractDeclaration(e,s){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(s,this.parseClass(e,!0,!1));if(this.isContextual(129)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(he.NonClassMethodPropertyHasAbstractModifer,e),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,s,n,r,a,o,l){const h=super.parseMethod(e,s,n,r,a,o,l);if(h.abstract&&(this.hasPlugin("estree")?!!h.value.body:!!h.body)){const{key:d}=h;this.raise(he.AbstractMethodHasImplementation,h,{methodName:d.type==="Identifier"&&!h.computed?d.name:`[${this.input.slice(d.start,d.end)}]`})}return h}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,s,n,r){return!s&&r?(this.parseTypeOnlyImportExportSpecifier(e,!1,n),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,s,n,r))}parseImportSpecifier(e,s,n,r,a){return!s&&r?(this.parseTypeOnlyImportExportSpecifier(e,!0,n),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,s,n,r,n?4098:4096))}parseTypeOnlyImportExportSpecifier(e,s,n){const r=s?"imported":"local",a=s?"local":"exported";let o=e[r],l,h=!1,u=!0;const d=o.loc.start;if(this.isContextual(93)){const f=this.parseIdentifier();if(this.isContextual(93)){const p=this.parseIdentifier();Pt(this.state.type)?(h=!0,o=f,l=s?this.parseIdentifier():this.parseModuleExportName(),u=!1):(l=p,u=!1)}else Pt(this.state.type)?(u=!1,l=s?this.parseIdentifier():this.parseModuleExportName()):(h=!0,o=f)}else Pt(this.state.type)&&(h=!0,s?(o=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(o.name,o.loc.start,!0,!0)):o=this.parseModuleExportName());h&&n&&this.raise(s?he.TypeModifierIsUsedInTypeImports:he.TypeModifierIsUsedInTypeExports,d),e[r]=o,e[a]=l;const c=s?"importKind":"exportKind";e[c]=h?"type":"value",u&&this.eatContextual(93)&&(e[a]=s?this.parseIdentifier():this.parseModuleExportName()),e[a]||(e[a]=zt(e[r])),s&&this.checkIdentifier(e[a],h?4098:4096)}};function sd(i){if(i.type!=="MemberExpression")return!1;const{computed:t,property:e}=i;return t&&e.type!=="StringLiteral"&&(e.type!=="TemplateLiteral"||e.expressions.length>0)?!1:oc(i.object)}function id(i,t){var e;const{type:s}=i;if((e=i.extra)!=null&&e.parenthesized)return!1;if(t){if(s==="Literal"){const{value:n}=i;if(typeof n=="string"||typeof n=="boolean")return!0}}else if(s==="StringLiteral"||s==="BooleanLiteral")return!0;return!!(ac(i,t)||nd(i,t)||s==="TemplateLiteral"&&i.expressions.length===0||sd(i))}function ac(i,t){return t?i.type==="Literal"&&(typeof i.value=="number"||"bigint"in i):i.type==="NumericLiteral"||i.type==="BigIntLiteral"}function nd(i,t){if(i.type==="UnaryExpression"){const{operator:e,argument:s}=i;if(e==="-"&&ac(s,t))return!0}return!1}function oc(i){return i.type==="Identifier"?!0:i.type!=="MemberExpression"||i.computed?!1:oc(i.object)}const xo=Gt`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."});var rd=i=>class extends i{parsePlaceholder(e){if(this.match(144)){const s=this.startNode();return this.next(),this.assertNoSpace(),s.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(144),this.finishPlaceholder(s,e)}}finishPlaceholder(e,s){let n=e;return(!n.expectedNode||!n.type)&&(n=this.finishNode(n,"Placeholder")),n.expectedNode=s,n}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(144,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder("Expression")||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder("Identifier")||super.parseIdentifier(e)}checkReservedWord(e,s,n,r){e!==void 0&&super.checkReservedWord(e,s,n,r)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,s,n){return e==="Placeholder"||super.isValidLVal(e,s,n)}toAssignable(e,s){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,s)}chStartsBindingIdentifier(e,s){return!!(super.chStartsBindingIdentifier(e,s)||this.lookahead().type===144)}verifyBreakContinue(e,s){e.label&&e.label.type==="Placeholder"||super.verifyBreakContinue(e,s)}parseExpressionStatement(e,s){var n;if(s.type!=="Placeholder"||(n=s.extra)!=null&&n.parenthesized)return super.parseExpressionStatement(e,s);if(this.match(14)){const a=e;return a.label=this.finishPlaceholder(s,"Identifier"),this.next(),a.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(a,"LabeledStatement")}this.semicolon();const r=e;return r.name=s.name,this.finishPlaceholder(r,"Statement")}parseBlock(e,s,n){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,s,n)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,s,n){const r=s?"ClassDeclaration":"ClassExpression";this.next();const a=this.state.strict,o=this.parsePlaceholder("Identifier");if(o)if(this.match(81)||this.match(144)||this.match(5))e.id=o;else{if(n||!s)return e.id=null,e.body=this.finishPlaceholder(o,"ClassBody"),this.finishNode(e,r);throw this.raise(xo.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(e,s,n);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,a),this.finishNode(e,r)}parseExport(e,s){const n=this.parsePlaceholder("Identifier");if(!n)return super.parseExport(e,s);const r=e;if(!this.isContextual(98)&&!this.match(12))return r.specifiers=[],r.source=null,r.declaration=this.finishPlaceholder(n,"Declaration"),this.finishNode(r,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");const a=this.startNode();return a.exported=n,r.specifiers=[this.finishNode(a,"ExportDefaultSpecifier")],super.parseExport(r,s)}isExportDefaultSpecifier(){if(this.match(65)){const e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(os(144),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,s){var n;return(n=e.specifiers)!=null&&n.length?!0:super.maybeParseExportDefaultSpecifier(e,s)}checkExport(e){const{specifiers:s}=e;s!=null&&s.length&&(e.specifiers=s.filter(n=>n.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=s}parseImport(e){const s=this.parsePlaceholder("Identifier");if(!s)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(98)&&!this.match(12))return e.source=this.finishPlaceholder(s,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");const n=this.startNodeAtNode(s);return n.local=s,e.specifiers.push(this.finishNode(n,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(98),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.state.lastTokEndLoc.index&&this.raise(xo.UnexpectedSpace,this.state.lastTokEndLoc)}},ad=i=>class extends i{parseV8Intrinsic(){if(this.match(54)){const e=this.state.startLoc,s=this.startNode();if(this.next(),Me(this.state.type)){const n=this.parseIdentifierName(),r=this.createIdentifier(s,n);if(r.type="V8IntrinsicIdentifier",this.match(10))return r}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}};const So=["minimal","fsharp","hack","smart"],Po=["^^","@@","^","%","#"];function od(i){if(i.has("decorators")){if(i.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");const e=i.get("decorators").decoratorsBeforeExport;if(e!=null&&typeof e!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");const s=i.get("decorators").allowCallParenthesized;if(s!=null&&typeof s!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(i.has("flow")&&i.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(i.has("placeholders")&&i.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(i.has("pipelineOperator")){var t;const e=i.get("pipelineOperator").proposal;if(!So.includes(e)){const n=So.map(r=>`"${r}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${n}.`)}const s=((t=i.get("recordAndTuple"))==null?void 0:t.syntaxType)==="hash";if(e==="hack"){if(i.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(i.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");const n=i.get("pipelineOperator").topicToken;if(!Po.includes(n)){const r=Po.map(a=>`"${a}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${r}.`)}if(n==="#"&&s)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",i.get("recordAndTuple")])}\`.`)}else if(e==="smart"&&s)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",i.get("recordAndTuple")])}\`.`)}if(i.has("moduleAttributes")){if(i.has("importAttributes")||i.has("importAssertions"))throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins.");if(i.get("moduleAttributes").version!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(i.has("importAssertions")&&i.has("importAttributes"))throw new Error("Cannot combine importAssertions and importAttributes plugins.");if(i.has("recordAndTuple")){const e=i.get("recordAndTuple").syntaxType;if(e!=null){const s=["hash","bar"];if(!s.includes(e))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+s.map(n=>`'${n}'`).join(", "))}}if(i.has("asyncDoExpressions")&&!i.has("doExpressions")){const e=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw e.missingPlugins="doExpressions",e}if(i.has("optionalChainingAssign")&&i.get("optionalChainingAssign").version!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.")}const lc={estree:Jf,jsx:zp,flow:Kp,typescript:td,v8intrinsic:ad,placeholders:rd},ld=Object.keys(lc),tr={sourceType:"script",sourceFilename:void 0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0};function cd(i){if(i==null)return Object.assign({},tr);if(i.annexB!=null&&i.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");const t={};for(const s of Object.keys(tr)){var e;t[s]=(e=i[s])!=null?e:tr[s]}return t}class ud extends Yp{checkProto(t,e,s,n){if(t.type==="SpreadElement"||this.isObjectMethod(t)||t.computed||t.shorthand)return;const r=t.key;if((r.type==="Identifier"?r.name:r.value)==="__proto__"){if(e){this.raise(w.RecordNoProto,r);return}s.used&&(n?n.doubleProtoLoc===null&&(n.doubleProtoLoc=r.loc.start):this.raise(w.DuplicateProto,r)),s.used=!0}}shouldExitDescending(t,e){return t.type==="ArrowFunctionExpression"&&t.start===e}getExpression(){this.enterInitialScopes(),this.nextToken();const t=this.parseExpression();return this.match(139)||this.unexpected(),this.finalizeRemainingComments(),t.comments=this.comments,t.errors=this.state.errors,this.options.tokens&&(t.tokens=this.tokens),t}parseExpression(t,e){return t?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(t){const e=this.state.startLoc,s=this.parseMaybeAssign(t);if(this.match(12)){const n=this.startNodeAt(e);for(n.expressions=[s];this.eat(12);)n.expressions.push(this.parseMaybeAssign(t));return this.toReferencedList(n.expressions),this.finishNode(n,"SequenceExpression")}return s}parseMaybeAssignDisallowIn(t,e){return this.disallowInAnd(()=>this.parseMaybeAssign(t,e))}parseMaybeAssignAllowIn(t,e){return this.allowInAnd(()=>this.parseMaybeAssign(t,e))}setOptionalParametersError(t,e){var s;t.optionalParametersLoc=(s=e==null?void 0:e.loc)!=null?s:this.state.startLoc}parseMaybeAssign(t,e){const s=this.state.startLoc;if(this.isContextual(108)&&this.prodParam.hasYield){let o=this.parseYield();return e&&(o=e.call(this,o,s)),o}let n;t?n=!1:(t=new Qi,n=!0);const{type:r}=this.state;(r===10||Me(r))&&(this.state.potentialArrowAt=this.state.start);let a=this.parseMaybeConditional(t);if(e&&(a=e.call(this,a,s)),ep(this.state.type)){const o=this.startNodeAt(s),l=this.state.value;if(o.operator=l,this.match(29)){this.toAssignable(a,!0),o.left=a;const h=s.index;t.doubleProtoLoc!=null&&t.doubleProtoLoc.index>=h&&(t.doubleProtoLoc=null),t.shorthandAssignLoc!=null&&t.shorthandAssignLoc.index>=h&&(t.shorthandAssignLoc=null),t.privateKeyLoc!=null&&t.privateKeyLoc.index>=h&&(this.checkDestructuringPrivate(t),t.privateKeyLoc=null)}else o.left=a;return this.next(),o.right=this.parseMaybeAssign(),this.checkLVal(a,this.finishNode(o,"AssignmentExpression")),o}else n&&this.checkExpressionErrors(t,!0);return a}parseMaybeConditional(t){const e=this.state.startLoc,s=this.state.potentialArrowAt,n=this.parseExprOps(t);return this.shouldExitDescending(n,s)?n:this.parseConditional(n,e,t)}parseConditional(t,e,s){if(this.eat(17)){const n=this.startNodeAt(e);return n.test=t,n.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),n.alternate=this.parseMaybeAssign(),this.finishNode(n,"ConditionalExpression")}return t}parseMaybeUnaryOrPrivate(t){return this.match(138)?this.parsePrivateName():this.parseMaybeUnary(t)}parseExprOps(t){const e=this.state.startLoc,s=this.state.potentialArrowAt,n=this.parseMaybeUnaryOrPrivate(t);return this.shouldExitDescending(n,s)?n:this.parseExprOp(n,e,-1)}parseExprOp(t,e,s){if(this.isPrivateName(t)){const r=this.getPrivateNameSV(t);(s>=Yi(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(w.PrivateInExpectedIn,t,{identifierName:r}),this.classScope.usePrivateName(r,t.loc.start)}const n=this.state.type;if(sp(n)&&(this.prodParam.hasIn||!this.match(58))){let r=Yi(n);if(r>s){if(n===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return t;this.checkPipelineAtInfixOperator(t,e)}const a=this.startNodeAt(e);a.left=t,a.operator=this.state.value;const o=n===41||n===42,l=n===40;if(l&&(r=Yi(42)),this.next(),n===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(w.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);a.right=this.parseExprOpRightExpr(n,r);const h=this.finishNode(a,o||l?"LogicalExpression":"BinaryExpression"),u=this.state.type;if(l&&(u===41||u===42)||o&&u===40)throw this.raise(w.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(h,e,s)}}return t}parseExprOpRightExpr(t,e){const s=this.state.startLoc;switch(t){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"smart":return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(w.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(t,e),s)});case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}default:return this.parseExprOpBaseRightExpr(t,e)}}parseExprOpBaseRightExpr(t,e){const s=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),s,op(t)?e-1:e)}parseHackPipeBody(){var t;const{startLoc:e}=this.state,s=this.parseMaybeAssign();return Gf.has(s.type)&&!((t=s.extra)!=null&&t.parenthesized)&&this.raise(w.PipeUnparenthesizedBody,e,{type:s.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(w.PipeTopicUnused,e),s}checkExponentialAfterUnary(t){this.match(57)&&this.raise(w.UnexpectedTokenUnaryExponentiation,t.argument)}parseMaybeUnary(t,e){const s=this.state.startLoc,n=this.isContextual(96);if(n&&this.recordAwaitIfAllowed()){this.next();const l=this.parseAwait(s);return e||this.checkExponentialAfterUnary(l),l}const r=this.match(34),a=this.startNode();if(np(this.state.type)){a.operator=this.state.value,a.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");const l=this.match(89);if(this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),this.state.strict&&l){const h=a.argument;h.type==="Identifier"?this.raise(w.StrictDelete,a):this.hasPropertyAsPrivateName(h)&&this.raise(w.DeletePrivateField,a)}if(!r)return e||this.checkExponentialAfterUnary(a),this.finishNode(a,"UnaryExpression")}const o=this.parseUpdate(a,r,t);if(n){const{type:l}=this.state;if((this.hasPlugin("v8intrinsic")?Sr(l):Sr(l)&&!this.match(54))&&!this.isAmbiguousAwait())return this.raiseOverwrite(w.AwaitNotInAsyncContext,s),this.parseAwait(s)}return o}parseUpdate(t,e,s){if(e){const a=t;return this.checkLVal(a.argument,this.finishNode(a,"UpdateExpression")),t}const n=this.state.startLoc;let r=this.parseExprSubscripts(s);if(this.checkExpressionErrors(s,!1))return r;for(;ip(this.state.type)&&!this.canInsertSemicolon();){const a=this.startNodeAt(n);a.operator=this.state.value,a.prefix=!1,a.argument=r,this.next(),this.checkLVal(r,r=this.finishNode(a,"UpdateExpression"))}return r}parseExprSubscripts(t){const e=this.state.startLoc,s=this.state.potentialArrowAt,n=this.parseExprAtom(t);return this.shouldExitDescending(n,s)?n:this.parseSubscripts(n,e)}parseSubscripts(t,e,s){const n={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(t),stop:!1};do t=this.parseSubscript(t,e,s,n),n.maybeAsyncArrow=!1;while(!n.stop);return t}parseSubscript(t,e,s,n){const{type:r}=this.state;if(!s&&r===15)return this.parseBind(t,e,s,n);if(un(r))return this.parseTaggedTemplateExpression(t,e,n);let a=!1;if(r===18){if(s&&(this.raise(w.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return n.stop=!0,t;n.optionalChainMember=a=!0,this.next()}if(!s&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(t,e,n,a);{const o=this.eat(0);return o||a||this.eat(16)?this.parseMember(t,e,n,o,a):(n.stop=!0,t)}}parseMember(t,e,s,n,r){const a=this.startNodeAt(e);return a.object=t,a.computed=n,n?(a.property=this.parseExpression(),this.expect(3)):this.match(138)?(t.type==="Super"&&this.raise(w.SuperPrivateField,e),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),s.optionalChainMember?(a.optional=r,this.finishNode(a,"OptionalMemberExpression")):this.finishNode(a,"MemberExpression")}parseBind(t,e,s,n){const r=this.startNodeAt(e);return r.object=t,this.next(),r.callee=this.parseNoCallExpr(),n.stop=!0,this.parseSubscripts(this.finishNode(r,"BindExpression"),e,s)}parseCoverCallAndAsyncArrowHead(t,e,s,n){const r=this.state.maybeInArrowParameters;let a=null;this.state.maybeInArrowParameters=!0,this.next();const o=this.startNodeAt(e);o.callee=t;const{maybeAsyncArrow:l,optionalChainMember:h}=s;l&&(this.expressionScope.enter(Dp()),a=new Qi),h&&(o.optional=n),n?o.arguments=this.parseCallExpressionArguments(11):o.arguments=this.parseCallExpressionArguments(11,t.type==="Import",t.type!=="Super",o,a);let u=this.finishCallExpression(o,h);return l&&this.shouldParseAsyncArrow()&&!n?(s.stop=!0,this.checkDestructuringPrivate(a),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),u=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),u)):(l&&(this.checkExpressionErrors(a,!0),this.expressionScope.exit()),this.toReferencedArguments(u)),this.state.maybeInArrowParameters=r,u}toReferencedArguments(t,e){this.toReferencedListDeep(t.arguments,e)}parseTaggedTemplateExpression(t,e,s){const n=this.startNodeAt(e);return n.tag=t,n.quasi=this.parseTemplate(!0),s.optionalChainMember&&this.raise(w.OptionalChainingNoTemplate,e),this.finishNode(n,"TaggedTemplateExpression")}atPossibleAsyncArrow(t){return t.type==="Identifier"&&t.name==="async"&&this.state.lastTokEndLoc.index===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&t.start===this.state.potentialArrowAt}finishCallExpression(t,e){if(t.callee.type==="Import")if(t.arguments.length===2&&(this.hasPlugin("moduleAttributes")||this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes")),t.arguments.length===0||t.arguments.length>2)this.raise(w.ImportCallArity,t,{maxArgumentCount:this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")||this.hasPlugin("moduleAttributes")?2:1});else for(const s of t.arguments)s.type==="SpreadElement"&&this.raise(w.ImportCallSpreadArgument,s);return this.finishNode(t,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(t,e,s,n,r){const a=[];let o=!0;const l=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(t);){if(o)o=!1;else if(this.expect(12),this.match(t)){e&&!this.hasPlugin("importAttributes")&&!this.hasPlugin("importAssertions")&&!this.hasPlugin("moduleAttributes")&&this.raise(w.ImportCallArgumentTrailingComma,this.state.lastTokStartLoc),n&&this.addTrailingCommaExtraToNode(n),this.next();break}a.push(this.parseExprListItem(!1,r,s))}return this.state.inFSharpPipelineDirectBody=l,a}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(t,e){var s;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(t,e.arguments,!0,(s=e.extra)==null?void 0:s.trailingCommaLoc),e.innerComments&&Ai(t,e.innerComments),e.callee.trailingComments&&Ai(t,e.callee.trailingComments),t}parseNoCallExpr(){const t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),t,!0)}parseExprAtom(t){let e,s=null;const{type:n}=this.state;switch(n){case 79:return this.parseSuper();case 83:return e=this.startNode(),this.next(),this.match(16)?this.parseImportMetaProperty(e):this.match(10)?this.options.createImportExpressions?this.parseImportCall(e):this.finishNode(e,"Import"):(this.raise(w.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(e,"Import"));case 78:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 134:return this.parseNumericLiteral(this.state.value);case 135:return this.parseBigIntLiteral(this.state.value);case 133:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{const r=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(r)}case 2:case 1:return this.parseArrayLike(this.state.type===2?4:3,!1,!0);case 0:return this.parseArrayLike(3,!0,!1,t);case 6:case 7:return this.parseObjectLike(this.state.type===6?9:8,!1,!0);case 5:return this.parseObjectLike(8,!1,!1,t);case 68:return this.parseFunctionOrFunctionSent();case 26:s=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(s,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{e=this.startNode(),this.next(),e.object=null;const r=e.callee=this.parseNoCallExpr();if(r.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(w.UnsupportedBind,r)}case 138:return this.raise(w.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{const r=this.getPluginOption("pipelineOperator","proposal");if(r)return this.parseTopicReference(r);this.unexpected();break}case 47:{const r=this.input.codePointAt(this.nextTokenStart());Vt(r)||r===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(n===136)return this.parseDecimalLiteral(this.state.value);if(Me(n)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();const r=this.state.potentialArrowAt===this.state.start,a=this.state.containsEsc,o=this.parseIdentifier();if(!a&&o.name==="async"&&!this.canInsertSemicolon()){const{type:l}=this.state;if(l===68)return this.resetPreviousNodeTrailingComments(o),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(o));if(Me(l))return this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(o)):o;if(l===90)return this.resetPreviousNodeTrailingComments(o),this.parseDo(this.startNodeAtNode(o),!0)}return r&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(o),[o],!1)):o}else this.unexpected()}}parseTopicReferenceThenEqualsSign(t,e){const s=this.getPluginOption("pipelineOperator","proposal");if(s)return this.state.type=t,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=ot(this.state.endLoc,-1),this.parseTopicReference(s);this.unexpected()}parseTopicReference(t){const e=this.startNode(),s=this.state.startLoc,n=this.state.type;return this.next(),this.finishTopicReference(e,s,t,n)}finishTopicReference(t,e,s,n){if(this.testTopicReferenceConfiguration(s,e,n)){const r=s==="smart"?"PipelinePrimaryTopicReference":"TopicReference";return this.topicReferenceIsAllowedInCurrentContext()||this.raise(s==="smart"?w.PrimaryTopicNotAllowed:w.PipeTopicUnbound,e),this.registerTopicReference(),this.finishNode(t,r)}else throw this.raise(w.PipeTopicUnconfiguredToken,e,{token:os(n)})}testTopicReferenceConfiguration(t,e,s){switch(t){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:os(s)}]);case"smart":return s===27;default:throw this.raise(w.PipeTopicRequiresHackPipes,e)}}parseAsyncArrowUnaryFunction(t){this.prodParam.enter(Zi(!0,this.prodParam.hasYield));const e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(w.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(t,e,!0)}parseDo(t,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),t.async=e,this.next();const s=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(2),t.body=this.parseBlock(),this.prodParam.exit()):t.body=this.parseBlock(),this.state.labels=s,this.finishNode(t,"DoExpression")}parseSuper(){const t=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!this.options.allowSuperOutsideMethod?this.raise(w.SuperNotAllowed,t):!this.scope.allowSuper&&!this.options.allowSuperOutsideMethod&&this.raise(w.UnexpectedSuper,t),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(w.UnsupportedSuper,t),this.finishNode(t,"Super")}parsePrivateName(){const t=this.startNode(),e=this.startNodeAt(ot(this.state.startLoc,1)),s=this.state.value;return this.next(),t.id=this.createIdentifier(e,s),this.finishNode(t,"PrivateName")}parseFunctionOrFunctionSent(){const t=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){const e=this.createIdentifier(this.startNodeAtNode(t),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(t,e,"sent")}return this.parseFunction(t)}parseMetaProperty(t,e,s){t.meta=e;const n=this.state.containsEsc;return t.property=this.parseIdentifier(!0),(t.property.name!==s||n)&&this.raise(w.UnsupportedMetaProperty,t.property,{target:e.name,onlyValidPropertyName:s}),this.finishNode(t,"MetaProperty")}parseImportMetaProperty(t){const e=this.createIdentifier(this.startNodeAtNode(t),"import");if(this.next(),this.isContextual(101))this.inModule||this.raise(w.ImportMetaOutsideModule,e),this.sawUnambiguousESM=!0;else if(this.isContextual(105)||this.isContextual(97)){const s=this.isContextual(105);if(s||this.unexpected(),this.expectPlugin(s?"sourcePhaseImports":"deferredImportEvaluation"),!this.options.createImportExpressions)throw this.raise(w.DynamicImportPhaseRequiresImportExpressions,this.state.startLoc,{phase:this.state.value});return this.next(),t.phase=s?"source":"defer",this.parseImportCall(t)}return this.parseMetaProperty(t,e,"meta")}parseLiteralAtNode(t,e,s){return this.addExtra(s,"rawValue",t),this.addExtra(s,"raw",this.input.slice(s.start,this.state.end)),s.value=t,this.next(),this.finishNode(s,e)}parseLiteral(t,e){const s=this.startNode();return this.parseLiteralAtNode(t,e,s)}parseStringLiteral(t){return this.parseLiteral(t,"StringLiteral")}parseNumericLiteral(t){return this.parseLiteral(t,"NumericLiteral")}parseBigIntLiteral(t){return this.parseLiteral(t,"BigIntLiteral")}parseDecimalLiteral(t){return this.parseLiteral(t,"DecimalLiteral")}parseRegExpLiteral(t){const e=this.startNode();return this.addExtra(e,"raw",this.input.slice(e.start,this.state.end)),e.pattern=t.pattern,e.flags=t.flags,this.next(),this.finishNode(e,"RegExpLiteral")}parseBooleanLiteral(t){const e=this.startNode();return e.value=t,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){const t=this.startNode();return this.next(),this.finishNode(t,"NullLiteral")}parseParenAndDistinguishExpression(t){const e=this.state.startLoc;let s;this.next(),this.expressionScope.enter(Op());const n=this.state.maybeInArrowParameters,r=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;const a=this.state.startLoc,o=[],l=new Qi;let h=!0,u,d;for(;!this.match(11);){if(h)h=!1;else if(this.expect(12,l.optionalParametersLoc===null?null:l.optionalParametersLoc),this.match(11)){d=this.state.startLoc;break}if(this.match(21)){const p=this.state.startLoc;if(u=this.state.startLoc,o.push(this.parseParenItem(this.parseRestBinding(),p)),!this.checkCommaAfterRest(41))break}else o.push(this.parseMaybeAssignAllowIn(l,this.parseParenItem))}const c=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=n,this.state.inFSharpPipelineDirectBody=r;let f=this.startNodeAt(e);return t&&this.shouldParseArrow(o)&&(f=this.parseArrow(f))?(this.checkDestructuringPrivate(l),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(f,o,!1),f):(this.expressionScope.exit(),o.length||this.unexpected(this.state.lastTokStartLoc),d&&this.unexpected(d),u&&this.unexpected(u),this.checkExpressionErrors(l,!0),this.toReferencedListDeep(o,!0),o.length>1?(s=this.startNodeAt(a),s.expressions=o,this.finishNode(s,"SequenceExpression"),this.resetEndLocation(s,c)):s=o[0],this.wrapParenthesis(e,s))}wrapParenthesis(t,e){if(!this.options.createParenthesizedExpressions)return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",t.index),this.takeSurroundingComments(e,t.index,this.state.lastTokEndLoc.index),e;const s=this.startNodeAt(t);return s.expression=e,this.finishNode(s,"ParenthesizedExpression")}shouldParseArrow(t){return!this.canInsertSemicolon()}parseArrow(t){if(this.eat(19))return t}parseParenItem(t,e){return t}parseNewOrNewTarget(){const t=this.startNode();if(this.next(),this.match(16)){const e=this.createIdentifier(this.startNodeAtNode(t),"new");this.next();const s=this.parseMetaProperty(t,e,"target");return!this.scope.inNonArrowFunction&&!this.scope.inClass&&!this.options.allowNewTargetOutsideFunction&&this.raise(w.UnexpectedNewTarget,s),s}return this.parseNew(t)}parseNew(t){if(this.parseNewCallee(t),this.eat(10)){const e=this.parseExprList(11);this.toReferencedList(e),t.arguments=e}else t.arguments=[];return this.finishNode(t,"NewExpression")}parseNewCallee(t){const e=this.match(83),s=this.parseNoCallExpr();t.callee=s,e&&(s.type==="Import"||s.type==="ImportExpression")&&this.raise(w.ImportCallNotNewExpression,s)}parseTemplateElement(t){const{start:e,startLoc:s,end:n,value:r}=this.state,a=e+1,o=this.startNodeAt(ot(s,1));r===null&&(t||this.raise(w.InvalidEscapeSequenceTemplate,ot(this.state.firstInvalidTemplateEscapePos,1)));const l=this.match(24),h=l?-1:-2,u=n+h;o.value={raw:this.input.slice(a,u).replace(/\r\n?/g,` +`),cooked:r===null?null:r.slice(1,h)},o.tail=l,this.next();const d=this.finishNode(o,"TemplateElement");return this.resetEndLocation(d,ot(this.state.lastTokEndLoc,h)),d}parseTemplate(t){const e=this.startNode();let s=this.parseTemplateElement(t);const n=[s],r=[];for(;!s.tail;)r.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),n.push(s=this.parseTemplateElement(t));return e.expressions=r,e.quasis=n,this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(t,e,s,n){s&&this.expectPlugin("recordAndTuple");const r=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;const a=Object.create(null);let o=!0;const l=this.startNode();for(l.properties=[],this.next();!this.match(t);){if(o)o=!1;else if(this.expect(12),this.match(t)){this.addTrailingCommaExtraToNode(l);break}let u;e?u=this.parseBindingProperty():(u=this.parsePropertyDefinition(n),this.checkProto(u,s,a,n)),s&&!this.isObjectProperty(u)&&u.type!=="SpreadElement"&&this.raise(w.InvalidRecordProperty,u),u.shorthand&&this.addExtra(u,"shorthand",!0),l.properties.push(u)}this.next(),this.state.inFSharpPipelineDirectBody=r;let h="ObjectExpression";return e?h="ObjectPattern":s&&(h="RecordExpression"),this.finishNode(l,h)}addTrailingCommaExtraToNode(t){this.addExtra(t,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(t,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(t){return!t.computed&&t.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(t){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(w.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)e.push(this.parseDecorator());const s=this.startNode();let n=!1,r=!1,a;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(s.decorators=e,e=[]),s.method=!1,t&&(a=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(s);const l=this.state.containsEsc;if(this.parsePropertyName(s,t),!o&&!l&&this.maybeAsyncOrAccessorProp(s)){const{key:h}=s,u=h.name;u==="async"&&!this.hasPrecedingLineBreak()&&(n=!0,this.resetPreviousNodeTrailingComments(h),o=this.eat(55),this.parsePropertyName(s)),(u==="get"||u==="set")&&(r=!0,this.resetPreviousNodeTrailingComments(h),s.kind=u,this.match(55)&&(o=!0,this.raise(w.AccessorIsGenerator,this.state.curPosition(),{kind:u}),this.next()),this.parsePropertyName(s))}return this.parseObjPropValue(s,a,o,n,!1,r,t)}getGetterSetterExpectedParamCount(t){return t.kind==="get"?0:1}getObjectOrClassMethodParams(t){return t.params}checkGetterSetterParams(t){var e;const s=this.getGetterSetterExpectedParamCount(t),n=this.getObjectOrClassMethodParams(t);n.length!==s&&this.raise(t.kind==="get"?w.BadGetterArity:w.BadSetterArity,t),t.kind==="set"&&((e=n[n.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(w.BadSetterRestParameter,t)}parseObjectMethod(t,e,s,n,r){if(r){const a=this.parseMethod(t,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(a),a}if(s||e||this.match(10))return n&&this.unexpected(),t.kind="method",t.method=!0,this.parseMethod(t,e,s,!1,!1,"ObjectMethod")}parseObjectProperty(t,e,s,n){if(t.shorthand=!1,this.eat(14))return t.value=s?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(n),this.finishNode(t,"ObjectProperty");if(!t.computed&&t.key.type==="Identifier"){if(this.checkReservedWord(t.key.name,t.key.loc.start,!0,!1),s)t.value=this.parseMaybeDefault(e,zt(t.key));else if(this.match(29)){const r=this.state.startLoc;n!=null?n.shorthandAssignLoc===null&&(n.shorthandAssignLoc=r):this.raise(w.InvalidCoverInitializedName,r),t.value=this.parseMaybeDefault(e,zt(t.key))}else t.value=zt(t.key);return t.shorthand=!0,this.finishNode(t,"ObjectProperty")}}parseObjPropValue(t,e,s,n,r,a,o){const l=this.parseObjectMethod(t,s,n,r,a)||this.parseObjectProperty(t,e,r,o);return l||this.unexpected(),l}parsePropertyName(t,e){if(this.eat(0))t.computed=!0,t.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{const{type:s,value:n}=this.state;let r;if(Pt(s))r=this.parseIdentifier(!0);else switch(s){case 134:r=this.parseNumericLiteral(n);break;case 133:r=this.parseStringLiteral(n);break;case 135:r=this.parseBigIntLiteral(n);break;case 138:{const a=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=a):this.raise(w.UnexpectedPrivateField,a),r=this.parsePrivateName();break}default:if(s===136){r=this.parseDecimalLiteral(n);break}this.unexpected()}t.key=r,s!==138&&(t.computed=!1)}}initFunction(t,e){t.id=null,t.generator=!1,t.async=e}parseMethod(t,e,s,n,r,a,o=!1){this.initFunction(t,s),t.generator=e,this.scope.enter(18|(o?64:0)|(r?32:0)),this.prodParam.enter(Zi(s,t.generator)),this.parseFunctionParams(t,n);const l=this.parseFunctionBodyAndFinish(t,a,!0);return this.prodParam.exit(),this.scope.exit(),l}parseArrayLike(t,e,s,n){s&&this.expectPlugin("recordAndTuple");const r=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;const a=this.startNode();return this.next(),a.elements=this.parseExprList(t,!s,n,a),this.state.inFSharpPipelineDirectBody=r,this.finishNode(a,s?"TupleExpression":"ArrayExpression")}parseArrowExpression(t,e,s,n){this.scope.enter(6);let r=Zi(s,!1);!this.match(5)&&this.prodParam.hasIn&&(r|=8),this.prodParam.enter(r),this.initFunction(t,s);const a=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(t,e,n)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(t,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=a,this.finishNode(t,"ArrowFunctionExpression")}setArrowFunctionParameters(t,e,s){this.toAssignableList(e,s,!1),t.params=e}parseFunctionBodyAndFinish(t,e,s=!1){return this.parseFunctionBody(t,!1,s),this.finishNode(t,e)}parseFunctionBody(t,e,s=!1){const n=e&&!this.match(5);if(this.expressionScope.enter(nc()),n)t.body=this.parseMaybeAssign(),this.checkParams(t,!1,e,!1);else{const r=this.state.strict,a=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),t.body=this.parseBlock(!0,!1,o=>{const l=!this.isSimpleParamList(t.params);o&&l&&this.raise(w.IllegalLanguageModeDirective,(t.kind==="method"||t.kind==="constructor")&&!!t.key?t.key.loc.end:t);const h=!r&&this.state.strict;this.checkParams(t,!this.state.strict&&!e&&!s&&!l,e,h),this.state.strict&&t.id&&this.checkIdentifier(t.id,65,h)}),this.prodParam.exit(),this.state.labels=a}this.expressionScope.exit()}isSimpleParameter(t){return t.type==="Identifier"}isSimpleParamList(t){for(let e=0,s=t.length;e10||!gp(t))return;if(s&&dp(t)){this.raise(w.UnexpectedKeyword,e,{keyword:t});return}if((this.state.strict?n?Ql:Yl:Xl)(t,this.inModule)){this.raise(w.UnexpectedReservedWord,e,{reservedWord:t});return}else if(t==="yield"){if(this.prodParam.hasYield){this.raise(w.YieldBindingIdentifier,e);return}}else if(t==="await"){if(this.prodParam.hasAwait){this.raise(w.AwaitBindingIdentifier,e);return}if(this.scope.inStaticBlock){this.raise(w.AwaitBindingIdentifierInStaticBlock,e);return}this.expressionScope.recordAsyncArrowParametersError(e)}else if(t==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(w.ArgumentsInClass,e);return}}recordAwaitIfAllowed(){const t=this.prodParam.hasAwait||this.options.allowAwaitOutsideFunction&&!this.scope.inFunction;return t&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),t}parseAwait(t){const e=this.startNodeAt(t);return this.expressionScope.recordParameterInitializerError(w.AwaitExpressionFormalParameter,e),this.eat(55)&&this.raise(w.ObsoleteAwaitStar,e),!this.scope.inFunction&&!this.options.allowAwaitOutsideFunction&&(this.isAmbiguousAwait()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(e.argument=this.parseMaybeUnary(null,!0)),this.finishNode(e,"AwaitExpression")}isAmbiguousAwait(){if(this.hasPrecedingLineBreak())return!0;const{type:t}=this.state;return t===53||t===10||t===0||un(t)||t===102&&!this.state.containsEsc||t===137||t===56||this.hasPlugin("v8intrinsic")&&t===54}parseYield(){const t=this.startNode();this.expressionScope.recordParameterInitializerError(w.YieldInParameter,t),this.next();let e=!1,s=null;if(!this.hasPrecedingLineBreak())switch(e=this.eat(55),this.state.type){case 13:case 139:case 8:case 11:case 3:case 9:case 14:case 12:if(!e)break;default:s=this.parseMaybeAssign()}return t.delegate=e,t.argument=s,this.finishNode(t,"YieldExpression")}parseImportCall(t){return this.next(),t.source=this.parseMaybeAssignAllowIn(),(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))&&(t.options=null),this.eat(12)&&(this.hasPlugin("moduleAttributes")||this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes"),this.match(11)||(t.options=this.parseMaybeAssignAllowIn(),this.eat(12))),this.expect(11),this.finishNode(t,"ImportExpression")}checkPipelineAtInfixOperator(t,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&t.type==="SequenceExpression"&&this.raise(w.PipelineHeadSequenceExpression,e)}parseSmartPipelineBodyInStyle(t,e){if(this.isSimpleReference(t)){const s=this.startNodeAt(e);return s.callee=t,this.finishNode(s,"PipelineBareFunction")}else{const s=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),s.expression=t,this.finishNode(s,"PipelineTopicExpression")}}isSimpleReference(t){switch(t.type){case"MemberExpression":return!t.computed&&this.isSimpleReference(t.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(t){if(this.match(19))throw this.raise(w.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(w.PipelineTopicUnused,t)}withTopicBindingContext(t){const e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(t){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){const e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}else return t()}withSoloAwaitPermittingContext(t){const e=this.state.soloAwait;this.state.soloAwait=!0;try{return t()}finally{this.state.soloAwait=e}}allowInAnd(t){const e=this.prodParam.currentFlags();if(8&~e){this.prodParam.enter(e|8);try{return t()}finally{this.prodParam.exit()}}return t()}disallowInAnd(t){const e=this.prodParam.currentFlags();if(8&e){this.prodParam.enter(e&-9);try{return t()}finally{this.prodParam.exit()}}return t()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(t){const e=this.state.startLoc;this.state.potentialArrowAt=this.state.start;const s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;const n=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,t);return this.state.inFSharpPipelineDirectBody=s,n}parseModuleExpression(){this.expectPlugin("moduleBlocks");const t=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);const e=this.startNodeAt(this.state.endLoc);this.next();const s=this.initializeScopes(!0);this.enterInitialScopes();try{t.body=this.parseProgram(e,8,"module")}finally{s()}return this.finishNode(t,"ModuleExpression")}parsePropertyNamePrefixOperator(t){}}const sr={kind:1},hd={kind:2},fd=/[\uD800-\uDFFF]/u,ir=/in(?:stanceof)?/y;function pd(i,t){for(let e=0;e0)for(const[r,a]of Array.from(this.scope.undefinedExports))this.raise(w.ModuleExportUndefined,a,{localName:r});this.addExtra(t,"topLevelAwait",this.state.hasTopLevelAwait)}let n;return e===139?n=this.finishNode(t,"Program"):n=this.finishNodeAt(t,"Program",ot(this.state.startLoc,-1)),n}stmtToDirective(t){const e=t;e.type="Directive",e.value=e.expression,delete e.expression;const s=e.value,n=s.value,r=this.input.slice(s.start,s.end),a=s.value=r.slice(1,-1);return this.addExtra(s,"raw",r),this.addExtra(s,"rawValue",a),this.addExtra(s,"expressionValue",n),s.type="DirectiveLiteral",e}parseInterpreterDirective(){if(!this.match(28))return null;const t=this.startNode();return t.value=this.state.value,this.next(),this.finishNode(t,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(t,e){if(Vt(t)){if(ir.lastIndex=e,ir.test(this.input)){const s=this.codePointAtPos(ir.lastIndex);if(!Us(s)&&s!==92)return!1}return!0}else return t===92}chStartsBindingPattern(t){return t===91||t===123}hasFollowingBindingAtom(){const t=this.nextTokenStart(),e=this.codePointAtPos(t);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,t)}hasInLineFollowingBindingIdentifierOrBrace(){const t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return e===123||this.chStartsBindingIdentifier(e,t)}startsUsingForOf(){const{type:t,containsEsc:e}=this.lookahead();if(t===102&&!e)return!1;if(Me(t)&&!this.hasFollowingLineBreak())return this.expectPlugin("explicitResourceManagement"),!0}startsAwaitUsing(){let t=this.nextTokenInLineStart();if(this.isUnparsedContextual(t,"using")){t=this.nextTokenInLineStartSince(t+5);const e=this.codePointAtPos(t);if(this.chStartsBindingIdentifier(e,t))return this.expectPlugin("explicitResourceManagement"),!0}return!1}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(t=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,t&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(t){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(t,e)}parseStatementContent(t,e){const s=this.state.type,n=this.startNode(),r=!!(t&2),a=!!(t&4),o=t&1;switch(s){case 60:return this.parseBreakContinueStatement(n,!0);case 63:return this.parseBreakContinueStatement(n,!1);case 64:return this.parseDebuggerStatement(n);case 90:return this.parseDoWhileStatement(n);case 91:return this.parseForStatement(n);case 68:if(this.lookaheadCharCode()===46)break;return a||this.raise(this.state.strict?w.StrictFunction:this.options.annexB?w.SloppyFunctionAnnexB:w.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(n,!1,!r&&a);case 80:return r||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,n),!0);case 69:return this.parseIfStatement(n);case 70:return this.parseReturnStatement(n);case 71:return this.parseSwitchStatement(n);case 72:return this.parseThrowStatement(n);case 73:return this.parseTryStatement(n);case 96:if(!this.state.containsEsc&&this.startsAwaitUsing())return this.recordAwaitIfAllowed()?r||this.raise(w.UnexpectedLexicalDeclaration,n):this.raise(w.AwaitUsingNotInAsyncContext,n),this.next(),this.parseVarStatement(n,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel?this.raise(w.UnexpectedUsingDeclaration,this.state.startLoc):r||this.raise(w.UnexpectedLexicalDeclaration,this.state.startLoc),this.parseVarStatement(n,"using");case 100:{if(this.state.containsEsc)break;const u=this.nextTokenStart(),d=this.codePointAtPos(u);if(d!==91&&(!r&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(d,u)&&d!==123))break}case 75:r||this.raise(w.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{const u=this.state.value;return this.parseVarStatement(n,u)}case 92:return this.parseWhileStatement(n);case 76:return this.parseWithStatement(n);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(n);case 83:{const u=this.lookaheadCharCode();if(u===40||u===46)break}case 82:{!this.options.allowImportExportEverywhere&&!o&&this.raise(w.UnexpectedImportExport,this.state.startLoc),this.next();let u;return s===83?(u=this.parseImport(n),u.type==="ImportDeclaration"&&(!u.importKind||u.importKind==="value")&&(this.sawUnambiguousESM=!0)):(u=this.parseExport(n,e),(u.type==="ExportNamedDeclaration"&&(!u.exportKind||u.exportKind==="value")||u.type==="ExportAllDeclaration"&&(!u.exportKind||u.exportKind==="value")||u.type==="ExportDefaultDeclaration")&&(this.sawUnambiguousESM=!0)),this.assertModuleNodeAllowed(u),u}default:if(this.isAsyncFunction())return r||this.raise(w.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(n,!0,!r&&a)}const l=this.state.value,h=this.parseExpression();return Me(s)&&h.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(n,l,h,t):this.parseExpressionStatement(n,h,e)}assertModuleNodeAllowed(t){!this.options.allowImportExportEverywhere&&!this.inModule&&this.raise(w.ImportOutsideModule,t)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(t,e,s){return t&&(e.decorators&&e.decorators.length>0?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(w.DecoratorsBeforeAfterExport,e.decorators[0]),e.decorators.unshift(...t)):e.decorators=t,this.resetStartLocationFromNode(e,t[0]),s&&this.resetStartLocationFromNode(s,e)),e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(t){const e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))t||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(w.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(w.UnexpectedLeadingDecorator,this.state.startLoc);return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);const t=this.startNode();if(this.next(),this.hasPlugin("decorators")){const e=this.state.startLoc;let s;if(this.match(10)){const n=this.state.startLoc;this.next(),s=this.parseExpression(),this.expect(11),s=this.wrapParenthesis(n,s);const r=this.state.startLoc;t.expression=this.parseMaybeDecoratorArguments(s),this.getPluginOption("decorators","allowCallParenthesized")===!1&&t.expression!==s&&this.raise(w.DecoratorArgumentsOutsideParentheses,r)}else{for(s=this.parseIdentifier(!1);this.eat(16);){const n=this.startNodeAt(e);n.object=s,this.match(138)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),n.property=this.parsePrivateName()):n.property=this.parseIdentifier(!0),n.computed=!1,s=this.finishNode(n,"MemberExpression")}t.expression=this.parseMaybeDecoratorArguments(s)}}else t.expression=this.parseExprSubscripts();return this.finishNode(t,"Decorator")}parseMaybeDecoratorArguments(t){if(this.eat(10)){const e=this.startNodeAtNode(t);return e.callee=t,e.arguments=this.parseCallExpressionArguments(11,!1),this.toReferencedList(e.arguments),this.finishNode(e,"CallExpression")}return t}parseBreakContinueStatement(t,e){return this.next(),this.isLineTerminator()?t.label=null:(t.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(t,e),this.finishNode(t,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(t,e){let s;for(s=0;sthis.parseStatement()),this.state.labels.pop(),this.expect(92),t.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(t,"DoWhileStatement")}parseForStatement(t){this.next(),this.state.labels.push(sr);let e=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(e=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(t,null);const s=this.isContextual(100);{const l=this.isContextual(96)&&this.startsAwaitUsing(),h=l||this.isContextual(107)&&this.startsUsingForOf(),u=s&&this.hasFollowingBindingAtom()||h;if(this.match(74)||this.match(75)||u){const d=this.startNode();let c;l?(c="await using",this.recordAwaitIfAllowed()||this.raise(w.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):c=this.state.value,this.next(),this.parseVar(d,!0,c);const f=this.finishNode(d,"VariableDeclaration"),p=this.match(58);return p&&h&&this.raise(w.ForInUsing,f),(p||this.isContextual(102))&&f.declarations.length===1?this.parseForIn(t,f,e):(e!==null&&this.unexpected(e),this.parseFor(t,f))}}const n=this.isContextual(95),r=new Qi,a=this.parseExpression(!0,r),o=this.isContextual(102);if(o&&(s&&this.raise(w.ForOfLet,a),e===null&&n&&a.type==="Identifier"&&this.raise(w.ForOfAsync,a)),o||this.match(58)){this.checkDestructuringPrivate(r),this.toAssignable(a,!0);const l=o?"ForOfStatement":"ForInStatement";return this.checkLVal(a,{type:l}),this.parseForIn(t,a,e)}else this.checkExpressionErrors(r,!0);return e!==null&&this.unexpected(e),this.parseFor(t,a)}parseFunctionStatement(t,e,s){return this.next(),this.parseFunction(t,1|(s?2:0)|(e?8:0))}parseIfStatement(t){return this.next(),t.test=this.parseHeaderExpression(),t.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),t.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(t,"IfStatement")}parseReturnStatement(t){return!this.prodParam.hasReturn&&!this.options.allowReturnOutsideFunction&&this.raise(w.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")}parseSwitchStatement(t){this.next(),t.discriminant=this.parseHeaderExpression();const e=t.cases=[];this.expect(5),this.state.labels.push(hd),this.scope.enter(0);let s;for(let n;!this.match(8);)if(this.match(61)||this.match(65)){const r=this.match(61);s&&this.finishNode(s,"SwitchCase"),e.push(s=this.startNode()),s.consequent=[],this.next(),r?s.test=this.parseExpression():(n&&this.raise(w.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),n=!0,s.test=null),this.expect(14)}else s?s.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),s&&this.finishNode(s,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(t,"SwitchStatement")}parseThrowStatement(t){return this.next(),this.hasPrecedingLineBreak()&&this.raise(w.NewlineAfterThrow,this.state.lastTokEndLoc),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")}parseCatchClauseParam(){const t=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&t.type==="Identifier"?8:0),this.checkLVal(t,{type:"CatchClause"},9),t}parseTryStatement(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.match(62)){const e=this.startNode();this.next(),this.match(10)?(this.expect(10),e.param=this.parseCatchClauseParam(),this.expect(11)):(e.param=null,this.scope.enter(0)),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(67)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(w.NoCatchOrFinally,t),this.finishNode(t,"TryStatement")}parseVarStatement(t,e,s=!1){return this.next(),this.parseVar(t,!1,e,s),this.semicolon(),this.finishNode(t,"VariableDeclaration")}parseWhileStatement(t){return this.next(),t.test=this.parseHeaderExpression(),this.state.labels.push(sr),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(t,"WhileStatement")}parseWithStatement(t){return this.state.strict&&this.raise(w.StrictWith,this.state.startLoc),this.next(),t.object=this.parseHeaderExpression(),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(t,"WithStatement")}parseEmptyStatement(t){return this.next(),this.finishNode(t,"EmptyStatement")}parseLabeledStatement(t,e,s,n){for(const a of this.state.labels)a.name===e&&this.raise(w.LabelRedeclaration,s,{labelName:e});const r=tp(this.state.type)?1:this.match(71)?2:null;for(let a=this.state.labels.length-1;a>=0;a--){const o=this.state.labels[a];if(o.statementStart===t.start)o.statementStart=this.state.start,o.kind=r;else break}return this.state.labels.push({name:e,kind:r,statementStart:this.state.start}),t.body=n&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),t.label=s,this.finishNode(t,"LabeledStatement")}parseExpressionStatement(t,e,s){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")}parseBlock(t=!1,e=!0,s){const n=this.startNode();return t&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(n,t,!1,8,s),e&&this.scope.exit(),this.finishNode(n,"BlockStatement")}isValidDirective(t){return t.type==="ExpressionStatement"&&t.expression.type==="StringLiteral"&&!t.expression.extra.parenthesized}parseBlockBody(t,e,s,n,r){const a=t.body=[],o=t.directives=[];this.parseBlockOrModuleBlockBody(a,e?o:void 0,s,n,r)}parseBlockOrModuleBlockBody(t,e,s,n,r){const a=this.state.strict;let o=!1,l=!1;for(;!this.match(n);){const h=s?this.parseModuleItem():this.parseStatementListItem();if(e&&!l){if(this.isValidDirective(h)){const u=this.stmtToDirective(h);e.push(u),!o&&u.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}l=!0,this.state.strictErrors.clear()}t.push(h)}r==null||r.call(this,o),a||this.setStrict(!1),this.next()}parseFor(t,e){return t.init=e,this.semicolon(!1),t.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),t.update=this.match(11)?null:this.parseExpression(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,"ForStatement")}parseForIn(t,e,s){const n=this.match(58);return this.next(),n?s!==null&&this.unexpected(s):t.await=s!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!n||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(w.ForInOfLoopInitializer,e,{type:n?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(w.InvalidLhs,e,{ancestor:{type:"ForStatement"}}),t.left=e,t.right=n?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,n?"ForInStatement":"ForOfStatement")}parseVar(t,e,s,n=!1){const r=t.declarations=[];for(t.kind=s;;){const a=this.startNode();if(this.parseVarId(a,s),a.init=this.eat(29)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,a.init===null&&!n&&(a.id.type!=="Identifier"&&!(e&&(this.match(58)||this.isContextual(102)))?this.raise(w.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(s==="const"||s==="using"||s==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(w.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:s})),r.push(this.finishNode(a,"VariableDeclarator")),!this.eat(12))break}return t}parseVarId(t,e){const s=this.parseBindingAtom();(e==="using"||e==="await using")&&(s.type==="ArrayPattern"||s.type==="ObjectPattern")&&this.raise(w.UsingDeclarationHasBindingPattern,s.loc.start),this.checkLVal(s,{type:"VariableDeclarator"},e==="var"?5:8201),t.id=s}parseAsyncFunctionExpression(t){return this.parseFunction(t,8)}parseFunction(t,e=0){const s=e&2,n=!!(e&1),r=n&&!(e&4),a=!!(e&8);this.initFunction(t,a),this.match(55)&&(s&&this.raise(w.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),t.generator=!0),n&&(t.id=this.parseFunctionId(r));const o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(Zi(a,t.generator)),n||(t.id=this.parseFunctionId()),this.parseFunctionParams(t,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(t,n?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),n&&!s&&this.registerFunctionStatementId(t),this.state.maybeInArrowParameters=o,t}parseFunctionId(t){return t||Me(this.state.type)?this.parseIdentifier():null}parseFunctionParams(t,e){this.expect(10),this.expressionScope.enter(Mp()),t.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(t){!t.id||this.scope.declareName(t.id.name,!this.options.annexB||this.state.strict||t.generator||t.async?this.scope.treatFunctionsAsVar?5:8201:17,t.id.loc.start)}parseClass(t,e,s){this.next();const n=this.state.strict;return this.state.strict=!0,this.parseClassId(t,e,s),this.parseClassSuper(t),t.body=this.parseClassBody(!!t.superClass,n),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(t){return t.type==="Identifier"&&t.name==="constructor"||t.type==="StringLiteral"&&t.value==="constructor"}isNonstaticConstructor(t){return!t.computed&&!t.static&&this.nameIsConstructor(t.key)}parseClassBody(t,e){this.classScope.enter();const s={hadConstructor:!1,hadSuperClass:t};let n=[];const r=this.startNode();if(r.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(n.length>0)throw this.raise(w.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){n.push(this.parseDecorator());continue}const a=this.startNode();n.length&&(a.decorators=n,this.resetStartLocationFromNode(a,n[0]),n=[]),this.parseClassMember(r,a,s),a.kind==="constructor"&&a.decorators&&a.decorators.length>0&&this.raise(w.DecoratorConstructor,a)}}),this.state.strict=e,this.next(),n.length)throw this.raise(w.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(r,"ClassBody")}parseClassMemberFromModifier(t,e){const s=this.parseIdentifier(!0);if(this.isClassMethod()){const n=e;return n.kind="method",n.computed=!1,n.key=s,n.static=!1,this.pushClassMethod(t,n,!1,!1,!1,!1),!0}else if(this.isClassProperty()){const n=e;return n.computed=!1,n.key=s,n.static=!1,t.body.push(this.parseClassProperty(n)),!0}return this.resetPreviousNodeTrailingComments(s),!1}parseClassMember(t,e,s){const n=this.isContextual(106);if(n){if(this.parseClassMemberFromModifier(t,e))return;if(this.eat(5)){this.parseClassStaticBlock(t,e);return}}this.parseClassMemberWithIsStatic(t,e,s,n)}parseClassMemberWithIsStatic(t,e,s,n){const r=e,a=e,o=e,l=e,h=e,u=r,d=r;if(e.static=n,this.parsePropertyNamePrefixOperator(e),this.eat(55)){u.kind="method";const P=this.match(138);if(this.parseClassElementName(u),P){this.pushClassPrivateMethod(t,a,!0,!1);return}this.isNonstaticConstructor(r)&&this.raise(w.ConstructorIsGenerator,r.key),this.pushClassMethod(t,r,!0,!1,!1,!1);return}const c=!this.state.containsEsc&&Me(this.state.type),f=this.parseClassElementName(e),p=c?f.name:null,m=this.isPrivateName(f),b=this.state.startLoc;if(this.parsePostMemberNameModifiers(d),this.isClassMethod()){if(u.kind="method",m){this.pushClassPrivateMethod(t,a,!1,!1);return}const P=this.isNonstaticConstructor(r);let A=!1;P&&(r.kind="constructor",s.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(w.DuplicateConstructor,f),P&&this.hasPlugin("typescript")&&e.override&&this.raise(w.OverrideOnConstructor,f),s.hadConstructor=!0,A=s.hadSuperClass),this.pushClassMethod(t,r,!1,!1,P,A)}else if(this.isClassProperty())m?this.pushClassPrivateProperty(t,l):this.pushClassProperty(t,o);else if(p==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(f);const P=this.eat(55);d.optional&&this.unexpected(b),u.kind="method";const A=this.match(138);this.parseClassElementName(u),this.parsePostMemberNameModifiers(d),A?this.pushClassPrivateMethod(t,a,P,!0):(this.isNonstaticConstructor(r)&&this.raise(w.ConstructorIsAsync,r.key),this.pushClassMethod(t,r,P,!0,!1,!1))}else if((p==="get"||p==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(f),u.kind=p;const P=this.match(138);this.parseClassElementName(r),P?this.pushClassPrivateMethod(t,a,!1,!1):(this.isNonstaticConstructor(r)&&this.raise(w.ConstructorIsAccessor,r.key),this.pushClassMethod(t,r,!1,!1,!1,!1)),this.checkGetterSetterParams(r)}else if(p==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(f);const P=this.match(138);this.parseClassElementName(o),this.pushClassAccessorProperty(t,h,P)}else this.isLineTerminator()?m?this.pushClassPrivateProperty(t,l):this.pushClassProperty(t,o):this.unexpected()}parseClassElementName(t){const{type:e,value:s}=this.state;if((e===132||e===133)&&t.static&&s==="prototype"&&this.raise(w.StaticPrototype,this.state.startLoc),e===138){s==="constructor"&&this.raise(w.ConstructorClassPrivateField,this.state.startLoc);const n=this.parsePrivateName();return t.key=n,n}return this.parsePropertyName(t),t.key}parseClassStaticBlock(t,e){var s;this.scope.enter(208);const n=this.state.labels;this.state.labels=[],this.prodParam.enter(0);const r=e.body=[];this.parseBlockOrModuleBlockBody(r,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=n,t.body.push(this.finishNode(e,"StaticBlock")),(s=e.decorators)!=null&&s.length&&this.raise(w.DecoratorStaticBlock,e)}pushClassProperty(t,e){!e.computed&&this.nameIsConstructor(e.key)&&this.raise(w.ConstructorClassField,e.key),t.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(t,e){const s=this.parseClassPrivateProperty(e);t.body.push(s),this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),0,s.key.loc.start)}pushClassAccessorProperty(t,e,s){!s&&!e.computed&&this.nameIsConstructor(e.key)&&this.raise(w.ConstructorClassField,e.key);const n=this.parseClassAccessorProperty(e);t.body.push(n),s&&this.classScope.declarePrivateName(this.getPrivateNameSV(n.key),0,n.key.loc.start)}pushClassMethod(t,e,s,n,r,a){t.body.push(this.parseMethod(e,s,n,r,a,"ClassMethod",!0))}pushClassPrivateMethod(t,e,s,n){const r=this.parseMethod(e,s,n,!1,!1,"ClassPrivateMethod",!0);t.body.push(r);const a=r.kind==="get"?r.static?6:2:r.kind==="set"?r.static?5:1:0;this.declareClassPrivateMethodInScope(r,a)}declareClassPrivateMethodInScope(t,e){this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),e,t.key.loc.start)}parsePostMemberNameModifiers(t){}parseClassPrivateProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassPrivateProperty")}parseClassProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassProperty")}parseClassAccessorProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassAccessorProperty")}parseInitializer(t){this.scope.enter(80),this.expressionScope.enter(nc()),this.prodParam.enter(0),t.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(t,e,s,n=8331){if(Me(this.state.type))t.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(t.id,n);else if(s||!e)t.id=null;else throw this.raise(w.MissingClassName,this.state.startLoc)}parseClassSuper(t){t.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(t,e){const s=this.parseMaybeImportPhase(t,!0),n=this.maybeParseExportDefaultSpecifier(t,s),r=!n||this.eat(12),a=r&&this.eatExportStar(t),o=a&&this.maybeParseExportNamespaceSpecifier(t),l=r&&(!o||this.eat(12)),h=n||a;if(a&&!o){if(n&&this.unexpected(),e)throw this.raise(w.UnsupportedDecoratorExport,t);return this.parseExportFrom(t,!0),this.finishNode(t,"ExportAllDeclaration")}const u=this.maybeParseExportNamedSpecifiers(t);n&&r&&!a&&!u&&this.unexpected(null,5),o&&l&&this.unexpected(null,98);let d;if(h||u){if(d=!1,e)throw this.raise(w.UnsupportedDecoratorExport,t);this.parseExportFrom(t,h)}else d=this.maybeParseExportDeclaration(t);if(h||u||d){var c;const f=t;if(this.checkExport(f,!0,!1,!!f.source),((c=f.declaration)==null?void 0:c.type)==="ClassDeclaration")this.maybeTakeDecorators(e,f.declaration,f);else if(e)throw this.raise(w.UnsupportedDecoratorExport,t);return this.finishNode(f,"ExportNamedDeclaration")}if(this.eat(65)){const f=t,p=this.parseExportDefaultExpression();if(f.declaration=p,p.type==="ClassDeclaration")this.maybeTakeDecorators(e,p,f);else if(e)throw this.raise(w.UnsupportedDecoratorExport,t);return this.checkExport(f,!0,!0),this.finishNode(f,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(t){return this.eat(55)}maybeParseExportDefaultSpecifier(t,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e==null?void 0:e.loc.start);const s=e||this.parseIdentifier(!0),n=this.startNodeAtNode(s);return n.exported=s,t.specifiers=[this.finishNode(n,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(t){if(this.isContextual(93)){var e,s;(s=(e=t).specifiers)!=null||(e.specifiers=[]);const n=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),n.exported=this.parseModuleExportName(),t.specifiers.push(this.finishNode(n,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(t){if(this.match(5)){const e=t;e.specifiers||(e.specifiers=[]);const s=e.exportKind==="type";return e.specifiers.push(...this.parseExportSpecifiers(s)),e.source=null,e.declaration=null,this.hasPlugin("importAssertions")&&(e.assertions=[]),!0}return!1}maybeParseExportDeclaration(t){return this.shouldParseExportDeclaration()?(t.specifiers=[],t.source=null,this.hasPlugin("importAssertions")&&(t.assertions=[]),t.declaration=this.parseExportDeclaration(t),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;const t=this.nextTokenInLineStart();return this.isUnparsedContextual(t,"function")}parseExportDefaultExpression(){const t=this.startNode();if(this.match(68))return this.next(),this.parseFunction(t,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(t,13);if(this.match(80))return this.parseClass(t,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(w.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet())throw this.raise(w.UnsupportedDefaultExport,this.state.startLoc);const e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(t){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){const{type:t}=this.state;if(Me(t)){if(t===95&&!this.state.containsEsc||t===100)return!1;if((t===130||t===129)&&!this.state.containsEsc){const{type:n}=this.lookahead();if(Me(n)&&n!==98||n===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;const e=this.nextTokenStart(),s=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||Me(this.state.type)&&s)return!0;if(this.match(65)&&s){const n=this.input.charCodeAt(this.nextTokenStartSince(e+4));return n===34||n===39}return!1}parseExportFrom(t,e){this.eatContextual(98)?(t.source=this.parseImportSource(),this.checkExport(t),this.maybeParseImportAttributes(t),this.checkJSONModuleImport(t)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){const{type:t}=this.state;return t===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(w.DecoratorBeforeExport,this.state.startLoc),!0):this.isContextual(107)?(this.raise(w.UsingDeclarationExport,this.state.startLoc),!0):this.isContextual(96)&&this.startsAwaitUsing()?(this.raise(w.UsingDeclarationExport,this.state.startLoc),!0):t===74||t===75||t===68||t===80||this.isLet()||this.isAsyncFunction()}checkExport(t,e,s,n){if(e){var r;if(s){if(this.checkDuplicateExports(t,"default"),this.hasPlugin("exportDefaultFrom")){var a;const o=t.declaration;o.type==="Identifier"&&o.name==="from"&&o.end-o.start===4&&!((a=o.extra)!=null&&a.parenthesized)&&this.raise(w.ExportDefaultFromAsIdentifier,o)}}else if((r=t.specifiers)!=null&&r.length)for(const o of t.specifiers){const{exported:l}=o,h=l.type==="Identifier"?l.name:l.value;if(this.checkDuplicateExports(o,h),!n&&o.local){const{local:u}=o;u.type!=="Identifier"?this.raise(w.ExportBindingIsString,o,{localName:u.value,exportName:h}):(this.checkReservedWord(u.name,u.loc.start,!0,!1),this.scope.checkLocalExport(u))}}else if(t.declaration){const o=t.declaration;if(o.type==="FunctionDeclaration"||o.type==="ClassDeclaration"){const{id:l}=o;if(!l)throw new Error("Assertion failure");this.checkDuplicateExports(t,l.name)}else if(o.type==="VariableDeclaration")for(const l of o.declarations)this.checkDeclaration(l.id)}}}checkDeclaration(t){if(t.type==="Identifier")this.checkDuplicateExports(t,t.name);else if(t.type==="ObjectPattern")for(const e of t.properties)this.checkDeclaration(e);else if(t.type==="ArrayPattern")for(const e of t.elements)e&&this.checkDeclaration(e);else t.type==="ObjectProperty"?this.checkDeclaration(t.value):t.type==="RestElement"?this.checkDeclaration(t.argument):t.type==="AssignmentPattern"&&this.checkDeclaration(t.left)}checkDuplicateExports(t,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(w.DuplicateDefaultExport,t):this.raise(w.DuplicateExport,t,{exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(t){const e=[];let s=!0;for(this.expect(5);!this.eat(8);){if(s)s=!1;else if(this.expect(12),this.eat(8))break;const n=this.isContextual(130),r=this.match(133),a=this.startNode();a.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(a,r,t,n))}return e}parseExportSpecifier(t,e,s,n){return this.eatContextual(93)?t.exported=this.parseModuleExportName():e?t.exported=$p(t.local):t.exported||(t.exported=zt(t.local)),this.finishNode(t,"ExportSpecifier")}parseModuleExportName(){if(this.match(133)){const t=this.parseStringLiteral(this.state.value),e=fd.exec(t.value);return e&&this.raise(w.ModuleExportNameHasLoneSurrogate,t,{surrogateCharCode:e[0].charCodeAt(0)}),t}return this.parseIdentifier(!0)}isJSONModuleImport(t){return t.assertions!=null?t.assertions.some(({key:e,value:s})=>s.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(t){const{specifiers:e}=t,s=e.length===1?e[0].type:null;if(t.phase==="source")s!=="ImportDefaultSpecifier"&&this.raise(w.SourcePhaseImportRequiresDefault,e[0].loc.start);else if(t.phase==="defer")s!=="ImportNamespaceSpecifier"&&this.raise(w.DeferImportRequiresNamespace,e[0].loc.start);else if(t.module){var n;s!=="ImportDefaultSpecifier"&&this.raise(w.ImportReflectionNotBinding,e[0].loc.start),((n=t.assertions)==null?void 0:n.length)>0&&this.raise(w.ImportReflectionHasAssertion,e[0].loc.start)}}checkJSONModuleImport(t){if(this.isJSONModuleImport(t)&&t.type!=="ExportAllDeclaration"){const{specifiers:e}=t;if(e!=null){const s=e.find(n=>{let r;if(n.type==="ExportSpecifier"?r=n.local:n.type==="ImportSpecifier"&&(r=n.imported),r!==void 0)return r.type==="Identifier"?r.name!=="default":r.value!=="default"});s!==void 0&&this.raise(w.ImportJSONBindingNotDefault,s.loc.start)}}}isPotentialImportPhase(t){return t?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(t,e,s,n){e||(s==="module"?(this.expectPlugin("importReflection",n),t.module=!0):this.hasPlugin("importReflection")&&(t.module=!1),s==="source"?(this.expectPlugin("sourcePhaseImports",n),t.phase="source"):s==="defer"?(this.expectPlugin("deferredImportEvaluation",n),t.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(t.phase=null))}parseMaybeImportPhase(t,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(t,e,null),null;const s=this.parseIdentifier(!0),{type:n}=this.state;return(Pt(n)?n!==98||this.lookaheadCharCode()===102:n!==12)?(this.resetPreviousIdentifierLeadingComments(s),this.applyImportPhase(t,e,s.name,s.loc.start),null):(this.applyImportPhase(t,e,null),s)}isPrecedingIdImportPhase(t){const{type:e}=this.state;return Me(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(t){return this.match(133)?this.parseImportSourceAndAttributes(t):this.parseImportSpecifiersAndAfter(t,this.parseMaybeImportPhase(t,!1))}parseImportSpecifiersAndAfter(t,e){t.specifiers=[];const n=!this.maybeParseDefaultImportSpecifier(t,e)||this.eat(12),r=n&&this.maybeParseStarImportSpecifier(t);return n&&!r&&this.parseNamedImportSpecifiers(t),this.expectContextual(98),this.parseImportSourceAndAttributes(t)}parseImportSourceAndAttributes(t){var e;return(e=t.specifiers)!=null||(t.specifiers=[]),t.source=this.parseImportSource(),this.maybeParseImportAttributes(t),this.checkImportReflection(t),this.checkJSONModuleImport(t),this.semicolon(),this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.match(133)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(t,e,s){e.local=this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(e,s))}finishImportSpecifier(t,e,s=8201){return this.checkLVal(t.local,{type:e},s),this.finishNode(t,e)}parseImportAttributes(){this.expect(5);const t=[],e=new Set;do{if(this.match(8))break;const s=this.startNode(),n=this.state.value;if(e.has(n)&&this.raise(w.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:n}),e.add(n),this.match(133)?s.key=this.parseStringLiteral(n):s.key=this.parseIdentifier(!0),this.expect(14),!this.match(133))throw this.raise(w.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return this.expect(8),t}parseModuleAttributes(){const t=[],e=new Set;do{const s=this.startNode();if(s.key=this.parseIdentifier(!0),s.key.name!=="type"&&this.raise(w.ModuleAttributeDifferentFromType,s.key),e.has(s.key.name)&&this.raise(w.ModuleAttributesWithDuplicateKeys,s.key,{key:s.key.name}),e.add(s.key.name),this.expect(14),!this.match(133))throw this.raise(w.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return t}maybeParseImportAttributes(t){let e;var s=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?e=this.parseModuleAttributes():(this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes"),e=this.parseImportAttributes()),s=!0}else if(this.isContextual(94)&&!this.hasPrecedingLineBreak())this.hasPlugin("importAttributes")?(this.getPluginOption("importAttributes","deprecatedAssertSyntax")!==!0&&this.raise(w.ImportAttributesUseAssert,this.state.startLoc),this.addExtra(t,"deprecatedAssertSyntax",!0)):this.expectOnePlugin(["importAttributes","importAssertions"]),this.next(),e=this.parseImportAttributes();else if(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))e=[];else if(this.hasPlugin("moduleAttributes"))e=[];else return;!s&&this.hasPlugin("importAssertions")?t.assertions=e:t.attributes=e}maybeParseDefaultImportSpecifier(t,e){if(e){const s=this.startNodeAtNode(e);return s.local=e,t.specifiers.push(this.finishImportSpecifier(s,"ImportDefaultSpecifier")),!0}else if(Pt(this.state.type))return this.parseImportSpecifierLocal(t,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(t){if(this.match(55)){const e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(t,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(t){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(w.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}const s=this.startNode(),n=this.match(133),r=this.isContextual(130);s.imported=this.parseModuleExportName();const a=this.parseImportSpecifier(s,n,t.importKind==="type"||t.importKind==="typeof",r,void 0);t.specifiers.push(a)}}parseImportSpecifier(t,e,s,n,r){if(this.eatContextual(93))t.local=this.parseIdentifier();else{const{imported:a}=t;if(e)throw this.raise(w.ImportBindingIsString,t,{importName:a.value});this.checkReservedWord(a.name,t.loc.start,!0,!0),t.local||(t.local=zt(a))}return this.finishImportSpecifier(t,"ImportSpecifier",r)}isThisParam(t){return t.type==="Identifier"&&t.name==="this"}}class cc extends dd{constructor(t,e,s){t=cd(t),super(t,e),this.options=t,this.initializeScopes(),this.plugins=s,this.filename=t.sourceFilename}getScopeHandler(){return la}parse(){this.enterInitialScopes();const t=this.startNode(),e=this.startNode();return this.nextToken(),t.errors=null,this.parseTopLevel(t,e),t.errors=this.state.errors,t.comments.length=this.state.commentsLen,t}}function md(i,t){var e;if(((e=t)==null?void 0:e.sourceType)==="unambiguous"){t=Object.assign({},t);try{t.sourceType="module";const s=ri(t,i),n=s.parse();if(s.sawUnambiguousESM)return n;if(s.ambiguousScriptDifferentAst)try{return t.sourceType="script",ri(t,i).parse()}catch{}else n.program.sourceType="script";return n}catch(s){try{return t.sourceType="script",ri(t,i).parse()}catch{}throw s}}else return ri(t,i).parse()}function yd(i,t){const e=ri(t,i);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function gd(i){const t={};for(const e of Object.keys(i))t[e]=Bt(i[e]);return t}const Td=gd(Yf);function ri(i,t){let e=cc;const s=new Map;if(i!=null&&i.plugins){for(const n of i.plugins){let r,a;typeof n=="string"?r=n:[r,a]=n,s.has(r)||s.set(r,a||{})}od(s),e=bd(s)}return new e(i,t,s)}const Eo=new Map;function bd(i){const t=[];for(const n of ld)i.has(n)&&t.push(n);const e=t.join("|");let s=Eo.get(e);if(!s){s=cc;for(const n of t)s=lc[n](s);Eo.set(e,s)}return s}var xd=vn.parse=md;vn.parseExpression=yd;vn.tokTypes=Td;var _i={},hs={},gt={};Object.defineProperty(gt,"__esModule",{value:!0});function uc(i){return{type:"concat",parts:i}}gt.concat=uc;function Sd(i,t){const e=[];return t.forEach((s,n)=>{n>0&&e.push(i),e.push(s)}),uc(e)}gt.join=Sd;gt.line={type:"line",hard:!1,soft:!1};gt.hardline={type:"line",hard:!0,soft:!1};gt.softline={type:"line",hard:!1,soft:!0};function Pd(i){return{type:"indent",content:i}}gt.indent=Pd;function Ed(i){return{type:"lineSuffix",content:i}}gt.lineSuffix=Ed;function Ad(i,t=!1){return{type:"group",content:i,willBreak:t}}gt.group=Ad;gt.breakParent={type:"breakParent"};function wd(i){return typeof i=="string"&&i.length===0}gt.isEmpty=wd;var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});function Cd(i){return i.range[0]}Ye.locStart=Cd;function kd(i){return i.range[1]}Ye.locEnd=kd;function vd(i){if(!i||typeof i.type!="string")return!1;switch(i.type){case"LabelStatement":case"BreakStatement":case"GotoStatement":case"ReturnStatement":case"IfStatement":case"IfClause":case"ElseifClause":case"ElseClause":case"WhileStatement":case"DoStatement":case"RepeatStatement":case"LocalStatement":case"AssignmentStatement":case"CallStatement":case"FunctionDeclaration":case"ForNumericStatement":case"ForGenericStatement":case"Chunk":case"Identifier":case"BooleanLiteral":case"NilLiteral":case"NumericLiteral":case"StringLiteral":case"VarargLiteral":case"TableKey":case"TableKeyString":case"TableValue":case"TableConstructorExpression":case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"MemberExpression":case"IndexExpression":case"CallExpression":case"TableCallExpression":case"StringCallExpression":case"Comment":return!0;default:return!1}}Ye.isNode=vd;function ha(i,t,e,s={}){let n=0;return e.forEach(r=>{if((s.searchBackwards?i.substring(t-r.length,t):i.substring(t,t+r.length))===r){n=r.length;return}}),t+(s.searchBackwards?-n:n)}Ye.skipOnce=ha;function fa(i,t,e,s={}){let n=null;for(;n!==t;)n=t,t=ha(i,t,e,s);return t}Ye.skipMany=fa;function wi(i,t,e={}){return ha(i,t,[` `,`\r -`],e)}Ye.skipNewLine=wi;function Gs(i,t,e={}){return fa(i,t,[" "," "],e)}Ye.skipSpaces=Gs;function hc(i,t,e={}){return fa(i,Gs(i,t),[";"],e)}Ye.skipToLineEnd=hc;function fc(i,t,e={}){const s=Gs(i,t,e),r=wi(i,s,e);return s!==r}Ye.hasNewLine=fc;function Ld(i,t,e){return i.substr(t,e-t).indexOf(` +`],e)}Ye.skipNewLine=wi;function Gs(i,t,e={}){return fa(i,t,[" "," "],e)}Ye.skipSpaces=Gs;function hc(i,t,e={}){return fa(i,Gs(i,t),[";"],e)}Ye.skipToLineEnd=hc;function fc(i,t,e={}){const s=Gs(i,t,e),n=wi(i,s,e);return s!==n}Ye.hasNewLine=fc;function Ld(i,t,e){return i.substr(t,e-t).indexOf(` `)!==-1}Ye.hasNewLineInRange=Ld;function Id(i,t){t=Gs(i,t,{searchBackwards:!0}),t=wi(i,t,{searchBackwards:!0}),t=Gs(i,t,{searchBackwards:!0});const e=wi(i,t,{searchBackwards:!0});return t!==e}Ye.isPreviousLineEmpty=Id;function pc(i,t){if(i.charAt(t)==="-"&&i.charAt(t+1)==="-")for(t+=2;t>=0&&t=0&&!(Ue.locStart(e[n])<=Ue.locStart(r)&&Ue.locEnd(e[n])<=Ue.locEnd(i));--n);e.splice(n+1,0,r)}}for(const r of t){const n=i[r];Array.isArray(n)?n.forEach(s):n&&s(n)}return e}function Md(i,t){for(const e of i.comments){dc(i,e);const s=e.precedingNode,r=e.enclosingNode,n=e.followingNode;Ue.hasNewLine(t.sourceText,Ue.locStart(e),{searchBackwards:!0})?jd(r,e)||Ud(s,r,e)||Vd(s,r,n,e)||(n?Ao(n,e):s?wo(s,e):Wt(r||i,e)):Hd(s,r,e)||Gd(s,r,e)||(s?wo(s,e):n?Ao(n,e):Wt(r||i,e))}}hs.attachComments=Md;function Od(i,t){if(!t.sourceText.startsWith("#!"))return;const e=t.sourceText.indexOf(` -`),s=t.sourceText.slice(0,e),r=t.sourceText.slice(2,e);i.comments.push({type:"Comment",loc:{start:{line:1,column:0},end:{line:1,column:e}},range:[0,e],raw:s,value:r})}hs.injectShebang=Od;function Dd(i,t=!1){const e=i.getValue();if(!e||!e.attachedComments)return"";const s=[];return i.forEach(r=>{const n=r.getValue();n.commentType===Mt.Dangling&&s.push(n.raw)},"attachedComments"),s.length===0?"":t?He.join(He.hardline,s):He.indent(He.concat([He.hardline,He.join(He.hardline,s)]))}hs.printDanglingComments=Dd;function Fd(i){const t=i.getValue();if(!t||!t.attachedComments)return"";const e=[];return i.forEach(s=>{const r=s.getValue();r.commentType===Mt.DanglingStatement&&(e.push(" "),e.push(r.raw))},"attachedComments"),e.length===0?"":He.concat(e)}hs.printDanglingStatementComments=Fd;function Bd(i,t){const e=i.getValue();if(e.raw.startsWith("--[["))return He.concat([e.raw,Ue.hasNewLine(t.sourceText,Ue.locEnd(e))?He.hardline:" "]);const r=[];return r.push(e.raw),r.push(He.hardline),Ue.isNextLineEmpty(t.sourceText,Ue.locEnd(e))&&r.push(He.hardline),He.concat(r)}function Rd(i,t){const e=i.getValue();if(Ue.hasNewLine(t.sourceText,Ue.locStart(e),{searchBackwards:!0})){const r=Ue.isPreviousLineEmpty(t.sourceText,Ue.locStart(e));return He.concat([He.hardline,r?He.hardline:"",e.raw])}if(e.raw.startsWith("--[["))return He.concat([" ",e.raw]);const s=[];return Ue.isNextLineEmpty(t.sourceText,Ue.locStart(e),{searchBackwards:!0})&&s.push(He.hardline),s.push(" "),s.push(e.raw),s.push(He.breakParent),He.lineSuffix(He.concat(s))}function $d(i,t,e){const s=i.getValue(),r=e(i),n=s.attachedComments;if(!n||n.length===0)return r;const a=[],o=[r];return i.forEach(l=>{switch(l.getValue().commentType){case Mt.Leading:a.push(Bd(i,t));break;case Mt.Trailing:o.push(Rd(i,t));break}},"attachedComments"),He.concat(a.concat(o))}hs.printComments=$d;function dc(i,t){const e=_d(i);let s=null,r=null,n=0,a=e.length;for(;n0?!1:t.parameters.length>0&&t.parameters[t.parameters.length-1]===i||i&&i.type==="Identifier"?(Wt(t,e),!0):!1}function Vd(i,t,e,s){return!t||t.type!=="IfStatement"?!1:e&&(e.type==="ElseifClause"||e.type==="ElseClause")||i&&i.type==="ElseClause"?(Wt(i,s),!0):!1}function Hd(i,t,e){if(e.raw.startsWith("--[[")||!t)return!1;switch(t.type){case"WhileStatement":if(i===t.condition)return ss(t,e),!0;break;case"DoStatement":case"RepeatStatement":if(i==null)return ss(t,e),!0;break;case"FunctionDeclaration":if(t.parameters.length&&i===t.parameters[t.parameters.length-1]||i===t.identifier)return ss(t,e),!0;break;case"ForNumericStatement":if(i===t.end||i===t.step)return ss(t,e),!0;break;case"ForGenericStatement":if(i===t.iterators[t.iterators.length-1])return ss(t,e),!0;break;case"IfClause":case"ElseifClause":if(i===t.condition&&e.loc.start.column>i.loc.start.column)return ss(t,e),!0;break;case"ElseClause":if(i==null)return ss(t,e),!0;break}return!1}function Gd(i,t,e){if(!i||!t||t.type!=="IfStatement")return!1;switch(i.type){case"IfClause":case"ElseifClause":case"ElseClause":if(i.body.length===0)return ss(i,e),!0;break}return!1}var pa={},da={};Object.defineProperty(da,"__esModule",{value:!0});const Wd=Ye;class Kd{constructor(t){this.stack=[t]}getValue(){return this.stack[this.stack.length-1]}getNodeAtDepth(t){for(let e=this.stack.length-1;e>=0;e-=2){const s=this.stack[e];if(Wd.isNode(s)&&--t<0)return s}return null}getParent(t=0){return this.getNodeAtDepth(t+1)}call(t,e){const s=this.getValue(),r=this.stack.length;this.stack.push(e,s[e]);const n=t(this);return this.stack.length=r,n}forEach(t,e=null){let s=this.getValue();const r=this.stack.length;e&&(s=s[e],this.stack.push(s));for(let n=0;n{this.stack.push(o,a),r.push(t(this,o)),this.stack.length-=2}),this.stack.length=n,r}needsParens(){const t=this.getParent(),e=this.getValue();let s=!1;switch(e.type){case"FunctionDeclaration":case"Chunk":case"Identifier":case"BooleanLiteral":case"NilLiteral":case"NumericLiteral":case"StringLiteral":case"VarargLiteral":case"TableConstructorExpression":case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"MemberExpression":case"IndexExpression":case"CallExpression":case"TableCallExpression":case"StringCallExpression":s=e.inParens||!1}return t&&e.type==="UnaryExpression"&&t.type==="UnaryExpression"&&(s=!0),s}}da.FastPath=Kd;var Ir={};Object.defineProperty(Ir,"__esModule",{value:!0});function mc(i,t,e){let s=!1;const r=n=>{if(t(n)){s=!0;return}if(!s&&typeof n!="string"){switch(n.type){case"concat":n.parts.forEach(r);break;case"indent":case"group":case"lineSuffix":r(n.content);break}e&&e(n)}};r(i)}function qd(i,t){let e=!1;return mc(i,s=>t(s)?(e=!0,!0):!1),e}function zd(i){return qd(i,t=>{if(typeof t=="string")return!1;switch(t.type){case"line":if(t.hard)return!0;break;case"group":if(t.willBreak)return!0}return!1})}Ir.willBreak=zd;function Co(i){i.length>0&&(i[i.length-1].willBreak=!0)}function Jd(i){const t=[];mc(i,e=>{if(typeof e=="string")return!1;switch(e.type){case"breakParent":Co(t);break;case"group":t.push(e);break}return!1},e=>{if(typeof e=="string")return!1;if(e.type==="group"){const s=t.pop();s&&s.willBreak&&Co(t)}return!1})}Ir.propagateBreaks=Jd;var Nr={};(function(i){Object.defineProperty(i,"__esModule",{value:!0});var t;(function(r){r.StdOut="stdout",r.Replace="replace",r.Diff="diff"})(t=i.WriteMode||(i.WriteMode={})),i.defaultOptions={sourceText:"",lineWidth:120,indentCount:4,useTabs:!1,linebreakMultipleAssignments:!1,quotemark:"double",writeMode:t.StdOut};function e(r){return r==="single"?"'":'"'}i.getStringQuotemark=e;function s(r){return r==="single"?'"':"'"}i.getAlternativeStringQuotemark=s})(Nr);Object.defineProperty(pa,"__esModule",{value:!0});const Xd=da,V=gt,yc=Ir,hr=hs,An=Ye,wn=Nr;function gc(i,t,e){const s=[];return i.forEach(r=>{const n=[e(r)];An.isNextLineEmpty(t.sourceText,An.locEnd(r.getValue()))&&!Qd(i)&&n.push(V.hardline),s.push(V.concat(n))}),V.join(V.hardline,s)}function Dt(i,t,e,s){const r=i.call(n=>gc(n,t,e),s);return V.indent(V.concat([V.hardline,r]))}function Ft(i){return i.getValue().attachedComments?V.concat([hr.printDanglingStatementComments(i),hr.printDanglingComments(i)]):""}function Yd(i,t){const e=wn.getStringQuotemark(t),s=wn.getAlternativeStringQuotemark(t==="single"?"single":"double"),r=i.replace(/\\([\s\S])|(['"])/g,(n,a,o)=>a===s?a:o===e?"\\"+o:n);return e+r+e}function Zd(i,t){const e=i.getValue();if(e.type!=="StringLiteral")throw new Error("printStringLiteral: Expected StringLiteral, got "+e.type);if(e.raw.startsWith("[[")||e.raw.startsWith("[="))return e.raw;const s=e.raw.slice(1,-1);let r=t.quotemark;const n=wn.getStringQuotemark(r);return s.includes(n)&&(r=r==="single"?"double":"single"),Yd(s,r)}function Qd(i){const t=i.getParent(),e=i.getValue(),s=t.body;return s&&s[s.length-1]===e}function em(i,t,e){const s=i.getValue();if(!s)return"";const r=[],n=s;switch(n.type){case"Chunk":return r.push(i.call(p=>gc(p,t,e),"body")),r.push(hr.printDanglingComments(i,!0)),(n.body.length||n.attachedComments)&&r.push(V.hardline),V.concat(r);case"LabelStatement":return V.concat(["::",i.call(e,"label"),"::"]);case"GotoStatement":return V.concat(["goto ",i.call(e,"label")]);case"BreakStatement":return"break";case"ReturnStatement":return r.push("return"),n.arguments.length>0&&(r.push(" "),r.push(V.join(", ",i.map(e,"arguments")))),V.concat(r);case"WhileStatement":return r.push("while "),r.push(i.call(e,"condition")),r.push(" do"),r.push(Ft(i)),n.body.length&&r.push(Dt(i,t,e,"body")),r.push(V.concat([V.hardline,"end"])),V.concat(r);case"DoStatement":return r.push("do"),r.push(Ft(i)),n.body.length&&r.push(Dt(i,t,e,"body")),r.push(V.concat([V.hardline,"end"])),V.concat(r);case"RepeatStatement":return r.push("repeat"),r.push(Ft(i)),n.body.length&&r.push(Dt(i,t,e,"body")),r.push(V.concat([V.hardline,"until "])),r.push(i.call(e,"condition")),V.concat(r);case"LocalStatement":case"AssignmentStatement":{const p=[];n.type==="LocalStatement"&&p.push("local ");const m=t.linebreakMultipleAssignments;p.push(V.indent(V.join(V.concat([",",m?V.hardline:V.line]),i.map(e,"variables"))));let b="";const P=[];n.init.length&&(b=" =",n.init.length>1?P.push(V.indent(V.join(V.concat([",",V.line]),i.map(e,"init")))):P.push(V.join(V.concat([",",V.line]),i.map(e,"init"))));const A=n.init.some(U=>U!=null&&U.type!=="TableConstructorExpression"&&U.type!=="FunctionDeclaration");return V.group(V.concat([V.group(V.concat(p)),V.group(V.concat([b,A?V.indent(V.line):" ",V.concat(P)]))]))}case"CallStatement":return i.call(e,"expression");case"FunctionDeclaration":return n.isLocal&&r.push("local "),r.push("function"),n.identifier&&r.push(" ",i.call(e,"identifier")),r.push(V.concat(["(",V.group(V.indent(V.concat([V.softline,V.join(V.concat([",",V.line]),i.map(e,"parameters"))]))),")"])),r.push(Ft(i)),n.body.length&&r.push(Dt(i,t,e,"body")),r.push(V.hardline,"end"),V.concat(r);case"ForNumericStatement":return r.push("for "),r.push(i.call(e,"variable")),r.push(" = "),r.push(i.call(e,"start")),r.push(", "),r.push(i.call(e,"end")),n.step&&(r.push(", "),r.push(i.call(e,"step"))),r.push(" do"),r.push(Ft(i)),n.body.length&&r.push(Dt(i,t,e,"body")),r.push(V.concat([V.hardline,"end"])),V.concat(r);case"ForGenericStatement":return r.push("for "),r.push(V.join(", ",i.map(e,"variables"))),r.push(" in "),r.push(V.join(", ",i.map(e,"iterators"))),r.push(" do"),r.push(Ft(i)),n.body.length&&r.push(Dt(i,t,e,"body")),r.push(V.concat([V.hardline,"end"])),V.concat(r);case"IfStatement":const a=[];return i.forEach(p=>{a.push(e(p))},"clauses"),r.push(V.join(V.hardline,a)),r.push(V.concat([V.hardline,"end"])),V.concat(r);case"IfClause":return r.push(V.concat(["if ",V.group(V.concat([V.indent(V.concat([V.softline,i.call(e,"condition")])),V.softline]))," then"])),r.push(Ft(i)),n.body.length&&r.push(Dt(i,t,e,"body")),V.concat(r);case"ElseifClause":return r.push(V.concat(["elseif ",V.group(V.concat([V.indent(V.concat([V.softline,i.call(e,"condition")])),V.softline]))," then"])),r.push(Ft(i)),n.body.length&&r.push(Dt(i,t,e,"body")),V.concat(r);case"ElseClause":return r.push("else"),r.push(Ft(i)),n.body.length&&r.push(Dt(i,t,e,"body")),V.concat(r);case"BooleanLiteral":return n.raw;case"NilLiteral":return"nil";case"NumericLiteral":return n.raw;case"StringLiteral":return Zd(i,t);case"VarargLiteral":return"...";case"Identifier":return n.name;case"BinaryExpression":case"LogicalExpression":const l=i.getParent().type!==n.type&&n.left.type!==n.type&&n.right.type!==n.type,h=V.concat([n.operator,V.line,i.call(e,"right")]);return V.group(V.concat([i.call(e,"left"),V.indent(V.concat([" ",l?V.group(h):h]))]));case"UnaryExpression":return r.push(n.operator),n.operator==="not"&&r.push(" "),r.push(i.call(e,"argument")),V.concat(r);case"MemberExpression":return V.concat([i.call(e,"base"),n.indexer,i.call(e,"identifier")]);case"IndexExpression":return V.concat([i.call(e,"base"),"[",V.group(V.concat([V.indent(V.concat([V.softline,i.call(e,"index")])),V.softline])),"]"]);case"CallExpression":const u=i.map(e,"arguments");return V.concat([i.call(e,"base"),V.group(V.concat(["(",V.indent(V.concat([V.softline,V.join(V.concat([",",V.line]),u)])),V.softline,")"]),u.some(yc.willBreak))]);case"TableCallExpression":return r.push(i.call(e,"base")),r.push(" "),r.push(i.call(e,"arguments")),V.concat(r);case"StringCallExpression":return r.push(i.call(e,"base")),r.push(" "),r.push(i.call(e,"argument")),V.concat(r);case"TableConstructorExpression":if(n.fields.length===0)return"{}";const d=[];let c=[];i.forEach(p=>{d.push(V.concat(c)),d.push(V.group(e(p))),c=[",",V.line]},"fields");const f=An.hasNewLineInRange(t.sourceText,n.range[0],n.range[1]);return V.group(V.concat(["{",V.indent(V.concat([V.softline,V.concat(d)])),V.softline,"}"]),f);case"TableKeyString":return V.concat([i.call(e,"key")," = ",i.call(e,"value")]);case"TableKey":return V.concat(["[",i.call(e,"key"),"]"," = ",i.call(e,"value")]);case"TableValue":return i.call(e,"value")}throw new Error("Unhandled AST node: "+n.type)}function tm(i,t,e){const s=em(i,t,e),r=[],n=i.needsParens();return n&&r.push("("),r.push(s),n&&r.push(")"),V.concat(r)}function sm(i,t){const e=r=>hr.printComments(r,t,n=>tm(n,t,e)),s=e(new Xd.FastPath(i));return yc.propagateBreaks(s),s}pa.buildDocFromAst=sm;var ma={};Object.defineProperty(ma,"__esModule",{value:!0});var Kt;(function(i){i[i.Flat=0]="Flat",i[i.Break=1]="Break"})(Kt||(Kt={}));function im(i,t){const e={options:t,indentation:0,currentLineLength:0,mode:Kt.Break,lineSuffixes:[],renderedText:""};return ai(i,e),e.renderedText}ma.printDocToString=im;function er(i,t){function e(s){return t.currentLineLength+s.length<=t.options.lineWidth?(t.currentLineLength+=s.length,!0):!1}if(typeof i=="string")return e(i);switch(i.type){case"concat":return i.parts.every(s=>er(s,t));case"indent":return t.indentation++,er(i.content,t)?(t.indentation--,!0):(t.indentation--,!1);case"group":return i.willBreak&&(t.mode=Kt.Break),er(i.content,t);case"line":return t.mode===Kt.Flat&&!i.hard?i.soft?!0:e(" "):(t.currentLineLength=t.indentation,!0);case"lineSuffix":return!0}return!1}function ai(i,t){if(typeof i=="string")t.renderedText+=i,t.currentLineLength+=i.length;else switch(i.type){case"concat":for(const n of i.parts)ai(n,t);break;case"line":if(t.mode===Kt.Flat&&!i.hard){i.soft||(t.renderedText+=" ",t.currentLineLength+=1);break}if(t.lineSuffixes.length>0){const n=[...t.lineSuffixes];t.lineSuffixes.length=0;for(const a of n)ai(a.content,t)}t.renderedText.length>0&&(t.renderedText=t.renderedText.replace(/[^\S\n]*$/,""));const e=t.options.useTabs?" ".repeat(t.indentation):" ".repeat(t.indentation*t.options.indentCount);t.renderedText+=` -`+e,t.currentLineLength=e.length;break;case"indent":{t.indentation++,ai(i.content,t),t.indentation--;break}case"lineSuffix":t.lineSuffixes.push(i);break;case"group":const s=er(i,Object.assign({},t,{mode:Kt.Flat})),r=t.mode;!i.willBreak&&s?t.mode=Kt.Flat:t.mode=Kt.Break,ai(i.content,t),t.mode=r;break}}var Cn={exports:{}};(function(i,t){(function(e,s,r){var n=t&&!t.nodeType&&t,a=i&&!i.nodeType&&i,o=n&&a&&typeof Ut=="object"&&Ut,l=a&&a.exports===n&&n;o&&(o.global===o||o.window===o||o.self===o)&&(e=o),r(n&&a?l?a.exports:n:e[s]={})})(Ut,"luaparse",function(e){e.version="0.2.1";var s,r,n,a=e.defaultOptions={wait:!1,comments:!0,scope:!1,locations:!1,ranges:!1,onCreateNode:null,onCreateScope:null,onDestroyScope:null,onLocalDeclaration:null,luaVersion:"5.1"},o=1,l=2,h=4,u=8,d=16,c=32,f=64,p=128,m=256;e.tokenTypes={EOF:o,StringLiteral:l,Keyword:h,Identifier:u,NumericLiteral:d,Punctuator:c,BooleanLiteral:f,NilLiteral:p,VarargLiteral:m};var b=e.errors={unexpected:"unexpected %1 '%2' near '%3'",expected:"'%1' expected near '%2'",expectedToken:"%1 expected near '%2'",unfinishedString:"unfinished string near '%1'",malformedNumber:"malformed number near '%1'",invalidVar:"invalid left-hand side of assignment near '%1'",decimalEscapeTooLarge:"decimal escape too large near '%1'",invalidEscape:"invalid escape sequence near '%1'",hexadecimalDigitExpected:"hexadecimal digit expected near '%1'",braceExpected:"missing '%1' near '%2'",tooLargeCodepoint:"UTF-8 value too large near '%1'",unfinishedLongString:"unfinished long string (starting at line %1) near '%2'",unfinishedLongComment:"unfinished long comment (starting at line %1) near '%2'"},P=e.ast={labelStatement:function(y){return{type:"LabelStatement",label:y}},breakStatement:function(){return{type:"BreakStatement"}},gotoStatement:function(y){return{type:"GotoStatement",label:y}},returnStatement:function(y){return{type:"ReturnStatement",arguments:y}},ifStatement:function(y){return{type:"IfStatement",clauses:y}},ifClause:function(y,v){return{type:"IfClause",condition:y,body:v}},elseifClause:function(y,v){return{type:"ElseifClause",condition:y,body:v}},elseClause:function(y){return{type:"ElseClause",body:y}},whileStatement:function(y,v){return{type:"WhileStatement",condition:y,body:v}},doStatement:function(y){return{type:"DoStatement",body:y}},repeatStatement:function(y,v){return{type:"RepeatStatement",condition:y,body:v}},localStatement:function(y,v){return{type:"LocalStatement",variables:y,init:v}},assignmentStatement:function(y,v){return{type:"AssignmentStatement",variables:y,init:v}},callStatement:function(y){return{type:"CallStatement",expression:y}},functionStatement:function(y,v,j,ne){return{type:"FunctionDeclaration",identifier:y,isLocal:j,parameters:v,body:ne}},forNumericStatement:function(y,v,j,ne,Se){return{type:"ForNumericStatement",variable:y,start:v,end:j,step:ne,body:Se}},forGenericStatement:function(y,v,j){return{type:"ForGenericStatement",variables:y,iterators:v,body:j}},chunk:function(y){return{type:"Chunk",body:y}},identifier:function(y){return{type:"Identifier",name:y}},literal:function(y,v,j){return y=y===l?"StringLiteral":y===d?"NumericLiteral":y===f?"BooleanLiteral":y===p?"NilLiteral":"VarargLiteral",{type:y,value:v,raw:j}},tableKey:function(y,v){return{type:"TableKey",key:y,value:v}},tableKeyString:function(y,v){return{type:"TableKeyString",key:y,value:v}},tableValue:function(y){return{type:"TableValue",value:y}},tableConstructorExpression:function(y){return{type:"TableConstructorExpression",fields:y}},binaryExpression:function(y,v,j){var ne=y==="and"||y==="or"?"LogicalExpression":"BinaryExpression";return{type:ne,operator:y,left:v,right:j}},unaryExpression:function(y,v){return{type:"UnaryExpression",operator:y,argument:v}},memberExpression:function(y,v,j){return{type:"MemberExpression",indexer:v,identifier:j,base:y}},indexExpression:function(y,v){return{type:"IndexExpression",base:y,index:v}},callExpression:function(y,v){return{type:"CallExpression",base:y,arguments:v}},tableCallExpression:function(y,v){return{type:"TableCallExpression",base:y,arguments:v}},stringCallExpression:function(y,v){return{type:"StringCallExpression",base:y,argument:v}},comment:function(y,v){return{type:"Comment",value:y,raw:v}}};function A(y){if(qe){var v=Ve.pop();v.complete(),v.bless(y)}return r.onCreateNode&&r.onCreateNode(y),y}var U=Array.prototype.slice,O=function(v,j){for(var ne=0,Se=v.length;ne=n)return{type:o,value:"",line:x,lineStart:C,range:[T,T]};var y=s.charCodeAt(T),v=s.charCodeAt(T+1);if(L=T,G(y))return F();switch(y){case 39:case 34:return K();case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return Z();case 46:return te(v)?Z():v===46?s.charCodeAt(T+2)===46?D():N(".."):N(".");case 61:return N(v===61?"==":"=");case 62:return r.luaVersion==="5.3"&&v===62?N(">>"):N(v===61?">=":">");case 60:return r.luaVersion==="5.3"&&v===60?N("<<"):N(v===61?"<=":"<");case 126:if(v===61)return N("~=");if(r.luaVersion==="5.1"||r.luaVersion==="5.2")break;return N("~");case 58:return(r.luaVersion==="5.2"||r.luaVersion==="5.3")&&v===58?N("::"):N(":");case 91:return v===91||v===61?Q():N("[");case 47:return r.luaVersion==="5.3"&&v===47?N("//"):N("/");case 38:case 124:if(r.luaVersion==="5.1"||r.luaVersion==="5.2")break;case 42:case 94:case 37:case 44:case 123:case 125:case 93:case 40:case 41:case 59:case 35:case 45:case 43:return N(s.charAt(T))}return ie(s.charAt(T))}function re(){var y=s.charCodeAt(T),v=s.charCodeAt(T+1);return H(y)?(y===10&&v===13&&++T,y===13&&v===10&&++T,++x,C=++T,!0):!1}function M(){for(;T=n||H(Ne))&&(Se+=s.slice(ne,T-1),g({},b.unfinishedString,Se+String.fromCharCode(Ne)));return Se+=s.slice(ne,T-1),{type:l,value:Se,line:v,lineStart:j,lastLine:x,lastLineStart:C,range:[L,T]}}function Q(){var y=x,v=C,j=I(!1);return j===!1&&g(k,b.expected,"[",k.value),{type:l,value:j,line:y,lineStart:v,lastLine:x,lastLineStart:C,range:[L,T]}}function Z(){var y=s.charAt(T),v=s.charAt(T+1),j=y==="0"&&"xX".indexOf(v||null)>=0?ce():pe();return{type:d,value:j,line:x,lineStart:C,range:[L,T]}}function ce(){var y=0,v=1,j=1,ne,Se,Ne,it;for(it=T+=2,X(s.charCodeAt(T))||g({},b.malformedNumber,s.slice(L,T));X(s.charCodeAt(T));)++T;if(ne=parseInt(s.slice(it,T),16),s.charAt(T)==="."){for(Se=++T;X(s.charCodeAt(T));)++T;y=s.slice(Se,T),y=Se===T?0:parseInt(y,16)/Math.pow(16,T-Se)}if("pP".indexOf(s.charAt(T)||null)>=0){for(++T,"+-".indexOf(s.charAt(T)||null)>=0&&(j=s.charAt(T++)==="+"?1:-1),Ne=T,te(s.charCodeAt(T))||g({},b.malformedNumber,s.slice(L,T));te(s.charCodeAt(T));)++T;v=s.slice(Ne,T),v=Math.pow(2,v*j)}return(ne+y)*v}function pe(){for(;te(s.charCodeAt(T));)++T;if(s.charAt(T)===".")for(++T;te(s.charCodeAt(T));)++T;if("eE".indexOf(s.charAt(T)||null)>=0)for(++T,"+-".indexOf(s.charAt(T)||null)>=0&&++T,te(s.charCodeAt(T))||g({},b.malformedNumber,s.slice(L,T));te(s.charCodeAt(T));)++T;return parseFloat(s.slice(L,T))}function ke(y){return y<128?String.fromCharCode(y):y<2048?String.fromCharCode(192|y>>6,128|y&63):y<65536?String.fromCharCode(224|y>>12,128|y>>6&63,128|y&63):y<1114112?String.fromCharCode(240|y>>18,128|y>>12&63,128|y>>6&63,128|y&63):null}function ve(){var y=T++;for(s.charAt(T++)!=="{"&&g({},b.braceExpected,"{","\\"+s.slice(y,T)),X(s.charCodeAt(T))||g({},b.hexadecimalDigitExpected,"\\"+s.slice(y,T));s.charCodeAt(T)===48;)++T;for(var v=T;X(s.charCodeAt(T));)++T,T-v>6&&g({},b.tooLargeCodepoint,"\\"+s.slice(y,T));var j=s.charAt(T++);j!=="}"&&(j==='"'||j==="'"?g({},b.braceExpected,"}","\\"+s.slice(y,T--)):g({},b.hexadecimalDigitExpected,"\\"+s.slice(y,T)));var ne=parseInt(s.slice(v,T-1),16);return ne=ke(ne),ne===null&&g({},b.tooLargeCodepoint,"\\"+s.slice(y,T)),ne}function Ie(){var y=T;switch(s.charAt(T)){case"a":return++T,"\x07";case"n":return++T,` +`)return t;t++}return t}Ye.skipTrailingComment=pc;function Nd(i,t,e={searchBackwards:!1}){t=hc(i,t,e);let s=null;for(;t!==s;)s=t,t=Gs(i,t,e);return t=pc(i,t),t=wi(i,t,e),fc(i,t)}Ye.isNextLineEmpty=Nd;Object.defineProperty(hs,"__esModule",{value:!0});const He=gt,Ue=Ye;var Mt;(function(i){i[i.Leading=0]="Leading",i[i.Trailing=1]="Trailing",i[i.Dangling=2]="Dangling",i[i.DanglingStatement=3]="DanglingStatement"})(Mt||(Mt={}));function _d(i){const t=Object.keys(i),e=[];function s(n){if(n&&typeof n.type=="string"&&n.type!=="Comment"){let r;for(r=e.length-1;r>=0&&!(Ue.locStart(e[r])<=Ue.locStart(n)&&Ue.locEnd(e[r])<=Ue.locEnd(i));--r);e.splice(r+1,0,n)}}for(const n of t){const r=i[n];Array.isArray(r)?r.forEach(s):r&&s(r)}return e}function Md(i,t){for(const e of i.comments){dc(i,e);const s=e.precedingNode,n=e.enclosingNode,r=e.followingNode;Ue.hasNewLine(t.sourceText,Ue.locStart(e),{searchBackwards:!0})?jd(n,e)||Ud(s,n,e)||Vd(s,n,r,e)||(r?Ao(r,e):s?wo(s,e):Wt(n||i,e)):Hd(s,n,e)||Gd(s,n,e)||(s?wo(s,e):r?Ao(r,e):Wt(n||i,e))}}hs.attachComments=Md;function Od(i,t){if(!t.sourceText.startsWith("#!"))return;const e=t.sourceText.indexOf(` +`),s=t.sourceText.slice(0,e),n=t.sourceText.slice(2,e);i.comments.push({type:"Comment",loc:{start:{line:1,column:0},end:{line:1,column:e}},range:[0,e],raw:s,value:n})}hs.injectShebang=Od;function Dd(i,t=!1){const e=i.getValue();if(!e||!e.attachedComments)return"";const s=[];return i.forEach(n=>{const r=n.getValue();r.commentType===Mt.Dangling&&s.push(r.raw)},"attachedComments"),s.length===0?"":t?He.join(He.hardline,s):He.indent(He.concat([He.hardline,He.join(He.hardline,s)]))}hs.printDanglingComments=Dd;function Fd(i){const t=i.getValue();if(!t||!t.attachedComments)return"";const e=[];return i.forEach(s=>{const n=s.getValue();n.commentType===Mt.DanglingStatement&&(e.push(" "),e.push(n.raw))},"attachedComments"),e.length===0?"":He.concat(e)}hs.printDanglingStatementComments=Fd;function Bd(i,t){const e=i.getValue();if(e.raw.startsWith("--[["))return He.concat([e.raw,Ue.hasNewLine(t.sourceText,Ue.locEnd(e))?He.hardline:" "]);const n=[];return n.push(e.raw),n.push(He.hardline),Ue.isNextLineEmpty(t.sourceText,Ue.locEnd(e))&&n.push(He.hardline),He.concat(n)}function Rd(i,t){const e=i.getValue();if(Ue.hasNewLine(t.sourceText,Ue.locStart(e),{searchBackwards:!0})){const n=Ue.isPreviousLineEmpty(t.sourceText,Ue.locStart(e));return He.concat([He.hardline,n?He.hardline:"",e.raw])}if(e.raw.startsWith("--[["))return He.concat([" ",e.raw]);const s=[];return Ue.isNextLineEmpty(t.sourceText,Ue.locStart(e),{searchBackwards:!0})&&s.push(He.hardline),s.push(" "),s.push(e.raw),s.push(He.breakParent),He.lineSuffix(He.concat(s))}function $d(i,t,e){const s=i.getValue(),n=e(i),r=s.attachedComments;if(!r||r.length===0)return n;const a=[],o=[n];return i.forEach(l=>{switch(l.getValue().commentType){case Mt.Leading:a.push(Bd(i,t));break;case Mt.Trailing:o.push(Rd(i,t));break}},"attachedComments"),He.concat(a.concat(o))}hs.printComments=$d;function dc(i,t){const e=_d(i);let s=null,n=null,r=0,a=e.length;for(;r0?!1:t.parameters.length>0&&t.parameters[t.parameters.length-1]===i||i&&i.type==="Identifier"?(Wt(t,e),!0):!1}function Vd(i,t,e,s){return!t||t.type!=="IfStatement"?!1:e&&(e.type==="ElseifClause"||e.type==="ElseClause")||i&&i.type==="ElseClause"?(Wt(i,s),!0):!1}function Hd(i,t,e){if(e.raw.startsWith("--[[")||!t)return!1;switch(t.type){case"WhileStatement":if(i===t.condition)return ss(t,e),!0;break;case"DoStatement":case"RepeatStatement":if(i==null)return ss(t,e),!0;break;case"FunctionDeclaration":if(t.parameters.length&&i===t.parameters[t.parameters.length-1]||i===t.identifier)return ss(t,e),!0;break;case"ForNumericStatement":if(i===t.end||i===t.step)return ss(t,e),!0;break;case"ForGenericStatement":if(i===t.iterators[t.iterators.length-1])return ss(t,e),!0;break;case"IfClause":case"ElseifClause":if(i===t.condition&&e.loc.start.column>i.loc.start.column)return ss(t,e),!0;break;case"ElseClause":if(i==null)return ss(t,e),!0;break}return!1}function Gd(i,t,e){if(!i||!t||t.type!=="IfStatement")return!1;switch(i.type){case"IfClause":case"ElseifClause":case"ElseClause":if(i.body.length===0)return ss(i,e),!0;break}return!1}var pa={},da={};Object.defineProperty(da,"__esModule",{value:!0});const Wd=Ye;class Kd{constructor(t){this.stack=[t]}getValue(){return this.stack[this.stack.length-1]}getNodeAtDepth(t){for(let e=this.stack.length-1;e>=0;e-=2){const s=this.stack[e];if(Wd.isNode(s)&&--t<0)return s}return null}getParent(t=0){return this.getNodeAtDepth(t+1)}call(t,e){const s=this.getValue(),n=this.stack.length;this.stack.push(e,s[e]);const r=t(this);return this.stack.length=n,r}forEach(t,e=null){let s=this.getValue();const n=this.stack.length;e&&(s=s[e],this.stack.push(s));for(let r=0;r{this.stack.push(o,a),n.push(t(this,o)),this.stack.length-=2}),this.stack.length=r,n}needsParens(){const t=this.getParent(),e=this.getValue();let s=!1;switch(e.type){case"FunctionDeclaration":case"Chunk":case"Identifier":case"BooleanLiteral":case"NilLiteral":case"NumericLiteral":case"StringLiteral":case"VarargLiteral":case"TableConstructorExpression":case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"MemberExpression":case"IndexExpression":case"CallExpression":case"TableCallExpression":case"StringCallExpression":s=e.inParens||!1}return t&&e.type==="UnaryExpression"&&t.type==="UnaryExpression"&&(s=!0),s}}da.FastPath=Kd;var Nn={};Object.defineProperty(Nn,"__esModule",{value:!0});function mc(i,t,e){let s=!1;const n=r=>{if(t(r)){s=!0;return}if(!s&&typeof r!="string"){switch(r.type){case"concat":r.parts.forEach(n);break;case"indent":case"group":case"lineSuffix":n(r.content);break}e&&e(r)}};n(i)}function qd(i,t){let e=!1;return mc(i,s=>t(s)?(e=!0,!0):!1),e}function zd(i){return qd(i,t=>{if(typeof t=="string")return!1;switch(t.type){case"line":if(t.hard)return!0;break;case"group":if(t.willBreak)return!0}return!1})}Nn.willBreak=zd;function Co(i){i.length>0&&(i[i.length-1].willBreak=!0)}function Jd(i){const t=[];mc(i,e=>{if(typeof e=="string")return!1;switch(e.type){case"breakParent":Co(t);break;case"group":t.push(e);break}return!1},e=>{if(typeof e=="string")return!1;if(e.type==="group"){const s=t.pop();s&&s.willBreak&&Co(t)}return!1})}Nn.propagateBreaks=Jd;var _n={};(function(i){Object.defineProperty(i,"__esModule",{value:!0});var t;(function(n){n.StdOut="stdout",n.Replace="replace",n.Diff="diff"})(t=i.WriteMode||(i.WriteMode={})),i.defaultOptions={sourceText:"",lineWidth:120,indentCount:4,useTabs:!1,linebreakMultipleAssignments:!1,quotemark:"double",writeMode:t.StdOut};function e(n){return n==="single"?"'":'"'}i.getStringQuotemark=e;function s(n){return n==="single"?'"':"'"}i.getAlternativeStringQuotemark=s})(_n);Object.defineProperty(pa,"__esModule",{value:!0});const Xd=da,V=gt,yc=Nn,fn=hs,Ar=Ye,wr=_n;function gc(i,t,e){const s=[];return i.forEach(n=>{const r=[e(n)];Ar.isNextLineEmpty(t.sourceText,Ar.locEnd(n.getValue()))&&!Qd(i)&&r.push(V.hardline),s.push(V.concat(r))}),V.join(V.hardline,s)}function Dt(i,t,e,s){const n=i.call(r=>gc(r,t,e),s);return V.indent(V.concat([V.hardline,n]))}function Ft(i){return i.getValue().attachedComments?V.concat([fn.printDanglingStatementComments(i),fn.printDanglingComments(i)]):""}function Yd(i,t){const e=wr.getStringQuotemark(t),s=wr.getAlternativeStringQuotemark(t==="single"?"single":"double"),n=i.replace(/\\([\s\S])|(['"])/g,(r,a,o)=>a===s?a:o===e?"\\"+o:r);return e+n+e}function Zd(i,t){const e=i.getValue();if(e.type!=="StringLiteral")throw new Error("printStringLiteral: Expected StringLiteral, got "+e.type);if(e.raw.startsWith("[[")||e.raw.startsWith("[="))return e.raw;const s=e.raw.slice(1,-1);let n=t.quotemark;const r=wr.getStringQuotemark(n);return s.includes(r)&&(n=n==="single"?"double":"single"),Yd(s,n)}function Qd(i){const t=i.getParent(),e=i.getValue(),s=t.body;return s&&s[s.length-1]===e}function em(i,t,e){const s=i.getValue();if(!s)return"";const n=[],r=s;switch(r.type){case"Chunk":return n.push(i.call(p=>gc(p,t,e),"body")),n.push(fn.printDanglingComments(i,!0)),(r.body.length||r.attachedComments)&&n.push(V.hardline),V.concat(n);case"LabelStatement":return V.concat(["::",i.call(e,"label"),"::"]);case"GotoStatement":return V.concat(["goto ",i.call(e,"label")]);case"BreakStatement":return"break";case"ReturnStatement":return n.push("return"),r.arguments.length>0&&(n.push(" "),n.push(V.join(", ",i.map(e,"arguments")))),V.concat(n);case"WhileStatement":return n.push("while "),n.push(i.call(e,"condition")),n.push(" do"),n.push(Ft(i)),r.body.length&&n.push(Dt(i,t,e,"body")),n.push(V.concat([V.hardline,"end"])),V.concat(n);case"DoStatement":return n.push("do"),n.push(Ft(i)),r.body.length&&n.push(Dt(i,t,e,"body")),n.push(V.concat([V.hardline,"end"])),V.concat(n);case"RepeatStatement":return n.push("repeat"),n.push(Ft(i)),r.body.length&&n.push(Dt(i,t,e,"body")),n.push(V.concat([V.hardline,"until "])),n.push(i.call(e,"condition")),V.concat(n);case"LocalStatement":case"AssignmentStatement":{const p=[];r.type==="LocalStatement"&&p.push("local ");const m=t.linebreakMultipleAssignments;p.push(V.indent(V.join(V.concat([",",m?V.hardline:V.line]),i.map(e,"variables"))));let b="";const P=[];r.init.length&&(b=" =",r.init.length>1?P.push(V.indent(V.join(V.concat([",",V.line]),i.map(e,"init")))):P.push(V.join(V.concat([",",V.line]),i.map(e,"init"))));const A=r.init.some(U=>U!=null&&U.type!=="TableConstructorExpression"&&U.type!=="FunctionDeclaration");return V.group(V.concat([V.group(V.concat(p)),V.group(V.concat([b,A?V.indent(V.line):" ",V.concat(P)]))]))}case"CallStatement":return i.call(e,"expression");case"FunctionDeclaration":return r.isLocal&&n.push("local "),n.push("function"),r.identifier&&n.push(" ",i.call(e,"identifier")),n.push(V.concat(["(",V.group(V.indent(V.concat([V.softline,V.join(V.concat([",",V.line]),i.map(e,"parameters"))]))),")"])),n.push(Ft(i)),r.body.length&&n.push(Dt(i,t,e,"body")),n.push(V.hardline,"end"),V.concat(n);case"ForNumericStatement":return n.push("for "),n.push(i.call(e,"variable")),n.push(" = "),n.push(i.call(e,"start")),n.push(", "),n.push(i.call(e,"end")),r.step&&(n.push(", "),n.push(i.call(e,"step"))),n.push(" do"),n.push(Ft(i)),r.body.length&&n.push(Dt(i,t,e,"body")),n.push(V.concat([V.hardline,"end"])),V.concat(n);case"ForGenericStatement":return n.push("for "),n.push(V.join(", ",i.map(e,"variables"))),n.push(" in "),n.push(V.join(", ",i.map(e,"iterators"))),n.push(" do"),n.push(Ft(i)),r.body.length&&n.push(Dt(i,t,e,"body")),n.push(V.concat([V.hardline,"end"])),V.concat(n);case"IfStatement":const a=[];return i.forEach(p=>{a.push(e(p))},"clauses"),n.push(V.join(V.hardline,a)),n.push(V.concat([V.hardline,"end"])),V.concat(n);case"IfClause":return n.push(V.concat(["if ",V.group(V.concat([V.indent(V.concat([V.softline,i.call(e,"condition")])),V.softline]))," then"])),n.push(Ft(i)),r.body.length&&n.push(Dt(i,t,e,"body")),V.concat(n);case"ElseifClause":return n.push(V.concat(["elseif ",V.group(V.concat([V.indent(V.concat([V.softline,i.call(e,"condition")])),V.softline]))," then"])),n.push(Ft(i)),r.body.length&&n.push(Dt(i,t,e,"body")),V.concat(n);case"ElseClause":return n.push("else"),n.push(Ft(i)),r.body.length&&n.push(Dt(i,t,e,"body")),V.concat(n);case"BooleanLiteral":return r.raw;case"NilLiteral":return"nil";case"NumericLiteral":return r.raw;case"StringLiteral":return Zd(i,t);case"VarargLiteral":return"...";case"Identifier":return r.name;case"BinaryExpression":case"LogicalExpression":const l=i.getParent().type!==r.type&&r.left.type!==r.type&&r.right.type!==r.type,h=V.concat([r.operator,V.line,i.call(e,"right")]);return V.group(V.concat([i.call(e,"left"),V.indent(V.concat([" ",l?V.group(h):h]))]));case"UnaryExpression":return n.push(r.operator),r.operator==="not"&&n.push(" "),n.push(i.call(e,"argument")),V.concat(n);case"MemberExpression":return V.concat([i.call(e,"base"),r.indexer,i.call(e,"identifier")]);case"IndexExpression":return V.concat([i.call(e,"base"),"[",V.group(V.concat([V.indent(V.concat([V.softline,i.call(e,"index")])),V.softline])),"]"]);case"CallExpression":const u=i.map(e,"arguments");return V.concat([i.call(e,"base"),V.group(V.concat(["(",V.indent(V.concat([V.softline,V.join(V.concat([",",V.line]),u)])),V.softline,")"]),u.some(yc.willBreak))]);case"TableCallExpression":return n.push(i.call(e,"base")),n.push(" "),n.push(i.call(e,"arguments")),V.concat(n);case"StringCallExpression":return n.push(i.call(e,"base")),n.push(" "),n.push(i.call(e,"argument")),V.concat(n);case"TableConstructorExpression":if(r.fields.length===0)return"{}";const d=[];let c=[];i.forEach(p=>{d.push(V.concat(c)),d.push(V.group(e(p))),c=[",",V.line]},"fields");const f=Ar.hasNewLineInRange(t.sourceText,r.range[0],r.range[1]);return V.group(V.concat(["{",V.indent(V.concat([V.softline,V.concat(d)])),V.softline,"}"]),f);case"TableKeyString":return V.concat([i.call(e,"key")," = ",i.call(e,"value")]);case"TableKey":return V.concat(["[",i.call(e,"key"),"]"," = ",i.call(e,"value")]);case"TableValue":return i.call(e,"value")}throw new Error("Unhandled AST node: "+r.type)}function tm(i,t,e){const s=em(i,t,e),n=[],r=i.needsParens();return r&&n.push("("),n.push(s),r&&n.push(")"),V.concat(n)}function sm(i,t){const e=n=>fn.printComments(n,t,r=>tm(r,t,e)),s=e(new Xd.FastPath(i));return yc.propagateBreaks(s),s}pa.buildDocFromAst=sm;var ma={};Object.defineProperty(ma,"__esModule",{value:!0});var Kt;(function(i){i[i.Flat=0]="Flat",i[i.Break=1]="Break"})(Kt||(Kt={}));function im(i,t){const e={options:t,indentation:0,currentLineLength:0,mode:Kt.Break,lineSuffixes:[],renderedText:""};return ai(i,e),e.renderedText}ma.printDocToString=im;function en(i,t){function e(s){return t.currentLineLength+s.length<=t.options.lineWidth?(t.currentLineLength+=s.length,!0):!1}if(typeof i=="string")return e(i);switch(i.type){case"concat":return i.parts.every(s=>en(s,t));case"indent":return t.indentation++,en(i.content,t)?(t.indentation--,!0):(t.indentation--,!1);case"group":return i.willBreak&&(t.mode=Kt.Break),en(i.content,t);case"line":return t.mode===Kt.Flat&&!i.hard?i.soft?!0:e(" "):(t.currentLineLength=t.indentation,!0);case"lineSuffix":return!0}return!1}function ai(i,t){if(typeof i=="string")t.renderedText+=i,t.currentLineLength+=i.length;else switch(i.type){case"concat":for(const r of i.parts)ai(r,t);break;case"line":if(t.mode===Kt.Flat&&!i.hard){i.soft||(t.renderedText+=" ",t.currentLineLength+=1);break}if(t.lineSuffixes.length>0){const r=[...t.lineSuffixes];t.lineSuffixes.length=0;for(const a of r)ai(a.content,t)}t.renderedText.length>0&&(t.renderedText=t.renderedText.replace(/[^\S\n]*$/,""));const e=t.options.useTabs?" ".repeat(t.indentation):" ".repeat(t.indentation*t.options.indentCount);t.renderedText+=` +`+e,t.currentLineLength=e.length;break;case"indent":{t.indentation++,ai(i.content,t),t.indentation--;break}case"lineSuffix":t.lineSuffixes.push(i);break;case"group":const s=en(i,Object.assign({},t,{mode:Kt.Flat})),n=t.mode;!i.willBreak&&s?t.mode=Kt.Flat:t.mode=Kt.Break,ai(i.content,t),t.mode=n;break}}var Cr={exports:{}};(function(i,t){(function(e,s,n){var r=t&&!t.nodeType&&t,a=i&&!i.nodeType&&i,o=r&&a&&typeof Ut=="object"&&Ut,l=a&&a.exports===r&&r;o&&(o.global===o||o.window===o||o.self===o)&&(e=o),n(r&&a?l?a.exports:r:e[s]={})})(Ut,"luaparse",function(e){e.version="0.2.1";var s,n,r,a=e.defaultOptions={wait:!1,comments:!0,scope:!1,locations:!1,ranges:!1,onCreateNode:null,onCreateScope:null,onDestroyScope:null,onLocalDeclaration:null,luaVersion:"5.1"},o=1,l=2,h=4,u=8,d=16,c=32,f=64,p=128,m=256;e.tokenTypes={EOF:o,StringLiteral:l,Keyword:h,Identifier:u,NumericLiteral:d,Punctuator:c,BooleanLiteral:f,NilLiteral:p,VarargLiteral:m};var b=e.errors={unexpected:"unexpected %1 '%2' near '%3'",expected:"'%1' expected near '%2'",expectedToken:"%1 expected near '%2'",unfinishedString:"unfinished string near '%1'",malformedNumber:"malformed number near '%1'",invalidVar:"invalid left-hand side of assignment near '%1'",decimalEscapeTooLarge:"decimal escape too large near '%1'",invalidEscape:"invalid escape sequence near '%1'",hexadecimalDigitExpected:"hexadecimal digit expected near '%1'",braceExpected:"missing '%1' near '%2'",tooLargeCodepoint:"UTF-8 value too large near '%1'",unfinishedLongString:"unfinished long string (starting at line %1) near '%2'",unfinishedLongComment:"unfinished long comment (starting at line %1) near '%2'"},P=e.ast={labelStatement:function(y){return{type:"LabelStatement",label:y}},breakStatement:function(){return{type:"BreakStatement"}},gotoStatement:function(y){return{type:"GotoStatement",label:y}},returnStatement:function(y){return{type:"ReturnStatement",arguments:y}},ifStatement:function(y){return{type:"IfStatement",clauses:y}},ifClause:function(y,v){return{type:"IfClause",condition:y,body:v}},elseifClause:function(y,v){return{type:"ElseifClause",condition:y,body:v}},elseClause:function(y){return{type:"ElseClause",body:y}},whileStatement:function(y,v){return{type:"WhileStatement",condition:y,body:v}},doStatement:function(y){return{type:"DoStatement",body:y}},repeatStatement:function(y,v){return{type:"RepeatStatement",condition:y,body:v}},localStatement:function(y,v){return{type:"LocalStatement",variables:y,init:v}},assignmentStatement:function(y,v){return{type:"AssignmentStatement",variables:y,init:v}},callStatement:function(y){return{type:"CallStatement",expression:y}},functionStatement:function(y,v,j,re){return{type:"FunctionDeclaration",identifier:y,isLocal:j,parameters:v,body:re}},forNumericStatement:function(y,v,j,re,Se){return{type:"ForNumericStatement",variable:y,start:v,end:j,step:re,body:Se}},forGenericStatement:function(y,v,j){return{type:"ForGenericStatement",variables:y,iterators:v,body:j}},chunk:function(y){return{type:"Chunk",body:y}},identifier:function(y){return{type:"Identifier",name:y}},literal:function(y,v,j){return y=y===l?"StringLiteral":y===d?"NumericLiteral":y===f?"BooleanLiteral":y===p?"NilLiteral":"VarargLiteral",{type:y,value:v,raw:j}},tableKey:function(y,v){return{type:"TableKey",key:y,value:v}},tableKeyString:function(y,v){return{type:"TableKeyString",key:y,value:v}},tableValue:function(y){return{type:"TableValue",value:y}},tableConstructorExpression:function(y){return{type:"TableConstructorExpression",fields:y}},binaryExpression:function(y,v,j){var re=y==="and"||y==="or"?"LogicalExpression":"BinaryExpression";return{type:re,operator:y,left:v,right:j}},unaryExpression:function(y,v){return{type:"UnaryExpression",operator:y,argument:v}},memberExpression:function(y,v,j){return{type:"MemberExpression",indexer:v,identifier:j,base:y}},indexExpression:function(y,v){return{type:"IndexExpression",base:y,index:v}},callExpression:function(y,v){return{type:"CallExpression",base:y,arguments:v}},tableCallExpression:function(y,v){return{type:"TableCallExpression",base:y,arguments:v}},stringCallExpression:function(y,v){return{type:"StringCallExpression",base:y,argument:v}},comment:function(y,v){return{type:"Comment",value:y,raw:v}}};function A(y){if(qe){var v=Ve.pop();v.complete(),v.bless(y)}return n.onCreateNode&&n.onCreateNode(y),y}var U=Array.prototype.slice,O=function(v,j){for(var re=0,Se=v.length;re=r)return{type:o,value:"",line:x,lineStart:C,range:[T,T]};var y=s.charCodeAt(T),v=s.charCodeAt(T+1);if(L=T,G(y))return F();switch(y){case 39:case 34:return K();case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return Z();case 46:return te(v)?Z():v===46?s.charCodeAt(T+2)===46?D():N(".."):N(".");case 61:return N(v===61?"==":"=");case 62:return n.luaVersion==="5.3"&&v===62?N(">>"):N(v===61?">=":">");case 60:return n.luaVersion==="5.3"&&v===60?N("<<"):N(v===61?"<=":"<");case 126:if(v===61)return N("~=");if(n.luaVersion==="5.1"||n.luaVersion==="5.2")break;return N("~");case 58:return(n.luaVersion==="5.2"||n.luaVersion==="5.3")&&v===58?N("::"):N(":");case 91:return v===91||v===61?Q():N("[");case 47:return n.luaVersion==="5.3"&&v===47?N("//"):N("/");case 38:case 124:if(n.luaVersion==="5.1"||n.luaVersion==="5.2")break;case 42:case 94:case 37:case 44:case 123:case 125:case 93:case 40:case 41:case 59:case 35:case 45:case 43:return N(s.charAt(T))}return ie(s.charAt(T))}function ne(){var y=s.charCodeAt(T),v=s.charCodeAt(T+1);return H(y)?(y===10&&v===13&&++T,y===13&&v===10&&++T,++x,C=++T,!0):!1}function M(){for(;T=r||H(Ne))&&(Se+=s.slice(re,T-1),g({},b.unfinishedString,Se+String.fromCharCode(Ne)));return Se+=s.slice(re,T-1),{type:l,value:Se,line:v,lineStart:j,lastLine:x,lastLineStart:C,range:[L,T]}}function Q(){var y=x,v=C,j=I(!1);return j===!1&&g(k,b.expected,"[",k.value),{type:l,value:j,line:y,lineStart:v,lastLine:x,lastLineStart:C,range:[L,T]}}function Z(){var y=s.charAt(T),v=s.charAt(T+1),j=y==="0"&&"xX".indexOf(v||null)>=0?ce():pe();return{type:d,value:j,line:x,lineStart:C,range:[L,T]}}function ce(){var y=0,v=1,j=1,re,Se,Ne,it;for(it=T+=2,X(s.charCodeAt(T))||g({},b.malformedNumber,s.slice(L,T));X(s.charCodeAt(T));)++T;if(re=parseInt(s.slice(it,T),16),s.charAt(T)==="."){for(Se=++T;X(s.charCodeAt(T));)++T;y=s.slice(Se,T),y=Se===T?0:parseInt(y,16)/Math.pow(16,T-Se)}if("pP".indexOf(s.charAt(T)||null)>=0){for(++T,"+-".indexOf(s.charAt(T)||null)>=0&&(j=s.charAt(T++)==="+"?1:-1),Ne=T,te(s.charCodeAt(T))||g({},b.malformedNumber,s.slice(L,T));te(s.charCodeAt(T));)++T;v=s.slice(Ne,T),v=Math.pow(2,v*j)}return(re+y)*v}function pe(){for(;te(s.charCodeAt(T));)++T;if(s.charAt(T)===".")for(++T;te(s.charCodeAt(T));)++T;if("eE".indexOf(s.charAt(T)||null)>=0)for(++T,"+-".indexOf(s.charAt(T)||null)>=0&&++T,te(s.charCodeAt(T))||g({},b.malformedNumber,s.slice(L,T));te(s.charCodeAt(T));)++T;return parseFloat(s.slice(L,T))}function ke(y){return y<128?String.fromCharCode(y):y<2048?String.fromCharCode(192|y>>6,128|y&63):y<65536?String.fromCharCode(224|y>>12,128|y>>6&63,128|y&63):y<1114112?String.fromCharCode(240|y>>18,128|y>>12&63,128|y>>6&63,128|y&63):null}function ve(){var y=T++;for(s.charAt(T++)!=="{"&&g({},b.braceExpected,"{","\\"+s.slice(y,T)),X(s.charCodeAt(T))||g({},b.hexadecimalDigitExpected,"\\"+s.slice(y,T));s.charCodeAt(T)===48;)++T;for(var v=T;X(s.charCodeAt(T));)++T,T-v>6&&g({},b.tooLargeCodepoint,"\\"+s.slice(y,T));var j=s.charAt(T++);j!=="}"&&(j==='"'||j==="'"?g({},b.braceExpected,"}","\\"+s.slice(y,T--)):g({},b.hexadecimalDigitExpected,"\\"+s.slice(y,T)));var re=parseInt(s.slice(v,T-1),16);return re=ke(re),re===null&&g({},b.tooLargeCodepoint,"\\"+s.slice(y,T)),re}function Ie(){var y=T;switch(s.charAt(T)){case"a":return++T,"\x07";case"n":return++T,` `;case"r":return++T,"\r";case"t":return++T," ";case"v":return++T,"\v";case"b":return++T,"\b";case"f":return++T,"\f";case"\r":case` -`:return re(),` -`;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;te(s.charCodeAt(T))&&T-y<3;)++T;var v=parseInt(s.slice(y,T),10);return v>255&&g({},b.decimalEscapeTooLarge,"\\"+v),String.fromCharCode(v);case"z":if(r.luaVersion==="5.2"||r.luaVersion==="5.3")return++T,M(),"";case"x":if(r.luaVersion==="5.2"||r.luaVersion==="5.3"){if(X(s.charCodeAt(T+1))&&X(s.charCodeAt(T+2)))return T+=3,String.fromCharCode(parseInt(s.slice(y+1,T),16));g({},b.hexadecimalDigitExpected,"\\"+s.slice(y,T+2))}case"u":if(r.luaVersion==="5.3")return ve();default:(r.luaVersion==="5.2"||r.luaVersion==="5.3")&&g({},b.invalidEscape,"\\"+s.slice(y,T+1));case"\\":case'"':case"'":return s.charAt(T++)}}function E(){L=T,T+=2;var y=s.charAt(T),v="",j=!1,ne=T,Se=C,Ne=x;if(y==="["&&(v=I(!0),v===!1?v=y:j=!0),!j){for(;T")}function _(){Y=k,k=z,z=R()}function B(y){return y===k.value?(_(),!0):!1}function $(y){y===k.value?_():g(k,b.expected,y,k.value)}function q(y){return y===9||y===32||y===11||y===12}function H(y){return y===10||y===13}function te(y){return y>=48&&y<=57}function X(y){return y>=48&&y<=57||y>=97&&y<=102||y>=65&&y<=70}function G(y){return y>=65&&y<=90||y>=97&&y<=122||y===95}function ye(y){return y>=65&&y<=90||y>=97&&y<=122||y===95||y>=48&&y<=57}function ae(y){switch(y.length){case 2:return y==="do"||y==="if"||y==="in"||y==="or";case 3:return y==="and"||y==="end"||y==="for"||y==="not";case 4:return y==="else"||y==="then"?!0:r.luaVersion==="5.2"||r.luaVersion==="5.3"?y==="goto":!1;case 5:return y==="break"||y==="local"||y==="until"||y==="while";case 6:return y==="elseif"||y==="repeat"||y==="return";case 8:return y==="function"}return!1}function de(y){return c===y.type?"#-~".indexOf(y.value)>=0:h===y.type?y.value==="not":!1}function Te(y){switch(y.type){case"CallExpression":case"TableCallExpression":case"StringCallExpression":return!0}return!1}function J(y){if(o===y.type)return!0;if(h!==y.type)return!1;switch(y.value){case"else":case"elseif":case"end":case"until":return!0;default:return!1}}var ee,le,xe;function Pe(){var y=Array.apply(null,ee[le++]);ee.push(y),r.onCreateScope&&r.onCreateScope()}function _e(){ee.pop(),le--,r.onDestroyScope&&r.onDestroyScope()}function Ke(y){r.onLocalDeclaration&&r.onLocalDeclaration(y),O(ee[le],y)===-1&&ee[le].push(y)}function ht(y){Ke(y.name),fs(y,!0)}function fs(y,v){!v&&S(xe,"name",y.name)===-1&&xe.push(y),y.isLocal=v}function Ze(y){return O(ee[le],y)!==-1}var Ve=[],qe;function Yt(){return new Mi(k)}function Mi(y){r.locations&&(this.loc={start:{line:y.line,column:y.range[0]-y.lineStart},end:{line:0,column:0}}),r.ranges&&(this.range=[y.range[0],0])}Mi.prototype.complete=function(){r.locations&&(this.loc.end.line=Y.lastLine||Y.line,this.loc.end.column=Y.range[1]-(Y.lastLineStart||Y.lineStart)),r.ranges&&(this.range[1]=Y.range[1])},Mi.prototype.bless=function(y){if(this.loc){var v=this.loc;y.loc={start:{line:v.start.line,column:v.start.column},end:{line:v.end.line,column:v.end.column}}}this.range&&(y.range=[this.range[0],this.range[1]])};function ks(){qe&&Ve.push(Yt())}function ct(y){qe&&Ve.push(y)}function Wc(){_(),ks(),r.scope&&Pe();var y=wt();return r.scope&&_e(),o!==k.type&&ie(k),qe&&!y.length&&(Y=k),A(P.chunk(y))}function wt(y){for(var v=[],j;!J(k);){if(k.value==="return"){v.push(xa());break}j=xa(),B(";"),j&&v.push(j)}return v}function xa(){if(ks(),h===k.type)switch(k.value){case"local":return _(),tu();case"if":return _(),Qc();case"return":return _(),Zc();case"function":_();var y=iu();return Mr(y);case"while":return _(),Xc();case"for":return _(),eu();case"repeat":return _(),Yc();case"break":return _(),qc();case"do":return _(),Jc();case"goto":return _(),zc()}if(c===k.type&&B("::"))return Kc();if(qe&&Ve.pop(),!((r.luaVersion==="5.2"||r.luaVersion==="5.3")&&B(";")))return su()}function Kc(){var y=k.value,v=ut();return r.scope&&(Ke("::"+y+"::"),fs(v,!0)),$("::"),A(P.labelStatement(v))}function qc(){return A(P.breakStatement())}function zc(){k.value;var y=ut();return A(P.gotoStatement(y))}function Jc(){r.scope&&Pe();var y=wt();return r.scope&&_e(),$("end"),A(P.doStatement(y))}function Xc(){var y=ze();$("do"),r.scope&&Pe();var v=wt();return r.scope&&_e(),$("end"),A(P.whileStatement(y,v))}function Yc(){r.scope&&Pe();var y=wt();$("until");var v=ze();return r.scope&&_e(),A(P.repeatStatement(v,y))}function Zc(){var y=[];if(k.value!=="end"){var v=Oi();for(v!=null&&y.push(v);B(",");)v=ze(),y.push(v);B(";")}return A(P.returnStatement(y))}function Qc(){var y=[],v,j,ne;for(qe&&(ne=Ve[Ve.length-1],Ve.push(ne)),v=ze(),$("then"),r.scope&&Pe(),j=wt(),r.scope&&_e(),y.push(A(P.ifClause(v,j))),qe&&(ne=Yt());B("elseif");)ct(ne),v=ze(),$("then"),r.scope&&Pe(),j=wt(),r.scope&&_e(),y.push(A(P.elseifClause(v,j))),qe&&(ne=Yt());return B("else")&&(qe&&(ne=new Mi(Y),Ve.push(ne)),r.scope&&Pe(),j=wt(),r.scope&&_e(),y.push(A(P.elseClause(j)))),$("end"),A(P.ifStatement(y))}function eu(){var y=ut(),v;if(r.scope&&(Pe(),ht(y)),B("=")){var j=ze();$(",");var ne=ze(),Se=B(",")?ze():null;return $("do"),v=wt(),$("end"),r.scope&&_e(),A(P.forNumericStatement(y,j,ne,Se,v))}else{for(var Ne=[y];B(",");)y=ut(),r.scope&&ht(y),Ne.push(y);$("in");var it=[];do{var Ks=ze();it.push(Ks)}while(B(","));return $("do"),v=wt(),$("end"),r.scope&&_e(),A(P.forGenericStatement(Ne,it,v))}}function tu(){var y;if(u===k.type){var v=[],j=[];do y=ut(),v.push(y);while(B(","));if(B("="))do{var ne=ze();j.push(ne)}while(B(","));if(r.scope)for(var Se=0,Ne=v.length;Se",k)}function Sa(y){(y.inParens||["Identifier","MemberExpression","IndexExpression"].indexOf(y.type)===-1)&&g(k,b.invalidVar,k.value)}function su(){var y=k,v,j;if(qe&&(j=Yt()),v=Dr(),v==null)return ie(k);if(",=".indexOf(k.value)>=0){var ne=[v],Se=[],Ne;for(Sa(v);B(",");)Ne=Dr(),Ne==null&&se("",k),Sa(Ne),ne.push(Ne);$("=");do Ne=ze(),Se.push(Ne);while(B(","));return ct(j),A(P.assignmentStatement(ne,Se))}return Te(v)?(ct(j),A(P.callStatement(v))):ie(y)}function ut(){ks();var y=k.value;return u!==k.type&&se("",k),_(),A(P.identifier(y))}function Mr(y,v){var j=[];if($("("),!B(")"))for(;;)if(u===k.type){var ne=ut();if(r.scope&&ht(ne),j.push(ne),B(","))continue;if(B(")"))break}else if(m===k.type){j.push(Br()),$(")");break}else se(" or '...'",k);var Se=wt();return $("end"),r.scope&&_e(),v=v||!1,A(P.functionStatement(y,j,v,Se))}function iu(){var y,v,j;for(qe&&(j=Yt()),y=ut(),r.scope&&(fs(y,Ze(y.name)),Pe());B(".");)ct(j),v=ut(),y=A(P.memberExpression(y,".",v));return B(":")&&(ct(j),v=ut(),y=A(P.memberExpression(y,":",v)),r.scope&&Ke("self")),y}function Pa(){for(var y=[],v,j;;){if(ks(),c===k.type&&B("["))v=ze(),$("]"),$("="),j=ze(),y.push(A(P.tableKey(v,j)));else if(u===k.type)z.value==="="?(v=ut(),_(),j=ze(),y.push(A(P.tableKeyString(v,j)))):(j=ze(),y.push(A(P.tableValue(j))));else{if((j=Oi())==null){Ve.pop();break}y.push(A(P.tableValue(j)))}if(",;".indexOf(k.value)>=0){_();continue}break}return $("}"),A(P.tableConstructorExpression(y))}function Oi(){var y=Or(0);return y}function ze(){var y=Oi();if(y==null)se("",k);else return y}function ru(y){var v=y.charCodeAt(0),j=y.length;if(j===1)switch(v){case 94:return 12;case 42:case 47:case 37:return 10;case 43:case 45:return 9;case 38:return 6;case 126:return 5;case 124:return 4;case 60:case 62:return 3}else if(j===2)switch(v){case 47:return 10;case 46:return 8;case 60:case 62:return y==="<<"||y===">>"?7:3;case 61:case 126:return 3;case 111:return 1}else if(v===97&&y==="and")return 2;return 0}function Or(y){var v=k.value,j,ne;if(qe&&(ne=Yt()),de(k)){ks(),_();var Se=Or(10);Se==null&&se("",k),j=A(P.unaryExpression(v,Se))}if(j==null&&(j=Br(),j==null&&(j=Dr())),j==null)return null;for(var Ne;v=k.value,Ne=c===k.type||h===k.type?ru(v):0,!(Ne===0||Ne<=y);){(v==="^"||v==="..")&&Ne--,_();var it=Or(Ne);it==null&&se("",k),qe&&Ve.push(ne),j=A(P.binaryExpression(v,j,it))}return j}function Dr(){var y,v,j;if(qe&&(j=Yt()),u===k.type)v=k.value,y=ut(),r.scope&&fs(y,Ze(v));else if(B("("))y=ze(),$(")"),y.inParens=!0;else return null;for(var ne,Se;;)if(c===k.type)switch(k.value){case"[":ct(j),_(),ne=ze(),$("]"),y=A(P.indexExpression(y,ne));break;case".":ct(j),_(),Se=ut(),y=A(P.memberExpression(y,".",Se));break;case":":ct(j),_(),Se=ut(),y=A(P.memberExpression(y,":",Se)),ct(j),y=Fr(y);break;case"(":case"{":ct(j),y=Fr(y);break;default:return y}else if(l===k.type)ct(j),y=Fr(y);else break;return y}function Fr(y){if(c===k.type)switch(k.value){case"(":_();var v=[],j=Oi();for(j!=null&&v.push(j);B(",");)j=ze(),v.push(j);return $(")"),A(P.callExpression(y,v));case"{":ks(),_();var ne=Pa();return A(P.tableCallExpression(y,ne))}else if(l===k.type)return A(P.stringCallExpression(y,Br()));se("function arguments",k)}function Br(){var y=l|d|f|p|m,v=k.value,j=k.type,ne;if(qe&&(ne=Yt()),j&y){ct(ne);var Se=s.slice(k.range[0],k.range[1]);return _(),A(P.literal(j,v,Se))}else{if(h===j&&v==="function")return ct(ne),_(),r.scope&&Pe(),Mr(null);if(B("{"))return ct(ne),Pa()}}e.parse=nu;function nu(y,v){if(typeof v=="undefined"&&typeof y=="object"&&(v=y,y=void 0),v||(v={}),s=y||"",r=fe(a,v),T=0,x=1,C=0,n=s.length,ee=[[]],le=0,xe=[],Ve=[],!(r.luaVersion==="5.1"||r.luaVersion==="5.2"||r.luaVersion==="5.3"))throw new Error(W("Lua version '%1' not supported",r.luaVersion));return r.comments&&(ue=[]),r.wait?e:Aa()}e.write=Ea;function Ea(y){return s+=String(y),n=s.length,e}e.end=Aa;function Aa(y){typeof y!="undefined"&&Ea(y),s&&s.substr(0,2)==="#!"&&(s=s.replace(/^.*/,function(j){return j.replace(/./g," ")})),n=s.length,qe=r.locations||r.ranges,z=R();var v=Wc();if(r.comments&&(v.comments=ue),r.scope&&(v.globals=xe),Ve.length>0)throw new Error("Location tracking failed. This is most likely a bug in luaparse");return v}})})(Cn,Cn.exports);var Tc={exports:{}};/*! +`:return ne(),` +`;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;te(s.charCodeAt(T))&&T-y<3;)++T;var v=parseInt(s.slice(y,T),10);return v>255&&g({},b.decimalEscapeTooLarge,"\\"+v),String.fromCharCode(v);case"z":if(n.luaVersion==="5.2"||n.luaVersion==="5.3")return++T,M(),"";case"x":if(n.luaVersion==="5.2"||n.luaVersion==="5.3"){if(X(s.charCodeAt(T+1))&&X(s.charCodeAt(T+2)))return T+=3,String.fromCharCode(parseInt(s.slice(y+1,T),16));g({},b.hexadecimalDigitExpected,"\\"+s.slice(y,T+2))}case"u":if(n.luaVersion==="5.3")return ve();default:(n.luaVersion==="5.2"||n.luaVersion==="5.3")&&g({},b.invalidEscape,"\\"+s.slice(y,T+1));case"\\":case'"':case"'":return s.charAt(T++)}}function E(){L=T,T+=2;var y=s.charAt(T),v="",j=!1,re=T,Se=C,Ne=x;if(y==="["&&(v=I(!0),v===!1?v=y:j=!0),!j){for(;T")}function _(){Y=k,k=z,z=R()}function B(y){return y===k.value?(_(),!0):!1}function $(y){y===k.value?_():g(k,b.expected,y,k.value)}function q(y){return y===9||y===32||y===11||y===12}function H(y){return y===10||y===13}function te(y){return y>=48&&y<=57}function X(y){return y>=48&&y<=57||y>=97&&y<=102||y>=65&&y<=70}function G(y){return y>=65&&y<=90||y>=97&&y<=122||y===95}function ye(y){return y>=65&&y<=90||y>=97&&y<=122||y===95||y>=48&&y<=57}function ae(y){switch(y.length){case 2:return y==="do"||y==="if"||y==="in"||y==="or";case 3:return y==="and"||y==="end"||y==="for"||y==="not";case 4:return y==="else"||y==="then"?!0:n.luaVersion==="5.2"||n.luaVersion==="5.3"?y==="goto":!1;case 5:return y==="break"||y==="local"||y==="until"||y==="while";case 6:return y==="elseif"||y==="repeat"||y==="return";case 8:return y==="function"}return!1}function de(y){return c===y.type?"#-~".indexOf(y.value)>=0:h===y.type?y.value==="not":!1}function Te(y){switch(y.type){case"CallExpression":case"TableCallExpression":case"StringCallExpression":return!0}return!1}function J(y){if(o===y.type)return!0;if(h!==y.type)return!1;switch(y.value){case"else":case"elseif":case"end":case"until":return!0;default:return!1}}var ee,le,xe;function Pe(){var y=Array.apply(null,ee[le++]);ee.push(y),n.onCreateScope&&n.onCreateScope()}function _e(){ee.pop(),le--,n.onDestroyScope&&n.onDestroyScope()}function Ke(y){n.onLocalDeclaration&&n.onLocalDeclaration(y),O(ee[le],y)===-1&&ee[le].push(y)}function ht(y){Ke(y.name),fs(y,!0)}function fs(y,v){!v&&S(xe,"name",y.name)===-1&&xe.push(y),y.isLocal=v}function Ze(y){return O(ee[le],y)!==-1}var Ve=[],qe;function Yt(){return new Mi(k)}function Mi(y){n.locations&&(this.loc={start:{line:y.line,column:y.range[0]-y.lineStart},end:{line:0,column:0}}),n.ranges&&(this.range=[y.range[0],0])}Mi.prototype.complete=function(){n.locations&&(this.loc.end.line=Y.lastLine||Y.line,this.loc.end.column=Y.range[1]-(Y.lastLineStart||Y.lineStart)),n.ranges&&(this.range[1]=Y.range[1])},Mi.prototype.bless=function(y){if(this.loc){var v=this.loc;y.loc={start:{line:v.start.line,column:v.start.column},end:{line:v.end.line,column:v.end.column}}}this.range&&(y.range=[this.range[0],this.range[1]])};function ks(){qe&&Ve.push(Yt())}function ct(y){qe&&Ve.push(y)}function Wc(){_(),ks(),n.scope&&Pe();var y=wt();return n.scope&&_e(),o!==k.type&&ie(k),qe&&!y.length&&(Y=k),A(P.chunk(y))}function wt(y){for(var v=[],j;!J(k);){if(k.value==="return"){v.push(xa());break}j=xa(),B(";"),j&&v.push(j)}return v}function xa(){if(ks(),h===k.type)switch(k.value){case"local":return _(),tu();case"if":return _(),Qc();case"return":return _(),Zc();case"function":_();var y=iu();return On(y);case"while":return _(),Xc();case"for":return _(),eu();case"repeat":return _(),Yc();case"break":return _(),qc();case"do":return _(),Jc();case"goto":return _(),zc()}if(c===k.type&&B("::"))return Kc();if(qe&&Ve.pop(),!((n.luaVersion==="5.2"||n.luaVersion==="5.3")&&B(";")))return su()}function Kc(){var y=k.value,v=ut();return n.scope&&(Ke("::"+y+"::"),fs(v,!0)),$("::"),A(P.labelStatement(v))}function qc(){return A(P.breakStatement())}function zc(){k.value;var y=ut();return A(P.gotoStatement(y))}function Jc(){n.scope&&Pe();var y=wt();return n.scope&&_e(),$("end"),A(P.doStatement(y))}function Xc(){var y=ze();$("do"),n.scope&&Pe();var v=wt();return n.scope&&_e(),$("end"),A(P.whileStatement(y,v))}function Yc(){n.scope&&Pe();var y=wt();$("until");var v=ze();return n.scope&&_e(),A(P.repeatStatement(v,y))}function Zc(){var y=[];if(k.value!=="end"){var v=Oi();for(v!=null&&y.push(v);B(",");)v=ze(),y.push(v);B(";")}return A(P.returnStatement(y))}function Qc(){var y=[],v,j,re;for(qe&&(re=Ve[Ve.length-1],Ve.push(re)),v=ze(),$("then"),n.scope&&Pe(),j=wt(),n.scope&&_e(),y.push(A(P.ifClause(v,j))),qe&&(re=Yt());B("elseif");)ct(re),v=ze(),$("then"),n.scope&&Pe(),j=wt(),n.scope&&_e(),y.push(A(P.elseifClause(v,j))),qe&&(re=Yt());return B("else")&&(qe&&(re=new Mi(Y),Ve.push(re)),n.scope&&Pe(),j=wt(),n.scope&&_e(),y.push(A(P.elseClause(j)))),$("end"),A(P.ifStatement(y))}function eu(){var y=ut(),v;if(n.scope&&(Pe(),ht(y)),B("=")){var j=ze();$(",");var re=ze(),Se=B(",")?ze():null;return $("do"),v=wt(),$("end"),n.scope&&_e(),A(P.forNumericStatement(y,j,re,Se,v))}else{for(var Ne=[y];B(",");)y=ut(),n.scope&&ht(y),Ne.push(y);$("in");var it=[];do{var Ks=ze();it.push(Ks)}while(B(","));return $("do"),v=wt(),$("end"),n.scope&&_e(),A(P.forGenericStatement(Ne,it,v))}}function tu(){var y;if(u===k.type){var v=[],j=[];do y=ut(),v.push(y);while(B(","));if(B("="))do{var re=ze();j.push(re)}while(B(","));if(n.scope)for(var Se=0,Ne=v.length;Se",k)}function Sa(y){(y.inParens||["Identifier","MemberExpression","IndexExpression"].indexOf(y.type)===-1)&&g(k,b.invalidVar,k.value)}function su(){var y=k,v,j;if(qe&&(j=Yt()),v=Fn(),v==null)return ie(k);if(",=".indexOf(k.value)>=0){var re=[v],Se=[],Ne;for(Sa(v);B(",");)Ne=Fn(),Ne==null&&se("",k),Sa(Ne),re.push(Ne);$("=");do Ne=ze(),Se.push(Ne);while(B(","));return ct(j),A(P.assignmentStatement(re,Se))}return Te(v)?(ct(j),A(P.callStatement(v))):ie(y)}function ut(){ks();var y=k.value;return u!==k.type&&se("",k),_(),A(P.identifier(y))}function On(y,v){var j=[];if($("("),!B(")"))for(;;)if(u===k.type){var re=ut();if(n.scope&&ht(re),j.push(re),B(","))continue;if(B(")"))break}else if(m===k.type){j.push(Rn()),$(")");break}else se(" or '...'",k);var Se=wt();return $("end"),n.scope&&_e(),v=v||!1,A(P.functionStatement(y,j,v,Se))}function iu(){var y,v,j;for(qe&&(j=Yt()),y=ut(),n.scope&&(fs(y,Ze(y.name)),Pe());B(".");)ct(j),v=ut(),y=A(P.memberExpression(y,".",v));return B(":")&&(ct(j),v=ut(),y=A(P.memberExpression(y,":",v)),n.scope&&Ke("self")),y}function Pa(){for(var y=[],v,j;;){if(ks(),c===k.type&&B("["))v=ze(),$("]"),$("="),j=ze(),y.push(A(P.tableKey(v,j)));else if(u===k.type)z.value==="="?(v=ut(),_(),j=ze(),y.push(A(P.tableKeyString(v,j)))):(j=ze(),y.push(A(P.tableValue(j))));else{if((j=Oi())==null){Ve.pop();break}y.push(A(P.tableValue(j)))}if(",;".indexOf(k.value)>=0){_();continue}break}return $("}"),A(P.tableConstructorExpression(y))}function Oi(){var y=Dn(0);return y}function ze(){var y=Oi();if(y==null)se("",k);else return y}function nu(y){var v=y.charCodeAt(0),j=y.length;if(j===1)switch(v){case 94:return 12;case 42:case 47:case 37:return 10;case 43:case 45:return 9;case 38:return 6;case 126:return 5;case 124:return 4;case 60:case 62:return 3}else if(j===2)switch(v){case 47:return 10;case 46:return 8;case 60:case 62:return y==="<<"||y===">>"?7:3;case 61:case 126:return 3;case 111:return 1}else if(v===97&&y==="and")return 2;return 0}function Dn(y){var v=k.value,j,re;if(qe&&(re=Yt()),de(k)){ks(),_();var Se=Dn(10);Se==null&&se("",k),j=A(P.unaryExpression(v,Se))}if(j==null&&(j=Rn(),j==null&&(j=Fn())),j==null)return null;for(var Ne;v=k.value,Ne=c===k.type||h===k.type?nu(v):0,!(Ne===0||Ne<=y);){(v==="^"||v==="..")&&Ne--,_();var it=Dn(Ne);it==null&&se("",k),qe&&Ve.push(re),j=A(P.binaryExpression(v,j,it))}return j}function Fn(){var y,v,j;if(qe&&(j=Yt()),u===k.type)v=k.value,y=ut(),n.scope&&fs(y,Ze(v));else if(B("("))y=ze(),$(")"),y.inParens=!0;else return null;for(var re,Se;;)if(c===k.type)switch(k.value){case"[":ct(j),_(),re=ze(),$("]"),y=A(P.indexExpression(y,re));break;case".":ct(j),_(),Se=ut(),y=A(P.memberExpression(y,".",Se));break;case":":ct(j),_(),Se=ut(),y=A(P.memberExpression(y,":",Se)),ct(j),y=Bn(y);break;case"(":case"{":ct(j),y=Bn(y);break;default:return y}else if(l===k.type)ct(j),y=Bn(y);else break;return y}function Bn(y){if(c===k.type)switch(k.value){case"(":_();var v=[],j=Oi();for(j!=null&&v.push(j);B(",");)j=ze(),v.push(j);return $(")"),A(P.callExpression(y,v));case"{":ks(),_();var re=Pa();return A(P.tableCallExpression(y,re))}else if(l===k.type)return A(P.stringCallExpression(y,Rn()));se("function arguments",k)}function Rn(){var y=l|d|f|p|m,v=k.value,j=k.type,re;if(qe&&(re=Yt()),j&y){ct(re);var Se=s.slice(k.range[0],k.range[1]);return _(),A(P.literal(j,v,Se))}else{if(h===j&&v==="function")return ct(re),_(),n.scope&&Pe(),On(null);if(B("{"))return ct(re),Pa()}}e.parse=ru;function ru(y,v){if(typeof v=="undefined"&&typeof y=="object"&&(v=y,y=void 0),v||(v={}),s=y||"",n=fe(a,v),T=0,x=1,C=0,r=s.length,ee=[[]],le=0,xe=[],Ve=[],!(n.luaVersion==="5.1"||n.luaVersion==="5.2"||n.luaVersion==="5.3"))throw new Error(W("Lua version '%1' not supported",n.luaVersion));return n.comments&&(ue=[]),n.wait?e:Aa()}e.write=Ea;function Ea(y){return s+=String(y),r=s.length,e}e.end=Aa;function Aa(y){typeof y!="undefined"&&Ea(y),s&&s.substr(0,2)==="#!"&&(s=s.replace(/^.*/,function(j){return j.replace(/./g," ")})),r=s.length,qe=n.locations||n.ranges,z=R();var v=Wc();if(n.comments&&(v.comments=ue),n.scope&&(v.globals=xe),Ve.length>0)throw new Error("Location tracking failed. This is most likely a bug in luaparse");return v}})})(Cr,Cr.exports);var Tc={exports:{}};/*! diff v3.5.0 @@ -67,48 +67,55 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @license -*/(function(i,t){(function(s,r){i.exports=r()})(Ut,function(){return function(e){var s={};function r(n){if(s[n])return s[n].exports;var a=s[n]={exports:{},id:n,loaded:!1};return e[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}return r.m=e,r.c=s,r.p="",r(0)}([function(e,s,r){s.__esModule=!0,s.canonicalize=s.convertChangesToXML=s.convertChangesToDMP=s.merge=s.parsePatch=s.applyPatches=s.applyPatch=s.createPatch=s.createTwoFilesPatch=s.structuredPatch=s.diffArrays=s.diffJson=s.diffCss=s.diffSentences=s.diffTrimmedLines=s.diffLines=s.diffWordsWithSpace=s.diffWords=s.diffChars=s.Diff=void 0;var n=r(1),a=O(n),o=r(2),l=r(3),h=r(5),u=r(6),d=r(7),c=r(8),f=r(9),p=r(10),m=r(11),b=r(13),P=r(14),A=r(16),U=r(17);function O(S){return S&&S.__esModule?S:{default:S}}s.Diff=a.default,s.diffChars=o.diffChars,s.diffWords=l.diffWords,s.diffWordsWithSpace=l.diffWordsWithSpace,s.diffLines=h.diffLines,s.diffTrimmedLines=h.diffTrimmedLines,s.diffSentences=u.diffSentences,s.diffCss=d.diffCss,s.diffJson=c.diffJson,s.diffArrays=f.diffArrays,s.structuredPatch=P.structuredPatch,s.createTwoFilesPatch=P.createTwoFilesPatch,s.createPatch=P.createPatch,s.applyPatch=p.applyPatch,s.applyPatches=p.applyPatches,s.parsePatch=m.parsePatch,s.merge=b.merge,s.convertChangesToDMP=A.convertChangesToDMP,s.convertChangesToXML=U.convertChangesToXML,s.canonicalize=c.canonicalize},function(e,s){s.__esModule=!0,s.default=r;function r(){}r.prototype={diff:function(l,h){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=u.callback;typeof u=="function"&&(d=u,u={}),this.options=u;var c=this;function f(W){return d?(setTimeout(function(){d(void 0,W)},0),!0):W}l=this.castInput(l),h=this.castInput(h),l=this.removeEmpty(this.tokenize(l)),h=this.removeEmpty(this.tokenize(h));var p=h.length,m=l.length,b=1,P=p+m,A=[{newPos:-1,components:[]}],U=this.extractCommon(A[0],h,l,0);if(A[0].newPos+1>=p&&U+1>=m)return f([{value:this.join(h),count:h.length}]);function O(){for(var W=-1*b;W<=b;W+=2){var fe=void 0,g=A[W-1],se=A[W+1],ie=(se?se.newPos:0)-W;g&&(A[W-1]=void 0);var T=g&&g.newPos+1=p&&ie+1>=m)return f(n(c,fe.components,h,l,c.useLongestToken));A[W]=fe}b++}if(d)(function W(){setTimeout(function(){if(b>P)return d();O()||W()},0)})();else for(;b<=P;){var S=O();if(S)return S}},pushComponent:function(l,h,u){var d=l[l.length-1];d&&d.added===h&&d.removed===u?l[l.length-1]={count:d.count+1,added:h,removed:u}:l.push({count:1,added:h,removed:u})},extractCommon:function(l,h,u,d){for(var c=h.length,f=u.length,p=l.newPos,m=p-d,b=0;p+1O.length?W:O}),b.value=o.join(P)}else b.value=o.join(h.slice(p,p+b.count));p+=b.count,b.added||(m+=b.count)}}var U=l[f-1];return f>1&&typeof U.value=="string"&&(U.added||U.removed)&&o.equals("",U.value)&&(l[f-2].value+=U.value,l.pop()),l}function a(o){return{newPos:o.newPos,components:o.components.slice(0)}}},function(e,s,r){s.__esModule=!0,s.characterDiff=void 0,s.diffChars=h;var n=r(1),a=o(n);function o(u){return u&&u.__esModule?u:{default:u}}var l=s.characterDiff=new a.default;function h(u,d,c){return l.diff(u,d,c)}},function(e,s,r){s.__esModule=!0,s.wordDiff=void 0,s.diffWords=c,s.diffWordsWithSpace=f;var n=r(1),a=l(n),o=r(4);function l(p){return p&&p.__esModule?p:{default:p}}var h=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,u=/\S/,d=s.wordDiff=new a.default;d.equals=function(p,m){return this.options.ignoreCase&&(p=p.toLowerCase(),m=m.toLowerCase()),p===m||this.options.ignoreWhitespace&&!u.test(p)&&!u.test(m)},d.tokenize=function(p){for(var m=p.split(/(\s+|\b)/),b=0;b2&&arguments[2]!==void 0?arguments[2]:{};if(typeof c=="string"&&(c=(0,n.parsePatch)(c)),Array.isArray(c)){if(c.length>1)throw new Error("applyPatch only works with a single input.");c=c[0]}var p=d.split(/\r\n|[\n\v\f\r\x85]/),m=d.match(/\r\n|[\n\v\f\r\x85]/g)||[],b=c.hunks,P=f.compareLine||function(Q,Z,ce,pe){return Z===pe},A=0,U=f.fuzzFactor||0,O=0,S=0,W=void 0,fe=void 0;function g(Q,Z){for(var ce=0;ce0?pe[0]:" ",ve=pe.length>0?pe.substr(1):pe;if(ke===" "||ke==="-"){if(!P(Z+1,p[Z],ke,ve)&&(A++,A>U))return!1;Z++}}return!0}for(var se=0;se0?re[0]:" ",F=re.length>0?re.substr(1):re,N=x.linedelimiters[R];if(M===" ")C++;else if(M==="-")p.splice(C,1),m.splice(C,1);else if(M==="+")p.splice(C,0,F),m.splice(C,0,N),C++;else if(M==="\\"){var D=x.lines[R-1]?x.lines[R-1][0]:null;D==="+"?W=!0:D==="-"&&(fe=!0)}}}if(W)for(;!p[p.length-1];)p.pop(),m.pop();else fe&&(p.push(""),m.push(` -`));for(var K=0;K1&&arguments[1]!==void 0?arguments[1]:{},o=n.split(/\r\n|[\n\v\f\r\x85]/),l=n.match(/\r\n|[\n\v\f\r\x85]/g)||[],h=[],u=0;function d(){var p={};for(h.push(p);u0?A(L.lines.slice(-b.context)):[],O-=W.length,S-=W.length)}(ue=W).push.apply(ue,a(z.map(function(N){return(Y.added?"+":"-")+N}))),Y.added?g+=z.length:fe+=z.length}else{if(O)if(z.length<=b.context*2&&k=P.length-2&&z.length<=b.context){var M=/\n$/.test(c),F=/\n$/.test(f);z.length==0&&!M?W.splice(re.oldLines,0,"\\ No newline at end of file"):(!M||!F)&&W.push("\\ No newline at end of file")}U.push(re),O=0,S=0,W=[]}fe+=z.length,g+=z.length}},ie=0;ie2&&arguments[2]!==void 0?arguments[2]:{},d=u.callback;typeof u=="function"&&(d=u,u={}),this.options=u;var c=this;function f(W){return d?(setTimeout(function(){d(void 0,W)},0),!0):W}l=this.castInput(l),h=this.castInput(h),l=this.removeEmpty(this.tokenize(l)),h=this.removeEmpty(this.tokenize(h));var p=h.length,m=l.length,b=1,P=p+m,A=[{newPos:-1,components:[]}],U=this.extractCommon(A[0],h,l,0);if(A[0].newPos+1>=p&&U+1>=m)return f([{value:this.join(h),count:h.length}]);function O(){for(var W=-1*b;W<=b;W+=2){var fe=void 0,g=A[W-1],se=A[W+1],ie=(se?se.newPos:0)-W;g&&(A[W-1]=void 0);var T=g&&g.newPos+1=p&&ie+1>=m)return f(r(c,fe.components,h,l,c.useLongestToken));A[W]=fe}b++}if(d)(function W(){setTimeout(function(){if(b>P)return d();O()||W()},0)})();else for(;b<=P;){var S=O();if(S)return S}},pushComponent:function(l,h,u){var d=l[l.length-1];d&&d.added===h&&d.removed===u?l[l.length-1]={count:d.count+1,added:h,removed:u}:l.push({count:1,added:h,removed:u})},extractCommon:function(l,h,u,d){for(var c=h.length,f=u.length,p=l.newPos,m=p-d,b=0;p+1O.length?W:O}),b.value=o.join(P)}else b.value=o.join(h.slice(p,p+b.count));p+=b.count,b.added||(m+=b.count)}}var U=l[f-1];return f>1&&typeof U.value=="string"&&(U.added||U.removed)&&o.equals("",U.value)&&(l[f-2].value+=U.value,l.pop()),l}function a(o){return{newPos:o.newPos,components:o.components.slice(0)}}},function(e,s,n){s.__esModule=!0,s.characterDiff=void 0,s.diffChars=h;var r=n(1),a=o(r);function o(u){return u&&u.__esModule?u:{default:u}}var l=s.characterDiff=new a.default;function h(u,d,c){return l.diff(u,d,c)}},function(e,s,n){s.__esModule=!0,s.wordDiff=void 0,s.diffWords=c,s.diffWordsWithSpace=f;var r=n(1),a=l(r),o=n(4);function l(p){return p&&p.__esModule?p:{default:p}}var h=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,u=/\S/,d=s.wordDiff=new a.default;d.equals=function(p,m){return this.options.ignoreCase&&(p=p.toLowerCase(),m=m.toLowerCase()),p===m||this.options.ignoreWhitespace&&!u.test(p)&&!u.test(m)},d.tokenize=function(p){for(var m=p.split(/(\s+|\b)/),b=0;b2&&arguments[2]!==void 0?arguments[2]:{};if(typeof c=="string"&&(c=(0,r.parsePatch)(c)),Array.isArray(c)){if(c.length>1)throw new Error("applyPatch only works with a single input.");c=c[0]}var p=d.split(/\r\n|[\n\v\f\r\x85]/),m=d.match(/\r\n|[\n\v\f\r\x85]/g)||[],b=c.hunks,P=f.compareLine||function(Q,Z,ce,pe){return Z===pe},A=0,U=f.fuzzFactor||0,O=0,S=0,W=void 0,fe=void 0;function g(Q,Z){for(var ce=0;ce0?pe[0]:" ",ve=pe.length>0?pe.substr(1):pe;if(ke===" "||ke==="-"){if(!P(Z+1,p[Z],ke,ve)&&(A++,A>U))return!1;Z++}}return!0}for(var se=0;se0?ne[0]:" ",F=ne.length>0?ne.substr(1):ne,N=x.linedelimiters[R];if(M===" ")C++;else if(M==="-")p.splice(C,1),m.splice(C,1);else if(M==="+")p.splice(C,0,F),m.splice(C,0,N),C++;else if(M==="\\"){var D=x.lines[R-1]?x.lines[R-1][0]:null;D==="+"?W=!0:D==="-"&&(fe=!0)}}}if(W)for(;!p[p.length-1];)p.pop(),m.pop();else fe&&(p.push(""),m.push(` +`));for(var K=0;K1&&arguments[1]!==void 0?arguments[1]:{},o=r.split(/\r\n|[\n\v\f\r\x85]/),l=r.match(/\r\n|[\n\v\f\r\x85]/g)||[],h=[],u=0;function d(){var p={};for(h.push(p);u0?A(L.lines.slice(-b.context)):[],O-=W.length,S-=W.length)}(ue=W).push.apply(ue,a(z.map(function(N){return(Y.added?"+":"-")+N}))),Y.added?g+=z.length:fe+=z.length}else{if(O)if(z.length<=b.context*2&&k=P.length-2&&z.length<=b.context){var M=/\n$/.test(c),F=/\n$/.test(f);z.length==0&&!M?W.splice(ne.oldLines,0,"\\ No newline at end of file"):(!M||!F)&&W.push("\\ No newline at end of file")}U.push(ne),O=0,S=0,W=[]}fe+=z.length,g+=z.length}},ie=0;iea.length)return!1;for(var l=0;l"):h.removed&&o.push(""),o.push(n(h.value)),h.added?o.push(""):h.removed&&o.push("")}return o.join("")}function n(a){var o=a;return o=o.replace(/&/g,"&"),o=o.replace(//g,">"),o=o.replace(/"/g,"""),o}}])})})(Tc);Object.defineProperty(_i,"__esModule",{value:!0});const ko=hs,rm=pa,nm=ma,am=Nr,om=Cn.exports,lm=Tc.exports;var bc=Nr;_i.defaultOptions=bc.defaultOptions;_i.WriteMode=bc.WriteMode;function cm(i,t){const e=om.parse(i,{comments:!0,locations:!0,ranges:!0,luaVersion:"5.3"});e.range[0]=0,e.range[1]=i.length;const s=Object.assign({},am.defaultOptions,t),r=Object.assign({},s,{sourceText:i});ko.injectShebang(e,r),ko.attachComments(e,r);const n=rm.buildDocFromAst(e,r);return nm.printDocToString(n,r)}_i.formatText=cm;function um(i,t,e){return lm.createPatch(i,t,e,"original","formatted")}_i.producePatch=um;function hm(i){for(var t=0,e=i.length;e--;)t+=i.charCodeAt(e),t+=t<<10,t^=t>>6;return t+=t<<3,t^=t>>11,t+=t<<15,t}const Os=console.log,lt=function(i,t){if(!i)throw t};function Tt(i,t){if(!i)return 0;var e=i.toString().split(".");return e.length>1?parseInt(e[0],t)+parseInt(e[1],t)/Math.pow(t,e[1].length):parseInt(e[0],t)}const xc=[" ",` +`}function h(u,d,c,f,p,m){return l(u,u,d,c,f,p,m)}},function(e,s){s.__esModule=!0,s.arrayEqual=n,s.arrayStartsWith=r;function n(a,o){return a.length!==o.length?!1:r(a,o)}function r(a,o){if(o.length>a.length)return!1;for(var l=0;l"):h.removed&&o.push(""),o.push(r(h.value)),h.added?o.push(""):h.removed&&o.push("")}return o.join("")}function r(a){var o=a;return o=o.replace(/&/g,"&"),o=o.replace(//g,">"),o=o.replace(/"/g,"""),o}}])})})(Tc);Object.defineProperty(_i,"__esModule",{value:!0});const ko=hs,nm=pa,rm=ma,am=_n,om=Cr.exports,lm=Tc.exports;var bc=_n;_i.defaultOptions=bc.defaultOptions;_i.WriteMode=bc.WriteMode;function cm(i,t){const e=om.parse(i,{comments:!0,locations:!0,ranges:!0,luaVersion:"5.3"});e.range[0]=0,e.range[1]=i.length;const s=Object.assign({},am.defaultOptions,t),n=Object.assign({},s,{sourceText:i});ko.injectShebang(e,n),ko.attachComments(e,n);const r=nm.buildDocFromAst(e,n);return rm.printDocToString(r,n)}_i.formatText=cm;function um(i,t,e){return lm.createPatch(i,t,e,"original","formatted")}_i.producePatch=um;function hm(i){for(var t=0,e=i.length;e--;)t+=i.charCodeAt(e),t+=t<<10,t^=t>>6;return t+=t<<3,t^=t>>11,t+=t<<15,t}const Os=console.log,lt=function(i,t){if(!i)throw t};function Tt(i,t){if(!i)return 0;var e=i.toString().split(".");return e.length>1?parseInt(e[0],t)+parseInt(e[1],t)/Math.pow(t,e[1].length):parseInt(e[0],t)}const xc=[" ",` `," ","\r"],fm={r:"\r",n:` -`,t:" ",'"':'"',"'":"'","\\":"\\"},vo=new Proxy(fm,{get(i,t){return Tt(t)}}),pm=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","_","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],kn=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","_","a","b","c","d","e","f","g","t","u","v","w","h","i","j","k","l","m","n","o","p","q","r","s","x","y","z"],ei=["0","1","2","3","4","5","6","7","8","9"],dm=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","A","B","C","D","E","F"],mm=["0","1"],ym=["+","-","*",")",";","/","^","%","#",",","{","}",":","[","]","(",".","`"],gm=["~","=",">","<"],Tm=["+","-","*","/","^","..","%","//"],bm=["+=","-=","*=","/=","^=","..=","%=","//="],Sc=["and","break","do","else","elseif","end","false","for","function","goto","if","in","local","nil","not","or","repeat","return","then","true","until","while","continue"],xm=["else","elseif","until","end"],Sm=["-","not","#","~"],Pc=["+","-","*","/","%","^","#","//","&","|","~","<<",">>","..",".",":",">","<","<=",">=","~=","==","+=","-=","*=","/=","%=","^=","..=","//=","and","or"],Pm=11,rn={"^":[13,12],"%":[10,10],"//":[10,10],"/":[10,10],"*":[10,10],"+":[9,9],"-":[9,9],"..":[8,7],">>":[7,7],"<<":[7,7],"&":[6,6],"~":[5,5],"|":[4,4],"==":[3,3],"~=":[3,3],">=":[3,3],"<=":[3,3],">":[3,3],"<":[3,3],"+=":[3,3],"-=":[3,3],"*=":[3,3],"/=":[3,3],"^=":[3,3],"%=":[3,3],"..=":[3,3],"//=":[3,3],and:[2,2],or:[1,1]};function Em(i){let t=0;const e=i.length,s=[];function r(c){return c=c||0,t<=e?i.substr(t+c,1):""}function n(){if(t<=e){const c=i.substr(t,1);return t++,c}else return""}function a(c){let p=1,m=1;for(;0<=t;)i.substr(0,1)==` -`?(p++,m=1):m++;let b;for(b=0;b`)}throw`file<${p}:${m}>: ${c}`}function o(c){for(;;){const f=n();if(f=="")a("Unfinished long string.");else if(f=="]"){let p=!0,m;for(m=1;m<=c;m++)if(r()=="=")t++;else{p=!1;break}if(p&&n()=="]")return}}}function l(){const c=t;for(;r()=="=";)t++;if(r()=="[")return t++,t-c-1;t=c}let h=0,u=0;function d(c){let f=i.substr(u,t-u),p=null;c=="Number"&&(f.substr(0,2).toLowerCase()=="0x"?(p="hex",parseInt(f,16)<999999999999&&(f=parseInt(f,16))):f.substr(0,2).toLowerCase()=="0b"&&(p="bin",parseInt(f.substr(2),2)<999999999999&&(f=parseInt(f.substr(2),2))));const m={Type:c,LeadingWhite:i.substr(h,u-h),Source:f};return p!==null&&(m.NType=p),s.push(m),h=t,u=t,m}for(;;){for(h=t;;){const f=r();if(f=="")break;if(f=="-")if(r(1)=="-")if(t+=2,r()=="["){t++;const p=l();if(p!=null)o(p),h=t;else for(;;){const m=n();if(m==""||m==` -`)break}}else for(;;){const p=n();if(p==""||p==` -`)break}else break;else if(xc.includes(f))t++;else break}i.substr(h,t-h),u=t;const c=n();if(c==""){d("Eof");break}else if(c=="'"||c=='"'){for(;;){const f=n();if(f=="\\"){const p=n();if(vo[p]==null)throw`Invalid Escape Sequence \`${p}\`.`}else{if(f==c)break;if(f=="")throw"Unfinished string!"}}d("String")}else if(c=="`"){for(;;){const f=n();if(f=="\\"){const p=n();if(vo[p]==null)throw`Invalid Escape Sequence \`${p}\`.`}else{if(f==c)break;if(f=="")throw"Unfinished string!"}}d("Hash")}else if(pm.includes(c)){for(;kn.includes(r());)t++;Sc.includes(i.substr(u,t-u))?d("Keyword"):d("Ident")}else if(ei.includes(c)||c=="."&&ei.includes(r())){if(c=="0"&&r().toLowerCase()=="x")for(t++;dm.includes(r())||r()==="_";)t++;else if(c=="0"&&r().toLowerCase()=="b")for(t++;mm.includes(r())||r()==="_";)t++;else{for(;ei.includes(r())||r()==="_";)t++;if(r()==".")for(t++;ei.includes(r());)t++;if(r()=="e"||r()=="E")for(t++,(r()=="-"||r()=="+")&&t++;ei.includes(r());)t++}d("Number")}else if(c=="["){const f=l();f!=null?(o(f),d("String")):d("Symbol")}else if(c==".")r()=="."&&(n(),(r()=="."||r()=="=")&&n()),d("Symbol");else if(c+r()=="//")n(),r()=="="&&n(),d("Symbol");else if(c+r()=="::")n(),d("Symbol");else if(Pc.includes(c+r()))n(),d("Symbol");else if(gm.includes(c))r()=="="&&t++,d("Symbol");else if(Tm.includes(c)&&r()=="=")n(),d("Symbol");else if(ym.includes(c))d("Symbol");else throw`Bad symbol \`${c}\` in source. ${t}`}return s}function Ec(i){const t=Em(i);let e=0;function s(){const M=t[e];return e at: ${n(M)}`}function o(){const M=r();return M.Type=="Eof"||M.Type=="Keyword"&&xm.includes(M.Source)}function l(){return Sm.includes(r().Source)||!1}function h(){return Pc.includes(r().Source)||!1}function u(M,F){const N=r();if(N.Type==M&&(F==null||N.Source==F))return s();{let D;for(D=-3;D<=3;D++)Os(`Tokens[${D}] = \`${r(D).Source}\``);throw F?`${n(N)}: \`${F}\` expected.`:`${n(N)}: ${M} expected.`}}function d(M){const F=M.GetFirstToken,N=M.GetLastToken,D=M;return M.GetFirstToken=function(){const K=F(D);return lt(K),K},M.GetLastToken=function(){const K=N(D);return lt(K),K},M}let c,f;function p(M,F){const N=[f(M,F)],D=[];for(;r().Source==",";)D.push(s()),N.push(f(M,F));return[N,D]}function m(M,F){var D,K,Q,Z;const N=r();if(N.Source=="("){const ce=s(),pe=f(M,F),ke=u("Symbol",")");let ve;return ve=d({Type:"ParenExpr",Expression:pe,Token_OpenParen:ce,Token_CloseParen:ke,GetFirstToken:()=>ve.Token_OpenParen,GetLastToken:()=>ve.Token_CloseParen}),ve}else if(N.Type=="Ident"){let ce;return ce=d({Type:"VariableExpr",Token:s(),GetFirstToken:()=>ce.Token,GetLastToken:()=>ce.Token}),M[ce.Token.Source]!=null&&((K=(D=M[ce.Token.Source])==null?void 0:D.Tokens)==null?void 0:K.push)!=null?(M[ce.Token.Source].Tokens.push(ce.Token),M[ce.Token.Source].UseCountIncrease()):F[ce.Token.Source]!=null&&((Z=(Q=F[ce.Token.Source])==null?void 0:Q.Tokens)==null?void 0:Z.push)!=null&&(F[ce.Token.Source].Tokens.push(ce.Token),F[ce.Token.Source].UseCountIncrease()),ce}else throw Os(a()),`${n(N)}: Unexpected symbol. ${N.Type} ${N.Source}`}function b(M,F){const N=u("Symbol","{"),D=[],K=[];for(;r().Source!="}";){if(r().Source=="["){const ce=s(),pe=f(M,F),ke=u("Symbol","]"),ve=u("Symbol","="),Ie=f(M,F);pe.Token&&pe.Token.Source,D.push({EntryType:"Index",Index:pe,Value:Ie,Token_OpenBracket:ce,Token_CloseBracket:ke,Token_Equals:ve})}else if(r().Type=="Ident"&&r(1).Source=="="){const ce=s(),pe=s(),ke=f(M,F);D.push({EntryType:"Field",Field:ce,Value:ke,Token_Equals:pe})}else{const ce=f(M,F);D.push({EntryType:"Value",Value:ce})}if(r().Source==","||r().Source==";")K.push(s());else break}const Q=u("Symbol","}");let Z;return Z=d({Type:"TableLiteral",EntryList:D,Token_SeperatorList:K,Token_OpenBrace:N,Token_CloseBrace:Q,GetFirstToken:()=>Z.Token_OpenBrace,GetLastToken:()=>Z.Token_CloseBrace}),Z}function P(M,F){const N=[],D=[];if(r().Type=="Ident"){const K=s();if(F&&r().Source=="<"&&r(2).Source==">"){const Q=r(1).Source;K.Attribute={LeadingWhite:r().LeadingWhite,Source:`<${Q}>`},s(),s(),s()}N.push(K)}else if(r().Source=="..."&&M)return[N,D,s()];for(;r().Source==",";){if(D.push(s()),r().Source=="..."&&M)return[N,D,s()];{const K=u("Ident");if(F&&r().Source=="<"&&r(2).Source==">"){const Q=r(1).Source;K.Attribute={LeadingWhite:r().LeadingWhite,Source:`<${Q}>`},s(),s(),s()}N.push(K)}}return[N,D]}function A(M,F,N){const D=c(F,N),K=r();if(K.Type=="Keyword"&&K.Source==M)return s(),[D,K];throw Os(K.Type,K.Source),`${n(K)}: ${M} expected.`}function U(M,F,N,D){const K=s();let Q,Z;if(!M){Q=[],Z=[];const B=u("Ident");for(Q.push(B);r().Source==".";)Z.push(s()),Q.push(u("Ident"));r().Source==":"&&(Z.push(s()),Q.push(u("Ident")))}const ce=u("Symbol","("),[pe,ke,ve]=P(!0),Ie=u("Symbol",")"),[E,I]=A("end",F,N);let _;return _=d({Type:M==!0?"FunctionLiteral":"FunctionStat",NameChain:Q,ArgList:pe,Body:E,Token_Function:K,Token_NameChainSeperator:Z,Token_OpenParen:ce,Token_Varg:ve,Token_ArgCommaList:ke,Token_CloseParen:Ie,Token_End:I,GetFirstToken:()=>_.Token_Function,GetLastToken:()=>_.Token_End}),_}function O(M,F){const N=r();if(N.Source=="("){const D=s(),K=[],Q=[];for(;r().Source!=")"&&(K.push(f(M,F)),r().Source==",");)Q.push(s());const Z=u("Symbol",")");let ce;return ce=d({CallType:"ArgCall",ArgList:K,Token_CommaList:Q,Token_OpenParen:D,Token_CloseParen:Z,GetFirstToken:()=>ce.Token_OpenParen,GetLastToken:()=>ce.Token_CloseParen}),ce}else if(N.Source=="{"){let D;return D=d({CallType:"TableCall",TableExpr:f(M,F),GetFirstToken:()=>D.TableExpr.GetFirstToken(),GetLastToken:()=>D.TableExpr.GetLastToken()}),D}else if(N.Type=="String"){let D;return D=d({CallType:"StringCall",Token:s(),GetFirstToken:()=>D.Token,GetLastToken:()=>D.Token}),D}else throw"Function arguments expected."}function S(M,F){let N=m(M,F);for(lt(N,"nil prefixexpr");;){const D=r();if(D.Source=="."){const K=s(),Q=u("Ident");let Z;Z=d({Type:"FieldExpr",Base:N,Field:Q,Token_Dot:K,GetFirstToken:()=>Z.Base.GetFirstToken(),GetLastToken:()=>Z.Field}),N=Z}else if(D.Source==":"){const K=s(),Q=u("Ident"),Z=O(M,F);let ce;ce=d({Type:"MethodExpr",Base:N,Method:Q,FunctionArguments:Z,Token_Colon:K,GetFirstToken:()=>ce.Base.GetFirstToken(),GetLastToken:()=>ce.FunctionArguments.GetLastToken()}),N=ce}else if(D.Source=="["){const K=s(),Q=f(M,F),Z=u("Symbol","]");let ce;ce=d({Type:"IndexExpr",Base:N,Index:Q,Token_OpenBracket:K,Token_CloseBracket:Z,GetFirstToken:()=>ce.Base.GetFirstToken(),GetLastToken:()=>ce.Token_CloseBracket}),N=ce}else if(D.Source=="{"||D.Source=="("||D.Type=="String"){let K;K=d({Type:"CallExpr",Base:N,FunctionArguments:O(M,F),GetFirstToken:()=>K.Base.GetFirstToken(),GetLastToken:()=>K.FunctionArguments.GetLastToken()}),N=K}else if(bm.includes(D.Source)){const K=s(),Q=f(M,F);let Z;Z=d({Type:"CompoundStat",Base:N,Token_Compound:K,Rhs:Q,Lhs:N,GetFirstToken:()=>Z.Base.GetFirstToken(),GetLastToken:()=>Z.Rhs.GetLastToken()}),N=Z}else return N}}function W(M,F){const N=r();if(N.Type=="Number"){let D;return D=d({Type:"NumberLiteral",Token:s(),GetFirstToken:()=>D.Token,GetLastToken:()=>D.Token}),D}else if(N.Type=="String"){let D;return D=d({Type:"StringLiteral",Token:s(),GetFirstToken:()=>D.Token,GetLastToken:()=>D.Token}),D}else if(N.Type=="Hash"){let D;return D=d({Type:"HashLiteral",Token:s(),GetFirstToken:()=>D.Token,GetLastToken:()=>D.Token}),D}else if(N.Source=="nil"){let D;return D=d({Type:"NilLiteral",Token:s(),GetFirstToken:()=>D.Token,GetLastToken:()=>D.Token}),D}else if(N.Source=="true"||N.Source=="false"){let D;return D=d({Type:"BooleanLiteral",Token:s(),GetFirstToken:()=>D.Token,GetLastToken:()=>D.Token}),D}else if(N.Source=="..."){let D;return D=d({Type:"VargLiteral",Token:s(),GetFirstToken:()=>D.Token,GetLastToken:()=>D.Token}),D}else return N.Source=="{"?b(M,F):N.Source=="function"?U(!0,M,F):S(M,F)}function fe(M,F,N){let D;if(l()){const K=s(),Q=fe(Pm,F,N);let Z;Z=d({Type:"UnopExpr",Token_Op:K,Rhs:Q,GetFirstToken:()=>Z.Token_Op,GetLastToken:()=>Z.Rhs.GetLastToken()}),D=Z}else D=W(F,N),lt(D,"nil sipleexpr");for(;h()&&rn[r().Source]!=null&&rn[r().Source][0]>M;){const K=s(),Q=fe(rn[K.Source][1],F,N);lt(Q,"RhsNeeded");let Z;Z=d({Type:"BinopExpr",Lhs:D,Rhs:Q,Token_Op:K,GetFirstToken:()=>Z.Lhs.GetFirstToken(),GetLastToken:()=>Z.Rhs.GetLastToken()}),D=Z}return D}f=(M,F)=>fe(0,M,F);function g(M,F){const N=S(M,F);if(N.Type=="MethodExpr"||N.Type=="CallExpr"){let D;return D=d({Type:"CallExprStat",Expression:N,GetFirstToken:()=>D.Expression.GetFirstToken(),GetLastToken:()=>D.Expression.GetLastToken()}),D}else{if(N.Type=="CompoundStat")return N;{const D=[N],K=[];for(;r().Source==",";){K.push(s());const ke=S(M,F);if(ke.Type=="MethodExpr"||ke.Type=="CallExpr")throw"Bad left hand side of asignment";D.push(ke)}const Q=u("Symbol","="),Z=[f(M,F)],ce=[];for(;r().Source==",";)ce.push(s()),Z.push(f(M,F));let pe;return pe=d({Type:"AssignmentStat",Rhs:Z,Lhs:D,Token_Equals:Q,Token_LhsSeperatorList:K,Token_RhsSeperatorList:ce,GetFirstToken:()=>pe.Lhs[0].GetFirstToken(),GetLastToken:()=>pe.Rhs[pe.Rhs.length-1].GetLastToken()}),pe}}}function se(M,F){const N=s(),D=f(M,F),K=u("Keyword","then"),Q=c(M,F),Z=[];for(;r().Source=="elseif"||r().Source=="else";){const ke=s();let ve,Ie;ke.Source=="elseif"&&(ve=f(M,F),Ie=u("Keyword","then"));const E=c(M,F);if(Z.push({Condition:ve,Body:E,ClauseType:ke.Source,Token:ke,Token_Then:Ie}),ke.Source=="else")break}const ce=u("Keyword","end");let pe;return pe=d({Type:"IfStat",Condition:D,Body:Q,ElseClauseList:Z,Token_If:N,Token_Then:K,Token_End:ce,GetFirstToken:()=>pe.Token_If,GetLastToken:()=>pe.Token_End}),pe}function ie(M,F){const N=s(),[D,K]=A("end",M,F);let Q;return Q=d({Type:"DoStat",Body:D,Token_Do:N,Token_End:K,GetFirstToken:()=>Q.Token_Do,GetLastToken:()=>Q.Token_End}),Q}function T(M,F){const N=s(),D=f(M,F),K=u("Keyword","do"),[Q,Z]=A("end",M,F);let ce;return ce=d({Type:"WhileStat",Condition:D,Body:Q,Token_While:N,Token_Do:K,Token_End:Z,GetFirstToken:()=>ce.Token_While,GetLastToken:()=>ce.Token_End}),ce}function k(M,F){const N=s(),[D,K]=P();if(r().Source=="="){const Q=s(),[Z,ce]=p(M,F);if(Z.length<2||Z.length>3)throw"Expected 2 or 3 values for range bounds";const pe=u("Keyword","do"),[ke,ve]=A("end",M,F);let Ie;return Ie=d({Type:"NumericForStat",VarList:D,RangeList:Z,Body:ke,Token_For:N,Token_VarCommaList:K,Token_Equals:Q,Token_RangeCommaList:ce,Token_Do:pe,Token_End:ve,GetFirstToken:()=>Ie.Token_For,GetLastToken:()=>Ie.Token_End}),Ie}else if(r().Source=="in"){const Q=s(),[Z,ce]=p(M,F),pe=u("Keyword","do"),[ke,ve]=A("end",M,F);let Ie;return Ie=d({Type:"GenericForStat",VarList:D,GeneratorList:Z,Body:ke,Token_For:N,Token_VarCommaList:K,Token_In:Q,Token_GeneratorCommaList:ce,Token_Do:pe,Token_End:ve,GetFirstToken:()=>Ie.Token_For,GetLastToken:()=>Ie.Token_End}),Ie}}function Y(M,F){const N=s(),[D,K]=A("until",M),Q=f(M,F);let Z;return Z=d({Type:"RepeatStat",Body:D,Condition:Q,Token_Repeat:N,Token_Until:K,GetFirstToken:()=>Z.Token_Repeat,GetLastToken:()=>Z.Condition.GetLastToken()}),Z}function z(M,F){const N=s();if(r().Source=="function"){const D=U(!1,M,F);if(D.NameChain.length>1)throw n(D.Token_NameChainSeperator[0])+": `(` expected.";let K;return K=d({Type:"LocalFunctionStat",FunctionStat:D,Token_Local:N,GetFirstToken:()=>K.Token_Local,GetLastToken:()=>K.FunctionStat.GetLastToken()}),K}else if(r().Type=="Ident"){const[D,K]=P(!1,!0);let Q=[],Z=[],ce;if(r().Source=="="){ce=s();const[ke,ve]=p(M,F);Q=ke,Z=ve}let pe;return pe=d({Type:"LocalVarStat",VarList:D,ExprList:Q,Token_Local:N,Token_Equals:ce,Token_VarCommaList:K,Token_ExprCommaList:Z,GetFirstToken:()=>pe.Token_Local,GetLastToken:function(){return pe.ExprList.length>0?pe.ExprList[pe.ExprList.length-1].GetLastToken():pe.VarList[pe.VarList.length-1]}}),pe}else throw"`function` or ident expected"}function ue(M,F){const N=s();let D,K;o()||r().Source==";"?(D=[],K=[]):[D,K]=p(M,F);let Q;return Q={Type:"ReturnStat",ExprList:D,Token_Return:N,Token_CommaList:K,GetFirstToken:()=>Q.Token_Return,GetLastToken:function(){return Q.ExprList.length>0?Q.ExprList[Q.ExprList.length-1].GetLastToken():Q.Token_Return}},Q}function L(M,F){const N=s();let D;return D={Type:"BreakStat",Token_Break:N,GetFirstToken:()=>D.Token_Break,GetLastToken:()=>D.Token_Break},D}function x(M,F){const N=s();let D;return D={Type:"ContinueStat",Token_Continue:N,GetFirstToken:()=>D.Token_Continue,GetLastToken:()=>D.Token_Continue},D}function C(){const M=s();let F;r().Type=="Keyword"?F=u("Keyword"):F=u("Ident");let N;return N={Type:"GotoStat",Token_Goto:M,Token_Label:F,GetFirstToken:()=>N.Token_Goto,GetLastToken:()=>N.Token_Label},N}function R(){const M=s();let F;r().Type=="Keyword"?F=u("Keyword"):F=u("Ident");const N=u("Symbol","::");let D;return D={Type:"LabelStat",Token_ColonsLeft:M,Token_Label:F,Token_ColonsRight:N,GetFirstToken:()=>D.Token_ColonsLeft,GetLastToken:()=>D.Token_ColonsRight},D}function re(M,F){const N=r();return N.Source=="if"?[!1,se(M,F)]:N.Source=="while"?[!1,T(M,F)]:N.Source=="do"?[!1,ie(M,F)]:N.Source=="for"?[!1,k(M,F)]:N.Source=="repeat"?[!1,Y(M,F)]:N.Source=="function"?[!1,U(!1,M,F)]:N.Source=="local"?[!1,z(M,F)]:N.Source=="return"?[!0,ue(M,F)]:N.Source=="break"?[!0,L()]:N.Source=="continue"?[!0,x()]:N.Source=="goto"?[!1,C()]:N.Source=="::"?[!1,R()]:[!1,g(M,F)]}return c=function(M,F){const N=[],D=[],K={},Q={};if(F!=null)for(const[ve,Ie]of Object.entries(F))Q[ve]=Ie;if(M!=null)for(const[ve,Ie]of Object.entries(M))Q[ve]=Ie;let Z,ce=0;for(;!o();){Z&&Z==r()&&Os(`INFINITE LOOP POSSIBLE ON STATEMENT ${Z.Source} :`,Z),Z=r();const[ve,Ie]=re(K,Q);if(Ie)switch(N.push(Ie),Ie.Type){case"LocalVarStat":Ie.VarList.forEach(_=>{_.UseCount=0,_.Number=ce++,K[_.Source]=_;const B=[];function $(){_.UseCount++,B.forEach(q=>{q.UseCount=_.UseCount})}_.Tokens={},_.Tokens.push=q=>{q.UseCountIncrease=$,q.UseCount=_.UseCount,q.Tokens=_.Tokens,B.push(q)},_.Tokens.get=()=>B,_.UseCountIncrease=$});break;case"LocalFunctionStat":const I=Ie.FunctionStat.NameChain;if(I.length===1){let $=function(){_.UseCount++,B.forEach(q=>{q.UseCount=_.UseCount})};var ke=$;const _=I[0];_.UseCount=0,_.Number=ce++,K[_.Source]=_;const B=[];_.Tokens={},_.Tokens.push=q=>{q.UseCountIncrease=$,q.UseCount=_.UseCount,q.Tokens=_.Tokens,B.push(q)},_.Tokens.get=()=>B,_.UseCountIncrease=$}break}const E=r();E.Type=="Symbol"&&E.Source==";"&&(D[N.length-1]=s())}let pe;return pe={Type:"StatList",StatementList:N,SemicolonList:D,GetFirstToken:function(){var ve;if(pe.StatementList.length!=0)return(ve=pe.StatementList[0])==null?void 0:ve.GetFirstToken()},GetLastToken:function(){if(pe.StatementList.length!=0)return pe.SemicolonList[pe.StatementList.length-1]?pe.SemicolonList[pe.StatementList.length-1]:pe.StatementList[pe.StatementList.length-1].GetLastToken()}},pe},c([],[])}function ti(i,t){const e={BinopExpr:!0,UnopExpr:!0,NumberLiteral:!0,StringLiteral:!0,NilLiteral:!0,BooleanLiteral:!0,VargLiteral:!0,HashLiteral:!0,FieldExpr:!0,IndexExpr:!0,MethodExpr:!0,CallExpr:!0,FunctionLiteral:!0,VariableExpr:!0,ParenExpr:!0,TableLiteral:!0},s={StatList:!0,BreakStat:!0,ContinueStat:!0,LabelStat:!0,GotoStat:!0,ReturnStat:!0,LocalVarStat:!0,LocalFunctionStat:!0,FunctionStat:!0,RepeatStat:!0,GenericForStat:!0,NumericForStat:!0,WhileStat:!0,DoStat:!0,IfStat:!0,CallExprStat:!0,AssignmentStat:!0,CompoundStat:!0};for(var[r,n]of Object.entries(t))if(!s[r]&&!e[r])throw`Invalid visitor target: \`${r}\``;function a(u){if(u!=null){const d=t[u.Type];if(typeof d=="function")return d(u);if(d&&d.Pre)return d.Pre(u)}}function o(u){const d=t[u.Type];if(d&&typeof d=="object"&&d.Post)return d.Post(u)}let l,h;l=function(u){if(!a(u)){if(u.Type=="BinopExpr")l(u.Lhs),l(u.Rhs);else if(u.Type=="UnopExpr")l(u.Rhs);else if(!(u.Type=="NumberLiteral"||u.Type=="StringLiteral"||u.Type=="NilLiteral"||u.Type=="BooleanLiteral"||u.Type=="VargLiteral"||u.Type=="HashLiteral")){if(u.Type=="FieldExpr")l(u.Base);else if(u.Type=="IndexExpr")l(u.Base),l(u.Index);else if(u.Type=="MethodExpr"||u.Type=="CallExpr")l(u.Base),u.FunctionArguments.CallType=="ArgCall"?u.FunctionArguments.ArgList.forEach((d,c)=>{l(d)}):u.FunctionArguments.CallType=="TableCall"&&l(u.FunctionArguments.TableExpr);else if(u.Type=="FunctionLiteral")h(u.Body);else if(u.Type!="VariableExpr")if(u.Type=="ParenExpr")l(u.Expression);else if(u.Type=="TableLiteral")u.EntryList.forEach((d,c)=>{if(d.EntryType=="Field")l(d.Value);else if(d.EntryType=="Index")l(d.Index),l(d.Value);else if(d.EntryType=="Value")l(d.Value);else throw"unreachable"});else if(u.Type=="CompoundStat")l(u.Lhs),l(u.Rhs);else throw`unreachable, type: ${u.Type}: ${u}`}o(u)}},h=function(u){if(!a(u)){if(u.Type=="StatList")u.StatementList.forEach((d,c)=>{if(d!=null){if(d===null||d.Type===null)return;d.Remove=()=>{u.StatementList[c]=null},h(d)}});else if(u.Type!="BreakStat"){if(u.Type!="ContinueStat"){if(u.Type!="GotoStat"){if(u.Type!="LabelStat")if(u.Type=="ReturnStat")u.ExprList.forEach((d,c)=>{l(d)});else if(u.Type=="LocalVarStat")u.Token_Equals&&u.ExprList.forEach((d,c)=>{l(d)});else if(u.Type=="LocalFunctionStat")h(u.FunctionStat.Body);else if(u.Type=="FunctionStat")h(u.Body);else if(u.Type=="RepeatStat")h(u.Body),l(u.Condition);else if(u.Type=="GenericForStat")u.GeneratorList.forEach((d,c)=>{l(d)}),h(u.Body);else if(u.Type=="NumericForStat")u.RangeList.forEach((d,c)=>{l(d)}),h(u.Body);else if(u.Type=="WhileStat")l(u.Condition),h(u.Body);else if(u.Type=="DoStat")h(u.Body);else if(u.Type=="IfStat")l(u.Condition),h(u.Body),u.ElseClauseList.forEach(d=>{d.Condition!=null&&l(d.Condition),h(d.Body)});else if(u.Type=="CallExprStat")l(u.Expression);else if(u.Type=="CompoundStat")l(u.Lhs),l(u.Rhs);else if(u.Type=="AssignmentStat")u.Lhs.forEach(d=>{l(d)}),u.Rhs.forEach(d=>{l(d)});else throw"unreachable"}}}o(u)}},s[i.Type]?h(i):l(i)}function Ac(i){const t=[];let e,s=0;function r(){return s++,s}function n(){e={ParentScope:e,ChildScopeList:[],VariableList:[],BeginLocation:r(),Depth:null,GetVar:null},e.ParentScope?(e.Depth=e.ParentScope.Depth+1,e.ParentScope.ChildScopeList.push(e)):e.Depth=1;const f=e;e.GetVar=function(p){for(const m of f.VariableList)if(m.Name==p)return m;if(f.ParentScope)return f.ParentScope.GetVar(p);for(const m of t)if(m.Name==p)return m}}function a(){const f=e;return f.EndLocation=r(),f.VariableList.forEach(p=>{p.ScopeEndLocation=f.EndLocation}),e=f.ParentScope,f}n();function o(f,p,m){lt(m,"MIssing localInfo"),lt(f,"Missing local var name");const b={Type:"Local",Name:f,RenameList:[p],AssignedTo:!1,Info:m,Scope:e,BeginLocation:r(),EndLocation:r(),ReferenceLocationList:[r()]};return b.Rename=function(P){b.Name=P,b.RenameList.forEach(A=>{A(P)})},e.VariableList.push(b),b}function l(f){for(const m of t)if(m.Name==f)return m;const p={Type:"Global",Name:f,RenameList:[],AssignedTo:!1,Scope:null,BeginLocation:r(),EndLocation:r(),ReferenceLocationList:[]};return p.Rename=function(m){p.Name=m,p.RenameList.forEach(b=>{b(m)})},t.push(p),p}function h(f,p){lt(f,"Missing var name");const m=l(f);return m.RenameList.push(p),m}function u(f,p){let m;for(m=f.VariableList.length-1;m>=0;m--)if(f.VariableList[m].Name==p)return f.VariableList[m];if(f.ParentScope){const b=u(f.ParentScope,p);if(b)return b}}function d(f,p){lt(f,"Missing var name");let m=u(e,f);m?m.RenameList.push(p):m=h(f,p);const b=r();return m.EndLocation=b,m.ReferenceLocationList.push(m.EndLocation),m}const c={};return c.FunctionLiteral={Pre:function(f){n(),f.ArgList.forEach((p,m)=>{const b=o(p.Source,function(P,A){A||(p.Source=P)},{Type:"Argument",Index:m});p.var=b})},Post:function(f){a()}},c.VariableExpr=function(f){f.Variable=d(f.Token.Source,function(p){f.Token.Source=p})},c.StatList={Pre:function(f){n()},Post:function(f){f.SkipPop||a()}},c.LocalVarStat={Post:function(f){f.VarList.forEach((p,m)=>{o(p.Source,function(b){f.VarList[m].Source=b},{Type:"Local"})})}},c.LocalFunctionStat={Pre:function(f){o(f.FunctionStat.NameChain[0].Source,function(p){f.FunctionStat.NameChain[0].Source=p},{Type:"LocalFunction"}),n(),f.FunctionStat.ArgList.forEach((p,m)=>{o(p.Source,function(b){p.Source=b},{Type:"Argument",Index:m})})},Post:function(){a()}},c.FunctionStat={Pre:function(f){const p=f.NameChain;let m;p.length==1?u(e,p[0].Source)?m=d(p[0].Source,function(b){p[0].Source=b}):m=h(p[0].Source,function(b){p[0].Source=b}):m=d(p[0].Source,function(b){p[0].Source=b}),m.AssignedTo=!0,n(),f.ArgList.forEach((b,P)=>{o(b.Source,function(A){b.Source=A},{Type:"Argument",Index:P})})},Post:function(){a()}},c.GenericForStat={Pre:function(f){return f.GeneratorList.forEach(p=>{ti(p,c)}),n(),f.VarList.forEach((p,m)=>{o(p.Source,function(b){p.Source=b},{Type:"ForRange",Index:m})}),ti(f.Body,c),a(),!0}},c.NumericForStat={Pre:function(f){return f.RangeList.forEach(p=>{ti(p,c)}),n(),f.VarList.forEach((p,m)=>{o(p.Source,function(b){p.Source=b},{Type:"ForRange",Index:m})}),ti(f.Body,c),a(),!0}},c.RepeatStat={Pre:function(f){f.Body.SkipPop=!0},Post:function(f){a()}},c.AssignmentStat={Post:function(f){f.Lhs.forEach(p=>{p.Variable!=null&&(p.Variable.AssignedTo=!0)})}},ti(i,c),[t,a()]}function wc(i){let t,e,s="";const r=a=>typeof(a==null?void 0:a.LeadingWhite)!="string"?" ":a.LeadingWhite;function n(a){if(a.LeadingWhite==null||a.Source==null)throw`Bad token: tk=${a} | lwhite=${a.LeadingWhite} | source=${a.Source}`;s=`${s}${a.LeadingWhite}${a.Source}`}return e=function(a){if(a.Type=="BinopExpr")e(a.Lhs),n(a.Token_Op),e(a.Rhs);else if(a.Type=="UnopExpr")n(a.Token_Op),e(a.Rhs);else if(a.Type=="NumberLiteral"||a.Type=="StringLiteral"||a.Type=="NilLiteral"||a.Type=="BooleanLiteral"||a.Type=="VargLiteral"||a.Type=="HashLiteral")n(a.Token);else if(a.Type=="FieldExpr")e(a.Base),n(a.Token_Dot),n(a.Field);else if(a.Type=="IndexExpr")e(a.Base),n(a.Token_OpenBracket),e(a.Index),n(a.Token_CloseBracket);else if(a.Type=="MethodExpr"||a.Type=="CallExpr")e(a.Base),a.Type=="MethodExpr"&&(n(a.Token_Colon),n(a.Method)),a.FunctionArguments.CallType=="StringCall"?n(a.FunctionArguments.Token):a.FunctionArguments.CallType=="ArgCall"?(n(a.FunctionArguments.Token_OpenParen),a.FunctionArguments.ArgList.forEach((o,l)=>{e(o);const h=a.FunctionArguments.Token_CommaList[l];h!=null&&n(h)}),n(a.FunctionArguments.Token_CloseParen)):a.FunctionArguments.CallType=="TableCall"&&e(a.FunctionArguments.TableExpr);else if(a.Type=="FunctionLiteral")n(a.Token_Function),n(a.Token_OpenParen),a.ArgList.forEach((o,l)=>{n(o);const h=a.Token_ArgCommaList[l];h!=null&&n(h)}),a.Token_Varg!=null&&n(a.Token_Varg),n(a.Token_CloseParen),t(a.Body),n(a.Token_End);else if(a.Type=="VariableExpr")n(a.Token);else if(a.Type=="ParenExpr")n(a.Token_OpenParen),e(a.Expression),n(a.Token_CloseParen);else if(a.Type=="TableLiteral")n(a.Token_OpenBrace),a.EntryList.forEach((o,l)=>{if(o.EntryType=="Field")n(o.Field),n(o.Token_Equals),e(o.Value);else if(o.EntryType=="Index")n(o.Token_OpenBracket),e(o.Index),n(o.Token_CloseBracket),n(o.Token_Equals),e(o.Value);else if(o.EntryType=="Value")e(o.Value);else throw"unreachable";const h=a.Token_SeperatorList[l];h!=null&&n(h)}),n(a.Token_CloseBrace);else if(a.Type=="CompoundStat")t(a);else throw`unreachable, type: ${a.Type}: ${a}`},t=function(a){if(a==null)throw`STAT IS NIL! ${a}`;if(!(a.Type==="StatList"&&a.StatementList.length===0)){if(a.WrapInDo){const o=r(a.GetFirstToken());a.GetFirstToken().LeadingWhite="",s+=`${o}do `}a.Type=="StatList"?a.StatementList.forEach((o,l)=>{o===null||o.Type===null||(o.Remove=()=>{a.StatementList[l]=null},t(o),a.SemicolonList[l]&&n(a.SemicolonList[l]))}):a.Type=="BreakStat"?n(a.Token_Break):a.Type=="ContinueStat"?n(a.Token_Continue):a.Type=="GotoStat"?(n(a.Token_Goto),n(a.Token_Label)):a.Type=="LabelStat"?(n(a.Token_ColonsLeft),n(a.Token_Label),n(a.Token_ColonsRight)):a.Type=="ReturnStat"?(n(a.Token_Return),a.ExprList.forEach((o,l)=>{e(o),a.Token_CommaList[l]&&n(a.Token_CommaList[l])})):a.Type=="LocalVarStat"?(n(a.Token_Local),a.VarList.forEach((o,l)=>{n(o),o.Attribute!=null&&n(o.Attribute);const h=a.Token_VarCommaList[l];h!=null&&n(h)}),a.Token_Equals!=null&&(n(a.Token_Equals),a.ExprList.forEach((o,l)=>{e(o);const h=a.Token_ExprCommaList[l];h!=null&&n(h)}))):a.Type=="LocalFunctionStat"?(n(a.Token_Local),n(a.FunctionStat.Token_Function),n(a.FunctionStat.NameChain[0]),n(a.FunctionStat.Token_OpenParen),a.FunctionStat.ArgList.forEach((o,l)=>{n(o);const h=a.FunctionStat.Token_ArgCommaList[l];h!=null&&n(h)}),a.FunctionStat.Token_Varg&&n(a.FunctionStat.Token_Varg),n(a.FunctionStat.Token_CloseParen),t(a.FunctionStat.Body),n(a.FunctionStat.Token_End)):a.Type=="FunctionStat"?(n(a.Token_Function),a.NameChain.forEach((o,l)=>{n(o);const h=a.Token_NameChainSeperator[l];h!=null&&n(h)}),n(a.Token_OpenParen),a.ArgList.forEach((o,l)=>{n(o);const h=a.Token_ArgCommaList[l];h!=null&&n(h)}),a.Token_Varg&&n(a.Token_Varg),n(a.Token_CloseParen),t(a.Body),n(a.Token_End)):a.Type=="RepeatStat"?(n(a.Token_Repeat),t(a.Body),n(a.Token_Until),e(a.Condition)):a.Type=="GenericForStat"?(n(a.Token_For),a.VarList.forEach((o,l)=>{n(o);const h=a.Token_VarCommaList[l];h!=null&&n(h)}),n(a.Token_In),a.GeneratorList.forEach((o,l)=>{e(o);const h=a.Token_GeneratorCommaList[l];h!=null&&n(h)}),n(a.Token_Do),t(a.Body),n(a.Token_End)):a.Type=="NumericForStat"?(n(a.Token_For),a.VarList.forEach((o,l)=>{n(o);const h=a.Token_VarCommaList[l];h!=null&&n(h)}),n(a.Token_Equals),a.RangeList.forEach((o,l)=>{e(o);const h=a.Token_RangeCommaList[l];h!=null&&n(h)}),n(a.Token_Do),t(a.Body),n(a.Token_End)):a.Type=="WhileStat"?(n(a.Token_While),e(a.Condition),n(a.Token_Do),t(a.Body),n(a.Token_End)):a.Type=="DoStat"?(n(a.Token_Do),t(a.Body),n(a.Token_End)):a.Type=="IfStat"?(n(a.Token_If),e(a.Condition),n(a.Token_Then),t(a.Body),a.ElseClauseList.forEach(o=>{n(o.Token),o.Condition!=null&&(e(o.Condition),n(o.Token_Then)),t(o.Body)}),n(a.Token_End)):a.Type=="CallExprStat"?e(a.Expression):a.Type=="CompoundStat"?(e(a.Lhs),n(a.Token_Compound),e(a.Rhs),a.Type="CompoundStat"):a.Type=="AssignmentStat"?(a.Lhs.forEach((o,l)=>{e(o);const h=a.Token_LhsSeperatorList[l];h!=null&&n(h)}),n(a.Token_Equals),a.Rhs.forEach((o,l)=>{e(o);const h=a.Token_RhsSeperatorList[l];h!=null&&n(h)})):lt(!1,"unreachable"),a.WrapInDo&&(s+=" end ")}},t(i),s}function Am(i){let t,e,s=0;function r(c){if(c===void 0)return;const f=` -${" ".repeat(s)}`;if(c.LeadingWhite==""||c.LeadingWhite.substr(-f.length,f.length)!=f){let p="",m;for(m=c.LeadingWhite.length;m>=0;m--){const b=c.LeadingWhite.substr(m,1);if(!(b==""||b.match(/\s/g))){p=c.LeadingWhite.substr(0,m+1);break}}c.LeadingWhite=`${p}${f}`}}function n(){s++}function a(){s--,lt(s>=0,"Undented too far")}function o(c){return c.LeadingWhite.length>0?c.LeadingWhite.substr(0,1):c.Source.toString().substr(0,1)}function l(c){c.LeadingWhite=c.LeadingWhite.trim()}function h(c){l(c),xc.includes(o(c))||(c.LeadingWhite=" "+c.LeadingWhite)}function u(c){h(c.GetFirstToken())}function d(c,f,p){n(),t(f),a(),r(p)}e=function(c){if(c.Type=="BinopExpr")e(c.Lhs),e(c.Rhs),u(c.Rhs),h(c.Token_Op);else if(c.Type=="UnopExpr")l(c.Token_Op),e(c.Rhs),c.Token_Op.Source[0]&&h(c.Rhs.GetFirstToken());else if(c.Type=="NumberLiteral"||c.Type=="StringLiteral"||c.Type=="NilLiteral"||c.Type=="BooleanLiteral"||c.Type=="VargLiteral"||c.Type=="HashLiteral")l(c.Token),c.Type=="HashLiteral"&&(c.Token.Source='"'+hm(`${c.Token.Source.substring(1,c.Token.Source.length-1)}`)+'"',c.Type="StringLiteral",c.Token.Type="String");else if(c.Type=="FieldExpr")e(c.Base);else if(c.Type=="IndexExpr")e(c.Base),e(c.Index);else if(c.Type=="MethodExpr"||c.Type=="CallExpr")e(c.Base),l(c.FunctionArguments.GetFirstToken()),l(c.FunctionArguments.GetLastToken()),c.Type=="MethodExpr",c.FunctionArguments.CallType=="StringCall"||(c.FunctionArguments.CallType=="ArgCall"?c.FunctionArguments.ArgList.forEach((f,p)=>{e(f),p>0&&u(f);const m=c.FunctionArguments.Token_CommaList[p];m!=null&&l(m)}):c.FunctionArguments.CallType=="TableCall"&&e(c.FunctionArguments.TableExpr));else if(c.Type=="FunctionLiteral")c.ArgList.forEach((f,p)=>{p>0&&h(f),c.Token_ArgCommaList[p]}),c.ArgList.length>0&&c.Token_Varg!=null&&h(c.Token_Varg),d(c.Token_CloseParen,c.Body,c.Token_End);else if(c.Type!="VariableExpr")if(c.Type=="ParenExpr")l(c.Token_OpenParen),l(c.Token_CloseParen),e(c.Expression);else if(c.Type=="TableLiteral"){if(c.EntryList.length!=0){n();const f=100;c.EntryList.forEach((p,m)=>{p.EntryType=="Field"?(c.EntryList.length>f?vn(p.Value):r(p.Field),h(p.Token_Equals),e(p.Value),u(p.Value)):p.EntryType=="Index"?(c.EntryList.length>f?l(p.Token_OpenBracket):r(p.Token_OpenBracket),e(p.Index),h(p.Token_Equals),e(p.Value),u(p.Value)):p.EntryType=="Value"?(e(p.Value),c.EntryList.length>f?vn(p.Value):r(p.Value.GetFirstToken())):lt(!1,"unreachable");const b=c.Token_SeperatorList[m];b!=null&&(c.EntryList.length>f?b.LeadingWhite="":l(b))}),a(),c.EntryList.length>f?c.Token_CloseBrace.LeadingWhite="":r(c.Token_CloseBrace)}}else if(c.Type=="CompoundStat")t(c);else throw Os(c),`unreachable, type: ${c.Type}:`+c},t=function(c){if(c.Type=="StatList")c.StatementList.forEach((f,p)=>{f===null||f.Type===null||f.Type==="StatList"&&f.StatementList.length===0||(f.Remove=()=>{f.StatementList[p]=null},t(f),r(f.GetFirstToken()))});else if(c.Type!="BreakStat"){if(c.Type!="ContinueStat"){if(c.Type!="GotoStat"){if(c.Type!="LabelStat")if(c.Type=="ReturnStat")c.ExprList.forEach((f,p)=>{e(f),u(f),c.Token_CommaList[p]});else if(c.Type=="LocalVarStat"){if(c.VarList.forEach((f,p)=>{h(f),f.Attribute&&(f.Attribute.LeadingWhite=" "),c.Token_VarCommaList[p]}),c.Token_Equals){l(c.Token_Equals),h(c.Token_Equals);const f=[],p=[];c.ExprList.forEach((m,b)=>{m!=null&&(b{m!=null&&(e(m),u(m),c.Token_ExprCommaList[b]!=null&&c.ExprList.length-1==b&&(c.Token_ExprCommaList[b]=null))})}}else if(c.Type=="LocalFunctionStat")h(c.FunctionStat.Token_Function),h(c.FunctionStat.NameChain[0]),c.FunctionStat.ArgList.forEach((f,p)=>{p>0?h(f):l(f);const m=c.FunctionStat.Token_ArgCommaList[p];m&&l(m)}),c.FunctionStat.ArgList.length>0&&c.FunctionStat.Token_Varg?(l(c.FunctionStat.Token_Varg),h(c.FunctionStat.Token_Varg)):c.FunctionStat.Token_Varg&&l(c.FunctionStat.Token_Varg),l(c.FunctionStat.Token_OpenParen),l(c.FunctionStat.Token_CloseParen),d(c.FunctionStat.Token_CloseParen,c.FunctionStat.Body,c.FunctionStat.Token_End);else if(c.Type=="FunctionStat")c.NameChain.forEach((f,p)=>{p==0&&h(f),c.Token_NameChainSeperator[p]}),c.ArgList.forEach((f,p)=>{p>0&&h(f),c.Token_ArgCommaList[p]}),c.ArgList.length>0&&c.Token_Varg&&h(c.Token_Varg),d(c.Token_CloseParen,c.Body,c.Token_End);else if(c.Type=="RepeatStat")d(c.Token_Repeat,c.Body,c.Token_Until),e(c.Condition),u(c.Condition);else if(c.Type=="GenericForStat")c.VarList.forEach((f,p)=>{h(f),c.Token_VarCommaList[p]}),h(c.Token_In),c.GeneratorList.forEach((f,p)=>{e(f),u(f),c.Token_GeneratorCommaList[p]}),h(c.Token_Do),d(c.Token_Do,c.Body,c.Token_End);else if(c.Type=="NumericForStat")c.VarList.forEach((f,p)=>{h(f),c.Token_VarCommaList[p]}),h(c.Token_Equals),c.RangeList.forEach((f,p)=>{e(f),u(f),c.Token_RangeCommaList[p]}),h(c.Token_Do),d(c.Token_Do,c.Body,c.Token_End);else if(c.Type=="WhileStat")e(c.Condition),u(c.Condition),h(c.Token_Do),d(c.Token_Do,c.Body,c.Token_End);else if(c.Type=="DoStat")d(c.Token_Do,c.Body,c.Token_End);else if(c.Type=="IfStat"){e(c.Condition),u(c.Condition),h(c.Token_Then);let f=c.Token_Then,p=c.Body;c.ElseClauseList.forEach(m=>{d(f,p,m.Token),f=m.Token,m.Condition!=null&&(e(m.Condition),u(m.Condition),h(m.Token_Then),f=m.Token_Then),p=m.Body}),d(f,p,c.Token_End)}else c.Type=="CallExprStat"?e(c.Expression):c.Type=="CompoundStat"?(e(c.Lhs),e(c.Rhs),u(c.Lhs),u(c.Rhs),h(c.Token_Compound)):c.Type=="AssignmentStat"?(c.Lhs.forEach((f,p)=>{e(f),p>0&&u(f),c.Token_LhsSeperatorList[p]}),h(c.Token_Equals),c.Rhs.forEach((f,p)=>{e(f),u(f),c.Token_RhsSeperatorList[p]})):lt(!1,"Unreachable")}}}},t(i)}function vn(i){let t,e;function s(a){a&&(a.LeadingWhite="")}function r(a,o,l=!1){s(o);const h=(typeof a.Source=="string"?a.Source:a.Source.toString()).substr(a.Source.length-1,1),u=(typeof o.Source=="string"?o.Source:o.Source.toString()).substr(0,1);h=="-"&&u=="-"||kn.includes(h)&&kn.includes(u)||l&&h==")"&&u=="("?o.LeadingWhite=l?";":" ":o.LeadingWhite=""}function n(a,o,l){t(o),s(l);const h=o.GetFirstToken(),u=o.GetLastToken();h!=null?(r(a,h),r(u,l)):r(a,l)}e=function(a){if(a.Type==="BinopExpr")e(a.Lhs),e(a.Rhs),a.Lhs.Type=="NumberLiteral"&&a.Token_Op.Source==".."?a.Token_Op.LeadingWhite=" ":(s(a.Token_Op),r(a.Lhs.GetLastToken(),a.Token_Op)),r(a.Token_Op,a.Rhs.GetFirstToken());else if(a.Type==="UnopExpr")s(a.Token_Op),e(a.Rhs),r(a.Token_Op,a.Rhs.GetFirstToken());else if(a.Type==="NumberLiteral"||a.Type==="StringLiteral"||a.Type==="NilLiteral"||a.Type==="BooleanLiteral"||a.Type==="VargLiteral"||a.Type==="HashLiteral")s(a.Token);else if(a.Type=="FieldExpr")e(a.Base),s(a.Token_Dot),s(a.Field);else if(a.Type=="IndexExpr")e(a.Base),s(a.Token_OpenBracket),e(a.Index),s(a.Token_CloseBracket);else if(a.Type=="MethodExpr"||a.Type=="CallExpr")e(a.Base),a.Type=="MethodExpr"&&(s(a.Token_Colon),s(a.Method)),a.FunctionArguments.CallType=="StringCall"?s(a.FunctionArguments.Token):a.FunctionArguments.CallType=="ArgCall"?(s(a.FunctionArguments.Token_OpenParen),a.FunctionArguments.ArgList.forEach((o,l)=>{e(o);const h=a.FunctionArguments.Token_CommaList[l];h!=null&&s(h)}),s(a.FunctionArguments.Token_CloseParen)):a.FunctionArguments.CallType=="TableCall"&&e(a.FunctionArguments.TableExpr);else if(a.Type=="FunctionLiteral")s(a.Token_Function),s(a.Token_OpenParen),a.ArgList.forEach((o,l)=>{s(o);const h=a.Token_ArgCommaList[l];h!=null&&s(h)}),a.Token_Varg!=null&&s(a.Token_Varg),s(a.Token_CloseParen),n(a.Token_CloseParen,a.Body,a.Token_End);else if(a.Type=="VariableExpr")s(a.Token);else if(a.Type=="ParenExpr")s(a.Token_OpenParen),e(a.Expression),s(a.Token_CloseParen);else if(a.Type=="TableLiteral")s(a.Token_OpenBrace),a.EntryList.forEach((o,l)=>{o.EntryType=="Field"?(s(o.Field),s(o.Token_Equals),e(o.Value)):o.EntryType=="Index"?(s(o.Token_OpenBracket),e(o.Index),s(o.Token_CloseBracket),s(o.Token_Equals),e(o.Value)):o.EntryType=="Value"?e(o.Value):lt(!1,"unreachable");const h=a.Token_SeperatorList[l];h!=null&&s(h)}),a.Token_SeperatorList[a.EntryList.length-1]=null,s(a.Token_CloseBrace);else throw`unreachable, type: ${a.Type}:${a} ${console.trace()}`},t=function(a){if(a.Type=="StatList"){let o;for(o=0;o<=a.StatementList.length;o++){const l=a.StatementList[o];if(l==null)continue;t(l),s(l.GetFirstToken());const h=a.StatementList[o-1];if(h!=null){const u={")":["(","["],"]":["(","["]};if(a.SemicolonList[o-1]){const d=h.GetLastToken().Source,c=l.GetFirstToken().Source;(u[d]===null||u[d]===void 0||!u[d].includes(c))&&(a.SemicolonList[o-1]=null)}a.SemicolonList[o-1]||r(h.GetLastToken(),l.GetFirstToken(),!0)}}a.SemicolonList[a.StatementList.length-1]=null,a.StatementList.length>0&&s(a.StatementList[0].GetFirstToken())}else if(a.Type=="BreakStat")s(a.Token_Break);else if(a.Type=="ContinueStat")s(a.Token_Continue);else if(a.Type=="GotoStat")s(a.Token_Goto),r(a.Token_Goto,a.Token_Label);else if(a.Type=="LabelStat")s(a.Token_ColonsLeft),s(a.Token_Label),s(a.Token_ColonsRight);else if(a.Type=="ReturnStat")s(a.Token_Return),a.ExprList.forEach((o,l)=>{e(o),a.Token_CommaList[l]!=null&&s(a.Token_CommaList[l])}),a.ExprList.length>0&&r(a.Token_Return,a.ExprList[0].GetFirstToken());else if(a.Type=="LocalVarStat"){s(a.Token_Local);let o=!1;a.VarList.forEach((l,h)=>{h==0?r(a.Token_Local,l):s(l),l.Attribute&&(s(l.Attribute),h+1==a.VarList.length&&(o=!0));const u=a.Token_VarCommaList[h];u!=null&&s(u)}),a.Token_Equals!=null&&(o||s(a.Token_Equals),a.ExprList.forEach((l,h)=>{e(l);const u=a.Token_ExprCommaList[h];u!=null&&s(u)}))}else if(a.Type=="LocalFunctionStat")s(a.Token_Local),r(a.Token_Local,a.FunctionStat.Token_Function),r(a.FunctionStat.Token_Function,a.FunctionStat.NameChain[0]),r(a.FunctionStat.NameChain[0],a.FunctionStat.Token_OpenParen),a.FunctionStat.ArgList.forEach((o,l)=>{s(o);const h=a.FunctionStat.Token_ArgCommaList[l];h!=null&&s(h)}),a.FunctionStat.Token_Varg&&s(a.FunctionStat.Token_Varg),s(a.FunctionStat.Token_CloseParen),n(a.FunctionStat.Token_CloseParen,a.FunctionStat.Body,a.FunctionStat.Token_End);else if(a.Type=="FunctionStat")s(a.Token_Function),a.NameChain.forEach((o,l)=>{l==0?r(a.Token_Function,o):s(o);const h=a.Token_NameChainSeperator[l];h!=null&&s(h)}),s(a.Token_OpenParen),a.ArgList.forEach((o,l)=>{s(o);const h=a.Token_ArgCommaList[l];h!=null&&s(h)}),a.Token_Varg&&s(a.Token_Varg),s(a.Token_CloseParen),n(a.Token_CloseParen,a.Body,a.Token_End);else if(a.Type=="RepeatStat")s(a.Token_Repeat),n(a.Token_Repeat,a.Body,a.Token_Until),e(a.Condition),r(a.Token_Until,a.Condition.GetFirstToken());else if(a.Type=="GenericForStat")s(a.Token_For),a.VarList.forEach((o,l)=>{l==0?r(a.Token_For,o):s(o);const h=a.Token_VarCommaList[l];h!=null&&s(h)}),r(a.VarList[a.VarList.length-1],a.Token_In),a.GeneratorList.forEach((o,l)=>{e(o),l==0&&r(a.Token_In,o.GetFirstToken());const h=a.Token_GeneratorCommaList[l];h!=null&&s(h)}),r(a.GeneratorList[a.GeneratorList.length-1].GetLastToken(),a.Token_Do),n(a.Token_Do,a.Body,a.Token_End);else if(a.Type=="NumericForStat")s(a.Token_For),a.VarList.forEach((o,l)=>{l==0?r(a.Token_For,o):s(o);const h=a.Token_VarCommaList[l];h!=null&&s(h)}),r(a.VarList[a.VarList.length-1],a.Token_Equals),a.RangeList.forEach((o,l)=>{e(o),l==0&&r(a.Token_Equals,o.GetFirstToken());const h=a.Token_RangeCommaList[l];h!=null&&s(h)}),r(a.RangeList[a.RangeList.length-1].GetLastToken(),a.Token_Do),n(a.Token_Do,a.Body,a.Token_End);else if(a.Type=="WhileStat")s(a.Token_While),e(a.Condition),s(a.Token_Do),r(a.Token_While,a.Condition.GetFirstToken()),r(a.Condition.GetLastToken(),a.Token_Do),n(a.Token_Do,a.Body,a.Token_End);else if(a.Type=="DoStat")s(a.Token_Do),s(a.Token_End),n(a.Token_Do,a.Body,a.Token_End);else if(a.Type=="IfStat"){s(a.Token_If),e(a.Condition),r(a.Token_If,a.Condition.GetFirstToken()),r(a.Condition.GetLastToken(),a.Token_Then);let o=a.Token_Then,l=a.Body;a.ElseClauseList.forEach((h,u)=>{n(o,l,h.Token),o=h.Token,h.Condition!=null&&(e(h.Condition),r(h.Token,h.Condition.GetFirstToken()),r(h.Condition.GetLastToken(),h.Token_Then),o=h.Token_Then),t(h.Body),l=h.Body}),n(o,l,a.Token_End)}else if(a.Type=="CallExprStat")e(a.Expression);else if(a.Type=="CompoundStat")e(a.Lhs),s(a.Token_Compound),e(a.Rhs),r(a.Lhs.GetLastToken(),a.Token_Compound),r(a.Token_Compound,a.Rhs.GetFirstToken());else if(a.Type=="AssignmentStat")a.Lhs.forEach((o,l)=>{e(o);const h=a.Token_LhsSeperatorList[l];h!=null&&s(h)}),s(a.Token_Equals),a.Rhs.forEach((o,l)=>{e(o);const h=a.Token_RhsSeperatorList[l];h!=null&&s(h)});else return e(a)},t(i)}function Cc(i){let t,e;const s={NumberLiteral:!0,BooleanLiteral:!0,StringLiteral:!0,HashLiteral:!0,NilLiteral:!0,TableLiteral:!0,ParenExpr:!0,BinopExpr:!0};function r(c,f,p=null){let m;return m={Type:c,Token:{Type:p==null?"Number":p,LeadingWhite:"",Source:f},GetFirstToken:()=>m.Token,GetLastToken:()=>m.Token},m}function n(c,f,p){let m;return m={Type:"BinopExpr",Token_Op:{Type:"Symbol",LeadingWhite:"",Source:c},Lhs:f,Rhs:p,GetFirstToken:()=>m.Lhs.GetFirstToken(),GetLastToken:()=>m.Rhs.GetLastToken()},m}function a(c,f){let p;return p={Type:"UnopExpr",Token_Op:{Type:"Symbol",LeadingWhite:"",Source:c},Rhs:f,GetFirstToken:()=>p.Token_Op,GetLastToken:()=>p.Rhs.GetLastToken()},p}function o(c,f){if(f!=null)for(var[p,m]of Object.entries(f))c[p]=m}function l(c){if(c==null||c.substr==null)return;const f=c.substr(0,1);let p;if((f=='"'||f=="'")&&(p=c.substr(1,c.length-2)),f=="["){let P=0,A=1;for(;c.substr(A,1)=="=";)P++,A++;p=c.substr(2+P,c.length-4-P-2)}if(p==null)return"";let m="",b;for(b=0;b<=p.length;b++){const P=p.substr(b,1);P=="'"||P=='"'?m+=`\\${P}`:m+=P}return m}function h(c){if(typeof c=="object"&&c.Type=="ParenExpr")return o(c,c.Expression)}function u(c,f,p){let m=f,b=p;if(f&&f.Type=="ParenExpr"&&(m=f.Expression),p&&p.Type=="ParenExpr"&&(b=p.Expression),m==null||b==null||m.Type==null||b.Type==null||m.Type=="VariableExpr"||m.Type=="CallExpr"||m.Type=="BinopExpr"||b.Type=="CallExpr"||b.Type=="BinopExpr"||b.Type=="VariableExpr")return;const P=m.Token||m.Expression!=null&&m.Expression.Token||null,A=b.Token||b.Expression!=null&&b.Expression.Token||null,U=P!=null?P.Source:null,O=A!=null?A.Source:null;let S,W;if(m.Type=="BooleanLiteral"&&(S=U=="true"),b.Type=="BooleanLiteral"&&(W=O=="true"),!(m.Type=="NumberLiteral"&&(S=Tt(U),S==null))&&!(b.Type=="NumberLiteral"&&(W=Tt(O),W==null))&&((m.Type=="StringLiteral"||m.Type=="HashLiteral")&&(S=U.toString()),(b.Type=="StringLiteral"||b.Type=="HashLiteral")&&(W=O.toString()),S!=null&&W!=null)){if(c=="==")return S==W;if(c=="~=")return S!=W;if(c=="and")return S&&W;if(c=="or")return S||W;if(c==".."&&m.Type=="StringLiteral"&&b.Type=="StringLiteral")return`"${l(U)+l(O)}"`;if(m.Type=="StringLiteral"&&(S=Tt(l(S))),b.Type=="StringLiteral"&&(W=Tt(l(W))),S==null||W==null)return;let fe;if(c=="+"&&(fe=S+W),c=="-"&&(fe=S-W),c=="*"&&(fe=S*W),c=="/"&&(fe=S/W),c=="^"&&(fe=S**W),c=="%"&&(fe=S%W),c==">"&&(fe=S>W),c=="<"&&(fe=S="&&(fe=S>=W),c=="<="&&(fe=S<=W),fe==!1||fe==!0||isFinite(fe)&&fe>-(10**6)&&fe<10**6)return fe}}function d(c,f){const p=f.Token||f.Expression||f.EntryList||f;if(p==null||p.Source==null&&f.Type!="TableLiteral"||f.Type=="VariableExpr"||f.Type=="CallExpr"||f.Type=="BinopExpr")return;const m=p.Source;let b;if(f.Type=="TableLiteral"&&p!=null){const P=[];let A=0,U=!1,O=!1,S=0;if(p.forEach((W,fe)=>{if(U)P.push(W);else if(W.EntryType=="Value"||W.EntryType=="Index")if((W.Index==null||W.Index.Type=="NumberLiteral")&&W.Value){if((W.Index!=null&&W.Index.Token!=null&&W.Index.Token.Source!==null?W.Index.Token.Source:S+1).toString()!==(++S).toString())return U=!0,O=!0,P.push(W);W.Value.Type!="CallExpr"?A++:(U=!0,P.push(W))}else P.push(W)}),O)return;if(c=="#")return f.EntryList=P,f.EntryList.length<=0?r("NumberLiteral",A!==null?A:f.EntryList.length):A<=0?a("#",f):n("+",r("NumberLiteral",A),a("#",f))}if(f.Type=="BooleanLiteral"&&(b=m=="true"),!(f.Type=="NumberLiteral"&&(b=Tt(m),b===null))){if(f.Type=="StringLiteral"&&(b=m.substr(1,m.length-2)),c=="not"&&f.Type!==null)return f.Type=="NilLiteral"||f.Type=="BooleanLiteral"&&b===!1;if(b!=null){if(c=="#")return b.length;if(c=="-")return-b}}}e=function(c){if(c.Type=="BinopExpr"){if(e(c.Lhs),e(c.Rhs),c.Lhs!=null&&c.Rhs!=null){const f=c.Token_Op;if(f!=null&&f.Source!=null){const p=u(f.Source,c.Lhs,c.Rhs);if(p!=null){if(typeof p=="boolean"){const m=r("BooleanLiteral",p.toString(),"Keyword");o(c,m);return}else if(typeof p=="number"){if(isFinite(p)==!0){const m=r("NumberLiteral",p.toString(),"Number");o(c,m);return}}else if(typeof p=="string"){const m=r("StringLiteral",p,"String");o(c,m);return}else if(typeof p=="object"){o(c,p);return}return}}if(c.Lhs.Type=="ParenExpr"){const m=c.Lhs.Expression;m.Type=="NumberLiteral"||m.Type=="StringLiteral"||m.Type=="NilLiteral"||m.Type=="BooleanLiteral"||m.Type=="HashLiteral"}if(c.Rhs.Type=="ParenExpr"){const m=c.Rhs.Expression;m.Type=="NumberLiteral"||m.Type=="StringLiteral"||m.Type=="NilLiteral"||m.Type=="BooleanLiteral"||m.Type=="HashLiteral"}}}else if(c.Type=="UnopExpr"){if(e(c.Rhs),c.Rhs!=null&&s[c.Rhs.Type]==!0){const f=c.Token_Op;if(f!=null&&f.Source!=null){const p=c.Rhs.Expression!=null?c.Rhs.Expression:c.Rhs,m=d(f.Source,p);if(m!=null){if(typeof m=="boolean"){const b=r("BooleanLiteral",m.toString(),"Keyword");o(c,b);return}else if(typeof m=="number"){if(isFinite(m)==!0){const b=r("NumberLiteral",m,"Number");o(c,b);return}}else if(typeof m=="string"){const b=r("StringLiteral",m,"String");o(c,b);return}else if(typeof m=="object"){o(c,m);return}return}}}}else if(c.Type=="NumberLiteral"||c.Type=="StringLiteral"||c.Type=="NilLiteral"||c.Type=="BooleanLiteral"||c.Type=="VargLiteral"||c.Type=="HashLiteral"){const f=c.Token;if(f!=null){if(f.Type=="Number"){const p=f.Source.toString().split("e");if(p.length===2){const m=Tt(p[0]),b=Tt(p[1]);isFinite(m)&&isFinite(b)&&m**b<999999999&&!f.Source.includes("+")&&!!f.Source.includes(".")&&!f.Source.includes("-")&&(f.Source=(m**b).toString())}}f.Type=="String"&&(f.Source=f.Source.replace(/\\\d+/gi,p=>{const m=Tt(p.substr(1,p.length-1));return m&&isFinite(m)&&(m>=97&&m<=122||m>=65&&m<=90||m>=33&&m<=47||m>=58&&m<=64||m>=91&&m<=96||m>=123&&m<=126)&&m!==34&&m!==39&&m!==92?String.fromCharCode(m):p}))}}else if(c.Type=="FieldExpr")e(c.Base);else if(c.Type=="IndexExpr")e(c.Base),e(c.Index);else if(c.Type=="MethodExpr"||c.Type=="CallExpr"){if(e(c.Base),c.FunctionArguments.CallType=="ArgCall"?c.FunctionArguments.ArgList.forEach((f,p)=>{e(f)}):c.FunctionArguments.CallType=="TableCall"&&e(c.FunctionArguments.TableExpr),c.Base.Type==="ParenExpr"&&c.Base.Expression.Type==="FunctionLiteral"&&c.FunctionArguments.CallType==="ArgCall"){const f=c.Base.Expression;c.FunctionArguments.ArgList.forEach((p,m)=>{const b=c.FunctionArguments.ArgList[m];if(b!==void 0&&(b.Type=="NumberLiteral"||b.Type=="StringLiteral"||b.Type=="NilLiteral"||b.Type=="BooleanLiteral"||b.Type=="HashLiteral")){const P=f.ArgList[m];P&&P.var.RenameList.forEach(A=>{A(b.Token.Source,!0)})}})}}else if(c.Type=="FunctionLiteral")t(c.Body);else if(c.Type!="VariableExpr")if(c.Type=="ParenExpr"){const f=c.Expression;f!=null&&f.Type=="ParenExpr"&&(c.Expression=f.Expression),e(c.Expression),(c.Type=="NumberLiteral"||c.Type=="StringLiteral"||c.Type=="NilLiteral"||c.Type=="BooleanLiteral"||c.Type=="VargLiteral"||c.Type=="HashLiteral")&&h(c)}else c.Type=="TableLiteral"&&c.EntryList.forEach((f,p)=>{f.EntryType=="Field"?e(f.Value):f.EntryType=="Index"?(e(f.Index),e(f.Value)):f.EntryType=="Value"?e(f.Value):lt(!1,"unreachable")})},t=function(c){if(c.Type=="StatList")c.StatementList.forEach((f,p)=>{f===null||f.Type===null||(f.Remove=()=>{c.StatementList[p]=null},t(f))});else if(c.Type!="BreakStat"){if(c.Type!="ContinueStat")if(c.Type=="ReturnStat")c.ExprList.forEach((f,p)=>{e(f)});else if(c.Type=="LocalVarStat")c.Token_Equals!=null&&c.ExprList.forEach((f,p)=>{e(f)});else if(c.Type=="LocalFunctionStat")t(c.FunctionStat.Body),c.FunctionStat.NameChain.length===1&&c.FunctionStat.NameChain[0].UseCount;else if(c.Type=="FunctionStat")t(c.Body);else if(c.Type=="RepeatStat")t(c.Body),e(c.Condition),c.Body.Type=="StatList"&&c.Body.StatementList.length;else if(c.Type=="GenericForStat")c.GeneratorList.forEach((f,p)=>{e(f)}),t(c.Body);else if(c.Type=="NumericForStat"){c.RangeList.forEach((W,fe)=>{e(W)}),t(c.Body);const f=c.RangeList[0],p=c.RangeList[1],m=c.RangeList[2];if(f==null||p==null)return c.Remove();if(h(f),h(p),h(m),f.Type!="NumberLiteral"||p.Type!="NumberLiteral"||m!=null&&m.Type!="NumberLiteral"||m==null)return;const b=Tt(f.Token.Source),P=Tt(p.Token.Source),A=m!=null&&Tt(m.Token.Source)||1,U=A>0&&b<=P||A<0&&b>=P,O=(P-b+A)/A;if(!(U&&O>=0)||c.Body.Type=="StatList"&&c.Body.StatementList.length===0)return c.Remove()}else if(c.Type=="WhileStat"){e(c.Condition),t(c.Body);let f=c.Condition;switch(f.Type){case"ParenExpr":f=f.Expression;case"BooleanLiteral":if(f==null||f.Token==null||f.Token.Source!=="false")break;case"NilLiteral":c.Remove();break}}else if(c.Type=="DoStat"){if(t(c.Body),c.Body===null||c.Body.Type=="StatList"&&c.Body.StatementList.length===0)return c.Remove();if(c.Body.StatementList.length===1){const f=c.Body.StatementList[0];f.Type!=="ContinueStat"&&f.Type!=="BreakStat"&&f.Type!=="ReturnStat"&&o(c,f)}}else if(c.Type=="IfStat"){e(c.Condition),t(c.Body),c.ElseClauseList.forEach((p,m)=>{p.Condition!=null&&e(p.Condition),t(p.Body)});let f=c.Condition;switch(f.Type){case"ParenExpr":f=f.Expression;case"BooleanLiteral":if(c.ElseClauseList.length>=1||f==null||f.Token==null||f.Token.Source!=="false")break;case"NilLiteral":c.Remove();break}}else c.Type=="CallExprStat"?e(c.Expression):c.Type=="CompoundStat"?(e(c.Lhs),e(c.Rhs)):c.Type=="AssignmentStat"&&(c.Lhs.forEach((f,p)=>{e(f)}),c.Rhs.forEach((f,p)=>{e(f)}))}},t(i)}const Ss=[];let Ge;for(Ge="a".charCodeAt();Ge<="z".charCodeAt();Ge++)Ss.push(String.fromCharCode(Ge));for(Ge="A".charCodeAt();Ge<="Z".charCodeAt();Ge++)Ss.push(String.fromCharCode(Ge));for(Ge="0".charCodeAt();Ge<="9".charCodeAt();Ge++)Ss.push(String.fromCharCode(Ge));Ss.push("_");const yi=[];for(Ge="a".charCodeAt();Ge<="z".charCodeAt();Ge++)yi.push(String.fromCharCode(Ge));for(Ge="A".charCodeAt();Ge<="Z".charCodeAt();Ge++)yi.push(String.fromCharCode(Ge));function Lo(i){let t="";const e=i%yi.length;for(i=(i-e)/yi.length,t=`${t}${yi[e]}`;i>0;){const s=i%Ss.length;i=(i-s)/Ss.length,t=`${t}${Ss[s]}`}return t}function wm(i,t,e){const s=[];for(var[r,n]of Object.entries(Sc))s[r]=!0;const a=[];i.forEach(d=>{d.AssignedTo&&e?a.push(d):s[d.Name]=!0});function o(d){d.VariableList.forEach(c=>{a.push(c)}),d.ChildScopeList.forEach(c=>{o(c)})}o(t),a.forEach(d=>{d.UsedNameArray=[]}),a.sort((d,c)=>d-c);let l=0;const h=[];function u(d){let c=h[d];if(c==null){for(c=Lo(l),l++;s[c];)c=Lo(l),l++;h[d]=c}return c}a.forEach((d,c)=>{d.Renamed=!0;let f=0;for(;d.UsedNameArray[f];)f++;d.Rename(u(f)),d.Scope?a.forEach(p=>{p.Renamed||(!p.Scope||p.Scope.Depthm>=d.BeginLocation&&m<=d.ScopeEndLocation?(p.UsedNameArray[f]=!0,!0):!1):p.Scope.Depth>d.Scope.Depth?d.ReferenceLocationList.some(m=>m>=p.BeginLocation&&m<=p.ScopeEndLocation?(p.UsedNameArray[f]=!0,!0):!1):d.BeginLocationp.BeginLocation&&(p.UsedNameArray[f]=!0))}):a.forEach(p=>{if(!p.Renamed)if(p.Type=="Global")p.UsedNameArray[f]=!0;else if(p.Type=="Local")d.ReferenceLocationList.some(m=>m>=p.BeginLocation&&m<=p.ScopeEndLocation?(p.UsedNameArray[f]=!0,!0):!1);else throw"Unreachable"})})}function Cm(i,t,e){const s=[];i.forEach(l=>{(!l.AssignedTo||!e)&&(s[l.Name]=!0)});let r=1,n=1;function a(l,h){l.Name=h,l.RenameList.forEach(u=>{u(h)})}if(e){const l={};i.forEach(h=>{h.AssignedTo&&!h.ChangedName&&(l[h.Name]=l[h.Name]||`G_${n}_`,h.ChangedName=!0,a(h,l[h.Name]),n++)})}function o(l){l.VariableList.forEach(h=>{let u=`L_${r}_`;h.Info.Type=="Argument"?u=`${u}arg${h.Info.Index}`:h.Info.Type=="LocalFunction"?u=`${u}func`:h.Info.Type=="ForRange"&&(u=`${u}forvar${h.Info.Index}`),a(h,u),r++}),l.ChildScopeList.forEach(h=>{o(h)})}o(t)}const Ci={};Ci.Minify=function(i,t){const e=Ec(i),[s,r]=Ac(e);return t.RenameVariables==!0&&wm(s,r,t.RenameGlobals),t.SolveMath==!0&&Cc(e),vn(e),wc(e)};Ci.Beautify=function(i,t){const e=Ec(i),[s,r]=Ac(e);return t.RenameVariables&&Cm(s,r,t.RenameGlobals),t.SolveMath==!0&&Cc(e),Am(e),wc(e)};try{oi!=null&&oi.exports!=null&&(oi.exports.Beautify=Ci.Beautify,oi.exports.Minify=Ci.Minify)}catch{}const ys="_M",Re="__tmp",Io="esPairs",No="caseExp",Ln={debug:!1,tagArrayExpression:!0,useColonOnMethod:!0,importStatementHoisting:!0,transform$SymbolToDollar:!0,transformToString:!0,transformString:!0,transformJSONStringify:!0,transformJSONParse:!0,transformParseFloat:!0,transformParseInt:!0,transformNumber:!0,transformIsArray:!0,transformConsoleLog:!0,moduleExportsToReturn:!0,index0To1:!0,tryTranslateClass:!0,disableUpdateExpressionCallback:!0,renameCatchErrorIfNeeded:!0,disableClassCall:!0};function In(){console.log.apply(this,arguments)}function Ls(i){return i.filter(t=>t.trim()!=="").join(` -`)}function Nn(i){return xd(i,{plugins:["typescript"],sourceType:"module"})}const km={and:"_and",break:"_break",do:"_do",else:"_else",elseif:"_elseif",end:"_end",false:"_false",for:"_for",function:"_function",if:"_if",in:"_in",local:"_local",nil:"_nil",not:"_not",or:"_or",repeat:"_repeat",return:"_return",then:"_then",true:"_true",until:"_until",while:"_while"},vt=i=>Object.prototype.hasOwnProperty.call(km,i),nn={"!":"not","&&":"and","||":"or","===":"==","==":"==","!==":"~=","!=":"~="},an=i=>i.length>0?"self,":"self",vm=i=>i&&typeof i=="object"&&i.type;function Jt(i,t,e){const s=e===void 0?void 0:e-1,r=e>0||e===void 0;if(Array.isArray(i)){if(r)for(const n of i)Jt(n,t,s)}else if(vm(i)){const n=t(i);if(n)return n;if(r)for(const a of Object.values(i))Jt(a,t,s)}else return}function Lm(i,t,e,s){Jt(i,r=>{r.type=="Identifier"&&r.name==t&&(r.name=e)},s)}function si(i,t,e){let s;return Jt(i,r=>{if(r.type=="Identifier"&&r.name==t)return s=r,!0},e),s}const Im=["pcall","xpcall","unpack"];function Nm(i){var s;if(i.type!=="VariableDeclaration"||i.declarations.length!==1)return!1;const t=i.declarations[0];if(t.id.type!=="ArrayPattern"||!t.id.elements.every(r=>r&&r.type==="Identifier")||((s=t.init)==null?void 0:s.type)!=="CallExpression")return!1;const e=t.init.callee.name;return Im.includes(e)}function _o(i){Jt(i,t=>{t.type=="ThisExpression"&&(t.type="Identifier",t.name="cls")})}function kc(i,t,e){let s;return Jt(i,n=>{if(t(n))return s=n,!0},e),s}function Hi(i){return gi(i,"ContinueStatement")?"::continue::":""}function gi(i,t,e){return kc(i,s=>s.type===t,e)}const on=i=>i=="ArrayPattern"||i=="ObjectPattern";function _m(i){const t=gi(i,"RestElement");return t?`local ${t.argument.name} = {...};`:""}function Mm(i){const t=[];let e=[];for(const[n,a]of i.cases.entries())a.test?(e.push(a),a.consequent.length>0&&(t.push(e),e=[])):t.push([a]);e.length>0&&t.push(e);const s=[];for(const n of t)if(n.length===1)s.push(n[0]);else{const a=n[n.length-1];a.testGroup=n.map(o=>o.test),s.push(a)}const r=s.findIndex(n=>!n.test);r!==-1&&r!==s.length-1?i.cases=[...s.slice(0,r),...s.slice(r+1),s[r]]:i.cases=s}function Om(i,t={}){var fe;t={...Ln,...t},t.debug&&In((fe=i==null?void 0:i.program)==null?void 0:fe.body);const e=[],s=[],r=[];let n="",a="",o=!1,l=!1,h=!1,u=!1;const d=g=>g.filter(se=>se.type=="AssignmentPattern").map(se=>`if ${S(se.left)} == nil then ${S(se.left)} = ${S(se.right)} end`).join(";"),c=g=>{const se=[];for(const[k,Y]of g.entries())on(Y.type)&&(se.push("local "+S(Y)({type:"Identifier",name:`__tmp${k}`})),g[k]={type:"Identifier",name:`__tmp${k}`});const ie=_m(g),T=d(g);return`${se.join(";")} +`,t:" ",'"':'"',"'":"'","\\":"\\"},vo=new Proxy(fm,{get(i,t){return Tt(t)}}),pm=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","_","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],kr=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","_","a","b","c","d","e","f","g","t","u","v","w","h","i","j","k","l","m","n","o","p","q","r","s","x","y","z"],ei=["0","1","2","3","4","5","6","7","8","9"],dm=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","A","B","C","D","E","F"],mm=["0","1"],ym=["+","-","*",")",";","/","^","%","#",",","{","}",":","[","]","(",".","`"],gm=["~","=",">","<"],Tm=["+","-","*","/","^","..","%","//"],bm=["+=","-=","*=","/=","^=","..=","%=","//="],Sc=["and","break","do","else","elseif","end","false","for","function","goto","if","in","local","nil","not","or","repeat","return","then","true","until","while","continue"],xm=["else","elseif","until","end"],Sm=["-","not","#","~"],Pc=["+","-","*","/","%","^","#","//","&","|","~","<<",">>","..",".",":",">","<","<=",">=","~=","==","+=","-=","*=","/=","%=","^=","..=","//=","and","or"],Pm=11,nr={"^":[13,12],"%":[10,10],"//":[10,10],"/":[10,10],"*":[10,10],"+":[9,9],"-":[9,9],"..":[8,7],">>":[7,7],"<<":[7,7],"&":[6,6],"~":[5,5],"|":[4,4],"==":[3,3],"~=":[3,3],">=":[3,3],"<=":[3,3],">":[3,3],"<":[3,3],"+=":[3,3],"-=":[3,3],"*=":[3,3],"/=":[3,3],"^=":[3,3],"%=":[3,3],"..=":[3,3],"//=":[3,3],and:[2,2],or:[1,1]};function Em(i){let t=0;const e=i.length,s=[];function n(c){return c=c||0,t<=e?i.substr(t+c,1):""}function r(){if(t<=e){const c=i.substr(t,1);return t++,c}else return""}function a(c){let p=1,m=1;for(;0<=t;)i.substr(0,1)==` +`?(p++,m=1):m++;let b;for(b=0;b`)}throw`file<${p}:${m}>: ${c}`}function o(c){for(;;){const f=r();if(f=="")a("Unfinished long string.");else if(f=="]"){let p=!0,m;for(m=1;m<=c;m++)if(n()=="=")t++;else{p=!1;break}if(p&&r()=="]")return}}}function l(){const c=t;for(;n()=="=";)t++;if(n()=="[")return t++,t-c-1;t=c}let h=0,u=0;function d(c){let f=i.substr(u,t-u),p=null;c=="Number"&&(f.substr(0,2).toLowerCase()=="0x"?(p="hex",parseInt(f,16)<999999999999&&(f=parseInt(f,16))):f.substr(0,2).toLowerCase()=="0b"&&(p="bin",parseInt(f.substr(2),2)<999999999999&&(f=parseInt(f.substr(2),2))));const m={Type:c,LeadingWhite:i.substr(h,u-h),Source:f};return p!==null&&(m.NType=p),s.push(m),h=t,u=t,m}for(;;){for(h=t;;){const f=n();if(f=="")break;if(f=="-")if(n(1)=="-")if(t+=2,n()=="["){t++;const p=l();if(p!=null)o(p),h=t;else for(;;){const m=r();if(m==""||m==` +`)break}}else for(;;){const p=r();if(p==""||p==` +`)break}else break;else if(xc.includes(f))t++;else break}i.substr(h,t-h),u=t;const c=r();if(c==""){d("Eof");break}else if(c=="'"||c=='"'){for(;;){const f=r();if(f=="\\"){const p=r();if(vo[p]==null)throw`Invalid Escape Sequence \`${p}\`.`}else{if(f==c)break;if(f=="")throw"Unfinished string!"}}d("String")}else if(c=="`"){for(;;){const f=r();if(f=="\\"){const p=r();if(vo[p]==null)throw`Invalid Escape Sequence \`${p}\`.`}else{if(f==c)break;if(f=="")throw"Unfinished string!"}}d("Hash")}else if(pm.includes(c)){for(;kr.includes(n());)t++;Sc.includes(i.substr(u,t-u))?d("Keyword"):d("Ident")}else if(ei.includes(c)||c=="."&&ei.includes(n())){if(c=="0"&&n().toLowerCase()=="x")for(t++;dm.includes(n())||n()==="_";)t++;else if(c=="0"&&n().toLowerCase()=="b")for(t++;mm.includes(n())||n()==="_";)t++;else{for(;ei.includes(n())||n()==="_";)t++;if(n()==".")for(t++;ei.includes(n());)t++;if(n()=="e"||n()=="E")for(t++,(n()=="-"||n()=="+")&&t++;ei.includes(n());)t++}d("Number")}else if(c=="["){const f=l();f!=null?(o(f),d("String")):d("Symbol")}else if(c==".")n()=="."&&(r(),(n()=="."||n()=="=")&&r()),d("Symbol");else if(c+n()=="//")r(),n()=="="&&r(),d("Symbol");else if(c+n()=="::")r(),d("Symbol");else if(Pc.includes(c+n()))r(),d("Symbol");else if(gm.includes(c))n()=="="&&t++,d("Symbol");else if(Tm.includes(c)&&n()=="=")r(),d("Symbol");else if(ym.includes(c))d("Symbol");else throw`Bad symbol \`${c}\` in source. ${t}`}return s}function Ec(i){const t=Em(i);let e=0;function s(){const M=t[e];return e at: ${r(M)}`}function o(){const M=n();return M.Type=="Eof"||M.Type=="Keyword"&&xm.includes(M.Source)}function l(){return Sm.includes(n().Source)||!1}function h(){return Pc.includes(n().Source)||!1}function u(M,F){const N=n();if(N.Type==M&&(F==null||N.Source==F))return s();{let D;for(D=-3;D<=3;D++)Os(`Tokens[${D}] = \`${n(D).Source}\``);throw F?`${r(N)}: \`${F}\` expected.`:`${r(N)}: ${M} expected.`}}function d(M){const F=M.GetFirstToken,N=M.GetLastToken,D=M;return M.GetFirstToken=function(){const K=F(D);return lt(K),K},M.GetLastToken=function(){const K=N(D);return lt(K),K},M}let c,f;function p(M,F){const N=[f(M,F)],D=[];for(;n().Source==",";)D.push(s()),N.push(f(M,F));return[N,D]}function m(M,F){var D,K,Q,Z;const N=n();if(N.Source=="("){const ce=s(),pe=f(M,F),ke=u("Symbol",")");let ve;return ve=d({Type:"ParenExpr",Expression:pe,Token_OpenParen:ce,Token_CloseParen:ke,GetFirstToken:()=>ve.Token_OpenParen,GetLastToken:()=>ve.Token_CloseParen}),ve}else if(N.Type=="Ident"){let ce;return ce=d({Type:"VariableExpr",Token:s(),GetFirstToken:()=>ce.Token,GetLastToken:()=>ce.Token}),M[ce.Token.Source]!=null&&((K=(D=M[ce.Token.Source])==null?void 0:D.Tokens)==null?void 0:K.push)!=null?(M[ce.Token.Source].Tokens.push(ce.Token),M[ce.Token.Source].UseCountIncrease()):F[ce.Token.Source]!=null&&((Z=(Q=F[ce.Token.Source])==null?void 0:Q.Tokens)==null?void 0:Z.push)!=null&&(F[ce.Token.Source].Tokens.push(ce.Token),F[ce.Token.Source].UseCountIncrease()),ce}else throw Os(a()),`${r(N)}: Unexpected symbol. ${N.Type} ${N.Source}`}function b(M,F){const N=u("Symbol","{"),D=[],K=[];for(;n().Source!="}";){if(n().Source=="["){const ce=s(),pe=f(M,F),ke=u("Symbol","]"),ve=u("Symbol","="),Ie=f(M,F);pe.Token&&pe.Token.Source,D.push({EntryType:"Index",Index:pe,Value:Ie,Token_OpenBracket:ce,Token_CloseBracket:ke,Token_Equals:ve})}else if(n().Type=="Ident"&&n(1).Source=="="){const ce=s(),pe=s(),ke=f(M,F);D.push({EntryType:"Field",Field:ce,Value:ke,Token_Equals:pe})}else{const ce=f(M,F);D.push({EntryType:"Value",Value:ce})}if(n().Source==","||n().Source==";")K.push(s());else break}const Q=u("Symbol","}");let Z;return Z=d({Type:"TableLiteral",EntryList:D,Token_SeperatorList:K,Token_OpenBrace:N,Token_CloseBrace:Q,GetFirstToken:()=>Z.Token_OpenBrace,GetLastToken:()=>Z.Token_CloseBrace}),Z}function P(M,F){const N=[],D=[];if(n().Type=="Ident"){const K=s();if(F&&n().Source=="<"&&n(2).Source==">"){const Q=n(1).Source;K.Attribute={LeadingWhite:n().LeadingWhite,Source:`<${Q}>`},s(),s(),s()}N.push(K)}else if(n().Source=="..."&&M)return[N,D,s()];for(;n().Source==",";){if(D.push(s()),n().Source=="..."&&M)return[N,D,s()];{const K=u("Ident");if(F&&n().Source=="<"&&n(2).Source==">"){const Q=n(1).Source;K.Attribute={LeadingWhite:n().LeadingWhite,Source:`<${Q}>`},s(),s(),s()}N.push(K)}}return[N,D]}function A(M,F,N){const D=c(F,N),K=n();if(K.Type=="Keyword"&&K.Source==M)return s(),[D,K];throw Os(K.Type,K.Source),`${r(K)}: ${M} expected.`}function U(M,F,N,D){const K=s();let Q,Z;if(!M){Q=[],Z=[];const B=u("Ident");for(Q.push(B);n().Source==".";)Z.push(s()),Q.push(u("Ident"));n().Source==":"&&(Z.push(s()),Q.push(u("Ident")))}const ce=u("Symbol","("),[pe,ke,ve]=P(!0),Ie=u("Symbol",")"),[E,I]=A("end",F,N);let _;return _=d({Type:M==!0?"FunctionLiteral":"FunctionStat",NameChain:Q,ArgList:pe,Body:E,Token_Function:K,Token_NameChainSeperator:Z,Token_OpenParen:ce,Token_Varg:ve,Token_ArgCommaList:ke,Token_CloseParen:Ie,Token_End:I,GetFirstToken:()=>_.Token_Function,GetLastToken:()=>_.Token_End}),_}function O(M,F){const N=n();if(N.Source=="("){const D=s(),K=[],Q=[];for(;n().Source!=")"&&(K.push(f(M,F)),n().Source==",");)Q.push(s());const Z=u("Symbol",")");let ce;return ce=d({CallType:"ArgCall",ArgList:K,Token_CommaList:Q,Token_OpenParen:D,Token_CloseParen:Z,GetFirstToken:()=>ce.Token_OpenParen,GetLastToken:()=>ce.Token_CloseParen}),ce}else if(N.Source=="{"){let D;return D=d({CallType:"TableCall",TableExpr:f(M,F),GetFirstToken:()=>D.TableExpr.GetFirstToken(),GetLastToken:()=>D.TableExpr.GetLastToken()}),D}else if(N.Type=="String"){let D;return D=d({CallType:"StringCall",Token:s(),GetFirstToken:()=>D.Token,GetLastToken:()=>D.Token}),D}else throw"Function arguments expected."}function S(M,F){let N=m(M,F);for(lt(N,"nil prefixexpr");;){const D=n();if(D.Source=="."){const K=s(),Q=u("Ident");let Z;Z=d({Type:"FieldExpr",Base:N,Field:Q,Token_Dot:K,GetFirstToken:()=>Z.Base.GetFirstToken(),GetLastToken:()=>Z.Field}),N=Z}else if(D.Source==":"){const K=s(),Q=u("Ident"),Z=O(M,F);let ce;ce=d({Type:"MethodExpr",Base:N,Method:Q,FunctionArguments:Z,Token_Colon:K,GetFirstToken:()=>ce.Base.GetFirstToken(),GetLastToken:()=>ce.FunctionArguments.GetLastToken()}),N=ce}else if(D.Source=="["){const K=s(),Q=f(M,F),Z=u("Symbol","]");let ce;ce=d({Type:"IndexExpr",Base:N,Index:Q,Token_OpenBracket:K,Token_CloseBracket:Z,GetFirstToken:()=>ce.Base.GetFirstToken(),GetLastToken:()=>ce.Token_CloseBracket}),N=ce}else if(D.Source=="{"||D.Source=="("||D.Type=="String"){let K;K=d({Type:"CallExpr",Base:N,FunctionArguments:O(M,F),GetFirstToken:()=>K.Base.GetFirstToken(),GetLastToken:()=>K.FunctionArguments.GetLastToken()}),N=K}else if(bm.includes(D.Source)){const K=s(),Q=f(M,F);let Z;Z=d({Type:"CompoundStat",Base:N,Token_Compound:K,Rhs:Q,Lhs:N,GetFirstToken:()=>Z.Base.GetFirstToken(),GetLastToken:()=>Z.Rhs.GetLastToken()}),N=Z}else return N}}function W(M,F){const N=n();if(N.Type=="Number"){let D;return D=d({Type:"NumberLiteral",Token:s(),GetFirstToken:()=>D.Token,GetLastToken:()=>D.Token}),D}else if(N.Type=="String"){let D;return D=d({Type:"StringLiteral",Token:s(),GetFirstToken:()=>D.Token,GetLastToken:()=>D.Token}),D}else if(N.Type=="Hash"){let D;return D=d({Type:"HashLiteral",Token:s(),GetFirstToken:()=>D.Token,GetLastToken:()=>D.Token}),D}else if(N.Source=="nil"){let D;return D=d({Type:"NilLiteral",Token:s(),GetFirstToken:()=>D.Token,GetLastToken:()=>D.Token}),D}else if(N.Source=="true"||N.Source=="false"){let D;return D=d({Type:"BooleanLiteral",Token:s(),GetFirstToken:()=>D.Token,GetLastToken:()=>D.Token}),D}else if(N.Source=="..."){let D;return D=d({Type:"VargLiteral",Token:s(),GetFirstToken:()=>D.Token,GetLastToken:()=>D.Token}),D}else return N.Source=="{"?b(M,F):N.Source=="function"?U(!0,M,F):S(M,F)}function fe(M,F,N){let D;if(l()){const K=s(),Q=fe(Pm,F,N);let Z;Z=d({Type:"UnopExpr",Token_Op:K,Rhs:Q,GetFirstToken:()=>Z.Token_Op,GetLastToken:()=>Z.Rhs.GetLastToken()}),D=Z}else D=W(F,N),lt(D,"nil sipleexpr");for(;h()&&nr[n().Source]!=null&&nr[n().Source][0]>M;){const K=s(),Q=fe(nr[K.Source][1],F,N);lt(Q,"RhsNeeded");let Z;Z=d({Type:"BinopExpr",Lhs:D,Rhs:Q,Token_Op:K,GetFirstToken:()=>Z.Lhs.GetFirstToken(),GetLastToken:()=>Z.Rhs.GetLastToken()}),D=Z}return D}f=(M,F)=>fe(0,M,F);function g(M,F){const N=S(M,F);if(N.Type=="MethodExpr"||N.Type=="CallExpr"){let D;return D=d({Type:"CallExprStat",Expression:N,GetFirstToken:()=>D.Expression.GetFirstToken(),GetLastToken:()=>D.Expression.GetLastToken()}),D}else{if(N.Type=="CompoundStat")return N;{const D=[N],K=[];for(;n().Source==",";){K.push(s());const ke=S(M,F);if(ke.Type=="MethodExpr"||ke.Type=="CallExpr")throw"Bad left hand side of asignment";D.push(ke)}const Q=u("Symbol","="),Z=[f(M,F)],ce=[];for(;n().Source==",";)ce.push(s()),Z.push(f(M,F));let pe;return pe=d({Type:"AssignmentStat",Rhs:Z,Lhs:D,Token_Equals:Q,Token_LhsSeperatorList:K,Token_RhsSeperatorList:ce,GetFirstToken:()=>pe.Lhs[0].GetFirstToken(),GetLastToken:()=>pe.Rhs[pe.Rhs.length-1].GetLastToken()}),pe}}}function se(M,F){const N=s(),D=f(M,F),K=u("Keyword","then"),Q=c(M,F),Z=[];for(;n().Source=="elseif"||n().Source=="else";){const ke=s();let ve,Ie;ke.Source=="elseif"&&(ve=f(M,F),Ie=u("Keyword","then"));const E=c(M,F);if(Z.push({Condition:ve,Body:E,ClauseType:ke.Source,Token:ke,Token_Then:Ie}),ke.Source=="else")break}const ce=u("Keyword","end");let pe;return pe=d({Type:"IfStat",Condition:D,Body:Q,ElseClauseList:Z,Token_If:N,Token_Then:K,Token_End:ce,GetFirstToken:()=>pe.Token_If,GetLastToken:()=>pe.Token_End}),pe}function ie(M,F){const N=s(),[D,K]=A("end",M,F);let Q;return Q=d({Type:"DoStat",Body:D,Token_Do:N,Token_End:K,GetFirstToken:()=>Q.Token_Do,GetLastToken:()=>Q.Token_End}),Q}function T(M,F){const N=s(),D=f(M,F),K=u("Keyword","do"),[Q,Z]=A("end",M,F);let ce;return ce=d({Type:"WhileStat",Condition:D,Body:Q,Token_While:N,Token_Do:K,Token_End:Z,GetFirstToken:()=>ce.Token_While,GetLastToken:()=>ce.Token_End}),ce}function k(M,F){const N=s(),[D,K]=P();if(n().Source=="="){const Q=s(),[Z,ce]=p(M,F);if(Z.length<2||Z.length>3)throw"Expected 2 or 3 values for range bounds";const pe=u("Keyword","do"),[ke,ve]=A("end",M,F);let Ie;return Ie=d({Type:"NumericForStat",VarList:D,RangeList:Z,Body:ke,Token_For:N,Token_VarCommaList:K,Token_Equals:Q,Token_RangeCommaList:ce,Token_Do:pe,Token_End:ve,GetFirstToken:()=>Ie.Token_For,GetLastToken:()=>Ie.Token_End}),Ie}else if(n().Source=="in"){const Q=s(),[Z,ce]=p(M,F),pe=u("Keyword","do"),[ke,ve]=A("end",M,F);let Ie;return Ie=d({Type:"GenericForStat",VarList:D,GeneratorList:Z,Body:ke,Token_For:N,Token_VarCommaList:K,Token_In:Q,Token_GeneratorCommaList:ce,Token_Do:pe,Token_End:ve,GetFirstToken:()=>Ie.Token_For,GetLastToken:()=>Ie.Token_End}),Ie}}function Y(M,F){const N=s(),[D,K]=A("until",M),Q=f(M,F);let Z;return Z=d({Type:"RepeatStat",Body:D,Condition:Q,Token_Repeat:N,Token_Until:K,GetFirstToken:()=>Z.Token_Repeat,GetLastToken:()=>Z.Condition.GetLastToken()}),Z}function z(M,F){const N=s();if(n().Source=="function"){const D=U(!1,M,F);if(D.NameChain.length>1)throw r(D.Token_NameChainSeperator[0])+": `(` expected.";let K;return K=d({Type:"LocalFunctionStat",FunctionStat:D,Token_Local:N,GetFirstToken:()=>K.Token_Local,GetLastToken:()=>K.FunctionStat.GetLastToken()}),K}else if(n().Type=="Ident"){const[D,K]=P(!1,!0);let Q=[],Z=[],ce;if(n().Source=="="){ce=s();const[ke,ve]=p(M,F);Q=ke,Z=ve}let pe;return pe=d({Type:"LocalVarStat",VarList:D,ExprList:Q,Token_Local:N,Token_Equals:ce,Token_VarCommaList:K,Token_ExprCommaList:Z,GetFirstToken:()=>pe.Token_Local,GetLastToken:function(){return pe.ExprList.length>0?pe.ExprList[pe.ExprList.length-1].GetLastToken():pe.VarList[pe.VarList.length-1]}}),pe}else throw"`function` or ident expected"}function ue(M,F){const N=s();let D,K;o()||n().Source==";"?(D=[],K=[]):[D,K]=p(M,F);let Q;return Q={Type:"ReturnStat",ExprList:D,Token_Return:N,Token_CommaList:K,GetFirstToken:()=>Q.Token_Return,GetLastToken:function(){return Q.ExprList.length>0?Q.ExprList[Q.ExprList.length-1].GetLastToken():Q.Token_Return}},Q}function L(M,F){const N=s();let D;return D={Type:"BreakStat",Token_Break:N,GetFirstToken:()=>D.Token_Break,GetLastToken:()=>D.Token_Break},D}function x(M,F){const N=s();let D;return D={Type:"ContinueStat",Token_Continue:N,GetFirstToken:()=>D.Token_Continue,GetLastToken:()=>D.Token_Continue},D}function C(){const M=s();let F;n().Type=="Keyword"?F=u("Keyword"):F=u("Ident");let N;return N={Type:"GotoStat",Token_Goto:M,Token_Label:F,GetFirstToken:()=>N.Token_Goto,GetLastToken:()=>N.Token_Label},N}function R(){const M=s();let F;n().Type=="Keyword"?F=u("Keyword"):F=u("Ident");const N=u("Symbol","::");let D;return D={Type:"LabelStat",Token_ColonsLeft:M,Token_Label:F,Token_ColonsRight:N,GetFirstToken:()=>D.Token_ColonsLeft,GetLastToken:()=>D.Token_ColonsRight},D}function ne(M,F){const N=n();return N.Source=="if"?[!1,se(M,F)]:N.Source=="while"?[!1,T(M,F)]:N.Source=="do"?[!1,ie(M,F)]:N.Source=="for"?[!1,k(M,F)]:N.Source=="repeat"?[!1,Y(M,F)]:N.Source=="function"?[!1,U(!1,M,F)]:N.Source=="local"?[!1,z(M,F)]:N.Source=="return"?[!0,ue(M,F)]:N.Source=="break"?[!0,L()]:N.Source=="continue"?[!0,x()]:N.Source=="goto"?[!1,C()]:N.Source=="::"?[!1,R()]:[!1,g(M,F)]}return c=function(M,F){const N=[],D=[],K={},Q={};if(F!=null)for(const[ve,Ie]of Object.entries(F))Q[ve]=Ie;if(M!=null)for(const[ve,Ie]of Object.entries(M))Q[ve]=Ie;let Z,ce=0;for(;!o();){Z&&Z==n()&&Os(`INFINITE LOOP POSSIBLE ON STATEMENT ${Z.Source} :`,Z),Z=n();const[ve,Ie]=ne(K,Q);if(Ie)switch(N.push(Ie),Ie.Type){case"LocalVarStat":Ie.VarList.forEach(_=>{_.UseCount=0,_.Number=ce++,K[_.Source]=_;const B=[];function $(){_.UseCount++,B.forEach(q=>{q.UseCount=_.UseCount})}_.Tokens={},_.Tokens.push=q=>{q.UseCountIncrease=$,q.UseCount=_.UseCount,q.Tokens=_.Tokens,B.push(q)},_.Tokens.get=()=>B,_.UseCountIncrease=$});break;case"LocalFunctionStat":const I=Ie.FunctionStat.NameChain;if(I.length===1){let $=function(){_.UseCount++,B.forEach(q=>{q.UseCount=_.UseCount})};var ke=$;const _=I[0];_.UseCount=0,_.Number=ce++,K[_.Source]=_;const B=[];_.Tokens={},_.Tokens.push=q=>{q.UseCountIncrease=$,q.UseCount=_.UseCount,q.Tokens=_.Tokens,B.push(q)},_.Tokens.get=()=>B,_.UseCountIncrease=$}break}const E=n();E.Type=="Symbol"&&E.Source==";"&&(D[N.length-1]=s())}let pe;return pe={Type:"StatList",StatementList:N,SemicolonList:D,GetFirstToken:function(){var ve;if(pe.StatementList.length!=0)return(ve=pe.StatementList[0])==null?void 0:ve.GetFirstToken()},GetLastToken:function(){if(pe.StatementList.length!=0)return pe.SemicolonList[pe.StatementList.length-1]?pe.SemicolonList[pe.StatementList.length-1]:pe.StatementList[pe.StatementList.length-1].GetLastToken()}},pe},c([],[])}function ti(i,t){const e={BinopExpr:!0,UnopExpr:!0,NumberLiteral:!0,StringLiteral:!0,NilLiteral:!0,BooleanLiteral:!0,VargLiteral:!0,HashLiteral:!0,FieldExpr:!0,IndexExpr:!0,MethodExpr:!0,CallExpr:!0,FunctionLiteral:!0,VariableExpr:!0,ParenExpr:!0,TableLiteral:!0},s={StatList:!0,BreakStat:!0,ContinueStat:!0,LabelStat:!0,GotoStat:!0,ReturnStat:!0,LocalVarStat:!0,LocalFunctionStat:!0,FunctionStat:!0,RepeatStat:!0,GenericForStat:!0,NumericForStat:!0,WhileStat:!0,DoStat:!0,IfStat:!0,CallExprStat:!0,AssignmentStat:!0,CompoundStat:!0};for(var[n,r]of Object.entries(t))if(!s[n]&&!e[n])throw`Invalid visitor target: \`${n}\``;function a(u){if(u!=null){const d=t[u.Type];if(typeof d=="function")return d(u);if(d&&d.Pre)return d.Pre(u)}}function o(u){const d=t[u.Type];if(d&&typeof d=="object"&&d.Post)return d.Post(u)}let l,h;l=function(u){if(!a(u)){if(u.Type=="BinopExpr")l(u.Lhs),l(u.Rhs);else if(u.Type=="UnopExpr")l(u.Rhs);else if(!(u.Type=="NumberLiteral"||u.Type=="StringLiteral"||u.Type=="NilLiteral"||u.Type=="BooleanLiteral"||u.Type=="VargLiteral"||u.Type=="HashLiteral")){if(u.Type=="FieldExpr")l(u.Base);else if(u.Type=="IndexExpr")l(u.Base),l(u.Index);else if(u.Type=="MethodExpr"||u.Type=="CallExpr")l(u.Base),u.FunctionArguments.CallType=="ArgCall"?u.FunctionArguments.ArgList.forEach((d,c)=>{l(d)}):u.FunctionArguments.CallType=="TableCall"&&l(u.FunctionArguments.TableExpr);else if(u.Type=="FunctionLiteral")h(u.Body);else if(u.Type!="VariableExpr")if(u.Type=="ParenExpr")l(u.Expression);else if(u.Type=="TableLiteral")u.EntryList.forEach((d,c)=>{if(d.EntryType=="Field")l(d.Value);else if(d.EntryType=="Index")l(d.Index),l(d.Value);else if(d.EntryType=="Value")l(d.Value);else throw"unreachable"});else if(u.Type=="CompoundStat")l(u.Lhs),l(u.Rhs);else throw`unreachable, type: ${u.Type}: ${u}`}o(u)}},h=function(u){if(!a(u)){if(u.Type=="StatList")u.StatementList.forEach((d,c)=>{if(d!=null){if(d===null||d.Type===null)return;d.Remove=()=>{u.StatementList[c]=null},h(d)}});else if(u.Type!="BreakStat"){if(u.Type!="ContinueStat"){if(u.Type!="GotoStat"){if(u.Type!="LabelStat")if(u.Type=="ReturnStat")u.ExprList.forEach((d,c)=>{l(d)});else if(u.Type=="LocalVarStat")u.Token_Equals&&u.ExprList.forEach((d,c)=>{l(d)});else if(u.Type=="LocalFunctionStat")h(u.FunctionStat.Body);else if(u.Type=="FunctionStat")h(u.Body);else if(u.Type=="RepeatStat")h(u.Body),l(u.Condition);else if(u.Type=="GenericForStat")u.GeneratorList.forEach((d,c)=>{l(d)}),h(u.Body);else if(u.Type=="NumericForStat")u.RangeList.forEach((d,c)=>{l(d)}),h(u.Body);else if(u.Type=="WhileStat")l(u.Condition),h(u.Body);else if(u.Type=="DoStat")h(u.Body);else if(u.Type=="IfStat")l(u.Condition),h(u.Body),u.ElseClauseList.forEach(d=>{d.Condition!=null&&l(d.Condition),h(d.Body)});else if(u.Type=="CallExprStat")l(u.Expression);else if(u.Type=="CompoundStat")l(u.Lhs),l(u.Rhs);else if(u.Type=="AssignmentStat")u.Lhs.forEach(d=>{l(d)}),u.Rhs.forEach(d=>{l(d)});else throw"unreachable"}}}o(u)}},s[i.Type]?h(i):l(i)}function Ac(i){const t=[];let e,s=0;function n(){return s++,s}function r(){e={ParentScope:e,ChildScopeList:[],VariableList:[],BeginLocation:n(),Depth:null,GetVar:null},e.ParentScope?(e.Depth=e.ParentScope.Depth+1,e.ParentScope.ChildScopeList.push(e)):e.Depth=1;const f=e;e.GetVar=function(p){for(const m of f.VariableList)if(m.Name==p)return m;if(f.ParentScope)return f.ParentScope.GetVar(p);for(const m of t)if(m.Name==p)return m}}function a(){const f=e;return f.EndLocation=n(),f.VariableList.forEach(p=>{p.ScopeEndLocation=f.EndLocation}),e=f.ParentScope,f}r();function o(f,p,m){lt(m,"MIssing localInfo"),lt(f,"Missing local var name");const b={Type:"Local",Name:f,RenameList:[p],AssignedTo:!1,Info:m,Scope:e,BeginLocation:n(),EndLocation:n(),ReferenceLocationList:[n()]};return b.Rename=function(P){b.Name=P,b.RenameList.forEach(A=>{A(P)})},e.VariableList.push(b),b}function l(f){for(const m of t)if(m.Name==f)return m;const p={Type:"Global",Name:f,RenameList:[],AssignedTo:!1,Scope:null,BeginLocation:n(),EndLocation:n(),ReferenceLocationList:[]};return p.Rename=function(m){p.Name=m,p.RenameList.forEach(b=>{b(m)})},t.push(p),p}function h(f,p){lt(f,"Missing var name");const m=l(f);return m.RenameList.push(p),m}function u(f,p){let m;for(m=f.VariableList.length-1;m>=0;m--)if(f.VariableList[m].Name==p)return f.VariableList[m];if(f.ParentScope){const b=u(f.ParentScope,p);if(b)return b}}function d(f,p){lt(f,"Missing var name");let m=u(e,f);m?m.RenameList.push(p):m=h(f,p);const b=n();return m.EndLocation=b,m.ReferenceLocationList.push(m.EndLocation),m}const c={};return c.FunctionLiteral={Pre:function(f){r(),f.ArgList.forEach((p,m)=>{const b=o(p.Source,function(P,A){A||(p.Source=P)},{Type:"Argument",Index:m});p.var=b})},Post:function(f){a()}},c.VariableExpr=function(f){f.Variable=d(f.Token.Source,function(p){f.Token.Source=p})},c.StatList={Pre:function(f){r()},Post:function(f){f.SkipPop||a()}},c.LocalVarStat={Post:function(f){f.VarList.forEach((p,m)=>{o(p.Source,function(b){f.VarList[m].Source=b},{Type:"Local"})})}},c.LocalFunctionStat={Pre:function(f){o(f.FunctionStat.NameChain[0].Source,function(p){f.FunctionStat.NameChain[0].Source=p},{Type:"LocalFunction"}),r(),f.FunctionStat.ArgList.forEach((p,m)=>{o(p.Source,function(b){p.Source=b},{Type:"Argument",Index:m})})},Post:function(){a()}},c.FunctionStat={Pre:function(f){const p=f.NameChain;let m;p.length==1?u(e,p[0].Source)?m=d(p[0].Source,function(b){p[0].Source=b}):m=h(p[0].Source,function(b){p[0].Source=b}):m=d(p[0].Source,function(b){p[0].Source=b}),m.AssignedTo=!0,r(),f.ArgList.forEach((b,P)=>{o(b.Source,function(A){b.Source=A},{Type:"Argument",Index:P})})},Post:function(){a()}},c.GenericForStat={Pre:function(f){return f.GeneratorList.forEach(p=>{ti(p,c)}),r(),f.VarList.forEach((p,m)=>{o(p.Source,function(b){p.Source=b},{Type:"ForRange",Index:m})}),ti(f.Body,c),a(),!0}},c.NumericForStat={Pre:function(f){return f.RangeList.forEach(p=>{ti(p,c)}),r(),f.VarList.forEach((p,m)=>{o(p.Source,function(b){p.Source=b},{Type:"ForRange",Index:m})}),ti(f.Body,c),a(),!0}},c.RepeatStat={Pre:function(f){f.Body.SkipPop=!0},Post:function(f){a()}},c.AssignmentStat={Post:function(f){f.Lhs.forEach(p=>{p.Variable!=null&&(p.Variable.AssignedTo=!0)})}},ti(i,c),[t,a()]}function wc(i){let t,e,s="";const n=a=>typeof(a==null?void 0:a.LeadingWhite)!="string"?" ":a.LeadingWhite;function r(a){if(a.LeadingWhite==null||a.Source==null)throw`Bad token: tk=${a} | lwhite=${a.LeadingWhite} | source=${a.Source}`;s=`${s}${a.LeadingWhite}${a.Source}`}return e=function(a){if(a.Type=="BinopExpr")e(a.Lhs),r(a.Token_Op),e(a.Rhs);else if(a.Type=="UnopExpr")r(a.Token_Op),e(a.Rhs);else if(a.Type=="NumberLiteral"||a.Type=="StringLiteral"||a.Type=="NilLiteral"||a.Type=="BooleanLiteral"||a.Type=="VargLiteral"||a.Type=="HashLiteral")r(a.Token);else if(a.Type=="FieldExpr")e(a.Base),r(a.Token_Dot),r(a.Field);else if(a.Type=="IndexExpr")e(a.Base),r(a.Token_OpenBracket),e(a.Index),r(a.Token_CloseBracket);else if(a.Type=="MethodExpr"||a.Type=="CallExpr")e(a.Base),a.Type=="MethodExpr"&&(r(a.Token_Colon),r(a.Method)),a.FunctionArguments.CallType=="StringCall"?r(a.FunctionArguments.Token):a.FunctionArguments.CallType=="ArgCall"?(r(a.FunctionArguments.Token_OpenParen),a.FunctionArguments.ArgList.forEach((o,l)=>{e(o);const h=a.FunctionArguments.Token_CommaList[l];h!=null&&r(h)}),r(a.FunctionArguments.Token_CloseParen)):a.FunctionArguments.CallType=="TableCall"&&e(a.FunctionArguments.TableExpr);else if(a.Type=="FunctionLiteral")r(a.Token_Function),r(a.Token_OpenParen),a.ArgList.forEach((o,l)=>{r(o);const h=a.Token_ArgCommaList[l];h!=null&&r(h)}),a.Token_Varg!=null&&r(a.Token_Varg),r(a.Token_CloseParen),t(a.Body),r(a.Token_End);else if(a.Type=="VariableExpr")r(a.Token);else if(a.Type=="ParenExpr")r(a.Token_OpenParen),e(a.Expression),r(a.Token_CloseParen);else if(a.Type=="TableLiteral")r(a.Token_OpenBrace),a.EntryList.forEach((o,l)=>{if(o.EntryType=="Field")r(o.Field),r(o.Token_Equals),e(o.Value);else if(o.EntryType=="Index")r(o.Token_OpenBracket),e(o.Index),r(o.Token_CloseBracket),r(o.Token_Equals),e(o.Value);else if(o.EntryType=="Value")e(o.Value);else throw"unreachable";const h=a.Token_SeperatorList[l];h!=null&&r(h)}),r(a.Token_CloseBrace);else if(a.Type=="CompoundStat")t(a);else throw`unreachable, type: ${a.Type}: ${a}`},t=function(a){if(a==null)throw`STAT IS NIL! ${a}`;if(!(a.Type==="StatList"&&a.StatementList.length===0)){if(a.WrapInDo){const o=n(a.GetFirstToken());a.GetFirstToken().LeadingWhite="",s+=`${o}do `}a.Type=="StatList"?a.StatementList.forEach((o,l)=>{o===null||o.Type===null||(o.Remove=()=>{a.StatementList[l]=null},t(o),a.SemicolonList[l]&&r(a.SemicolonList[l]))}):a.Type=="BreakStat"?r(a.Token_Break):a.Type=="ContinueStat"?r(a.Token_Continue):a.Type=="GotoStat"?(r(a.Token_Goto),r(a.Token_Label)):a.Type=="LabelStat"?(r(a.Token_ColonsLeft),r(a.Token_Label),r(a.Token_ColonsRight)):a.Type=="ReturnStat"?(r(a.Token_Return),a.ExprList.forEach((o,l)=>{e(o),a.Token_CommaList[l]&&r(a.Token_CommaList[l])})):a.Type=="LocalVarStat"?(r(a.Token_Local),a.VarList.forEach((o,l)=>{r(o),o.Attribute!=null&&r(o.Attribute);const h=a.Token_VarCommaList[l];h!=null&&r(h)}),a.Token_Equals!=null&&(r(a.Token_Equals),a.ExprList.forEach((o,l)=>{e(o);const h=a.Token_ExprCommaList[l];h!=null&&r(h)}))):a.Type=="LocalFunctionStat"?(r(a.Token_Local),r(a.FunctionStat.Token_Function),r(a.FunctionStat.NameChain[0]),r(a.FunctionStat.Token_OpenParen),a.FunctionStat.ArgList.forEach((o,l)=>{r(o);const h=a.FunctionStat.Token_ArgCommaList[l];h!=null&&r(h)}),a.FunctionStat.Token_Varg&&r(a.FunctionStat.Token_Varg),r(a.FunctionStat.Token_CloseParen),t(a.FunctionStat.Body),r(a.FunctionStat.Token_End)):a.Type=="FunctionStat"?(r(a.Token_Function),a.NameChain.forEach((o,l)=>{r(o);const h=a.Token_NameChainSeperator[l];h!=null&&r(h)}),r(a.Token_OpenParen),a.ArgList.forEach((o,l)=>{r(o);const h=a.Token_ArgCommaList[l];h!=null&&r(h)}),a.Token_Varg&&r(a.Token_Varg),r(a.Token_CloseParen),t(a.Body),r(a.Token_End)):a.Type=="RepeatStat"?(r(a.Token_Repeat),t(a.Body),r(a.Token_Until),e(a.Condition)):a.Type=="GenericForStat"?(r(a.Token_For),a.VarList.forEach((o,l)=>{r(o);const h=a.Token_VarCommaList[l];h!=null&&r(h)}),r(a.Token_In),a.GeneratorList.forEach((o,l)=>{e(o);const h=a.Token_GeneratorCommaList[l];h!=null&&r(h)}),r(a.Token_Do),t(a.Body),r(a.Token_End)):a.Type=="NumericForStat"?(r(a.Token_For),a.VarList.forEach((o,l)=>{r(o);const h=a.Token_VarCommaList[l];h!=null&&r(h)}),r(a.Token_Equals),a.RangeList.forEach((o,l)=>{e(o);const h=a.Token_RangeCommaList[l];h!=null&&r(h)}),r(a.Token_Do),t(a.Body),r(a.Token_End)):a.Type=="WhileStat"?(r(a.Token_While),e(a.Condition),r(a.Token_Do),t(a.Body),r(a.Token_End)):a.Type=="DoStat"?(r(a.Token_Do),t(a.Body),r(a.Token_End)):a.Type=="IfStat"?(r(a.Token_If),e(a.Condition),r(a.Token_Then),t(a.Body),a.ElseClauseList.forEach(o=>{r(o.Token),o.Condition!=null&&(e(o.Condition),r(o.Token_Then)),t(o.Body)}),r(a.Token_End)):a.Type=="CallExprStat"?e(a.Expression):a.Type=="CompoundStat"?(e(a.Lhs),r(a.Token_Compound),e(a.Rhs),a.Type="CompoundStat"):a.Type=="AssignmentStat"?(a.Lhs.forEach((o,l)=>{e(o);const h=a.Token_LhsSeperatorList[l];h!=null&&r(h)}),r(a.Token_Equals),a.Rhs.forEach((o,l)=>{e(o);const h=a.Token_RhsSeperatorList[l];h!=null&&r(h)})):lt(!1,"unreachable"),a.WrapInDo&&(s+=" end ")}},t(i),s}function Am(i){let t,e,s=0;function n(c){if(c===void 0)return;const f=` +${" ".repeat(s)}`;if(c.LeadingWhite==""||c.LeadingWhite.substr(-f.length,f.length)!=f){let p="",m;for(m=c.LeadingWhite.length;m>=0;m--){const b=c.LeadingWhite.substr(m,1);if(!(b==""||b.match(/\s/g))){p=c.LeadingWhite.substr(0,m+1);break}}c.LeadingWhite=`${p}${f}`}}function r(){s++}function a(){s--,lt(s>=0,"Undented too far")}function o(c){return c.LeadingWhite.length>0?c.LeadingWhite.substr(0,1):c.Source.toString().substr(0,1)}function l(c){c.LeadingWhite=c.LeadingWhite.trim()}function h(c){l(c),xc.includes(o(c))||(c.LeadingWhite=" "+c.LeadingWhite)}function u(c){h(c.GetFirstToken())}function d(c,f,p){r(),t(f),a(),n(p)}e=function(c){if(c.Type=="BinopExpr")e(c.Lhs),e(c.Rhs),u(c.Rhs),h(c.Token_Op);else if(c.Type=="UnopExpr")l(c.Token_Op),e(c.Rhs),c.Token_Op.Source[0]&&h(c.Rhs.GetFirstToken());else if(c.Type=="NumberLiteral"||c.Type=="StringLiteral"||c.Type=="NilLiteral"||c.Type=="BooleanLiteral"||c.Type=="VargLiteral"||c.Type=="HashLiteral")l(c.Token),c.Type=="HashLiteral"&&(c.Token.Source='"'+hm(`${c.Token.Source.substring(1,c.Token.Source.length-1)}`)+'"',c.Type="StringLiteral",c.Token.Type="String");else if(c.Type=="FieldExpr")e(c.Base);else if(c.Type=="IndexExpr")e(c.Base),e(c.Index);else if(c.Type=="MethodExpr"||c.Type=="CallExpr")e(c.Base),l(c.FunctionArguments.GetFirstToken()),l(c.FunctionArguments.GetLastToken()),c.Type=="MethodExpr",c.FunctionArguments.CallType=="StringCall"||(c.FunctionArguments.CallType=="ArgCall"?c.FunctionArguments.ArgList.forEach((f,p)=>{e(f),p>0&&u(f);const m=c.FunctionArguments.Token_CommaList[p];m!=null&&l(m)}):c.FunctionArguments.CallType=="TableCall"&&e(c.FunctionArguments.TableExpr));else if(c.Type=="FunctionLiteral")c.ArgList.forEach((f,p)=>{p>0&&h(f),c.Token_ArgCommaList[p]}),c.ArgList.length>0&&c.Token_Varg!=null&&h(c.Token_Varg),d(c.Token_CloseParen,c.Body,c.Token_End);else if(c.Type!="VariableExpr")if(c.Type=="ParenExpr")l(c.Token_OpenParen),l(c.Token_CloseParen),e(c.Expression);else if(c.Type=="TableLiteral"){if(c.EntryList.length!=0){r();const f=100;c.EntryList.forEach((p,m)=>{p.EntryType=="Field"?(c.EntryList.length>f?vr(p.Value):n(p.Field),h(p.Token_Equals),e(p.Value),u(p.Value)):p.EntryType=="Index"?(c.EntryList.length>f?l(p.Token_OpenBracket):n(p.Token_OpenBracket),e(p.Index),h(p.Token_Equals),e(p.Value),u(p.Value)):p.EntryType=="Value"?(e(p.Value),c.EntryList.length>f?vr(p.Value):n(p.Value.GetFirstToken())):lt(!1,"unreachable");const b=c.Token_SeperatorList[m];b!=null&&(c.EntryList.length>f?b.LeadingWhite="":l(b))}),a(),c.EntryList.length>f?c.Token_CloseBrace.LeadingWhite="":n(c.Token_CloseBrace)}}else if(c.Type=="CompoundStat")t(c);else throw Os(c),`unreachable, type: ${c.Type}:`+c},t=function(c){if(c.Type=="StatList")c.StatementList.forEach((f,p)=>{f===null||f.Type===null||f.Type==="StatList"&&f.StatementList.length===0||(f.Remove=()=>{f.StatementList[p]=null},t(f),n(f.GetFirstToken()))});else if(c.Type!="BreakStat"){if(c.Type!="ContinueStat"){if(c.Type!="GotoStat"){if(c.Type!="LabelStat")if(c.Type=="ReturnStat")c.ExprList.forEach((f,p)=>{e(f),u(f),c.Token_CommaList[p]});else if(c.Type=="LocalVarStat"){if(c.VarList.forEach((f,p)=>{h(f),f.Attribute&&(f.Attribute.LeadingWhite=" "),c.Token_VarCommaList[p]}),c.Token_Equals){l(c.Token_Equals),h(c.Token_Equals);const f=[],p=[];c.ExprList.forEach((m,b)=>{m!=null&&(b{m!=null&&(e(m),u(m),c.Token_ExprCommaList[b]!=null&&c.ExprList.length-1==b&&(c.Token_ExprCommaList[b]=null))})}}else if(c.Type=="LocalFunctionStat")h(c.FunctionStat.Token_Function),h(c.FunctionStat.NameChain[0]),c.FunctionStat.ArgList.forEach((f,p)=>{p>0?h(f):l(f);const m=c.FunctionStat.Token_ArgCommaList[p];m&&l(m)}),c.FunctionStat.ArgList.length>0&&c.FunctionStat.Token_Varg?(l(c.FunctionStat.Token_Varg),h(c.FunctionStat.Token_Varg)):c.FunctionStat.Token_Varg&&l(c.FunctionStat.Token_Varg),l(c.FunctionStat.Token_OpenParen),l(c.FunctionStat.Token_CloseParen),d(c.FunctionStat.Token_CloseParen,c.FunctionStat.Body,c.FunctionStat.Token_End);else if(c.Type=="FunctionStat")c.NameChain.forEach((f,p)=>{p==0&&h(f),c.Token_NameChainSeperator[p]}),c.ArgList.forEach((f,p)=>{p>0&&h(f),c.Token_ArgCommaList[p]}),c.ArgList.length>0&&c.Token_Varg&&h(c.Token_Varg),d(c.Token_CloseParen,c.Body,c.Token_End);else if(c.Type=="RepeatStat")d(c.Token_Repeat,c.Body,c.Token_Until),e(c.Condition),u(c.Condition);else if(c.Type=="GenericForStat")c.VarList.forEach((f,p)=>{h(f),c.Token_VarCommaList[p]}),h(c.Token_In),c.GeneratorList.forEach((f,p)=>{e(f),u(f),c.Token_GeneratorCommaList[p]}),h(c.Token_Do),d(c.Token_Do,c.Body,c.Token_End);else if(c.Type=="NumericForStat")c.VarList.forEach((f,p)=>{h(f),c.Token_VarCommaList[p]}),h(c.Token_Equals),c.RangeList.forEach((f,p)=>{e(f),u(f),c.Token_RangeCommaList[p]}),h(c.Token_Do),d(c.Token_Do,c.Body,c.Token_End);else if(c.Type=="WhileStat")e(c.Condition),u(c.Condition),h(c.Token_Do),d(c.Token_Do,c.Body,c.Token_End);else if(c.Type=="DoStat")d(c.Token_Do,c.Body,c.Token_End);else if(c.Type=="IfStat"){e(c.Condition),u(c.Condition),h(c.Token_Then);let f=c.Token_Then,p=c.Body;c.ElseClauseList.forEach(m=>{d(f,p,m.Token),f=m.Token,m.Condition!=null&&(e(m.Condition),u(m.Condition),h(m.Token_Then),f=m.Token_Then),p=m.Body}),d(f,p,c.Token_End)}else c.Type=="CallExprStat"?e(c.Expression):c.Type=="CompoundStat"?(e(c.Lhs),e(c.Rhs),u(c.Lhs),u(c.Rhs),h(c.Token_Compound)):c.Type=="AssignmentStat"?(c.Lhs.forEach((f,p)=>{e(f),p>0&&u(f),c.Token_LhsSeperatorList[p]}),h(c.Token_Equals),c.Rhs.forEach((f,p)=>{e(f),u(f),c.Token_RhsSeperatorList[p]})):lt(!1,"Unreachable")}}}},t(i)}function vr(i){let t,e;function s(a){a&&(a.LeadingWhite="")}function n(a,o,l=!1){s(o);const h=(typeof a.Source=="string"?a.Source:a.Source.toString()).substr(a.Source.length-1,1),u=(typeof o.Source=="string"?o.Source:o.Source.toString()).substr(0,1);h=="-"&&u=="-"||kr.includes(h)&&kr.includes(u)||l&&h==")"&&u=="("?o.LeadingWhite=l?";":" ":o.LeadingWhite=""}function r(a,o,l){t(o),s(l);const h=o.GetFirstToken(),u=o.GetLastToken();h!=null?(n(a,h),n(u,l)):n(a,l)}e=function(a){if(a.Type==="BinopExpr")e(a.Lhs),e(a.Rhs),a.Lhs.Type=="NumberLiteral"&&a.Token_Op.Source==".."?a.Token_Op.LeadingWhite=" ":(s(a.Token_Op),n(a.Lhs.GetLastToken(),a.Token_Op)),n(a.Token_Op,a.Rhs.GetFirstToken());else if(a.Type==="UnopExpr")s(a.Token_Op),e(a.Rhs),n(a.Token_Op,a.Rhs.GetFirstToken());else if(a.Type==="NumberLiteral"||a.Type==="StringLiteral"||a.Type==="NilLiteral"||a.Type==="BooleanLiteral"||a.Type==="VargLiteral"||a.Type==="HashLiteral")s(a.Token);else if(a.Type=="FieldExpr")e(a.Base),s(a.Token_Dot),s(a.Field);else if(a.Type=="IndexExpr")e(a.Base),s(a.Token_OpenBracket),e(a.Index),s(a.Token_CloseBracket);else if(a.Type=="MethodExpr"||a.Type=="CallExpr")e(a.Base),a.Type=="MethodExpr"&&(s(a.Token_Colon),s(a.Method)),a.FunctionArguments.CallType=="StringCall"?s(a.FunctionArguments.Token):a.FunctionArguments.CallType=="ArgCall"?(s(a.FunctionArguments.Token_OpenParen),a.FunctionArguments.ArgList.forEach((o,l)=>{e(o);const h=a.FunctionArguments.Token_CommaList[l];h!=null&&s(h)}),s(a.FunctionArguments.Token_CloseParen)):a.FunctionArguments.CallType=="TableCall"&&e(a.FunctionArguments.TableExpr);else if(a.Type=="FunctionLiteral")s(a.Token_Function),s(a.Token_OpenParen),a.ArgList.forEach((o,l)=>{s(o);const h=a.Token_ArgCommaList[l];h!=null&&s(h)}),a.Token_Varg!=null&&s(a.Token_Varg),s(a.Token_CloseParen),r(a.Token_CloseParen,a.Body,a.Token_End);else if(a.Type=="VariableExpr")s(a.Token);else if(a.Type=="ParenExpr")s(a.Token_OpenParen),e(a.Expression),s(a.Token_CloseParen);else if(a.Type=="TableLiteral")s(a.Token_OpenBrace),a.EntryList.forEach((o,l)=>{o.EntryType=="Field"?(s(o.Field),s(o.Token_Equals),e(o.Value)):o.EntryType=="Index"?(s(o.Token_OpenBracket),e(o.Index),s(o.Token_CloseBracket),s(o.Token_Equals),e(o.Value)):o.EntryType=="Value"?e(o.Value):lt(!1,"unreachable");const h=a.Token_SeperatorList[l];h!=null&&s(h)}),a.Token_SeperatorList[a.EntryList.length-1]=null,s(a.Token_CloseBrace);else throw`unreachable, type: ${a.Type}:${a} ${console.trace()}`},t=function(a){if(a.Type=="StatList"){let o;for(o=0;o<=a.StatementList.length;o++){const l=a.StatementList[o];if(l==null)continue;t(l),s(l.GetFirstToken());const h=a.StatementList[o-1];if(h!=null){const u={")":["(","["],"]":["(","["]};if(a.SemicolonList[o-1]){const d=h.GetLastToken().Source,c=l.GetFirstToken().Source;(u[d]===null||u[d]===void 0||!u[d].includes(c))&&(a.SemicolonList[o-1]=null)}a.SemicolonList[o-1]||n(h.GetLastToken(),l.GetFirstToken(),!0)}}a.SemicolonList[a.StatementList.length-1]=null,a.StatementList.length>0&&s(a.StatementList[0].GetFirstToken())}else if(a.Type=="BreakStat")s(a.Token_Break);else if(a.Type=="ContinueStat")s(a.Token_Continue);else if(a.Type=="GotoStat")s(a.Token_Goto),n(a.Token_Goto,a.Token_Label);else if(a.Type=="LabelStat")s(a.Token_ColonsLeft),s(a.Token_Label),s(a.Token_ColonsRight);else if(a.Type=="ReturnStat")s(a.Token_Return),a.ExprList.forEach((o,l)=>{e(o),a.Token_CommaList[l]!=null&&s(a.Token_CommaList[l])}),a.ExprList.length>0&&n(a.Token_Return,a.ExprList[0].GetFirstToken());else if(a.Type=="LocalVarStat"){s(a.Token_Local);let o=!1;a.VarList.forEach((l,h)=>{h==0?n(a.Token_Local,l):s(l),l.Attribute&&(s(l.Attribute),h+1==a.VarList.length&&(o=!0));const u=a.Token_VarCommaList[h];u!=null&&s(u)}),a.Token_Equals!=null&&(o||s(a.Token_Equals),a.ExprList.forEach((l,h)=>{e(l);const u=a.Token_ExprCommaList[h];u!=null&&s(u)}))}else if(a.Type=="LocalFunctionStat")s(a.Token_Local),n(a.Token_Local,a.FunctionStat.Token_Function),n(a.FunctionStat.Token_Function,a.FunctionStat.NameChain[0]),n(a.FunctionStat.NameChain[0],a.FunctionStat.Token_OpenParen),a.FunctionStat.ArgList.forEach((o,l)=>{s(o);const h=a.FunctionStat.Token_ArgCommaList[l];h!=null&&s(h)}),a.FunctionStat.Token_Varg&&s(a.FunctionStat.Token_Varg),s(a.FunctionStat.Token_CloseParen),r(a.FunctionStat.Token_CloseParen,a.FunctionStat.Body,a.FunctionStat.Token_End);else if(a.Type=="FunctionStat")s(a.Token_Function),a.NameChain.forEach((o,l)=>{l==0?n(a.Token_Function,o):s(o);const h=a.Token_NameChainSeperator[l];h!=null&&s(h)}),s(a.Token_OpenParen),a.ArgList.forEach((o,l)=>{s(o);const h=a.Token_ArgCommaList[l];h!=null&&s(h)}),a.Token_Varg&&s(a.Token_Varg),s(a.Token_CloseParen),r(a.Token_CloseParen,a.Body,a.Token_End);else if(a.Type=="RepeatStat")s(a.Token_Repeat),r(a.Token_Repeat,a.Body,a.Token_Until),e(a.Condition),n(a.Token_Until,a.Condition.GetFirstToken());else if(a.Type=="GenericForStat")s(a.Token_For),a.VarList.forEach((o,l)=>{l==0?n(a.Token_For,o):s(o);const h=a.Token_VarCommaList[l];h!=null&&s(h)}),n(a.VarList[a.VarList.length-1],a.Token_In),a.GeneratorList.forEach((o,l)=>{e(o),l==0&&n(a.Token_In,o.GetFirstToken());const h=a.Token_GeneratorCommaList[l];h!=null&&s(h)}),n(a.GeneratorList[a.GeneratorList.length-1].GetLastToken(),a.Token_Do),r(a.Token_Do,a.Body,a.Token_End);else if(a.Type=="NumericForStat")s(a.Token_For),a.VarList.forEach((o,l)=>{l==0?n(a.Token_For,o):s(o);const h=a.Token_VarCommaList[l];h!=null&&s(h)}),n(a.VarList[a.VarList.length-1],a.Token_Equals),a.RangeList.forEach((o,l)=>{e(o),l==0&&n(a.Token_Equals,o.GetFirstToken());const h=a.Token_RangeCommaList[l];h!=null&&s(h)}),n(a.RangeList[a.RangeList.length-1].GetLastToken(),a.Token_Do),r(a.Token_Do,a.Body,a.Token_End);else if(a.Type=="WhileStat")s(a.Token_While),e(a.Condition),s(a.Token_Do),n(a.Token_While,a.Condition.GetFirstToken()),n(a.Condition.GetLastToken(),a.Token_Do),r(a.Token_Do,a.Body,a.Token_End);else if(a.Type=="DoStat")s(a.Token_Do),s(a.Token_End),r(a.Token_Do,a.Body,a.Token_End);else if(a.Type=="IfStat"){s(a.Token_If),e(a.Condition),n(a.Token_If,a.Condition.GetFirstToken()),n(a.Condition.GetLastToken(),a.Token_Then);let o=a.Token_Then,l=a.Body;a.ElseClauseList.forEach((h,u)=>{r(o,l,h.Token),o=h.Token,h.Condition!=null&&(e(h.Condition),n(h.Token,h.Condition.GetFirstToken()),n(h.Condition.GetLastToken(),h.Token_Then),o=h.Token_Then),t(h.Body),l=h.Body}),r(o,l,a.Token_End)}else if(a.Type=="CallExprStat")e(a.Expression);else if(a.Type=="CompoundStat")e(a.Lhs),s(a.Token_Compound),e(a.Rhs),n(a.Lhs.GetLastToken(),a.Token_Compound),n(a.Token_Compound,a.Rhs.GetFirstToken());else if(a.Type=="AssignmentStat")a.Lhs.forEach((o,l)=>{e(o);const h=a.Token_LhsSeperatorList[l];h!=null&&s(h)}),s(a.Token_Equals),a.Rhs.forEach((o,l)=>{e(o);const h=a.Token_RhsSeperatorList[l];h!=null&&s(h)});else return e(a)},t(i)}function Cc(i){let t,e;const s={NumberLiteral:!0,BooleanLiteral:!0,StringLiteral:!0,HashLiteral:!0,NilLiteral:!0,TableLiteral:!0,ParenExpr:!0,BinopExpr:!0};function n(c,f,p=null){let m;return m={Type:c,Token:{Type:p==null?"Number":p,LeadingWhite:"",Source:f},GetFirstToken:()=>m.Token,GetLastToken:()=>m.Token},m}function r(c,f,p){let m;return m={Type:"BinopExpr",Token_Op:{Type:"Symbol",LeadingWhite:"",Source:c},Lhs:f,Rhs:p,GetFirstToken:()=>m.Lhs.GetFirstToken(),GetLastToken:()=>m.Rhs.GetLastToken()},m}function a(c,f){let p;return p={Type:"UnopExpr",Token_Op:{Type:"Symbol",LeadingWhite:"",Source:c},Rhs:f,GetFirstToken:()=>p.Token_Op,GetLastToken:()=>p.Rhs.GetLastToken()},p}function o(c,f){if(f!=null)for(var[p,m]of Object.entries(f))c[p]=m}function l(c){if(c==null||c.substr==null)return;const f=c.substr(0,1);let p;if((f=='"'||f=="'")&&(p=c.substr(1,c.length-2)),f=="["){let P=0,A=1;for(;c.substr(A,1)=="=";)P++,A++;p=c.substr(2+P,c.length-4-P-2)}if(p==null)return"";let m="",b;for(b=0;b<=p.length;b++){const P=p.substr(b,1);P=="'"||P=='"'?m+=`\\${P}`:m+=P}return m}function h(c){if(typeof c=="object"&&c.Type=="ParenExpr")return o(c,c.Expression)}function u(c,f,p){let m=f,b=p;if(f&&f.Type=="ParenExpr"&&(m=f.Expression),p&&p.Type=="ParenExpr"&&(b=p.Expression),m==null||b==null||m.Type==null||b.Type==null||m.Type=="VariableExpr"||m.Type=="CallExpr"||m.Type=="BinopExpr"||b.Type=="CallExpr"||b.Type=="BinopExpr"||b.Type=="VariableExpr")return;const P=m.Token||m.Expression!=null&&m.Expression.Token||null,A=b.Token||b.Expression!=null&&b.Expression.Token||null,U=P!=null?P.Source:null,O=A!=null?A.Source:null;let S,W;if(m.Type=="BooleanLiteral"&&(S=U=="true"),b.Type=="BooleanLiteral"&&(W=O=="true"),!(m.Type=="NumberLiteral"&&(S=Tt(U),S==null))&&!(b.Type=="NumberLiteral"&&(W=Tt(O),W==null))&&((m.Type=="StringLiteral"||m.Type=="HashLiteral")&&(S=U.toString()),(b.Type=="StringLiteral"||b.Type=="HashLiteral")&&(W=O.toString()),S!=null&&W!=null)){if(c=="==")return S==W;if(c=="~=")return S!=W;if(c=="and")return S&&W;if(c=="or")return S||W;if(c==".."&&m.Type=="StringLiteral"&&b.Type=="StringLiteral")return`"${l(U)+l(O)}"`;if(m.Type=="StringLiteral"&&(S=Tt(l(S))),b.Type=="StringLiteral"&&(W=Tt(l(W))),S==null||W==null)return;let fe;if(c=="+"&&(fe=S+W),c=="-"&&(fe=S-W),c=="*"&&(fe=S*W),c=="/"&&(fe=S/W),c=="^"&&(fe=S**W),c=="%"&&(fe=S%W),c==">"&&(fe=S>W),c=="<"&&(fe=S="&&(fe=S>=W),c=="<="&&(fe=S<=W),fe==!1||fe==!0||isFinite(fe)&&fe>-(10**6)&&fe<10**6)return fe}}function d(c,f){const p=f.Token||f.Expression||f.EntryList||f;if(p==null||p.Source==null&&f.Type!="TableLiteral"||f.Type=="VariableExpr"||f.Type=="CallExpr"||f.Type=="BinopExpr")return;const m=p.Source;let b;if(f.Type=="TableLiteral"&&p!=null){const P=[];let A=0,U=!1,O=!1,S=0;if(p.forEach((W,fe)=>{if(U)P.push(W);else if(W.EntryType=="Value"||W.EntryType=="Index")if((W.Index==null||W.Index.Type=="NumberLiteral")&&W.Value){if((W.Index!=null&&W.Index.Token!=null&&W.Index.Token.Source!==null?W.Index.Token.Source:S+1).toString()!==(++S).toString())return U=!0,O=!0,P.push(W);W.Value.Type!="CallExpr"?A++:(U=!0,P.push(W))}else P.push(W)}),O)return;if(c=="#")return f.EntryList=P,f.EntryList.length<=0?n("NumberLiteral",A!==null?A:f.EntryList.length):A<=0?a("#",f):r("+",n("NumberLiteral",A),a("#",f))}if(f.Type=="BooleanLiteral"&&(b=m=="true"),!(f.Type=="NumberLiteral"&&(b=Tt(m),b===null))){if(f.Type=="StringLiteral"&&(b=m.substr(1,m.length-2)),c=="not"&&f.Type!==null)return f.Type=="NilLiteral"||f.Type=="BooleanLiteral"&&b===!1;if(b!=null){if(c=="#")return b.length;if(c=="-")return-b}}}e=function(c){if(c.Type=="BinopExpr"){if(e(c.Lhs),e(c.Rhs),c.Lhs!=null&&c.Rhs!=null){const f=c.Token_Op;if(f!=null&&f.Source!=null){const p=u(f.Source,c.Lhs,c.Rhs);if(p!=null){if(typeof p=="boolean"){const m=n("BooleanLiteral",p.toString(),"Keyword");o(c,m);return}else if(typeof p=="number"){if(isFinite(p)==!0){const m=n("NumberLiteral",p.toString(),"Number");o(c,m);return}}else if(typeof p=="string"){const m=n("StringLiteral",p,"String");o(c,m);return}else if(typeof p=="object"){o(c,p);return}return}}if(c.Lhs.Type=="ParenExpr"){const m=c.Lhs.Expression;m.Type=="NumberLiteral"||m.Type=="StringLiteral"||m.Type=="NilLiteral"||m.Type=="BooleanLiteral"||m.Type=="HashLiteral"}if(c.Rhs.Type=="ParenExpr"){const m=c.Rhs.Expression;m.Type=="NumberLiteral"||m.Type=="StringLiteral"||m.Type=="NilLiteral"||m.Type=="BooleanLiteral"||m.Type=="HashLiteral"}}}else if(c.Type=="UnopExpr"){if(e(c.Rhs),c.Rhs!=null&&s[c.Rhs.Type]==!0){const f=c.Token_Op;if(f!=null&&f.Source!=null){const p=c.Rhs.Expression!=null?c.Rhs.Expression:c.Rhs,m=d(f.Source,p);if(m!=null){if(typeof m=="boolean"){const b=n("BooleanLiteral",m.toString(),"Keyword");o(c,b);return}else if(typeof m=="number"){if(isFinite(m)==!0){const b=n("NumberLiteral",m,"Number");o(c,b);return}}else if(typeof m=="string"){const b=n("StringLiteral",m,"String");o(c,b);return}else if(typeof m=="object"){o(c,m);return}return}}}}else if(c.Type=="NumberLiteral"||c.Type=="StringLiteral"||c.Type=="NilLiteral"||c.Type=="BooleanLiteral"||c.Type=="VargLiteral"||c.Type=="HashLiteral"){const f=c.Token;if(f!=null){if(f.Type=="Number"){const p=f.Source.toString().split("e");if(p.length===2){const m=Tt(p[0]),b=Tt(p[1]);isFinite(m)&&isFinite(b)&&m**b<999999999&&!f.Source.includes("+")&&!!f.Source.includes(".")&&!f.Source.includes("-")&&(f.Source=(m**b).toString())}}f.Type=="String"&&(f.Source=f.Source.replace(/\\\d+/gi,p=>{const m=Tt(p.substr(1,p.length-1));return m&&isFinite(m)&&(m>=97&&m<=122||m>=65&&m<=90||m>=33&&m<=47||m>=58&&m<=64||m>=91&&m<=96||m>=123&&m<=126)&&m!==34&&m!==39&&m!==92?String.fromCharCode(m):p}))}}else if(c.Type=="FieldExpr")e(c.Base);else if(c.Type=="IndexExpr")e(c.Base),e(c.Index);else if(c.Type=="MethodExpr"||c.Type=="CallExpr"){if(e(c.Base),c.FunctionArguments.CallType=="ArgCall"?c.FunctionArguments.ArgList.forEach((f,p)=>{e(f)}):c.FunctionArguments.CallType=="TableCall"&&e(c.FunctionArguments.TableExpr),c.Base.Type==="ParenExpr"&&c.Base.Expression.Type==="FunctionLiteral"&&c.FunctionArguments.CallType==="ArgCall"){const f=c.Base.Expression;c.FunctionArguments.ArgList.forEach((p,m)=>{const b=c.FunctionArguments.ArgList[m];if(b!==void 0&&(b.Type=="NumberLiteral"||b.Type=="StringLiteral"||b.Type=="NilLiteral"||b.Type=="BooleanLiteral"||b.Type=="HashLiteral")){const P=f.ArgList[m];P&&P.var.RenameList.forEach(A=>{A(b.Token.Source,!0)})}})}}else if(c.Type=="FunctionLiteral")t(c.Body);else if(c.Type!="VariableExpr")if(c.Type=="ParenExpr"){const f=c.Expression;f!=null&&f.Type=="ParenExpr"&&(c.Expression=f.Expression),e(c.Expression),(c.Type=="NumberLiteral"||c.Type=="StringLiteral"||c.Type=="NilLiteral"||c.Type=="BooleanLiteral"||c.Type=="VargLiteral"||c.Type=="HashLiteral")&&h(c)}else c.Type=="TableLiteral"&&c.EntryList.forEach((f,p)=>{f.EntryType=="Field"?e(f.Value):f.EntryType=="Index"?(e(f.Index),e(f.Value)):f.EntryType=="Value"?e(f.Value):lt(!1,"unreachable")})},t=function(c){if(c.Type=="StatList")c.StatementList.forEach((f,p)=>{f===null||f.Type===null||(f.Remove=()=>{c.StatementList[p]=null},t(f))});else if(c.Type!="BreakStat"){if(c.Type!="ContinueStat")if(c.Type=="ReturnStat")c.ExprList.forEach((f,p)=>{e(f)});else if(c.Type=="LocalVarStat")c.Token_Equals!=null&&c.ExprList.forEach((f,p)=>{e(f)});else if(c.Type=="LocalFunctionStat")t(c.FunctionStat.Body),c.FunctionStat.NameChain.length===1&&c.FunctionStat.NameChain[0].UseCount;else if(c.Type=="FunctionStat")t(c.Body);else if(c.Type=="RepeatStat")t(c.Body),e(c.Condition),c.Body.Type=="StatList"&&c.Body.StatementList.length;else if(c.Type=="GenericForStat")c.GeneratorList.forEach((f,p)=>{e(f)}),t(c.Body);else if(c.Type=="NumericForStat"){c.RangeList.forEach((W,fe)=>{e(W)}),t(c.Body);const f=c.RangeList[0],p=c.RangeList[1],m=c.RangeList[2];if(f==null||p==null)return c.Remove();if(h(f),h(p),h(m),f.Type!="NumberLiteral"||p.Type!="NumberLiteral"||m!=null&&m.Type!="NumberLiteral"||m==null)return;const b=Tt(f.Token.Source),P=Tt(p.Token.Source),A=m!=null&&Tt(m.Token.Source)||1,U=A>0&&b<=P||A<0&&b>=P,O=(P-b+A)/A;if(!(U&&O>=0)||c.Body.Type=="StatList"&&c.Body.StatementList.length===0)return c.Remove()}else if(c.Type=="WhileStat"){e(c.Condition),t(c.Body);let f=c.Condition;switch(f.Type){case"ParenExpr":f=f.Expression;case"BooleanLiteral":if(f==null||f.Token==null||f.Token.Source!=="false")break;case"NilLiteral":c.Remove();break}}else if(c.Type=="DoStat"){if(t(c.Body),c.Body===null||c.Body.Type=="StatList"&&c.Body.StatementList.length===0)return c.Remove();if(c.Body.StatementList.length===1){const f=c.Body.StatementList[0];f.Type!=="ContinueStat"&&f.Type!=="BreakStat"&&f.Type!=="ReturnStat"&&o(c,f)}}else if(c.Type=="IfStat"){e(c.Condition),t(c.Body),c.ElseClauseList.forEach((p,m)=>{p.Condition!=null&&e(p.Condition),t(p.Body)});let f=c.Condition;switch(f.Type){case"ParenExpr":f=f.Expression;case"BooleanLiteral":if(c.ElseClauseList.length>=1||f==null||f.Token==null||f.Token.Source!=="false")break;case"NilLiteral":c.Remove();break}}else c.Type=="CallExprStat"?e(c.Expression):c.Type=="CompoundStat"?(e(c.Lhs),e(c.Rhs)):c.Type=="AssignmentStat"&&(c.Lhs.forEach((f,p)=>{e(f)}),c.Rhs.forEach((f,p)=>{e(f)}))}},t(i)}const Ss=[];let Ge;for(Ge="a".charCodeAt();Ge<="z".charCodeAt();Ge++)Ss.push(String.fromCharCode(Ge));for(Ge="A".charCodeAt();Ge<="Z".charCodeAt();Ge++)Ss.push(String.fromCharCode(Ge));for(Ge="0".charCodeAt();Ge<="9".charCodeAt();Ge++)Ss.push(String.fromCharCode(Ge));Ss.push("_");const yi=[];for(Ge="a".charCodeAt();Ge<="z".charCodeAt();Ge++)yi.push(String.fromCharCode(Ge));for(Ge="A".charCodeAt();Ge<="Z".charCodeAt();Ge++)yi.push(String.fromCharCode(Ge));function Lo(i){let t="";const e=i%yi.length;for(i=(i-e)/yi.length,t=`${t}${yi[e]}`;i>0;){const s=i%Ss.length;i=(i-s)/Ss.length,t=`${t}${Ss[s]}`}return t}function wm(i,t,e){const s=[];for(var[n,r]of Object.entries(Sc))s[n]=!0;const a=[];i.forEach(d=>{d.AssignedTo&&e?a.push(d):s[d.Name]=!0});function o(d){d.VariableList.forEach(c=>{a.push(c)}),d.ChildScopeList.forEach(c=>{o(c)})}o(t),a.forEach(d=>{d.UsedNameArray=[]}),a.sort((d,c)=>d-c);let l=0;const h=[];function u(d){let c=h[d];if(c==null){for(c=Lo(l),l++;s[c];)c=Lo(l),l++;h[d]=c}return c}a.forEach((d,c)=>{d.Renamed=!0;let f=0;for(;d.UsedNameArray[f];)f++;d.Rename(u(f)),d.Scope?a.forEach(p=>{p.Renamed||(!p.Scope||p.Scope.Depthm>=d.BeginLocation&&m<=d.ScopeEndLocation?(p.UsedNameArray[f]=!0,!0):!1):p.Scope.Depth>d.Scope.Depth?d.ReferenceLocationList.some(m=>m>=p.BeginLocation&&m<=p.ScopeEndLocation?(p.UsedNameArray[f]=!0,!0):!1):d.BeginLocationp.BeginLocation&&(p.UsedNameArray[f]=!0))}):a.forEach(p=>{if(!p.Renamed)if(p.Type=="Global")p.UsedNameArray[f]=!0;else if(p.Type=="Local")d.ReferenceLocationList.some(m=>m>=p.BeginLocation&&m<=p.ScopeEndLocation?(p.UsedNameArray[f]=!0,!0):!1);else throw"Unreachable"})})}function Cm(i,t,e){const s=[];i.forEach(l=>{(!l.AssignedTo||!e)&&(s[l.Name]=!0)});let n=1,r=1;function a(l,h){l.Name=h,l.RenameList.forEach(u=>{u(h)})}if(e){const l={};i.forEach(h=>{h.AssignedTo&&!h.ChangedName&&(l[h.Name]=l[h.Name]||`G_${r}_`,h.ChangedName=!0,a(h,l[h.Name]),r++)})}function o(l){l.VariableList.forEach(h=>{let u=`L_${n}_`;h.Info.Type=="Argument"?u=`${u}arg${h.Info.Index}`:h.Info.Type=="LocalFunction"?u=`${u}func`:h.Info.Type=="ForRange"&&(u=`${u}forvar${h.Info.Index}`),a(h,u),n++}),l.ChildScopeList.forEach(h=>{o(h)})}o(t)}const Ci={};Ci.Minify=function(i,t){const e=Ec(i),[s,n]=Ac(e);return t.RenameVariables==!0&&wm(s,n,t.RenameGlobals),t.SolveMath==!0&&Cc(e),vr(e),wc(e)};Ci.Beautify=function(i,t){const e=Ec(i),[s,n]=Ac(e);return t.RenameVariables&&Cm(s,n,t.RenameGlobals),t.SolveMath==!0&&Cc(e),Am(e),wc(e)};try{oi!=null&&oi.exports!=null&&(oi.exports.Beautify=Ci.Beautify,oi.exports.Minify=Ci.Minify)}catch{}const ys="_M",Fe="__tmp",Io="esPairs",No="caseExp",Lr={debug:!1,tagArrayExpression:!0,useColonOnMethod:!0,importStatementHoisting:!0,transform$SymbolToDollar:!0,transformToString:!0,transformString:!0,transformJSONStringify:!0,transformJSONParse:!0,transformParseFloat:!0,transformParseInt:!0,transformNumber:!0,transformIsArray:!0,transformConsoleLog:!0,moduleExportsToReturn:!0,index0To1:!0,tryTranslateClass:!0,disableUpdateExpressionCallback:!0,renameCatchErrorIfNeeded:!0,disableClassCall:!0};function Ir(){console.log.apply(this,arguments)}function Ls(i){return i.filter(t=>t.trim()!=="").join(` +`)}function Nr(i){return xd(i,{plugins:["typescript"],sourceType:"module"})}const km={and:"_and",break:"_break",do:"_do",else:"_else",elseif:"_elseif",end:"_end",false:"_false",for:"_for",function:"_function",if:"_if",in:"_in",local:"_local",nil:"_nil",not:"_not",or:"_or",repeat:"_repeat",return:"_return",then:"_then",true:"_true",until:"_until",while:"_while"},vt=i=>Object.prototype.hasOwnProperty.call(km,i),rr={"!":"not","&&":"and","||":"or","===":"==","==":"==","!==":"~=","!=":"~="},ar=i=>i.length>0?"self,":"self",vm=i=>i&&typeof i=="object"&&i.type;function Jt(i,t,e){const s=e===void 0?void 0:e-1,n=e>0||e===void 0;if(Array.isArray(i)){if(n)for(const r of i)Jt(r,t,s)}else if(vm(i)){const r=t(i);if(r)return r;if(n)for(const a of Object.values(i))Jt(a,t,s)}else return}function Lm(i,t,e,s){Jt(i,n=>{n.type=="Identifier"&&n.name==t&&(n.name=e)},s)}function si(i,t,e){let s;return Jt(i,n=>{if(n.type=="Identifier"&&n.name==t)return s=n,!0},e),s}const Im=["pcall","xpcall","unpack"];function Nm(i){var s;if(i.type!=="VariableDeclaration"||i.declarations.length!==1)return!1;const t=i.declarations[0];if(t.id.type!=="ArrayPattern"||!t.id.elements.every(n=>n&&n.type==="Identifier")||((s=t.init)==null?void 0:s.type)!=="CallExpression")return!1;const e=t.init.callee.name;return Im.includes(e)}function _o(i){Jt(i,t=>{t.type=="ThisExpression"&&(t.type="Identifier",t.name="cls")})}function kc(i,t,e){let s;return Jt(i,r=>{if(t(r))return s=r,!0},e),s}function Hi(i){return gi(i,"ContinueStatement")?"::continue::":""}function gi(i,t,e){return kc(i,s=>s.type===t,e)}const or=i=>i=="ArrayPattern"||i=="ObjectPattern";function _m(i){const t=gi(i,"RestElement");return t?`local ${t.argument.name} = {...};`:""}function Mm(i){const t=[];let e=[];for(const[r,a]of i.cases.entries())a.test?(e.push(a),a.consequent.length>0&&(t.push(e),e=[])):t.push([a]);e.length>0&&t.push(e);const s=[];for(const r of t)if(r.length===1)s.push(r[0]);else{const a=r[r.length-1];a.testGroup=r.map(o=>o.test),s.push(a)}const n=s.findIndex(r=>!r.test);n!==-1&&n!==s.length-1?i.cases=[...s.slice(0,n),...s.slice(n+1),s[n]]:i.cases=s}function Om(i,t={}){var fe;t={...Lr,...t},t.debug&&Ir((fe=i==null?void 0:i.program)==null?void 0:fe.body);const e=[],s=[],n=[];let r="",a="",o=!1,l=!1,h=!1,u=!1;const d=g=>g.filter(se=>se.type=="AssignmentPattern").map(se=>`if ${S(se.left)} == nil then ${S(se.left)} = ${S(se.right)} end`).join(";"),c=g=>{const se=[];for(const[k,Y]of g.entries())or(Y.type)&&(se.push("local "+S(Y)({type:"Identifier",name:`__tmp${k}`})),g[k]={type:"Identifier",name:`__tmp${k}`});const ie=_m(g),T=d(g);return`${se.join(";")} ${T} ${ie}`},f=(g,se)=>(g=S(g),vt(g)?`["${g}"]`:se?`.${g}`:g),p=(g,se)=>{const ie=S(g.key);return g.computed||g.key.type=="StringLiteral"?`[${ie}]`:vt(ie)?`["${ie}"]`:se?`.${ie}`:ie},m=g=>{if(g.specifiers.length===1){const se=g.specifiers[0],ie=`require(${S(g.source)})`;return se.type=="ImportDefaultSpecifier"?`local ${S(se.local)} = ${ie}.default`:se.type=="ImportNamespaceSpecifier"?`local ${S(se.local)} = ${ie}`:`local ${S(se.local)} = ${ie}.${S(se.imported)}`}else{const se=g.specifiers.map(T=>S(T.local)).join(", "),ie=g.specifiers.map(T=>T.type=="ImportDefaultSpecifier"?`${S(T.local)} = _esModule.default`:T.type=="ImportNamespaceSpecifier"?`${S(T.local)} = _esModule`:`${S(T.local)} = _esModule.${S(T.imported)}`);return`local ${se}; do local _esModule = require(${S(g.source)}) ${ie.join(";")} end`}},b=g=>se=>{const ie=g.elements.map(k=>k.type=="RestElement"?S(k.argument):`${S(k)}`);if(!se)return ie.join(", ");const T=g.elements.map((k,Y)=>{if(k.type=="RestElement"){const z=S(k.argument);return`${z} = {}; - for __i=${ie.length}, #${Re} do - ${z}[#${z}+1] = ${Re}[__i] - end`}else return`${S(k)} = ${Re}[${Y+1}]`}).join(";");return`${ie.join(", ")};do local ${Re} = ${S(se)}; ${T} end`},P=g=>se=>{const ie=g.properties.map(k=>k.type=="RestElement"?S(k.argument):`${S(k.value)}`),T=g.properties.map(k=>{if(k.type=="RestElement"){const Y=S(k.argument),z=g.properties.slice(0,-1).map(ue=>`k ~= "${S(ue.key)}"`).join(" and ");return`${Y} = {}; - for k, v in pairs(${Re}) do + for __i=${ie.length}, #${Fe} do + ${z}[#${z}+1] = ${Fe}[__i] + end`}else return`${S(k)} = ${Fe}[${Y+1}]`}).join(";");return`${ie.join(", ")};do local ${Fe} = ${S(se)}; ${T} end`},P=g=>se=>{const ie=g.properties.map(k=>k.type=="RestElement"?S(k.argument):`${S(k.value)}`),T=g.properties.map(k=>{if(k.type=="RestElement"){const Y=S(k.argument),z=g.properties.slice(0,-1).map(ue=>`k ~= "${S(ue.key)}"`).join(" and ");return`${Y} = {}; + for k, v in pairs(${Fe}) do if ${z} then ${Y}[k] = v end - end`}else{const Y=S(k.key),z=vt(Y)?`${Re}["${Y}"]`:`${Re}.${Y}`;return`${S(k.value)} = ${z}`}}).join(";");return`${ie.join(", ")};do local ${Re} = ${S(se)}; ${T} end`},A=g=>{const se=S(g.callee),ie=O(g.arguments);if(g.callee.type=="MemberExpression"){const T=S(g.callee.object),k=S(g.callee.property);if(g.callee.object.type=="Super")return[`${T}.${k}`,`${an(g.arguments)}${ie}`];if(k=="call")return[T,ie];if(k=="apply"){const[Y,z]=g.arguments;return z?[T,`${S(Y)}, unpack(${S(z)})`]:[T,S(Y)]}else return vt(k)?[`${T}["${k}"]`,`${T}${g.arguments.length>0?",":""}${ie}`]:t.transformConsoleLog&&T=="console"&&k=="log"?["print",ie]:t.transformToString&&k=="toString"?["tostring",T]:t.transformIsArray&&T=="Array"&&k=="isArray"?(h=!0,["isarray",ie]):t.transformJSONParse&&T=="JSON"&&k=="parse"?(o=!0,["cjson.decode",ie]):t.transformJSONStringify&&T=="JSON"&&k=="stringify"?(o=!0,["cjson.encode",ie]):g.callee.computed?[`${T}[${k}]`,`${T}${g.arguments.length>0?",":""}${ie}`]:[`${T}${t.useColonOnMethod?":":"."}${k}`,ie]}else return t.transformParseInt&&se=="parseInt"?["math.floor",ie]:t.transformParseFloat&&se=="parseFloat"?["tonumber",ie]:t.transformNumber&&se=="Number"?["tonumber",ie]:t.transformString&&se=="String"?["tostring",ie]:[se,ie]},U=g=>{const se=[];let ie=g;for(;;){const{type:ue,object:L}=ie;if(ue=="OptionalMemberExpression")se.push(ie);else if(ue=="MemberExpression")se.push(ie);else{se.push(ie);break}ie=L}let T=!1,k="";const Y=[];for(let ue=se.length-1;ue>-1;ue--){const L=se[ue];if(k)if(se[ue].computed)k=`${k}[${S(L.property)}]`;else{const x=f(L.property,!0);k=`${k}${x}`}else k=S(L);ue==0?Y.push(`else return ${k} end`):se[ue-1].optional&&(T?Y.push(`elseif ${k} == nil then return nil`):(T=!0,Y.push(`if ${k} == nil then return nil`)))}return[`(function() ${Y.join(` + end`}else{const Y=S(k.key),z=vt(Y)?`${Fe}["${Y}"]`:`${Fe}.${Y}`;return`${S(k.value)} = ${z}`}}).join(";");return`${ie.join(", ")};do local ${Fe} = ${S(se)}; ${T} end`},A=g=>{const se=S(g.callee),ie=O(g.arguments);if(g.callee.type=="MemberExpression"){const T=S(g.callee.object),k=S(g.callee.property);if(g.callee.object.type=="Super")return[`${T}.${k}`,`${ar(g.arguments)}${ie}`];if(k=="call")return[T,ie];if(k=="apply"){const[Y,z]=g.arguments;return z?[T,`${S(Y)}, unpack(${S(z)})`]:[T,S(Y)]}else return vt(k)?[`${T}["${k}"]`,`${T}${g.arguments.length>0?",":""}${ie}`]:t.transformConsoleLog&&T=="console"&&k=="log"?["print",ie]:t.transformToString&&k=="toString"?["tostring",T]:t.transformIsArray&&T=="Array"&&k=="isArray"?(h=!0,["isarray",ie]):t.transformJSONParse&&T=="JSON"&&k=="parse"?(o=!0,["cjson.decode",ie]):t.transformJSONStringify&&T=="JSON"&&k=="stringify"?(o=!0,["cjson.encode",ie]):g.callee.computed?[`${T}[${k}]`,`${T}${g.arguments.length>0?",":""}${ie}`]:[`${T}${t.useColonOnMethod?":":"."}${k}`,ie]}else return t.transformParseInt&&se=="parseInt"?["math.floor",ie]:t.transformParseFloat&&se=="parseFloat"?["tonumber",ie]:t.transformNumber&&se=="Number"?["tonumber",ie]:t.transformString&&se=="String"?["tostring",ie]:[se,ie]},U=g=>{const se=[];let ie=g;for(;;){const{type:ue,object:L}=ie;if(ue=="OptionalMemberExpression")se.push(ie);else if(ue=="MemberExpression")se.push(ie);else{se.push(ie);break}ie=L}let T=!1,k="";const Y=[];for(let ue=se.length-1;ue>-1;ue--){const L=se[ue];if(k)if(se[ue].computed)k=`${k}[${S(L.property)}]`;else{const x=f(L.property,!0);k=`${k}${x}`}else k=S(L);ue==0?Y.push(`else return ${k} end`):se[ue-1].optional&&(T?Y.push(`elseif ${k} == nil then return nil`):(T=!0,Y.push(`if ${k} == nil then return nil`)))}return[`(function() ${Y.join(` `)} end)()`,k]},O=(g,se=",")=>g.map(S).filter(ie=>ie).join(se);function S(g){var se,ie,T,k,Y,z,ue;switch(g.type){case"File":return O(g.program.body,`; `);case"VariableDeclaration":{if(Nm(g)){const x=g.declarations[0];return`local ${x.id.elements.map(S).join(", ")} = ${S(x.init)}`}const L=g.noPrefix?"":"local ";return g.declarations.map(S).filter(x=>x).map(x=>`${L}${x}`).join(`; `)}case"VariableDeclarator":if(g.init)if(g.init.type=="AssignmentExpression"){const L=[`${S(g.id)} = ${S(g.init.left)}`];let x=g.init;for(;x.type=="AssignmentExpression";){x.right.type=="AssignmentExpression"?L.unshift(`${S(x.left)} = ${S(x.right.left)}`):L.unshift(`${S(x.left)} = ${S(x.right)}`);x=x.right}return L.join(`; -local `)}else return g.id.type=="ArrayPattern"||g.id.type=="ObjectPattern"?S(g.id)(g.init):`${S(g.id)} = ${S(g.init)}`;else return on(g.id.type)?`${S(g.id)()}`:`${S(g.id)}`;case"Identifier":{const L=g.name;return L=="undefined"?"nil":L.startsWith("$")&&t.transform$SymbolToDollar?L.replace("$","_DOLLAR_"):L}case"NumericLiteral":return`${g.value}`;case"StringLiteral":return(se=g.extra)==null?void 0:se.raw;case"IfStatement":return`if ${S(g.test)} then ${S(g.consequent)} ${g.alternate?` else ${S(g.alternate)}`:""} end`;case"BlockStatement":return`${O(g.body,";")}`;case"CallExpression":if(g.callee.type=="MemberExpression"&&g.callee.object.type!=="MemberExpression"&&g.callee.object.type!=="Identifier"&&g.callee.object.type!=="Super"){const L=S(g.callee.object);return g.callee.object={type:"Identifier",name:Re},`(function() - local ${Re} = ${L} +local `)}else return g.id.type=="ArrayPattern"||g.id.type=="ObjectPattern"?S(g.id)(g.init):`${S(g.id)} = ${S(g.init)}`;else return or(g.id.type)?`${S(g.id)()}`:`${S(g.id)}`;case"Identifier":{const L=g.name;return L=="undefined"?"nil":L.startsWith("$")&&t.transform$SymbolToDollar?L.replace("$","_DOLLAR_"):L}case"NumericLiteral":return`${g.value}`;case"StringLiteral":return(se=g.extra)==null?void 0:se.raw;case"IfStatement":return`if ${S(g.test)} then ${S(g.consequent)} ${g.alternate?` else ${S(g.alternate)}`:""} end`;case"BlockStatement":return`${O(g.body,";")}`;case"CallExpression":if(g.callee.type=="MemberExpression"&&g.callee.object.type!=="MemberExpression"&&g.callee.object.type!=="Identifier"&&g.callee.object.type!=="Super"){const L=S(g.callee.object);return g.callee.object={type:"Identifier",name:Fe},`(function() + local ${Fe} = ${L} return ${S(g)} - end)()`}else{const[L,x]=A(g);return g.callee.type=="ArrowFunctionExpression"||g.callee.type=="FunctionExpression"?`(${L})(${x})`:`${L}(${x})`}case"BinaryExpression":{const L=nn[g.operator]||g.operator,x=F=>F.type==="BinaryExpression"&&F.operator==="+",C=F=>F.type==="StringLiteral"?!0:x(F)?C(F.left)||C(F.right):!1,R=F=>x(F)?F.stringConcat?`${S(F.left)} .. ${S(F.right)}`:C(F.left)||C(F.right)?(Jt(F,N=>{x(N)&&(N.stringConcat=!0)}),`${S(F.left)} .. ${S(F.right)}`):`${S(F.left)} + ${S(F.right)}`:S(F);if(g.operator==="+")return R(g);const re=S(g.left),M=S(g.right);return g.operator=="instanceof"?`getmetatable(${re}) == ${M}`:g.operator==">>"?(l=!0,`bit.rshift(${re}, ${M})`):g.operator=="<<"?(l=!0,`bit.lshift(${re}, ${M})`):g.operator=="&"?(l=!0,`bit.band(${re}, ${M})`):g.operator=="|"?(l=!0,`bit.bor(${re}, ${M})`):g.operator=="^"?(l=!0,`bit.bxor(${re}, ${M})`):g.operator=="**"?`math.pow(${re}, ${M})`:`${re} ${L} ${M}`}case"UnaryExpression":{const L=nn[g.operator]||g.operator,x=S(g.argument);return g.operator=="typeof"?`type(${x})`:g.operator=="delete"?`${x} = nil`:g.operator=="~"?(l=!0,`bit.bnot(${x})`):`${L} ${x}`}case"ThisExpression":return"self";case"BooleanLiteral":return`${g.value}`;case"ObjectExpression":return gi(g.properties,"SpreadElement",1)?`(function() local ${Re} = {}; ${g.properties.map(L=>L.type=="SpreadElement"?`for k, v in pairs(${S(L.argument)}) do ${Re}[k] = v end`:L.type=="ObjectMethod"?(L.asMember=!0,`${Re}${S(L)}`):`${Re}${p(L,!0)} = ${S(L.value)}`).join(";")} return ${Re} end)()`:`{${O(g.properties)}}`;case"ObjectProperty":return`${p(g)} = ${S(g.value)}`;case"ArrayExpression":{const L=t.tagArrayExpression?"array":"";return gi(g.elements,"SpreadElement",1)?`(function() local ${Re} = ${L}{}; ${g.elements.map(C=>C.type=="SpreadElement"?`for _, v in ipairs(${S(C.argument)}) do ${Re}[#${Re} + 1] = v end`:`${Re}[#${Re} + 1] = ${S(C)}`).join(";")} return ${Re} end)()`:`${L}{${O(g.elements)}}`}case"ForOfStatement":{const L=Hi(g);if(g.left.noPrefix=!0,((ie=g.left.declarations[0])==null?void 0:ie.id.type)=="ArrayPattern"){const x=si(g.body,Io)?Re:Io;return Ls([`for _, ${x} in ipairs(${S(g.right)}) do`,`local ${S(g.left)} = unpack(${x});`,S(g.body),L,"end"])}else return Ls([`for _, ${S(g.left)} in ipairs(${S(g.right)}) do`,S(g.body),L,"end"])}case"ForInStatement":{const L=Hi(g);return g.left.noPrefix=!0,Ls([`for ${S(g.left)}, __ in pairs(${S(g.right)}) do`,S(g.body),L,"end"])}case"LogicalExpression":{const L=nn[g.operator]||g.operator,x=S(g.left),C=S(g.right);let R;return L=="??"?R=`(function() - if ${x} == nil then - return ${C} - else - return ${x} - end - end)()`:R=`${x} ${L} ${C}`,(T=g.extra)!=null&&T.parenthesized?`(${R})`:`${R}`}case"ObjectMethod":{const L=p(g,g.asMember),x=c(g.params),C=S(g.body),R=O(g.params);return` ${L} = function (${R}) ${x} ${C} end`}case"FunctionDeclaration":{const L=S(g.id),x=c(g.params),C=S(g.body),R=O(g.params),re=g.params.length>0?", "+R:R;return t.tryTranslateClass&&L.match(/^[A-Z]/)&&gi(g.body,"ThisExpression")?`local ${L} = setmetatable({}, { - __call = function(t${re}) + end)()`}else{const[L,x]=A(g);return g.callee.type=="ArrowFunctionExpression"||g.callee.type=="FunctionExpression"?`(${L})(${x})`:`${L}(${x})`}case"BinaryExpression":{const L=rr[g.operator]||g.operator,x=F=>F.type==="BinaryExpression"&&F.operator==="+",C=F=>F.type==="StringLiteral"?!0:x(F)?C(F.left)||C(F.right):!1,R=F=>x(F)?F.stringConcat?`${S(F.left)} .. ${S(F.right)}`:C(F.left)||C(F.right)?(Jt(F,N=>{x(N)&&(N.stringConcat=!0)}),`${S(F.left)} .. ${S(F.right)}`):`${S(F.left)} + ${S(F.right)}`:S(F);if(g.operator==="+")return R(g);const ne=S(g.left),M=S(g.right);return g.operator=="instanceof"?`getmetatable(${ne}) == ${M}`:g.operator==">>"?(l=!0,`bit.rshift(${ne}, ${M})`):g.operator=="<<"?(l=!0,`bit.lshift(${ne}, ${M})`):g.operator=="&"?(l=!0,`bit.band(${ne}, ${M})`):g.operator=="|"?(l=!0,`bit.bor(${ne}, ${M})`):g.operator=="^"?(l=!0,`bit.bxor(${ne}, ${M})`):g.operator=="**"?`math.pow(${ne}, ${M})`:`${ne} ${L} ${M}`}case"UnaryExpression":{const L=rr[g.operator]||g.operator,x=S(g.argument);return g.operator=="typeof"?`type(${x})`:g.operator=="delete"?`${x} = nil`:g.operator=="~"?(l=!0,`bit.bnot(${x})`):`${L} ${x}`}case"ThisExpression":return"self";case"BooleanLiteral":return`${g.value}`;case"ObjectExpression":return gi(g.properties,"SpreadElement",1)?`(function() local ${Fe} = {}; ${g.properties.map(L=>L.type=="SpreadElement"?`for k, v in pairs(${S(L.argument)}) do ${Fe}[k] = v end`:L.type=="ObjectMethod"?(L.asMember=!0,`${Fe}${S(L)}`):`${Fe}${p(L,!0)} = ${S(L.value)}`).join(";")} return ${Fe} end)()`:`{${O(g.properties)}}`;case"ObjectProperty":return`${p(g)} = ${S(g.value)}`;case"ArrayExpression":{const L=t.tagArrayExpression?"array":"";return gi(g.elements,"SpreadElement",1)?`(function() local ${Fe} = ${L}{}; ${g.elements.map(C=>C.type=="SpreadElement"?`for _, v in ipairs(${S(C.argument)}) do ${Fe}[#${Fe} + 1] = v end`:`${Fe}[#${Fe} + 1] = ${S(C)}`).join(";")} return ${Fe} end)()`:`${L}{${O(g.elements)}}`}case"ForOfStatement":{const L=Hi(g);if(g.left.noPrefix=!0,((ie=g.left.declarations[0])==null?void 0:ie.id.type)=="ArrayPattern"){const x=si(g.body,Io)?Fe:Io;return Ls([`for _, ${x} in ipairs(${S(g.right)}) do`,`local ${S(g.left)} = unpack(${x});`,S(g.body),L,"end"])}else return Ls([`for _, ${S(g.left)} in ipairs(${S(g.right)}) do`,S(g.body),L,"end"])}case"ForInStatement":{const L=Hi(g);return g.left.noPrefix=!0,Ls([`for ${S(g.left)}, __ in pairs(${S(g.right)}) do`,S(g.body),L,"end"])}case"LogicalExpression":{const L=rr[g.operator]||g.operator,x=S(g.left),C=S(g.right);let R;return L=="??"?g.left.type=="Identifier"?R=`(function() + if ${x} == nil then + return ${C} + else + return ${x} + end + end)()`:R=`(function() + local ${Fe} = ${x} + if ${Fe} == nil then + return ${C} + else + return ${Fe} + end + end)()`:R=`${x} ${L} ${C}`,(T=g.extra)!=null&&T.parenthesized?`(${R})`:`${R}`}case"ObjectMethod":{const L=p(g,g.asMember),x=c(g.params),C=S(g.body),R=O(g.params);return` ${L} = function (${R}) ${x} ${C} end`}case"FunctionDeclaration":{const L=S(g.id),x=c(g.params),C=S(g.body),R=O(g.params),ne=g.params.length>0?", "+R:R;return t.tryTranslateClass&&L.match(/^[A-Z]/)&&gi(g.body,"ThisExpression")?`local ${L} = setmetatable({}, { + __call = function(t${ne}) local self = t:new(); self:constructor(${R}); return self; @@ -118,10 +125,10 @@ function ${L}.new(cls) return setmetatable({}, cls) end function ${L}:constructor(${R}) ${x} ${C} -end`:`local function ${L}(${R}) ${x} ${C} end`}case"ReturnStatement":return g.argument?`return ${S(g.argument)}`:"return;";case"ArrayPattern":return b(g);case"ObjectPattern":return P(g);case"ClassDeclaration":{const L=S(g.id),x=g.body.body.filter(N=>N.type==="ClassMethod"&&N.kind!=="constructor");g.superClass&&Jt(x,N=>{N.type==="MemberExpression"&&N.object.type=="Super"&&(N.object.superClass=g.superClass)});const C=x.map(N=>{const D=S(N.key),K=c(N.params),Q=vt(D)?`${L}["${D}"] = function`:`function ${L}:${D}`,Z=vt(D)?an(N.params):"";return`${Q}(${Z}${O(N.params)}) +end`:`local function ${L}(${R}) ${x} ${C} end`}case"ReturnStatement":return g.argument?`return ${S(g.argument)}`:"return;";case"ArrayPattern":return b(g);case"ObjectPattern":return P(g);case"ClassDeclaration":{const L=S(g.id),x=g.body.body.filter(N=>N.type==="ClassMethod"&&N.kind!=="constructor");g.superClass&&Jt(x,N=>{N.type==="MemberExpression"&&N.object.type=="Super"&&(N.object.superClass=g.superClass)});const C=x.map(N=>{const D=S(N.key),K=c(N.params),Q=vt(D)?`${L}["${D}"] = function`:`function ${L}:${D}`,Z=vt(D)?ar(N.params):"";return`${Q}(${Z}${O(N.params)}) ${K} ${S(N.body)} - end`}).join(";"),R=g.body.body.filter(N=>N.type==="ClassProperty"&&N.static).map(N=>{const D=S(N.key);return vt(D)?`${L}["${D}"] = ${S(N.value)}`:`${L}.${D} = ${S(N.value)}`}).join(";"),re=g.body.body.filter(N=>N.type==="ClassProperty"&&!N.static).map(N=>{const D=S(N.key);return vt(D)?`["${D}"] = ${S(N.value)}`:`${D} = ${S(N.value)}`}).join(","),M=kc(g.body,N=>N.kind=="constructor"),F=g.superClass?`__index = ${S(g.superClass)},`:"";if(M){g.superClass&&Jt(M.body,Z=>{Z.type==="MemberExpression"&&Z.object.type=="Super"&&(Z.object.superClass=g.superClass),Z.type=="CallExpression"&&Z.callee.type=="Super"&&(Z.callee={type:"MemberExpression",object:{type:"Super",superClass:g.superClass},property:{type:"Identifier",name:"constructor"}})});const N=c(M.params),D=S(M.body),K=O(M.params),Q=M.params.length>0?", "+K:K;return` local ${L} = setmetatable({}, { + end`}).join(";"),R=g.body.body.filter(N=>N.type==="ClassProperty"&&N.static).map(N=>{const D=S(N.key);return vt(D)?`${L}["${D}"] = ${S(N.value)}`:`${L}.${D} = ${S(N.value)}`}).join(";"),ne=g.body.body.filter(N=>N.type==="ClassProperty"&&!N.static).map(N=>{const D=S(N.key);return vt(D)?`["${D}"] = ${S(N.value)}`:`${D} = ${S(N.value)}`}).join(","),M=kc(g.body,N=>N.kind=="constructor"),F=g.superClass?`__index = ${S(g.superClass)},`:"";if(M){g.superClass&&Jt(M.body,Z=>{Z.type==="MemberExpression"&&Z.object.type=="Super"&&(Z.object.superClass=g.superClass),Z.type=="CallExpression"&&Z.callee.type=="Super"&&(Z.callee={type:"MemberExpression",object:{type:"Super",superClass:g.superClass},property:{type:"Identifier",name:"constructor"}})});const N=c(M.params),D=S(M.body),K=O(M.params),Q=M.params.length>0?", "+K:K;return` local ${L} = setmetatable({}, { ${F} __call = function(t${Q}) local self = t:new(); @@ -130,7 +137,7 @@ end`:`local function ${L}(${R}) ${x} ${C} end`}case"ReturnStatement":return g.ar end}) ${L}.__index = ${L} ${R} - function ${L}.new(cls) return setmetatable({${re}}, cls) end + function ${L}.new(cls) return setmetatable({${ne}}, cls) end function ${L}:constructor(${K}) ${N} ${D} @@ -144,23 +151,23 @@ end`:`local function ${L}(${R}) ${x} ${C} end`}case"ReturnStatement":return g.ar end}) ${L}.__index = ${L} ${R} - function ${L}.new(cls) return setmetatable({${re}}, cls) end + function ${L}.new(cls) return setmetatable({${ne}}, cls) end function ${L}:constructor() end ${C}`}case"ClassBody":return`${O(g.body,`, `)}`;case"ClassProperty":return`${f(g.key)} = ${S(g.value)}`;case"ClassMethod":{const L=c(g.params);return g.params.unshift({type:"ThisExpression"}),g.static&&!si(g.body,"cls")&&!si(g.params,"cls")&&(_o(g.body),_o(g.params)),`${f(g.key)} = function(${O(g.params)}) ${L} ${S(g.body)} end`}case"OptionalCallExpression":{let L,x,C,R;return g.callee.type=="OptionalMemberExpression"?([C,R]=A(g),[L,x]=U(g.callee),C=x):([C,R]=A(g),L=S(g.callee),x=L),L[0]=="#"&&(L=L.slice(1)+".length"),`(function() - local ${Re} = ${L} - if ${Re} == nil then + local ${Fe} = ${L} + if ${Fe} == nil then return nil - elseif type(${Re}) ~= 'function' then + elseif type(${Fe}) ~= 'function' then error('${x} is not a function') else return ${C}(${R}) end - end)()`}case"MemberExpression":{const L=S(g.object),x=S(g.property);return g.object.type=="Super"?`${L}.${x}`:x=="length"?"#"+L:vt(x)?`${L}["${x}"]`:g.computed?t.index0To1&&((k=g.property)==null?void 0:k.type)=="NumericLiteral"&&g.property.value===0?`${L}[1]`:`${L}[${x}]`:`${L}.${x}`}case"OptionalMemberExpression":return U(g)[0];case"ExpressionStatement":return g.expression.ExpressionStatement=!0,`${S(g.expression)}`;case"AssignmentExpression":{if(g.right.type=="FunctionExpression"&&g.left.type=="MemberExpression"&&g.left.object.type=="MemberExpression"&&((Y=g.left.object.property)==null?void 0:Y.name)=="prototype"){const x=c(g.right.params),C=S(g.left.property);if(vt(C)){const R=`${S(g.left.object.object)}["${C}"]`,re=an(g.right.params);return`${R} = function(${re}${O(g.right.params)}) + end)()`}case"MemberExpression":{const L=S(g.object),x=S(g.property);return g.object.type=="Super"?`${L}.${x}`:x=="length"?"#"+L:vt(x)?`${L}["${x}"]`:g.computed?t.index0To1&&((k=g.property)==null?void 0:k.type)=="NumericLiteral"&&g.property.value===0?`${L}[1]`:`${L}[${x}]`:`${L}.${x}`}case"OptionalMemberExpression":return U(g)[0];case"ExpressionStatement":return g.expression.ExpressionStatement=!0,`${S(g.expression)}`;case"AssignmentExpression":{if(g.right.type=="FunctionExpression"&&g.left.type=="MemberExpression"&&g.left.object.type=="MemberExpression"&&((Y=g.left.object.property)==null?void 0:Y.name)=="prototype"){const x=c(g.right.params),C=S(g.left.property);if(vt(C)){const R=`${S(g.left.object.object)}["${C}"]`,ne=ar(g.right.params);return`${R} = function(${ne}${O(g.right.params)}) ${x} ${S(g.right.body)} end`}else return`function ${`${S(g.left.object.object)}:${C}`}(${O(g.right.params)}) ${x} ${S(g.right.body)} end`}const L=S(g.left);if(t.moduleExportsToReturn&&g.left.type=="MemberExpression"&&(L=="module.exports"||L.startsWith("module.exports.")||L.startsWith("module.exports[")))return L=="module.exports"?a=`return ${S(g.right)}`:(u=!0,s.push(`${ys}${L.slice(14)} = ${S(g.right)}`)),"";if(g.right.type=="AssignmentExpression"){const x=S(g.left);return`${S(g.right)}; - local ${x} = ${S(g.right.left)}`}else{const x=g.operator;let C,R;return on(g.left.type)?(C=S(g.left)(),R=`unpack(${S(g.right)})`):(C=S(g.left),R=S(g.right)),x=="+="?`${C} = ${C} + ${R}`:x=="-="?`${C} = ${C} - ${R}`:x=="*="?`${C} = ${C} * ${R}`:x=="/="?`${C} = ${C} / ${R}`:x=="%="?`${C} = ${C} % ${R}`:x=="&&="?`${C} = ${C} and ${R}`:x=="||="?`${C} = ${C} or ${R}`:x=="&="?(l=!0,`${C} = bit.band(${C}, ${R})`):x=="|="?(l=!0,`${C} = bit.bor(${C}, ${R})`):x=="^="?(l=!0,`${C} = bit.bxor(${C}, ${R})`):x=="**="?`${C} = math.pow(${C}, ${R})`:x=="??="?`${C} = (function() + local ${x} = ${S(g.right.left)}`}else{const x=g.operator;let C,R;return or(g.left.type)?(C=S(g.left)(),R=`unpack(${S(g.right)})`):(C=S(g.left),R=S(g.right)),x=="+="?`${C} = ${C} + ${R}`:x=="-="?`${C} = ${C} - ${R}`:x=="*="?`${C} = ${C} * ${R}`:x=="/="?`${C} = ${C} / ${R}`:x=="%="?`${C} = ${C} % ${R}`:x=="&&="?`${C} = ${C} and ${R}`:x=="||="?`${C} = ${C} or ${R}`:x=="&="?(l=!0,`${C} = bit.band(${C}, ${R})`):x=="|="?(l=!0,`${C} = bit.bor(${C}, ${R})`):x=="^="?(l=!0,`${C} = bit.bxor(${C}, ${R})`):x=="**="?`${C} = math.pow(${C}, ${R})`:x=="??="?`${C} = (function() if ${C} == nil then return ${R} else @@ -170,13 +177,13 @@ end`:`local function ${L}(${R}) ${x} ${C} end`}case"ReturnStatement":return g.ar pcall(function() ${S(g.block)} end); if not ok then ${S(g.handler.body)} end`;case"UpdateExpression":{const L=S(g.argument),x=g.operator=="++"?"+":"-";return t.disableUpdateExpressionCallback&&g.ExpressionStatement?`${L} = ${L} ${x} 1`:`(function () ${L} = ${L} ${x} 1; return ${L} end)()`}case"WhileStatement":{const L=Hi(g);return Ls([`while ${S(g.test)} do`,S(g.body),L,"end"])}case"ArrowFunctionExpression":{const L=c(g.params);return`function(${O(g.params)}) ${L} ${g.body.type=="BlockStatement"?"":"return"} ${S(g.body)} end`}case"RestElement":return"...";case"ConditionalExpression":return`(function() if ${S(g.test)} then return ${S(g.consequent)}; - else return ${S(g.alternate)}; end end)()`;case"RegExpLiteral":return`[=[${g.pattern}]=]`;case"NullLiteral":return"nil";case"TemplateLiteral":return`string.format([=[${g.quasis.map(S).join("%s")}]=], ${O(g.expressions)})`;case"TemplateElement":return`${g.value.cooked}`;case"ForStatement":{const L=Hi(g);return((z=g.update)==null?void 0:z.type)=="UpdateExpression"&&(g.update.ExpressionStatement=!0),Ls(["do",g.init?S(g.init):"",`while ${g.test?S(g.test):"1"} do`,S(g.body),L,g.update?S(g.update):"","end","end"])}case"AssignmentPattern":return`${S(g.left)}`;case"SpreadElement":return`unpack(${S(g.argument)})`;case"Super":return g.superClass?S(g.superClass):"super";case"SequenceExpression":return`{${O(g.expressions,";")}}`;case"SwitchStatement":{Mm(g);const L=si(g,No)?Re:No;return`repeat + else return ${S(g.alternate)}; end end)()`;case"RegExpLiteral":return`[=[${g.pattern}]=]`;case"NullLiteral":return"nil";case"TemplateLiteral":return`string.format([=[${g.quasis.map(S).join("%s")}]=], ${O(g.expressions)})`;case"TemplateElement":return`${g.value.cooked}`;case"ForStatement":{const L=Hi(g);return((z=g.update)==null?void 0:z.type)=="UpdateExpression"&&(g.update.ExpressionStatement=!0),Ls(["do",g.init?S(g.init):"",`while ${g.test?S(g.test):"1"} do`,S(g.body),L,g.update?S(g.update):"","end","end"])}case"AssignmentPattern":return`${S(g.left)}`;case"SpreadElement":return`unpack(${S(g.argument)})`;case"Super":return g.superClass?S(g.superClass):"super";case"SequenceExpression":return`{${O(g.expressions,";")}}`;case"SwitchStatement":{Mm(g);const L=si(g,No)?Fe:No;return`repeat local ${L} = ${S(g.discriminant)} - ${g.cases.map((x,C)=>{const R=O(x.consequent,";");if(x.test){const re=x.testGroup?`${x.testGroup.map(M=>`${L} == ${S(M)}`).join(" or ")}`:`${L} == ${S(x.test)}`;return C===0?`if ${re} then ${R}`:`elseif ${re} then ${R}`}else return`else ${R}`}).join(` + ${g.cases.map((x,C)=>{const R=O(x.consequent,";");if(x.test){const ne=x.testGroup?`${x.testGroup.map(M=>`${L} == ${S(M)}`).join(" or ")}`:`${L} == ${S(x.test)}`;return C===0?`if ${ne} then ${R}`:`elseif ${ne} then ${R}`}else return`else ${R}`}).join(` `)} end until (false)`}case"ExportDefaultDeclaration":return u=!0,s.push(`${ys}.default = ${S(g.declaration)}`),"";case"ExportNamedDeclaration":if(u=!0,g.declaration)if(g.declaration.type=="VariableDeclaration"){const L=g.declaration.declarations.map(S).filter(C=>C).map(C=>`local ${C}`).join(`; -`),x=g.declaration.declarations.map(C=>{const R=S(C.id);return`${ys}.${R} = ${R}`});return s.push(...x),`${L}`}else if(((ue=g.declaration)==null?void 0:ue.type)=="FunctionDeclaration"){const L=S(g.declaration.id);return s.push(`${ys}.${L} = ${L}`),`${S(g.declaration)}`}else return"";else if(g.specifiers.length>0){const L=x=>`${ys}.${S(x.exported)} = ${S(x.local)}`;return s.push(...g.specifiers.map(L)),""}else return"";case"ImportDeclaration":{const L=m(g);return t.importStatementHoisting?(r.push(L),""):L}case"AwaitExpression":return`${S(g.argument)}`;default:return t.debug&&In("unknow node",g.type,g),""}}const W=S(i);return u&&(n=`local ${ys} = {}`,a=`return ${ys}`),o&&r.unshift('local cjson = require("cjson")'),h&&r.unshift('local isarray = require("table.isarray")'),l&&r.unshift('local bit = require("bit")'),Ls([`${r.join(";")}`,`${n}`,`${e.join(";")}`,`${W}`,`${s.join(";")}`,`${a}`])}function Dm(i,t){let e="";return e=Om(Nn(i),t),t.debug&&In(e),Ci.Beautify(e,{}).trim()}var vc={exports:{}};(function(i,t){(function(e,s){s()})(Ut,function(){function e(h,u){return typeof u=="undefined"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(h.type)?new Blob(["\uFEFF",h],{type:h.type}):h}function s(h,u,d){var c=new XMLHttpRequest;c.open("GET",h),c.responseType="blob",c.onload=function(){l(c.response,u,d)},c.onerror=function(){console.error("could not download file")},c.send()}function r(h){var u=new XMLHttpRequest;u.open("HEAD",h,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function n(h){try{h.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),h.dispatchEvent(u)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Ut=="object"&&Ut.global===Ut?Ut:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(h,u,d){var c=a.URL||a.webkitURL,f=document.createElement("a");u=u||h.name||"download",f.download=u,f.rel="noopener",typeof h=="string"?(f.href=h,f.origin===location.origin?n(f):r(f.href)?s(h,u,d):n(f,f.target="_blank")):(f.href=c.createObjectURL(h),setTimeout(function(){c.revokeObjectURL(f.href)},4e4),setTimeout(function(){n(f)},0))}:"msSaveOrOpenBlob"in navigator?function(h,u,d){if(u=u||h.name||"download",typeof h!="string")navigator.msSaveOrOpenBlob(e(h,d),u);else if(r(h))s(h,u,d);else{var c=document.createElement("a");c.href=h,c.target="_blank",setTimeout(function(){n(c)})}}:function(h,u,d,c){if(c=c||open("","_blank"),c&&(c.document.title=c.document.body.innerText="downloading..."),typeof h=="string")return s(h,u,d);var f=h.type==="application/octet-stream",p=/constructor/i.test(a.HTMLElement)||a.safari,m=/CriOS\/[\d]+/.test(navigator.userAgent);if((m||f&&p||o)&&typeof FileReader!="undefined"){var b=new FileReader;b.onloadend=function(){var U=b.result;U=m?U:U.replace(/^data:[^;]*;/,"data:attachment/file;"),c?c.location.href=U:location=U,c=null},b.readAsDataURL(h)}else{var P=a.URL||a.webkitURL,A=P.createObjectURL(h);c?c.location=A:location.href=A,c=null,setTimeout(function(){P.revokeObjectURL(A)},4e4)}});a.saveAs=l.saveAs=l,i.exports=l})})(vc);var Fm=vc.exports;const Bm="@xiangnanscu/js2lua",Rm="0.47.0",$m="module",jm="Writing LuaJIT with the expressiveness of JavaScript.",Um="src/js2lua.mjs",Vm={js2lua:"bin/js2lua.js"},Hm={type:"git",url:"git+https://github.com/xiangnanscu/js2lua.git"},Gm="Nan Xiang",Wm="MIT",Km={url:"https://github.com/xiangnanscu/js2lua/issues"},qm="https://github.xnscu.com/js2lua/",zm={dev:"vite",build:"vite build",preview:"vite preview",commit:"git add . && git commit -am ",push:"yarn commit",postpush:"while true; do git push && { echo 'Git push succeeded'; break; } || echo 'Git push failed, retrying in 1 seconds'; sleep 1; done",pull:"while true; do git pull && { echo 'Git pull succeeded'; break; } || echo 'Git pull failed, retrying in 1 seconds'; sleep 1; done",prerelease:"npm --no-git-tag-version version minor",docs:"node makeDocs.js",release:"npm run docs && push_option=release npm run push",rc:"yarn release",replace:"find . -type d \\( -name .git -o -name node_modules \\) -prune -o -type f -exec sed -i s/js2lua/field/g {} \\;",test:"node test.mjs"},Jm={"@babel/parser":"^7.22.14","lua-fmt":"^2.6.0","lua-format":"^1.5.2","yargs-parser":"^21.1.1"},Xm={"@highlightjs/vue-plugin":"^2.1.0","@prettier/plugin-lua":"^0.0.3","@rushstack/eslint-patch":"^1.3.3","@vitejs/plugin-vue":"^2.3.3",bootstrap:"^5.1.3",eslint:"^8.47.0","eslint-plugin-vue":"^9.17.0","file-saver":"^2.0.5","highlight.js":"^11.5.1",prettier:"^2.8.8",sass:"^1.52.1","source-map-support":"^0.5.21",vite:"^2.9.9","vite-plugin-require-transform":"^1.0.21",vue:"^3.2.25","vue-eslint-parser":"^9.3.1",yargs:"^17.7.2"};var Mo={name:Bm,version:Rm,type:$m,description:jm,main:Um,bin:Vm,repository:Hm,author:Gm,license:Wm,bugs:Km,homepage:qm,scripts:zm,dependencies:Jm,devDependencies:Xm},Ym=`const { a, b: bAlias, ...rest } = { a: 1, b: 2, c: 3, d: 4 } +`),x=g.declaration.declarations.map(C=>{const R=S(C.id);return`${ys}.${R} = ${R}`});return s.push(...x),`${L}`}else if(((ue=g.declaration)==null?void 0:ue.type)=="FunctionDeclaration"){const L=S(g.declaration.id);return s.push(`${ys}.${L} = ${L}`),`${S(g.declaration)}`}else return"";else if(g.specifiers.length>0){const L=x=>`${ys}.${S(x.exported)} = ${S(x.local)}`;return s.push(...g.specifiers.map(L)),""}else return"";case"ImportDeclaration":{const L=m(g);return t.importStatementHoisting?(n.push(L),""):L}case"AwaitExpression":return`${S(g.argument)}`;default:return t.debug&&Ir("unknow node",g.type,g),""}}const W=S(i);return u&&(r=`local ${ys} = {}`,a=`return ${ys}`),o&&n.unshift('local cjson = require("cjson")'),h&&n.unshift('local isarray = require("table.isarray")'),l&&n.unshift('local bit = require("bit")'),Ls([`${n.join(";")}`,`${r}`,`${e.join(";")}`,`${W}`,`${s.join(";")}`,`${a}`])}function Dm(i,t){let e="";return e=Om(Nr(i),t),t.debug&&Ir(e),Ci.Beautify(e,{}).trim()}var vc={exports:{}};(function(i,t){(function(e,s){s()})(Ut,function(){function e(h,u){return typeof u=="undefined"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(h.type)?new Blob(["\uFEFF",h],{type:h.type}):h}function s(h,u,d){var c=new XMLHttpRequest;c.open("GET",h),c.responseType="blob",c.onload=function(){l(c.response,u,d)},c.onerror=function(){console.error("could not download file")},c.send()}function n(h){var u=new XMLHttpRequest;u.open("HEAD",h,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function r(h){try{h.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),h.dispatchEvent(u)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Ut=="object"&&Ut.global===Ut?Ut:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(h,u,d){var c=a.URL||a.webkitURL,f=document.createElement("a");u=u||h.name||"download",f.download=u,f.rel="noopener",typeof h=="string"?(f.href=h,f.origin===location.origin?r(f):n(f.href)?s(h,u,d):r(f,f.target="_blank")):(f.href=c.createObjectURL(h),setTimeout(function(){c.revokeObjectURL(f.href)},4e4),setTimeout(function(){r(f)},0))}:"msSaveOrOpenBlob"in navigator?function(h,u,d){if(u=u||h.name||"download",typeof h!="string")navigator.msSaveOrOpenBlob(e(h,d),u);else if(n(h))s(h,u,d);else{var c=document.createElement("a");c.href=h,c.target="_blank",setTimeout(function(){r(c)})}}:function(h,u,d,c){if(c=c||open("","_blank"),c&&(c.document.title=c.document.body.innerText="downloading..."),typeof h=="string")return s(h,u,d);var f=h.type==="application/octet-stream",p=/constructor/i.test(a.HTMLElement)||a.safari,m=/CriOS\/[\d]+/.test(navigator.userAgent);if((m||f&&p||o)&&typeof FileReader!="undefined"){var b=new FileReader;b.onloadend=function(){var U=b.result;U=m?U:U.replace(/^data:[^;]*;/,"data:attachment/file;"),c?c.location.href=U:location=U,c=null},b.readAsDataURL(h)}else{var P=a.URL||a.webkitURL,A=P.createObjectURL(h);c?c.location=A:location.href=A,c=null,setTimeout(function(){P.revokeObjectURL(A)},4e4)}});a.saveAs=l.saveAs=l,i.exports=l})})(vc);var Fm=vc.exports;const Bm="@xiangnanscu/js2lua",Rm="0.48.0",$m="module",jm="Writing LuaJIT with the expressiveness of JavaScript.",Um="src/js2lua.mjs",Vm={js2lua:"bin/js2lua.js"},Hm={type:"git",url:"git+https://github.com/xiangnanscu/js2lua.git"},Gm="Nan Xiang",Wm="MIT",Km={url:"https://github.com/xiangnanscu/js2lua/issues"},qm="https://github.xnscu.com/js2lua/",zm={dev:"vite",build:"vite build",preview:"vite preview",commit:"git add . && git commit -am ",push:"yarn commit",postpush:"while true; do git push && { echo 'Git push succeeded'; break; } || echo 'Git push failed, retrying in 1 seconds'; sleep 1; done",pull:"while true; do git pull && { echo 'Git pull succeeded'; break; } || echo 'Git pull failed, retrying in 1 seconds'; sleep 1; done",prerelease:"npm --no-git-tag-version version minor",docs:"node makeDocs.js",release:"npm run docs && push_option=release npm run push",rc:"yarn release",replace:"find . -type d \\( -name .git -o -name node_modules \\) -prune -o -type f -exec sed -i s/js2lua/field/g {} \\;",test:"node test.mjs"},Jm={"@babel/parser":"^7.22.14","lua-fmt":"^2.6.0","lua-format":"^1.5.2","yargs-parser":"^21.1.1"},Xm={"@highlightjs/vue-plugin":"^2.1.0","@prettier/plugin-lua":"^0.0.3","@rushstack/eslint-patch":"^1.3.3","@vitejs/plugin-vue":"^2.3.3",bootstrap:"^5.1.3",eslint:"^8.47.0","eslint-plugin-vue":"^9.17.0","file-saver":"^2.0.5","highlight.js":"^11.5.1",prettier:"^2.8.8",sass:"^1.52.1","source-map-support":"^0.5.21",vite:"^2.9.9","vite-plugin-require-transform":"^1.0.21",vue:"^3.2.25","vue-eslint-parser":"^9.3.1",yargs:"^17.7.2"};var Mo={name:Bm,version:Rm,type:$m,description:jm,main:Um,bin:Vm,repository:Hm,author:Gm,license:Wm,bugs:Km,homepage:qm,scripts:zm,dependencies:Jm,devDependencies:Xm},Ym=`const { a, b: bAlias, ...rest } = { a: 1, b: 2, c: 3, d: 4 } const [x, y, ...others] = [1, 2, 3, 4] for (i = 0; i < 10; i = i + 2) { if (i % 2) { @@ -200,7 +207,7 @@ class Child extends Parent { // calling a function expression (() => print(1))(); -`;const Zm={style:{"margin-bottom":"1em","text-align":"center"}},Qm=["title"],ey={class:"row"},ty={class:"col-2"},sy={class:"form-check"},iy={class:"form-check"},ry=["id","value"],ny=["for"],ay={class:"col-3"},oy={key:0,class:"col"},ly={class:"form-check-inline"},cy={class:"form-check-label"},uy=["value"],hy={key:0},fy={key:1},py={class:"col"},dy={class:"table table-bordered"},my={colspan:"3"},yy=["href"],gy={colspan:"3"},Ty=["id"],by={class:"td-wrap"},xy=["onUpdate:modelValue"],Sy={__name:"App",setup(i){const t=gs(!1),e=gs(!1);function s(P,A){try{return Dm(P,A)}catch(U){return console.error(U),`-- ERROR: ${U.message}`}}function r(P,A){try{return Nn(P,A)}catch(U){return console.error(U),Nn(`throw new Error("ERROR: ${U.message}")`)}}const n=gs(Ym),a=Object.keys(Ln),o=gs(Object.entries(Ln).filter(([P,A])=>A).map(([P,A])=>P)),l=Ht(()=>Object.fromEntries(a.map(P=>[P,!!o.value.includes(P)]))),h={"../test/IIFE.mjs":`(() => { +`;const Zm={style:{"margin-bottom":"1em","text-align":"center"}},Qm=["title"],ey={class:"row"},ty={class:"col-2"},sy={class:"form-check"},iy={class:"form-check"},ny=["id","value"],ry=["for"],ay={class:"col-3"},oy={key:0,class:"col"},ly={class:"form-check-inline"},cy={class:"form-check-label"},uy=["value"],hy={key:0},fy={key:1},py={class:"col"},dy={class:"table table-bordered"},my={colspan:"3"},yy=["href"],gy={colspan:"3"},Ty=["id"],by={class:"td-wrap"},xy=["onUpdate:modelValue"],Sy={__name:"App",setup(i){const t=gs(!1),e=gs(!1);function s(P,A){try{return Dm(P,A)}catch(U){return console.error(U),`-- ERROR: ${U.message}`}}function n(P,A){try{return Nr(P,A)}catch(U){return console.error(U),Nr(`throw new Error("ERROR: ${U.message}")`)}}const r=gs(Ym),a=Object.keys(Lr),o=gs(Object.entries(Lr).filter(([P,A])=>A).map(([P,A])=>P)),l=Ht(()=>Object.fromEntries(a.map(P=>[P,!!o.value.includes(P)]))),h={"../test/IIFE.mjs":`(() => { print(1) })(); @@ -441,6 +448,7 @@ a.b?.c.d?.(); // nullish a ?? 'hello'; +a.b() ?? 'hello'; const d = {} d.n ??= 100;`,"../test/others.mjs":`const foo = {} delete foo.bar @@ -527,5 +535,5 @@ if (--i) { print(i) } -`};for(const[P,A]of Object.entries(h))h[P]=gs(A);const u=xr([]);for(const P in h){const A=h[P],U=Ht(()=>s(A.value,l.value)),O=P.match(/\/(\w+)\.mjs$/)[1];u.push({name:O,jscode:A,luacode:U})}const d=Ht(()=>s(n.value,l.value)),c=Ht(()=>{var P;return(P=r(n.value,l.value))==null?void 0:P.program.body});function f(){m("luacode")}function p(){Fm.saveAs(new Blob([d.value]),"test11.lua")}function m(P){if(window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),document.selection){const A=document.body.createTextRange();A.moveToElementText(document.getElementById(P)),A.select().createTextRange(),document.execCommand("copy")}else if(window.getSelection){const A=document.createRange();A.selectNode(document.getElementById(P)),window.getSelection().addRange(A),document.execCommand("copy")}}const b=gs(!1);return pi(b,P=>{P?o.value=[...a]:o.value=[]}),(P,A)=>{const U=Th("highlightjs");return St(),Ct("div",null,[Ae("h1",Zm,[Ae("a",{href:"https://github.com/xiangnanscu/js2lua",title:Ki(Mo).version},Ns(Ki(Mo).name),9,Qm),A[6]||(A[6]=Tn(" - Writing LuaJIT with the expressiveness of JavaScript. "))]),Ae("div",ey,[Ae("div",ty,[Ae("div",{class:bi({"error-wrapper":P.error})},[Ae("div",sy,[zs(Ae("input",{class:"form-check-input",type:"checkbox",id:"label-all","onUpdate:modelValue":A[0]||(A[0]=O=>e.value=O)},null,512),[[Xr,e.value]]),A[7]||(A[7]=Ae("label",{class:"form-check-label",for:"label-all",style:{color:"red"}}," show Js code ",-1))]),Ae("div",iy,[zs(Ae("input",{class:"form-check-input",type:"checkbox",id:"label-all","onUpdate:modelValue":A[1]||(A[1]=O=>b.value=O)},null,512),[[Xr,b.value]]),A[8]||(A[8]=Ae("label",{class:"form-check-label",for:"label-all",style:{color:"red"}}," all ",-1))]),(St(!0),Ct(dt,null,Hr(Ki(a),(O,S)=>(St(),Ct("div",{key:S,class:bi({"form-check":!0})},[zs(Ae("input",{class:"form-check-input",type:"checkbox",id:"label"+S,"onUpdate:modelValue":A[2]||(A[2]=W=>o.value=W),value:O},null,8,ry),[[Xr,o.value]]),Ae("label",{class:"form-check-label",for:"label"+S},Ns(O),9,ny)]))),128))],2)]),Ae("div",ay,[Ae("button",{onClick:A[3]||(A[3]=O=>n.value="")},"clear textarea"),zs(Ae("textarea",{rows:"10",style:{height:"500px"},class:"form-control","onUpdate:modelValue":A[4]||(A[4]=O=>n.value=O)},null,512),[[no,n.value]])]),e.value?(St(),Ct("div",oy,[Ae("div",ly,[Ae("label",cy,[Ae("input",{onInput:A[5]||(A[5]=O=>t.value=!t.value),value:t.value,type:"checkbox",class:"form-check-input"},null,40,uy),A[9]||(A[9]=Tn("show js ast"))])]),t.value?(St(),Ct("div",hy,[Ae("pre",null,Ns(c.value),1)])):(St(),Ct("div",fy,[Je(U,{language:"javascript",code:n.value},null,8,["code"])]))])):tf("",!0),Ae("div",py,[Ae("button",{onClick:f},"copy lua"),Ae("button",{onClick:p},"save as"),Je(U,{id:"luacode",language:"lua",code:d.value},null,8,["code"])])]),Ae("table",dy,[Ae("thead",null,[Ae("tr",null,[Ae("th",my,[A[10]||(A[10]=Ae("h1",null,"take a look at features:",-1)),(St(!0),Ct(dt,null,Hr(u,(O,S)=>(St(),Ct("div",{key:S},[Ae("a",{class:"link-block",href:`#${O.name}`},Ns(O.name),9,yy)]))),128))])])]),Ae("tbody",null,[(St(!0),Ct(dt,null,Hr(u,(O,S)=>(St(),Ct(dt,{key:S},[Ae("tr",null,[Ae("td",gy,[Ae("h3",{id:O.name},Ns(O.name),9,Ty)])]),Ae("tr",null,[Ae("td",by,[zs(Ae("textarea",{class:"td-textarea form-control","onUpdate:modelValue":W=>O.jscode=W},null,8,xy),[[no,O.jscode]])]),Ae("td",null,[Je(U,{language:"javascript",code:O.jscode,style:{width:"42em"}},null,8,["code"])]),Ae("td",null,[Je(U,{language:"lua",code:O.luacode,style:{width:"42em"}},null,8,["code"])])])],64))),128))])])])}}};function Lc(i){return i instanceof Map?i.clear=i.delete=i.set=function(){throw new Error("map is read-only")}:i instanceof Set&&(i.add=i.clear=i.delete=function(){throw new Error("set is read-only")}),Object.freeze(i),Object.getOwnPropertyNames(i).forEach(t=>{const e=i[t],s=typeof e;(s==="object"||s==="function")&&!Object.isFrozen(e)&&Lc(e)}),i}class Oo{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Ic(i){return i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function ns(i,...t){const e=Object.create(null);for(const s in i)e[s]=i[s];return t.forEach(function(s){for(const r in s)e[r]=s[r]}),e}const Py="",Do=i=>!!i.scope,Ey=(i,{prefix:t})=>{if(i.startsWith("language:"))return i.replace("language:","language-");if(i.includes(".")){const e=i.split(".");return[`${t}${e.shift()}`,...e.map((s,r)=>`${s}${"_".repeat(r+1)}`)].join(" ")}return`${t}${i}`};class Ay{constructor(t,e){this.buffer="",this.classPrefix=e.classPrefix,t.walk(this)}addText(t){this.buffer+=Ic(t)}openNode(t){if(!Do(t))return;const e=Ey(t.scope,{prefix:this.classPrefix});this.span(e)}closeNode(t){!Do(t)||(this.buffer+=Py)}value(){return this.buffer}span(t){this.buffer+=``}}const Fo=(i={})=>{const t={children:[]};return Object.assign(t,i),t};class ya{constructor(){this.rootNode=Fo(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const e=Fo({scope:t});this.add(e),this.stack.push(e)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,e){return typeof e=="string"?t.addText(e):e.children&&(t.openNode(e),e.children.forEach(s=>this._walk(t,s)),t.closeNode(e)),t}static _collapse(t){typeof t!="string"&&(!t.children||(t.children.every(e=>typeof e=="string")?t.children=[t.children.join("")]:t.children.forEach(e=>{ya._collapse(e)})))}}class wy extends ya{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,e){const s=t.root;e&&(s.scope=`language:${e}`),this.add(s)}toHTML(){return new Ay(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ki(i){return i?typeof i=="string"?i:i.source:null}function Nc(i){return Cs("(?=",i,")")}function Cy(i){return Cs("(?:",i,")*")}function ky(i){return Cs("(?:",i,")?")}function Cs(...i){return i.map(e=>ki(e)).join("")}function vy(i){const t=i[i.length-1];return typeof t=="object"&&t.constructor===Object?(i.splice(i.length-1,1),t):{}}function ga(...i){const t=vy(i);return"("+(t.capture?"":"?:")+i.map(s=>ki(s)).join("|")+")"}function _c(i){return new RegExp(i.toString()+"|").exec("").length-1}function Ly(i,t){const e=i&&i.exec(t);return e&&e.index===0}const Iy=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ta(i,{joinWith:t}){let e=0;return i.map(s=>{e+=1;const r=e;let n=ki(s),a="";for(;n.length>0;){const o=Iy.exec(n);if(!o){a+=n;break}a+=n.substring(0,o.index),n=n.substring(o.index+o[0].length),o[0][0]==="\\"&&o[1]?a+="\\"+String(Number(o[1])+r):(a+=o[0],o[0]==="("&&e++)}return a}).map(s=>`(${s})`).join(t)}const Ny=/\b\B/,Mc="[a-zA-Z]\\w*",ba="[a-zA-Z_]\\w*",Oc="\\b\\d+(\\.\\d+)?",Dc="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Fc="\\b(0b[01]+)",_y="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",My=(i={})=>{const t=/^#![ ]*\//;return i.binary&&(i.begin=Cs(t,/.*\b/,i.binary,/\b.*/)),ns({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,s)=>{e.index!==0&&s.ignoreMatch()}},i)},vi={begin:"\\\\[\\s\\S]",relevance:0},Oy={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[vi]},Dy={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[vi]},Fy={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},_r=function(i,t,e={}){const s=ns({scope:"comment",begin:i,end:t,contains:[]},e);s.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=ga("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return s.contains.push({begin:Cs(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),s},By=_r("//","$"),Ry=_r("/\\*","\\*/"),$y=_r("#","$"),jy={scope:"number",begin:Oc,relevance:0},Uy={scope:"number",begin:Dc,relevance:0},Vy={scope:"number",begin:Fc,relevance:0},Hy={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[vi,{begin:/\[/,end:/\]/,relevance:0,contains:[vi]}]},Gy={scope:"title",begin:Mc,relevance:0},Wy={scope:"title",begin:ba,relevance:0},Ky={begin:"\\.\\s*"+ba,relevance:0},qy=function(i){return Object.assign(i,{"on:begin":(t,e)=>{e.data._beginMatch=t[1]},"on:end":(t,e)=>{e.data._beginMatch!==t[1]&&e.ignoreMatch()}})};var Gi=Object.freeze({__proto__:null,APOS_STRING_MODE:Oy,BACKSLASH_ESCAPE:vi,BINARY_NUMBER_MODE:Vy,BINARY_NUMBER_RE:Fc,COMMENT:_r,C_BLOCK_COMMENT_MODE:Ry,C_LINE_COMMENT_MODE:By,C_NUMBER_MODE:Uy,C_NUMBER_RE:Dc,END_SAME_AS_BEGIN:qy,HASH_COMMENT_MODE:$y,IDENT_RE:Mc,MATCH_NOTHING_RE:Ny,METHOD_GUARD:Ky,NUMBER_MODE:jy,NUMBER_RE:Oc,PHRASAL_WORDS_MODE:Fy,QUOTE_STRING_MODE:Dy,REGEXP_MODE:Hy,RE_STARTERS_RE:_y,SHEBANG:My,TITLE_MODE:Gy,UNDERSCORE_IDENT_RE:ba,UNDERSCORE_TITLE_MODE:Wy});function zy(i,t){i.input[i.index-1]==="."&&t.ignoreMatch()}function Jy(i,t){i.className!==void 0&&(i.scope=i.className,delete i.className)}function Xy(i,t){!t||!i.beginKeywords||(i.begin="\\b("+i.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",i.__beforeBegin=zy,i.keywords=i.keywords||i.beginKeywords,delete i.beginKeywords,i.relevance===void 0&&(i.relevance=0))}function Yy(i,t){!Array.isArray(i.illegal)||(i.illegal=ga(...i.illegal))}function Zy(i,t){if(!!i.match){if(i.begin||i.end)throw new Error("begin & end are not supported with match");i.begin=i.match,delete i.match}}function Qy(i,t){i.relevance===void 0&&(i.relevance=1)}const eg=(i,t)=>{if(!i.beforeMatch)return;if(i.starts)throw new Error("beforeMatch cannot be used with starts");const e=Object.assign({},i);Object.keys(i).forEach(s=>{delete i[s]}),i.keywords=e.keywords,i.begin=Cs(e.beforeMatch,Nc(e.begin)),i.starts={relevance:0,contains:[Object.assign(e,{endsParent:!0})]},i.relevance=0,delete e.beforeMatch},tg=["of","and","for","in","not","or","if","then","parent","list","value"],sg="keyword";function Bc(i,t,e=sg){const s=Object.create(null);return typeof i=="string"?r(e,i.split(" ")):Array.isArray(i)?r(e,i):Object.keys(i).forEach(function(n){Object.assign(s,Bc(i[n],t,n))}),s;function r(n,a){t&&(a=a.map(o=>o.toLowerCase())),a.forEach(function(o){const l=o.split("|");s[l[0]]=[n,ig(l[0],l[1])]})}}function ig(i,t){return t?Number(t):rg(i)?0:1}function rg(i){return tg.includes(i.toLowerCase())}const Bo={},Ps=i=>{console.error(i)},Ro=(i,...t)=>{console.log(`WARN: ${i}`,...t)},Is=(i,t)=>{Bo[`${i}/${t}`]||(console.log(`Deprecated as of ${i}. ${t}`),Bo[`${i}/${t}`]=!0)},fr=new Error;function Rc(i,t,{key:e}){let s=0;const r=i[e],n={},a={};for(let o=1;o<=t.length;o++)a[o+s]=r[o],n[o+s]=!0,s+=_c(t[o-1]);i[e]=a,i[e]._emit=n,i[e]._multi=!0}function ng(i){if(!!Array.isArray(i.begin)){if(i.skip||i.excludeBegin||i.returnBegin)throw Ps("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),fr;if(typeof i.beginScope!="object"||i.beginScope===null)throw Ps("beginScope must be object"),fr;Rc(i,i.begin,{key:"beginScope"}),i.begin=Ta(i.begin,{joinWith:""})}}function ag(i){if(!!Array.isArray(i.end)){if(i.skip||i.excludeEnd||i.returnEnd)throw Ps("skip, excludeEnd, returnEnd not compatible with endScope: {}"),fr;if(typeof i.endScope!="object"||i.endScope===null)throw Ps("endScope must be object"),fr;Rc(i,i.end,{key:"endScope"}),i.end=Ta(i.end,{joinWith:""})}}function og(i){i.scope&&typeof i.scope=="object"&&i.scope!==null&&(i.beginScope=i.scope,delete i.scope)}function lg(i){og(i),typeof i.beginScope=="string"&&(i.beginScope={_wrap:i.beginScope}),typeof i.endScope=="string"&&(i.endScope={_wrap:i.endScope}),ng(i),ag(i)}function cg(i){function t(a,o){return new RegExp(ki(a),"m"+(i.case_insensitive?"i":"")+(i.unicodeRegex?"u":"")+(o?"g":""))}class e{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(o,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,o]),this.matchAt+=_c(o)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const o=this.regexes.map(l=>l[1]);this.matcherRe=t(Ta(o,{joinWith:"|"}),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(o);if(!l)return null;const h=l.findIndex((d,c)=>c>0&&d!==void 0),u=this.matchIndexes[h];return l.splice(0,h),Object.assign(l,u)}}class s{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(o){if(this.multiRegexes[o])return this.multiRegexes[o];const l=new e;return this.rules.slice(o).forEach(([h,u])=>l.addRule(h,u)),l.compile(),this.multiRegexes[o]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(o,l){this.rules.push([o,l]),l.type==="begin"&&this.count++}exec(o){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let h=l.exec(o);if(this.resumingScanAtSamePosition()&&!(h&&h.index===this.lastIndex)){const u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,h=u.exec(o)}return h&&(this.regexIndex+=h.position+1,this.regexIndex===this.count&&this.considerAll()),h}}function r(a){const o=new s;return a.contains.forEach(l=>o.addRule(l.begin,{rule:l,type:"begin"})),a.terminatorEnd&&o.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&o.addRule(a.illegal,{type:"illegal"}),o}function n(a,o){const l=a;if(a.isCompiled)return l;[Jy,Zy,lg,eg].forEach(u=>u(a,o)),i.compilerExtensions.forEach(u=>u(a,o)),a.__beforeBegin=null,[Xy,Yy,Qy].forEach(u=>u(a,o)),a.isCompiled=!0;let h=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),h=a.keywords.$pattern,delete a.keywords.$pattern),h=h||/\w+/,a.keywords&&(a.keywords=Bc(a.keywords,i.case_insensitive)),l.keywordPatternRe=t(h,!0),o&&(a.begin||(a.begin=/\B|\b/),l.beginRe=t(l.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(l.endRe=t(l.end)),l.terminatorEnd=ki(l.end)||"",a.endsWithParent&&o.terminatorEnd&&(l.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(l.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(u){return ug(u==="self"?a:u)})),a.contains.forEach(function(u){n(u,l)}),a.starts&&n(a.starts,o),l.matcher=r(l),l}if(i.compilerExtensions||(i.compilerExtensions=[]),i.contains&&i.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return i.classNameAliases=ns(i.classNameAliases||{}),n(i)}function $c(i){return i?i.endsWithParent||$c(i.starts):!1}function ug(i){return i.variants&&!i.cachedVariants&&(i.cachedVariants=i.variants.map(function(t){return ns(i,{variants:null},t)})),i.cachedVariants?i.cachedVariants:$c(i)?ns(i,{starts:i.starts?ns(i.starts):null}):Object.isFrozen(i)?ns(i):i}var hg="11.10.0";class fg extends Error{constructor(t,e){super(t),this.name="HTMLInjectionError",this.html=e}}const ln=Ic,$o=ns,jo=Symbol("nomatch"),pg=7,jc=function(i){const t=Object.create(null),e=Object.create(null),s=[];let r=!0;const n="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let o={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:wy};function l(x){return o.noHighlightRe.test(x)}function h(x){let C=x.className+" ";C+=x.parentNode?x.parentNode.className:"";const R=o.languageDetectRe.exec(C);if(R){const re=se(R[1]);return re||(Ro(n.replace("{}",R[1])),Ro("Falling back to no-highlight mode for this block.",x)),re?R[1]:"no-highlight"}return C.split(/\s+/).find(re=>l(re)||se(re))}function u(x,C,R){let re="",M="";typeof C=="object"?(re=x,R=C.ignoreIllegals,M=C.language):(Is("10.7.0","highlight(lang, code, ...args) has been deprecated."),Is("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),M=x,re=C),R===void 0&&(R=!0);const F={code:re,language:M};ue("before:highlight",F);const N=F.result?F.result:d(F.language,F.code,R);return N.code=F.code,ue("after:highlight",N),N}function d(x,C,R,re){const M=Object.create(null);function F(J,ee){return J.keywords[ee]}function N(){if(!H.keywords){X.addText(G);return}let J=0;H.keywordPatternRe.lastIndex=0;let ee=H.keywordPatternRe.exec(G),le="";for(;ee;){le+=G.substring(J,ee.index);const xe=B.case_insensitive?ee[0].toLowerCase():ee[0],Pe=F(H,xe);if(Pe){const[_e,Ke]=Pe;if(X.addText(le),le="",M[xe]=(M[xe]||0)+1,M[xe]<=pg&&(ye+=Ke),_e.startsWith("_"))le+=ee[0];else{const ht=B.classNameAliases[_e]||_e;Q(ee[0],ht)}}else le+=ee[0];J=H.keywordPatternRe.lastIndex,ee=H.keywordPatternRe.exec(G)}le+=G.substring(J),X.addText(le)}function D(){if(G==="")return;let J=null;if(typeof H.subLanguage=="string"){if(!t[H.subLanguage]){X.addText(G);return}J=d(H.subLanguage,G,!0,te[H.subLanguage]),te[H.subLanguage]=J._top}else J=f(G,H.subLanguage.length?H.subLanguage:null);H.relevance>0&&(ye+=J.relevance),X.__addSublanguage(J._emitter,J.language)}function K(){H.subLanguage!=null?D():N(),G=""}function Q(J,ee){J!==""&&(X.startScope(ee),X.addText(J),X.endScope())}function Z(J,ee){let le=1;const xe=ee.length-1;for(;le<=xe;){if(!J._emit[le]){le++;continue}const Pe=B.classNameAliases[J[le]]||J[le],_e=ee[le];Pe?Q(_e,Pe):(G=_e,N(),G=""),le++}}function ce(J,ee){return J.scope&&typeof J.scope=="string"&&X.openNode(B.classNameAliases[J.scope]||J.scope),J.beginScope&&(J.beginScope._wrap?(Q(G,B.classNameAliases[J.beginScope._wrap]||J.beginScope._wrap),G=""):J.beginScope._multi&&(Z(J.beginScope,ee),G="")),H=Object.create(J,{parent:{value:H}}),H}function pe(J,ee,le){let xe=Ly(J.endRe,le);if(xe){if(J["on:end"]){const Pe=new Oo(J);J["on:end"](ee,Pe),Pe.isMatchIgnored&&(xe=!1)}if(xe){for(;J.endsParent&&J.parent;)J=J.parent;return J}}if(J.endsWithParent)return pe(J.parent,ee,le)}function ke(J){return H.matcher.regexIndex===0?(G+=J[0],1):(Te=!0,0)}function ve(J){const ee=J[0],le=J.rule,xe=new Oo(le),Pe=[le.__beforeBegin,le["on:begin"]];for(const _e of Pe)if(!!_e&&(_e(J,xe),xe.isMatchIgnored))return ke(ee);return le.skip?G+=ee:(le.excludeBegin&&(G+=ee),K(),!le.returnBegin&&!le.excludeBegin&&(G=ee)),ce(le,J),le.returnBegin?0:ee.length}function Ie(J){const ee=J[0],le=C.substring(J.index),xe=pe(H,J,le);if(!xe)return jo;const Pe=H;H.endScope&&H.endScope._wrap?(K(),Q(ee,H.endScope._wrap)):H.endScope&&H.endScope._multi?(K(),Z(H.endScope,J)):Pe.skip?G+=ee:(Pe.returnEnd||Pe.excludeEnd||(G+=ee),K(),Pe.excludeEnd&&(G=ee));do H.scope&&X.closeNode(),!H.skip&&!H.subLanguage&&(ye+=H.relevance),H=H.parent;while(H!==xe.parent);return xe.starts&&ce(xe.starts,J),Pe.returnEnd?0:ee.length}function E(){const J=[];for(let ee=H;ee!==B;ee=ee.parent)ee.scope&&J.unshift(ee.scope);J.forEach(ee=>X.openNode(ee))}let I={};function _(J,ee){const le=ee&&ee[0];if(G+=J,le==null)return K(),0;if(I.type==="begin"&&ee.type==="end"&&I.index===ee.index&&le===""){if(G+=C.slice(ee.index,ee.index+1),!r){const xe=new Error(`0 width match regex (${x})`);throw xe.languageName=x,xe.badRule=I.rule,xe}return 1}if(I=ee,ee.type==="begin")return ve(ee);if(ee.type==="illegal"&&!R){const xe=new Error('Illegal lexeme "'+le+'" for mode "'+(H.scope||"")+'"');throw xe.mode=H,xe}else if(ee.type==="end"){const xe=Ie(ee);if(xe!==jo)return xe}if(ee.type==="illegal"&&le==="")return 1;if(de>1e5&&de>ee.index*3)throw new Error("potential infinite loop, way more iterations than matches");return G+=le,le.length}const B=se(x);if(!B)throw Ps(n.replace("{}",x)),new Error('Unknown language: "'+x+'"');const $=cg(B);let q="",H=re||$;const te={},X=new o.__emitter(o);E();let G="",ye=0,ae=0,de=0,Te=!1;try{if(B.__emitTokens)B.__emitTokens(C,X);else{for(H.matcher.considerAll();;){de++,Te?Te=!1:H.matcher.considerAll(),H.matcher.lastIndex=ae;const J=H.matcher.exec(C);if(!J)break;const ee=C.substring(ae,J.index),le=_(ee,J);ae=J.index+le}_(C.substring(ae))}return X.finalize(),q=X.toHTML(),{language:x,value:q,relevance:ye,illegal:!1,_emitter:X,_top:H}}catch(J){if(J.message&&J.message.includes("Illegal"))return{language:x,value:ln(C),illegal:!0,relevance:0,_illegalBy:{message:J.message,index:ae,context:C.slice(ae-100,ae+100),mode:J.mode,resultSoFar:q},_emitter:X};if(r)return{language:x,value:ln(C),illegal:!1,relevance:0,errorRaised:J,_emitter:X,_top:H};throw J}}function c(x){const C={value:ln(x),illegal:!1,relevance:0,_top:a,_emitter:new o.__emitter(o)};return C._emitter.addText(x),C}function f(x,C){C=C||o.languages||Object.keys(t);const R=c(x),re=C.filter(se).filter(T).map(K=>d(K,x,!1));re.unshift(R);const M=re.sort((K,Q)=>{if(K.relevance!==Q.relevance)return Q.relevance-K.relevance;if(K.language&&Q.language){if(se(K.language).supersetOf===Q.language)return 1;if(se(Q.language).supersetOf===K.language)return-1}return 0}),[F,N]=M,D=F;return D.secondBest=N,D}function p(x,C,R){const re=C&&e[C]||R;x.classList.add("hljs"),x.classList.add(`language-${re}`)}function m(x){let C=null;const R=h(x);if(l(R))return;if(ue("before:highlightElement",{el:x,language:R}),x.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",x);return}if(x.children.length>0&&(o.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(x)),o.throwUnescapedHTML))throw new fg("One of your code blocks includes unescaped HTML.",x.innerHTML);C=x;const re=C.textContent,M=R?u(re,{language:R,ignoreIllegals:!0}):f(re);x.innerHTML=M.value,x.dataset.highlighted="yes",p(x,R,M.language),x.result={language:M.language,re:M.relevance,relevance:M.relevance},M.secondBest&&(x.secondBest={language:M.secondBest.language,relevance:M.secondBest.relevance}),ue("after:highlightElement",{el:x,result:M,text:re})}function b(x){o=$o(o,x)}const P=()=>{O(),Is("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function A(){O(),Is("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let U=!1;function O(){if(document.readyState==="loading"){U=!0;return}document.querySelectorAll(o.cssSelector).forEach(m)}function S(){U&&O()}typeof window!="undefined"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",S,!1);function W(x,C){let R=null;try{R=C(i)}catch(re){if(Ps("Language definition for '{}' could not be registered.".replace("{}",x)),r)Ps(re);else throw re;R=a}R.name||(R.name=x),t[x]=R,R.rawDefinition=C.bind(null,i),R.aliases&&ie(R.aliases,{languageName:x})}function fe(x){delete t[x];for(const C of Object.keys(e))e[C]===x&&delete e[C]}function g(){return Object.keys(t)}function se(x){return x=(x||"").toLowerCase(),t[x]||t[e[x]]}function ie(x,{languageName:C}){typeof x=="string"&&(x=[x]),x.forEach(R=>{e[R.toLowerCase()]=C})}function T(x){const C=se(x);return C&&!C.disableAutodetect}function k(x){x["before:highlightBlock"]&&!x["before:highlightElement"]&&(x["before:highlightElement"]=C=>{x["before:highlightBlock"](Object.assign({block:C.el},C))}),x["after:highlightBlock"]&&!x["after:highlightElement"]&&(x["after:highlightElement"]=C=>{x["after:highlightBlock"](Object.assign({block:C.el},C))})}function Y(x){k(x),s.push(x)}function z(x){const C=s.indexOf(x);C!==-1&&s.splice(C,1)}function ue(x,C){const R=x;s.forEach(function(re){re[R]&&re[R](C)})}function L(x){return Is("10.7.0","highlightBlock will be removed entirely in v12.0"),Is("10.7.0","Please use highlightElement now."),m(x)}Object.assign(i,{highlight:u,highlightAuto:f,highlightAll:O,highlightElement:m,highlightBlock:L,configure:b,initHighlighting:P,initHighlightingOnLoad:A,registerLanguage:W,unregisterLanguage:fe,listLanguages:g,getLanguage:se,registerAliases:ie,autoDetection:T,inherit:$o,addPlugin:Y,removePlugin:z}),i.debugMode=function(){r=!1},i.safeMode=function(){r=!0},i.versionString=hg,i.regex={concat:Cs,lookahead:Nc,either:ga,optional:ky,anyNumberOfTimes:Cy};for(const x in Gi)typeof Gi[x]=="object"&&Lc(Gi[x]);return Object.assign(i,Gi),i},Ws=jc({});Ws.newInstance=()=>jc({});var dg=Ws;Ws.HighlightJS=Ws;Ws.default=Ws;var Ti=dg;const Uo="[A-Za-z$_][0-9A-Za-z$_]*",mg=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],yg=["true","false","null","undefined","NaN","Infinity"],Uc=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Vc=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Hc=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],gg=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Tg=[].concat(Hc,Uc,Vc);function bg(i){const t=i.regex,e=(C,{after:R})=>{const re="",end:""},n=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(C,R)=>{const re=C[0].length+C.index,M=C.input[re];if(M==="<"||M===","){R.ignoreMatch();return}M===">"&&(e(C,{after:re})||R.ignoreMatch());let F;const N=C.input.substring(re);if(F=N.match(/^\s*=/)){R.ignoreMatch();return}if((F=N.match(/^\s+extends\s+/))&&F.index===0){R.ignoreMatch();return}}},o={$pattern:Uo,keyword:mg,literal:yg,built_in:Tg,"variable.language":gg},l="[0-9](_?[0-9])*",h=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${h})|\\.)?|(${h}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},c={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[i.BACKSLASH_ESCAPE,c],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[i.BACKSLASH_ESCAPE,c],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[i.BACKSLASH_ESCAPE,c],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[i.BACKSLASH_ESCAPE,c]},P=i.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),A={className:"comment",variants:[P,i.C_BLOCK_COMMENT_MODE,i.C_LINE_COMMENT_MODE]},U=[i.APOS_STRING_MODE,i.QUOTE_STRING_MODE,f,p,m,b,{match:/\$\d+/},d];c.contains=U.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(U)});const O=[].concat(A,c.contains),S=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(O)}]),W={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:S},fe={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,t.concat(s,"(",t.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},g={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Uc,...Vc]}},se={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ie={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[W],illegal:/%/},T={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function k(C){return t.concat("(?!",C.join("|"),")")}const Y={match:t.concat(/\b/,k([...Hc,"super","import"].map(C=>`${C}\\s*\\(`)),s,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},z={begin:t.concat(/\./,t.lookahead(t.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ue={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},W]},L="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+i.UNDERSCORE_IDENT_RE+")\\s*=>",x={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(L)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[W]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:g},illegal:/#(?![$_A-z])/,contains:[i.SHEBANG({label:"shebang",binary:"node",relevance:5}),se,i.APOS_STRING_MODE,i.QUOTE_STRING_MODE,f,p,m,b,A,{match:/\$\d+/},d,g,{className:"attr",begin:s+t.lookahead(":"),relevance:0},x,{begin:"("+i.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,i.REGEXP_MODE,{className:"function",begin:L,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:i.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:n},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},ie,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+i.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[W,i.inherit(i.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},z,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[W]},Y,T,fe,ue,{match:/\$[(.]/}]}}function xg(i){const t="\\[=*\\[",e="\\]=*\\]",s={begin:t,end:e,contains:["self"]},r=[i.COMMENT("--(?!"+t+")","$"),i.COMMENT("--"+t,e,{contains:[s],relevance:10})];return{name:"Lua",keywords:{$pattern:i.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[i.inherit(i.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},i.C_NUMBER_MODE,i.APOS_STRING_MODE,i.QUOTE_STRING_MODE,{className:"string",begin:t,end:e,contains:[s],relevance:5}])}}var Vo=nh({props:{code:{type:String,required:!0},language:{type:String,default:""},autodetect:{type:Boolean,default:!0},ignoreIllegals:{type:Boolean,default:!0}},setup:function(i){var t=gs(i.language);pi(function(){return i.language},function(r){t.value=r});var e=Ht(function(){return i.autodetect||!t.value}),s=Ht(function(){return!e.value&&!Ti.getLanguage(t.value)});return{className:Ht(function(){return s.value?"":"hljs "+t.value}),highlightedCode:Ht(function(){var r;if(s.value)return console.warn('The language "'+t.value+'" you specified could not be found.'),i.code.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'");if(e.value){var n=Ti.highlightAuto(i.code);return t.value=(r=n.language)!==null&&r!==void 0?r:"",n.value}return(n=Ti.highlight(i.code,{language:t.value,ignoreIllegals:i.ignoreIllegals})).value})}},render:function(){return Ka("pre",{},[Ka("code",{class:this.className,innerHTML:this.highlightedCode})])}}),Sg={install:function(i){i.component("highlightjs",Vo)},component:Vo};const Gc=Bf(Sy);Ti.registerLanguage("javascript",bg);Ti.registerLanguage("lua",xg);Gc.use(Sg);Gc.mount("#app")});export default Pg(); +`};for(const[P,A]of Object.entries(h))h[P]=gs(A);const u=Sn([]);for(const P in h){const A=h[P],U=Ht(()=>s(A.value,l.value)),O=P.match(/\/(\w+)\.mjs$/)[1];u.push({name:O,jscode:A,luacode:U})}const d=Ht(()=>s(r.value,l.value)),c=Ht(()=>{var P;return(P=n(r.value,l.value))==null?void 0:P.program.body});function f(){m("luacode")}function p(){Fm.saveAs(new Blob([d.value]),"test11.lua")}function m(P){if(window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),document.selection){const A=document.body.createTextRange();A.moveToElementText(document.getElementById(P)),A.select().createTextRange(),document.execCommand("copy")}else if(window.getSelection){const A=document.createRange();A.selectNode(document.getElementById(P)),window.getSelection().addRange(A),document.execCommand("copy")}}const b=gs(!1);return pi(b,P=>{P?o.value=[...a]:o.value=[]}),(P,A)=>{const U=Th("highlightjs");return St(),Ct("div",null,[Ae("h1",Zm,[Ae("a",{href:"https://github.com/xiangnanscu/js2lua",title:Ki(Mo).version},Ns(Ki(Mo).name),9,Qm),A[6]||(A[6]=Tr(" - Writing LuaJIT with the expressiveness of JavaScript. "))]),Ae("div",ey,[Ae("div",ty,[Ae("div",{class:bi({"error-wrapper":P.error})},[Ae("div",sy,[zs(Ae("input",{class:"form-check-input",type:"checkbox",id:"label-all","onUpdate:modelValue":A[0]||(A[0]=O=>e.value=O)},null,512),[[Yn,e.value]]),A[7]||(A[7]=Ae("label",{class:"form-check-label",for:"label-all",style:{color:"red"}}," show Js code ",-1))]),Ae("div",iy,[zs(Ae("input",{class:"form-check-input",type:"checkbox",id:"label-all","onUpdate:modelValue":A[1]||(A[1]=O=>b.value=O)},null,512),[[Yn,b.value]]),A[8]||(A[8]=Ae("label",{class:"form-check-label",for:"label-all",style:{color:"red"}}," all ",-1))]),(St(!0),Ct(dt,null,Gn(Ki(a),(O,S)=>(St(),Ct("div",{key:S,class:bi({"form-check":!0})},[zs(Ae("input",{class:"form-check-input",type:"checkbox",id:"label"+S,"onUpdate:modelValue":A[2]||(A[2]=W=>o.value=W),value:O},null,8,ny),[[Yn,o.value]]),Ae("label",{class:"form-check-label",for:"label"+S},Ns(O),9,ry)]))),128))],2)]),Ae("div",ay,[Ae("button",{onClick:A[3]||(A[3]=O=>r.value="")},"clear textarea"),zs(Ae("textarea",{rows:"10",style:{height:"500px"},class:"form-control","onUpdate:modelValue":A[4]||(A[4]=O=>r.value=O)},null,512),[[ro,r.value]])]),e.value?(St(),Ct("div",oy,[Ae("div",ly,[Ae("label",cy,[Ae("input",{onInput:A[5]||(A[5]=O=>t.value=!t.value),value:t.value,type:"checkbox",class:"form-check-input"},null,40,uy),A[9]||(A[9]=Tr("show js ast"))])]),t.value?(St(),Ct("div",hy,[Ae("pre",null,Ns(c.value),1)])):(St(),Ct("div",fy,[Je(U,{language:"javascript",code:r.value},null,8,["code"])]))])):tf("",!0),Ae("div",py,[Ae("button",{onClick:f},"copy lua"),Ae("button",{onClick:p},"save as"),Je(U,{id:"luacode",language:"lua",code:d.value},null,8,["code"])])]),Ae("table",dy,[Ae("thead",null,[Ae("tr",null,[Ae("th",my,[A[10]||(A[10]=Ae("h1",null,"take a look at features:",-1)),(St(!0),Ct(dt,null,Gn(u,(O,S)=>(St(),Ct("div",{key:S},[Ae("a",{class:"link-block",href:`#${O.name}`},Ns(O.name),9,yy)]))),128))])])]),Ae("tbody",null,[(St(!0),Ct(dt,null,Gn(u,(O,S)=>(St(),Ct(dt,{key:S},[Ae("tr",null,[Ae("td",gy,[Ae("h3",{id:O.name},Ns(O.name),9,Ty)])]),Ae("tr",null,[Ae("td",by,[zs(Ae("textarea",{class:"td-textarea form-control","onUpdate:modelValue":W=>O.jscode=W},null,8,xy),[[ro,O.jscode]])]),Ae("td",null,[Je(U,{language:"javascript",code:O.jscode,style:{width:"42em"}},null,8,["code"])]),Ae("td",null,[Je(U,{language:"lua",code:O.luacode,style:{width:"42em"}},null,8,["code"])])])],64))),128))])])])}}};function Lc(i){return i instanceof Map?i.clear=i.delete=i.set=function(){throw new Error("map is read-only")}:i instanceof Set&&(i.add=i.clear=i.delete=function(){throw new Error("set is read-only")}),Object.freeze(i),Object.getOwnPropertyNames(i).forEach(t=>{const e=i[t],s=typeof e;(s==="object"||s==="function")&&!Object.isFrozen(e)&&Lc(e)}),i}class Oo{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Ic(i){return i.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function rs(i,...t){const e=Object.create(null);for(const s in i)e[s]=i[s];return t.forEach(function(s){for(const n in s)e[n]=s[n]}),e}const Py="",Do=i=>!!i.scope,Ey=(i,{prefix:t})=>{if(i.startsWith("language:"))return i.replace("language:","language-");if(i.includes(".")){const e=i.split(".");return[`${t}${e.shift()}`,...e.map((s,n)=>`${s}${"_".repeat(n+1)}`)].join(" ")}return`${t}${i}`};class Ay{constructor(t,e){this.buffer="",this.classPrefix=e.classPrefix,t.walk(this)}addText(t){this.buffer+=Ic(t)}openNode(t){if(!Do(t))return;const e=Ey(t.scope,{prefix:this.classPrefix});this.span(e)}closeNode(t){!Do(t)||(this.buffer+=Py)}value(){return this.buffer}span(t){this.buffer+=``}}const Fo=(i={})=>{const t={children:[]};return Object.assign(t,i),t};class ya{constructor(){this.rootNode=Fo(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const e=Fo({scope:t});this.add(e),this.stack.push(e)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,e){return typeof e=="string"?t.addText(e):e.children&&(t.openNode(e),e.children.forEach(s=>this._walk(t,s)),t.closeNode(e)),t}static _collapse(t){typeof t!="string"&&(!t.children||(t.children.every(e=>typeof e=="string")?t.children=[t.children.join("")]:t.children.forEach(e=>{ya._collapse(e)})))}}class wy extends ya{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,e){const s=t.root;e&&(s.scope=`language:${e}`),this.add(s)}toHTML(){return new Ay(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ki(i){return i?typeof i=="string"?i:i.source:null}function Nc(i){return Cs("(?=",i,")")}function Cy(i){return Cs("(?:",i,")*")}function ky(i){return Cs("(?:",i,")?")}function Cs(...i){return i.map(e=>ki(e)).join("")}function vy(i){const t=i[i.length-1];return typeof t=="object"&&t.constructor===Object?(i.splice(i.length-1,1),t):{}}function ga(...i){const t=vy(i);return"("+(t.capture?"":"?:")+i.map(s=>ki(s)).join("|")+")"}function _c(i){return new RegExp(i.toString()+"|").exec("").length-1}function Ly(i,t){const e=i&&i.exec(t);return e&&e.index===0}const Iy=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ta(i,{joinWith:t}){let e=0;return i.map(s=>{e+=1;const n=e;let r=ki(s),a="";for(;r.length>0;){const o=Iy.exec(r);if(!o){a+=r;break}a+=r.substring(0,o.index),r=r.substring(o.index+o[0].length),o[0][0]==="\\"&&o[1]?a+="\\"+String(Number(o[1])+n):(a+=o[0],o[0]==="("&&e++)}return a}).map(s=>`(${s})`).join(t)}const Ny=/\b\B/,Mc="[a-zA-Z]\\w*",ba="[a-zA-Z_]\\w*",Oc="\\b\\d+(\\.\\d+)?",Dc="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Fc="\\b(0b[01]+)",_y="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",My=(i={})=>{const t=/^#![ ]*\//;return i.binary&&(i.begin=Cs(t,/.*\b/,i.binary,/\b.*/)),rs({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,s)=>{e.index!==0&&s.ignoreMatch()}},i)},vi={begin:"\\\\[\\s\\S]",relevance:0},Oy={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[vi]},Dy={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[vi]},Fy={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Mn=function(i,t,e={}){const s=rs({scope:"comment",begin:i,end:t,contains:[]},e);s.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const n=ga("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return s.contains.push({begin:Cs(/[ ]+/,"(",n,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),s},By=Mn("//","$"),Ry=Mn("/\\*","\\*/"),$y=Mn("#","$"),jy={scope:"number",begin:Oc,relevance:0},Uy={scope:"number",begin:Dc,relevance:0},Vy={scope:"number",begin:Fc,relevance:0},Hy={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[vi,{begin:/\[/,end:/\]/,relevance:0,contains:[vi]}]},Gy={scope:"title",begin:Mc,relevance:0},Wy={scope:"title",begin:ba,relevance:0},Ky={begin:"\\.\\s*"+ba,relevance:0},qy=function(i){return Object.assign(i,{"on:begin":(t,e)=>{e.data._beginMatch=t[1]},"on:end":(t,e)=>{e.data._beginMatch!==t[1]&&e.ignoreMatch()}})};var Gi=Object.freeze({__proto__:null,APOS_STRING_MODE:Oy,BACKSLASH_ESCAPE:vi,BINARY_NUMBER_MODE:Vy,BINARY_NUMBER_RE:Fc,COMMENT:Mn,C_BLOCK_COMMENT_MODE:Ry,C_LINE_COMMENT_MODE:By,C_NUMBER_MODE:Uy,C_NUMBER_RE:Dc,END_SAME_AS_BEGIN:qy,HASH_COMMENT_MODE:$y,IDENT_RE:Mc,MATCH_NOTHING_RE:Ny,METHOD_GUARD:Ky,NUMBER_MODE:jy,NUMBER_RE:Oc,PHRASAL_WORDS_MODE:Fy,QUOTE_STRING_MODE:Dy,REGEXP_MODE:Hy,RE_STARTERS_RE:_y,SHEBANG:My,TITLE_MODE:Gy,UNDERSCORE_IDENT_RE:ba,UNDERSCORE_TITLE_MODE:Wy});function zy(i,t){i.input[i.index-1]==="."&&t.ignoreMatch()}function Jy(i,t){i.className!==void 0&&(i.scope=i.className,delete i.className)}function Xy(i,t){!t||!i.beginKeywords||(i.begin="\\b("+i.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",i.__beforeBegin=zy,i.keywords=i.keywords||i.beginKeywords,delete i.beginKeywords,i.relevance===void 0&&(i.relevance=0))}function Yy(i,t){!Array.isArray(i.illegal)||(i.illegal=ga(...i.illegal))}function Zy(i,t){if(!!i.match){if(i.begin||i.end)throw new Error("begin & end are not supported with match");i.begin=i.match,delete i.match}}function Qy(i,t){i.relevance===void 0&&(i.relevance=1)}const eg=(i,t)=>{if(!i.beforeMatch)return;if(i.starts)throw new Error("beforeMatch cannot be used with starts");const e=Object.assign({},i);Object.keys(i).forEach(s=>{delete i[s]}),i.keywords=e.keywords,i.begin=Cs(e.beforeMatch,Nc(e.begin)),i.starts={relevance:0,contains:[Object.assign(e,{endsParent:!0})]},i.relevance=0,delete e.beforeMatch},tg=["of","and","for","in","not","or","if","then","parent","list","value"],sg="keyword";function Bc(i,t,e=sg){const s=Object.create(null);return typeof i=="string"?n(e,i.split(" ")):Array.isArray(i)?n(e,i):Object.keys(i).forEach(function(r){Object.assign(s,Bc(i[r],t,r))}),s;function n(r,a){t&&(a=a.map(o=>o.toLowerCase())),a.forEach(function(o){const l=o.split("|");s[l[0]]=[r,ig(l[0],l[1])]})}}function ig(i,t){return t?Number(t):ng(i)?0:1}function ng(i){return tg.includes(i.toLowerCase())}const Bo={},Ps=i=>{console.error(i)},Ro=(i,...t)=>{console.log(`WARN: ${i}`,...t)},Is=(i,t)=>{Bo[`${i}/${t}`]||(console.log(`Deprecated as of ${i}. ${t}`),Bo[`${i}/${t}`]=!0)},pn=new Error;function Rc(i,t,{key:e}){let s=0;const n=i[e],r={},a={};for(let o=1;o<=t.length;o++)a[o+s]=n[o],r[o+s]=!0,s+=_c(t[o-1]);i[e]=a,i[e]._emit=r,i[e]._multi=!0}function rg(i){if(!!Array.isArray(i.begin)){if(i.skip||i.excludeBegin||i.returnBegin)throw Ps("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),pn;if(typeof i.beginScope!="object"||i.beginScope===null)throw Ps("beginScope must be object"),pn;Rc(i,i.begin,{key:"beginScope"}),i.begin=Ta(i.begin,{joinWith:""})}}function ag(i){if(!!Array.isArray(i.end)){if(i.skip||i.excludeEnd||i.returnEnd)throw Ps("skip, excludeEnd, returnEnd not compatible with endScope: {}"),pn;if(typeof i.endScope!="object"||i.endScope===null)throw Ps("endScope must be object"),pn;Rc(i,i.end,{key:"endScope"}),i.end=Ta(i.end,{joinWith:""})}}function og(i){i.scope&&typeof i.scope=="object"&&i.scope!==null&&(i.beginScope=i.scope,delete i.scope)}function lg(i){og(i),typeof i.beginScope=="string"&&(i.beginScope={_wrap:i.beginScope}),typeof i.endScope=="string"&&(i.endScope={_wrap:i.endScope}),rg(i),ag(i)}function cg(i){function t(a,o){return new RegExp(ki(a),"m"+(i.case_insensitive?"i":"")+(i.unicodeRegex?"u":"")+(o?"g":""))}class e{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(o,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,o]),this.matchAt+=_c(o)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const o=this.regexes.map(l=>l[1]);this.matcherRe=t(Ta(o,{joinWith:"|"}),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(o);if(!l)return null;const h=l.findIndex((d,c)=>c>0&&d!==void 0),u=this.matchIndexes[h];return l.splice(0,h),Object.assign(l,u)}}class s{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(o){if(this.multiRegexes[o])return this.multiRegexes[o];const l=new e;return this.rules.slice(o).forEach(([h,u])=>l.addRule(h,u)),l.compile(),this.multiRegexes[o]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(o,l){this.rules.push([o,l]),l.type==="begin"&&this.count++}exec(o){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let h=l.exec(o);if(this.resumingScanAtSamePosition()&&!(h&&h.index===this.lastIndex)){const u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,h=u.exec(o)}return h&&(this.regexIndex+=h.position+1,this.regexIndex===this.count&&this.considerAll()),h}}function n(a){const o=new s;return a.contains.forEach(l=>o.addRule(l.begin,{rule:l,type:"begin"})),a.terminatorEnd&&o.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&o.addRule(a.illegal,{type:"illegal"}),o}function r(a,o){const l=a;if(a.isCompiled)return l;[Jy,Zy,lg,eg].forEach(u=>u(a,o)),i.compilerExtensions.forEach(u=>u(a,o)),a.__beforeBegin=null,[Xy,Yy,Qy].forEach(u=>u(a,o)),a.isCompiled=!0;let h=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),h=a.keywords.$pattern,delete a.keywords.$pattern),h=h||/\w+/,a.keywords&&(a.keywords=Bc(a.keywords,i.case_insensitive)),l.keywordPatternRe=t(h,!0),o&&(a.begin||(a.begin=/\B|\b/),l.beginRe=t(l.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(l.endRe=t(l.end)),l.terminatorEnd=ki(l.end)||"",a.endsWithParent&&o.terminatorEnd&&(l.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(l.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(u){return ug(u==="self"?a:u)})),a.contains.forEach(function(u){r(u,l)}),a.starts&&r(a.starts,o),l.matcher=n(l),l}if(i.compilerExtensions||(i.compilerExtensions=[]),i.contains&&i.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return i.classNameAliases=rs(i.classNameAliases||{}),r(i)}function $c(i){return i?i.endsWithParent||$c(i.starts):!1}function ug(i){return i.variants&&!i.cachedVariants&&(i.cachedVariants=i.variants.map(function(t){return rs(i,{variants:null},t)})),i.cachedVariants?i.cachedVariants:$c(i)?rs(i,{starts:i.starts?rs(i.starts):null}):Object.isFrozen(i)?rs(i):i}var hg="11.10.0";class fg extends Error{constructor(t,e){super(t),this.name="HTMLInjectionError",this.html=e}}const lr=Ic,$o=rs,jo=Symbol("nomatch"),pg=7,jc=function(i){const t=Object.create(null),e=Object.create(null),s=[];let n=!0;const r="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let o={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:wy};function l(x){return o.noHighlightRe.test(x)}function h(x){let C=x.className+" ";C+=x.parentNode?x.parentNode.className:"";const R=o.languageDetectRe.exec(C);if(R){const ne=se(R[1]);return ne||(Ro(r.replace("{}",R[1])),Ro("Falling back to no-highlight mode for this block.",x)),ne?R[1]:"no-highlight"}return C.split(/\s+/).find(ne=>l(ne)||se(ne))}function u(x,C,R){let ne="",M="";typeof C=="object"?(ne=x,R=C.ignoreIllegals,M=C.language):(Is("10.7.0","highlight(lang, code, ...args) has been deprecated."),Is("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),M=x,ne=C),R===void 0&&(R=!0);const F={code:ne,language:M};ue("before:highlight",F);const N=F.result?F.result:d(F.language,F.code,R);return N.code=F.code,ue("after:highlight",N),N}function d(x,C,R,ne){const M=Object.create(null);function F(J,ee){return J.keywords[ee]}function N(){if(!H.keywords){X.addText(G);return}let J=0;H.keywordPatternRe.lastIndex=0;let ee=H.keywordPatternRe.exec(G),le="";for(;ee;){le+=G.substring(J,ee.index);const xe=B.case_insensitive?ee[0].toLowerCase():ee[0],Pe=F(H,xe);if(Pe){const[_e,Ke]=Pe;if(X.addText(le),le="",M[xe]=(M[xe]||0)+1,M[xe]<=pg&&(ye+=Ke),_e.startsWith("_"))le+=ee[0];else{const ht=B.classNameAliases[_e]||_e;Q(ee[0],ht)}}else le+=ee[0];J=H.keywordPatternRe.lastIndex,ee=H.keywordPatternRe.exec(G)}le+=G.substring(J),X.addText(le)}function D(){if(G==="")return;let J=null;if(typeof H.subLanguage=="string"){if(!t[H.subLanguage]){X.addText(G);return}J=d(H.subLanguage,G,!0,te[H.subLanguage]),te[H.subLanguage]=J._top}else J=f(G,H.subLanguage.length?H.subLanguage:null);H.relevance>0&&(ye+=J.relevance),X.__addSublanguage(J._emitter,J.language)}function K(){H.subLanguage!=null?D():N(),G=""}function Q(J,ee){J!==""&&(X.startScope(ee),X.addText(J),X.endScope())}function Z(J,ee){let le=1;const xe=ee.length-1;for(;le<=xe;){if(!J._emit[le]){le++;continue}const Pe=B.classNameAliases[J[le]]||J[le],_e=ee[le];Pe?Q(_e,Pe):(G=_e,N(),G=""),le++}}function ce(J,ee){return J.scope&&typeof J.scope=="string"&&X.openNode(B.classNameAliases[J.scope]||J.scope),J.beginScope&&(J.beginScope._wrap?(Q(G,B.classNameAliases[J.beginScope._wrap]||J.beginScope._wrap),G=""):J.beginScope._multi&&(Z(J.beginScope,ee),G="")),H=Object.create(J,{parent:{value:H}}),H}function pe(J,ee,le){let xe=Ly(J.endRe,le);if(xe){if(J["on:end"]){const Pe=new Oo(J);J["on:end"](ee,Pe),Pe.isMatchIgnored&&(xe=!1)}if(xe){for(;J.endsParent&&J.parent;)J=J.parent;return J}}if(J.endsWithParent)return pe(J.parent,ee,le)}function ke(J){return H.matcher.regexIndex===0?(G+=J[0],1):(Te=!0,0)}function ve(J){const ee=J[0],le=J.rule,xe=new Oo(le),Pe=[le.__beforeBegin,le["on:begin"]];for(const _e of Pe)if(!!_e&&(_e(J,xe),xe.isMatchIgnored))return ke(ee);return le.skip?G+=ee:(le.excludeBegin&&(G+=ee),K(),!le.returnBegin&&!le.excludeBegin&&(G=ee)),ce(le,J),le.returnBegin?0:ee.length}function Ie(J){const ee=J[0],le=C.substring(J.index),xe=pe(H,J,le);if(!xe)return jo;const Pe=H;H.endScope&&H.endScope._wrap?(K(),Q(ee,H.endScope._wrap)):H.endScope&&H.endScope._multi?(K(),Z(H.endScope,J)):Pe.skip?G+=ee:(Pe.returnEnd||Pe.excludeEnd||(G+=ee),K(),Pe.excludeEnd&&(G=ee));do H.scope&&X.closeNode(),!H.skip&&!H.subLanguage&&(ye+=H.relevance),H=H.parent;while(H!==xe.parent);return xe.starts&&ce(xe.starts,J),Pe.returnEnd?0:ee.length}function E(){const J=[];for(let ee=H;ee!==B;ee=ee.parent)ee.scope&&J.unshift(ee.scope);J.forEach(ee=>X.openNode(ee))}let I={};function _(J,ee){const le=ee&&ee[0];if(G+=J,le==null)return K(),0;if(I.type==="begin"&&ee.type==="end"&&I.index===ee.index&&le===""){if(G+=C.slice(ee.index,ee.index+1),!n){const xe=new Error(`0 width match regex (${x})`);throw xe.languageName=x,xe.badRule=I.rule,xe}return 1}if(I=ee,ee.type==="begin")return ve(ee);if(ee.type==="illegal"&&!R){const xe=new Error('Illegal lexeme "'+le+'" for mode "'+(H.scope||"")+'"');throw xe.mode=H,xe}else if(ee.type==="end"){const xe=Ie(ee);if(xe!==jo)return xe}if(ee.type==="illegal"&&le==="")return 1;if(de>1e5&&de>ee.index*3)throw new Error("potential infinite loop, way more iterations than matches");return G+=le,le.length}const B=se(x);if(!B)throw Ps(r.replace("{}",x)),new Error('Unknown language: "'+x+'"');const $=cg(B);let q="",H=ne||$;const te={},X=new o.__emitter(o);E();let G="",ye=0,ae=0,de=0,Te=!1;try{if(B.__emitTokens)B.__emitTokens(C,X);else{for(H.matcher.considerAll();;){de++,Te?Te=!1:H.matcher.considerAll(),H.matcher.lastIndex=ae;const J=H.matcher.exec(C);if(!J)break;const ee=C.substring(ae,J.index),le=_(ee,J);ae=J.index+le}_(C.substring(ae))}return X.finalize(),q=X.toHTML(),{language:x,value:q,relevance:ye,illegal:!1,_emitter:X,_top:H}}catch(J){if(J.message&&J.message.includes("Illegal"))return{language:x,value:lr(C),illegal:!0,relevance:0,_illegalBy:{message:J.message,index:ae,context:C.slice(ae-100,ae+100),mode:J.mode,resultSoFar:q},_emitter:X};if(n)return{language:x,value:lr(C),illegal:!1,relevance:0,errorRaised:J,_emitter:X,_top:H};throw J}}function c(x){const C={value:lr(x),illegal:!1,relevance:0,_top:a,_emitter:new o.__emitter(o)};return C._emitter.addText(x),C}function f(x,C){C=C||o.languages||Object.keys(t);const R=c(x),ne=C.filter(se).filter(T).map(K=>d(K,x,!1));ne.unshift(R);const M=ne.sort((K,Q)=>{if(K.relevance!==Q.relevance)return Q.relevance-K.relevance;if(K.language&&Q.language){if(se(K.language).supersetOf===Q.language)return 1;if(se(Q.language).supersetOf===K.language)return-1}return 0}),[F,N]=M,D=F;return D.secondBest=N,D}function p(x,C,R){const ne=C&&e[C]||R;x.classList.add("hljs"),x.classList.add(`language-${ne}`)}function m(x){let C=null;const R=h(x);if(l(R))return;if(ue("before:highlightElement",{el:x,language:R}),x.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",x);return}if(x.children.length>0&&(o.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(x)),o.throwUnescapedHTML))throw new fg("One of your code blocks includes unescaped HTML.",x.innerHTML);C=x;const ne=C.textContent,M=R?u(ne,{language:R,ignoreIllegals:!0}):f(ne);x.innerHTML=M.value,x.dataset.highlighted="yes",p(x,R,M.language),x.result={language:M.language,re:M.relevance,relevance:M.relevance},M.secondBest&&(x.secondBest={language:M.secondBest.language,relevance:M.secondBest.relevance}),ue("after:highlightElement",{el:x,result:M,text:ne})}function b(x){o=$o(o,x)}const P=()=>{O(),Is("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function A(){O(),Is("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let U=!1;function O(){if(document.readyState==="loading"){U=!0;return}document.querySelectorAll(o.cssSelector).forEach(m)}function S(){U&&O()}typeof window!="undefined"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",S,!1);function W(x,C){let R=null;try{R=C(i)}catch(ne){if(Ps("Language definition for '{}' could not be registered.".replace("{}",x)),n)Ps(ne);else throw ne;R=a}R.name||(R.name=x),t[x]=R,R.rawDefinition=C.bind(null,i),R.aliases&&ie(R.aliases,{languageName:x})}function fe(x){delete t[x];for(const C of Object.keys(e))e[C]===x&&delete e[C]}function g(){return Object.keys(t)}function se(x){return x=(x||"").toLowerCase(),t[x]||t[e[x]]}function ie(x,{languageName:C}){typeof x=="string"&&(x=[x]),x.forEach(R=>{e[R.toLowerCase()]=C})}function T(x){const C=se(x);return C&&!C.disableAutodetect}function k(x){x["before:highlightBlock"]&&!x["before:highlightElement"]&&(x["before:highlightElement"]=C=>{x["before:highlightBlock"](Object.assign({block:C.el},C))}),x["after:highlightBlock"]&&!x["after:highlightElement"]&&(x["after:highlightElement"]=C=>{x["after:highlightBlock"](Object.assign({block:C.el},C))})}function Y(x){k(x),s.push(x)}function z(x){const C=s.indexOf(x);C!==-1&&s.splice(C,1)}function ue(x,C){const R=x;s.forEach(function(ne){ne[R]&&ne[R](C)})}function L(x){return Is("10.7.0","highlightBlock will be removed entirely in v12.0"),Is("10.7.0","Please use highlightElement now."),m(x)}Object.assign(i,{highlight:u,highlightAuto:f,highlightAll:O,highlightElement:m,highlightBlock:L,configure:b,initHighlighting:P,initHighlightingOnLoad:A,registerLanguage:W,unregisterLanguage:fe,listLanguages:g,getLanguage:se,registerAliases:ie,autoDetection:T,inherit:$o,addPlugin:Y,removePlugin:z}),i.debugMode=function(){n=!1},i.safeMode=function(){n=!0},i.versionString=hg,i.regex={concat:Cs,lookahead:Nc,either:ga,optional:ky,anyNumberOfTimes:Cy};for(const x in Gi)typeof Gi[x]=="object"&&Lc(Gi[x]);return Object.assign(i,Gi),i},Ws=jc({});Ws.newInstance=()=>jc({});var dg=Ws;Ws.HighlightJS=Ws;Ws.default=Ws;var Ti=dg;const Uo="[A-Za-z$_][0-9A-Za-z$_]*",mg=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],yg=["true","false","null","undefined","NaN","Infinity"],Uc=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Vc=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Hc=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],gg=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Tg=[].concat(Hc,Uc,Vc);function bg(i){const t=i.regex,e=(C,{after:R})=>{const ne="",end:""},r=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(C,R)=>{const ne=C[0].length+C.index,M=C.input[ne];if(M==="<"||M===","){R.ignoreMatch();return}M===">"&&(e(C,{after:ne})||R.ignoreMatch());let F;const N=C.input.substring(ne);if(F=N.match(/^\s*=/)){R.ignoreMatch();return}if((F=N.match(/^\s+extends\s+/))&&F.index===0){R.ignoreMatch();return}}},o={$pattern:Uo,keyword:mg,literal:yg,built_in:Tg,"variable.language":gg},l="[0-9](_?[0-9])*",h=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${h})|\\.)?|(${h}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},c={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[i.BACKSLASH_ESCAPE,c],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[i.BACKSLASH_ESCAPE,c],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[i.BACKSLASH_ESCAPE,c],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[i.BACKSLASH_ESCAPE,c]},P=i.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),A={className:"comment",variants:[P,i.C_BLOCK_COMMENT_MODE,i.C_LINE_COMMENT_MODE]},U=[i.APOS_STRING_MODE,i.QUOTE_STRING_MODE,f,p,m,b,{match:/\$\d+/},d];c.contains=U.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(U)});const O=[].concat(A,c.contains),S=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(O)}]),W={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:S},fe={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,t.concat(s,"(",t.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},g={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Uc,...Vc]}},se={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ie={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[W],illegal:/%/},T={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function k(C){return t.concat("(?!",C.join("|"),")")}const Y={match:t.concat(/\b/,k([...Hc,"super","import"].map(C=>`${C}\\s*\\(`)),s,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},z={begin:t.concat(/\./,t.lookahead(t.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ue={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},W]},L="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+i.UNDERSCORE_IDENT_RE+")\\s*=>",x={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(L)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[W]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:g},illegal:/#(?![$_A-z])/,contains:[i.SHEBANG({label:"shebang",binary:"node",relevance:5}),se,i.APOS_STRING_MODE,i.QUOTE_STRING_MODE,f,p,m,b,A,{match:/\$\d+/},d,g,{className:"attr",begin:s+t.lookahead(":"),relevance:0},x,{begin:"("+i.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,i.REGEXP_MODE,{className:"function",begin:L,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:i.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n.begin,end:n.end},{match:r},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},ie,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+i.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[W,i.inherit(i.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},z,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[W]},Y,T,fe,ue,{match:/\$[(.]/}]}}function xg(i){const t="\\[=*\\[",e="\\]=*\\]",s={begin:t,end:e,contains:["self"]},n=[i.COMMENT("--(?!"+t+")","$"),i.COMMENT("--"+t,e,{contains:[s],relevance:10})];return{name:"Lua",keywords:{$pattern:i.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:n.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[i.inherit(i.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:n}].concat(n)},i.C_NUMBER_MODE,i.APOS_STRING_MODE,i.QUOTE_STRING_MODE,{className:"string",begin:t,end:e,contains:[s],relevance:5}])}}var Vo=rh({props:{code:{type:String,required:!0},language:{type:String,default:""},autodetect:{type:Boolean,default:!0},ignoreIllegals:{type:Boolean,default:!0}},setup:function(i){var t=gs(i.language);pi(function(){return i.language},function(n){t.value=n});var e=Ht(function(){return i.autodetect||!t.value}),s=Ht(function(){return!e.value&&!Ti.getLanguage(t.value)});return{className:Ht(function(){return s.value?"":"hljs "+t.value}),highlightedCode:Ht(function(){var n;if(s.value)return console.warn('The language "'+t.value+'" you specified could not be found.'),i.code.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'");if(e.value){var r=Ti.highlightAuto(i.code);return t.value=(n=r.language)!==null&&n!==void 0?n:"",r.value}return(r=Ti.highlight(i.code,{language:t.value,ignoreIllegals:i.ignoreIllegals})).value})}},render:function(){return Ka("pre",{},[Ka("code",{class:this.className,innerHTML:this.highlightedCode})])}}),Sg={install:function(i){i.component("highlightjs",Vo)},component:Vo};const Gc=Bf(Sy);Ti.registerLanguage("javascript",bg);Ti.registerLanguage("lua",xg);Gc.use(Sg);Gc.mount("#app")});export default Pg(); diff --git a/index.html b/index.html index e8a4e56..a9884aa 100644 --- a/index.html +++ b/index.html @@ -15,7 +15,7 @@ gtag('config', 'G-FEYV3C3QK5'); - +