builder.io 1.11.43 → 1.11.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/node/index.mjs CHANGED
@@ -1,45 +1,47 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- var fa=Object.create;var Is=Object.defineProperty;var da=Object.getOwnPropertyDescriptor;var ma=Object.getOwnPropertyNames;var ya=Object.getPrototypeOf,ga=Object.prototype.hasOwnProperty;var he=(i,s)=>()=>(s||i((s={exports:{}}).exports,s),s.exports),xa=(i,s)=>{for(var e in s)Is(i,e,{get:s[e],enumerable:!0})},ba=(i,s,e,t)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of ma(s))!ga.call(i,r)&&r!==e&&Is(i,r,{get:()=>s[r],enumerable:!(t=da(s,r))||t.enumerable});return i};var Ns=(i,s,e)=>(e=i!=null?fa(ya(i)):{},ba(s||!i||!i.__esModule?Is(e,"default",{value:i,enumerable:!0}):e,i));var Hr=he((fu,Kr)=>{"use strict";Kr.exports=function(){if(process.env.npm_config_user_agent)return Ta(process.env.npm_config_user_agent)};function Ta(i){let s=i.split(" ")[0],e=s.lastIndexOf("/"),t=s.substring(0,e);return{name:t==="npminstall"?"cnpm":t,version:s.substring(e+1)}}});var ei=he(Ls=>{var Zr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Ls.encode=function(i){if(0<=i&&i<Zr.length)return Zr[i];throw new TypeError("Must be between 0 and 63: "+i)};Ls.decode=function(i){var s=65,e=90,t=97,r=122,n=48,a=57,o=43,l=47,c=26,u=52;return s<=i&&i<=e?i-s:t<=i&&i<=r?i-t+c:n<=i&&i<=a?i-n+u:i==o?62:i==l?63:-1}});var Ms=he(Os=>{var ti=ei(),Ds=5,si=1<<Ds,ri=si-1,ii=si;function Ea(i){return i<0?(-i<<1)+1:(i<<1)+0}function Aa(i){var s=(i&1)===1,e=i>>1;return s?-e:e}Os.encode=function(s){var e="",t,r=Ea(s);do t=r&ri,r>>>=Ds,r>0&&(t|=ii),e+=ti.encode(t);while(r>0);return e};Os.decode=function(s,e,t){var r=s.length,n=0,a=0,o,l;do{if(e>=r)throw new Error("Expected more digits in base 64 VLQ value.");if(l=ti.decode(s.charCodeAt(e++)),l===-1)throw new Error("Invalid base64 digit: "+s.charAt(e-1));o=!!(l&ii),l&=ri,n=n+(l<<a),a+=Ds}while(o);t.value=Aa(n),t.rest=e}});var Ye=he(ee=>{function wa(i,s,e){if(s in i)return i[s];if(arguments.length===3)return e;throw new Error('"'+s+'" is a required argument.')}ee.getArg=wa;var ni=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,va=/^data:.+\,.+$/;function xt(i){var s=i.match(ni);return s?{scheme:s[1],auth:s[2],host:s[3],port:s[4],path:s[5]}:null}ee.urlParse=xt;function Qe(i){var s="";return i.scheme&&(s+=i.scheme+":"),s+="//",i.auth&&(s+=i.auth+"@"),i.host&&(s+=i.host),i.port&&(s+=":"+i.port),i.path&&(s+=i.path),s}ee.urlGenerate=Qe;var Ca=32;function Ia(i){var s=[];return function(e){for(var t=0;t<s.length;t++)if(s[t].input===e){var r=s[0];return s[0]=s[t],s[t]=r,s[0].result}var n=i(e);return s.unshift({input:e,result:n}),s.length>Ca&&s.pop(),n}}var Fs=Ia(function(s){var e=s,t=xt(s);if(t){if(!t.path)return s;e=t.path}for(var r=ee.isAbsolute(e),n=[],a=0,o=0;;)if(a=o,o=e.indexOf("/",a),o===-1){n.push(e.slice(a));break}else for(n.push(e.slice(a,o));o<e.length&&e[o]==="/";)o++;for(var l,c=0,o=n.length-1;o>=0;o--)l=n[o],l==="."?n.splice(o,1):l===".."?c++:c>0&&(l===""?(n.splice(o+1,c),c=0):(n.splice(o,2),c--));return e=n.join("/"),e===""&&(e=r?"/":"."),t?(t.path=e,Qe(t)):e});ee.normalize=Fs;function ai(i,s){i===""&&(i="."),s===""&&(s=".");var e=xt(s),t=xt(i);if(t&&(i=t.path||"/"),e&&!e.scheme)return t&&(e.scheme=t.scheme),Qe(e);if(e||s.match(va))return s;if(t&&!t.host&&!t.path)return t.host=s,Qe(t);var r=s.charAt(0)==="/"?s:Fs(i.replace(/\/+$/,"")+"/"+s);return t?(t.path=r,Qe(t)):r}ee.join=ai;ee.isAbsolute=function(i){return i.charAt(0)==="/"||ni.test(i)};function Na(i,s){i===""&&(i="."),i=i.replace(/\/$/,"");for(var e=0;s.indexOf(i+"/")!==0;){var t=i.lastIndexOf("/");if(t<0||(i=i.slice(0,t),i.match(/^([^\/]+:\/)?\/*$/)))return s;++e}return Array(e+1).join("../")+s.substr(i.length+1)}ee.relative=Na;var oi=function(){var i=Object.create(null);return!("__proto__"in i)}();function li(i){return i}function ka(i){return ci(i)?"$"+i:i}ee.toSetString=oi?li:ka;function La(i){return ci(i)?i.slice(1):i}ee.fromSetString=oi?li:La;function ci(i){if(!i)return!1;var s=i.length;if(s<9||i.charCodeAt(s-1)!==95||i.charCodeAt(s-2)!==95||i.charCodeAt(s-3)!==111||i.charCodeAt(s-4)!==116||i.charCodeAt(s-5)!==111||i.charCodeAt(s-6)!==114||i.charCodeAt(s-7)!==112||i.charCodeAt(s-8)!==95||i.charCodeAt(s-9)!==95)return!1;for(var e=s-10;e>=0;e--)if(i.charCodeAt(e)!==36)return!1;return!0}function Da(i,s,e){var t=ke(i.source,s.source);return t!==0||(t=i.originalLine-s.originalLine,t!==0)||(t=i.originalColumn-s.originalColumn,t!==0||e)||(t=i.generatedColumn-s.generatedColumn,t!==0)||(t=i.generatedLine-s.generatedLine,t!==0)?t:ke(i.name,s.name)}ee.compareByOriginalPositions=Da;function Oa(i,s,e){var t;return t=i.originalLine-s.originalLine,t!==0||(t=i.originalColumn-s.originalColumn,t!==0||e)||(t=i.generatedColumn-s.generatedColumn,t!==0)||(t=i.generatedLine-s.generatedLine,t!==0)?t:ke(i.name,s.name)}ee.compareByOriginalPositionsNoSource=Oa;function Ma(i,s,e){var t=i.generatedLine-s.generatedLine;return t!==0||(t=i.generatedColumn-s.generatedColumn,t!==0||e)||(t=ke(i.source,s.source),t!==0)||(t=i.originalLine-s.originalLine,t!==0)||(t=i.originalColumn-s.originalColumn,t!==0)?t:ke(i.name,s.name)}ee.compareByGeneratedPositionsDeflated=Ma;function Fa(i,s,e){var t=i.generatedColumn-s.generatedColumn;return t!==0||e||(t=ke(i.source,s.source),t!==0)||(t=i.originalLine-s.originalLine,t!==0)||(t=i.originalColumn-s.originalColumn,t!==0)?t:ke(i.name,s.name)}ee.compareByGeneratedPositionsDeflatedNoLine=Fa;function ke(i,s){return i===s?0:i===null?1:s===null?-1:i>s?1:-1}function Ba(i,s){var e=i.generatedLine-s.generatedLine;return e!==0||(e=i.generatedColumn-s.generatedColumn,e!==0)||(e=ke(i.source,s.source),e!==0)||(e=i.originalLine-s.originalLine,e!==0)||(e=i.originalColumn-s.originalColumn,e!==0)?e:ke(i.name,s.name)}ee.compareByGeneratedPositionsInflated=Ba;function _a(i){return JSON.parse(i.replace(/^\)]}'[^\n]*\n/,""))}ee.parseSourceMapInput=_a;function ja(i,s,e){if(s=s||"",i&&(i[i.length-1]!=="/"&&s[0]!=="/"&&(i+="/"),s=i+s),e){var t=xt(e);if(!t)throw new Error("sourceMapURL could not be parsed");if(t.path){var r=t.path.lastIndexOf("/");r>=0&&(t.path=t.path.substring(0,r+1))}s=ai(Qe(t),s)}return Fs(s)}ee.computeSourceURL=ja});var js=he(ui=>{var Bs=Ye(),_s=Object.prototype.hasOwnProperty,qe=typeof Map<"u";function Le(){this._array=[],this._set=qe?new Map:Object.create(null)}Le.fromArray=function(s,e){for(var t=new Le,r=0,n=s.length;r<n;r++)t.add(s[r],e);return t};Le.prototype.size=function(){return qe?this._set.size:Object.getOwnPropertyNames(this._set).length};Le.prototype.add=function(s,e){var t=qe?s:Bs.toSetString(s),r=qe?this.has(s):_s.call(this._set,t),n=this._array.length;(!r||e)&&this._array.push(s),r||(qe?this._set.set(s,n):this._set[t]=n)};Le.prototype.has=function(s){if(qe)return this._set.has(s);var e=Bs.toSetString(s);return _s.call(this._set,e)};Le.prototype.indexOf=function(s){if(qe){var e=this._set.get(s);if(e>=0)return e}else{var t=Bs.toSetString(s);if(_s.call(this._set,t))return this._set[t]}throw new Error('"'+s+'" is not in the set.')};Le.prototype.at=function(s){if(s>=0&&s<this._array.length)return this._array[s];throw new Error("No element indexed by "+s)};Le.prototype.toArray=function(){return this._array.slice()};ui.ArraySet=Le});var fi=he(pi=>{var hi=Ye();function Ra(i,s){var e=i.generatedLine,t=s.generatedLine,r=i.generatedColumn,n=s.generatedColumn;return t>e||t==e&&n>=r||hi.compareByGeneratedPositionsInflated(i,s)<=0}function Wt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Wt.prototype.unsortedForEach=function(s,e){this._array.forEach(s,e)};Wt.prototype.add=function(s){Ra(this._last,s)?(this._last=s,this._array.push(s)):(this._sorted=!1,this._array.push(s))};Wt.prototype.toArray=function(){return this._sorted||(this._array.sort(hi.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};pi.MappingList=Wt});var Rs=he(di=>{var bt=Ms(),Q=Ye(),Jt=js().ArraySet,Ua=fi().MappingList;function ye(i){i||(i={}),this._file=Q.getArg(i,"file",null),this._sourceRoot=Q.getArg(i,"sourceRoot",null),this._skipValidation=Q.getArg(i,"skipValidation",!1),this._ignoreInvalidMapping=Q.getArg(i,"ignoreInvalidMapping",!1),this._sources=new Jt,this._names=new Jt,this._mappings=new Ua,this._sourcesContents=null}ye.prototype._version=3;ye.fromSourceMap=function(s,e){var t=s.sourceRoot,r=new ye(Object.assign(e||{},{file:s.file,sourceRoot:t}));return s.eachMapping(function(n){var a={generated:{line:n.generatedLine,column:n.generatedColumn}};n.source!=null&&(a.source=n.source,t!=null&&(a.source=Q.relative(t,a.source)),a.original={line:n.originalLine,column:n.originalColumn},n.name!=null&&(a.name=n.name)),r.addMapping(a)}),s.sources.forEach(function(n){var a=n;t!==null&&(a=Q.relative(t,n)),r._sources.has(a)||r._sources.add(a);var o=s.sourceContentFor(n);o!=null&&r.setSourceContent(n,o)}),r};ye.prototype.addMapping=function(s){var e=Q.getArg(s,"generated"),t=Q.getArg(s,"original",null),r=Q.getArg(s,"source",null),n=Q.getArg(s,"name",null);!this._skipValidation&&this._validateMapping(e,t,r,n)===!1||(r!=null&&(r=String(r),this._sources.has(r)||this._sources.add(r)),n!=null&&(n=String(n),this._names.has(n)||this._names.add(n)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:t!=null&&t.line,originalColumn:t!=null&&t.column,source:r,name:n}))};ye.prototype.setSourceContent=function(s,e){var t=s;this._sourceRoot!=null&&(t=Q.relative(this._sourceRoot,t)),e!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Q.toSetString(t)]=e):this._sourcesContents&&(delete this._sourcesContents[Q.toSetString(t)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};ye.prototype.applySourceMap=function(s,e,t){var r=e;if(e==null){if(s.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);r=s.file}var n=this._sourceRoot;n!=null&&(r=Q.relative(n,r));var a=new Jt,o=new Jt;this._mappings.unsortedForEach(function(l){if(l.source===r&&l.originalLine!=null){var c=s.originalPositionFor({line:l.originalLine,column:l.originalColumn});c.source!=null&&(l.source=c.source,t!=null&&(l.source=Q.join(t,l.source)),n!=null&&(l.source=Q.relative(n,l.source)),l.originalLine=c.line,l.originalColumn=c.column,c.name!=null&&(l.name=c.name))}var u=l.source;u!=null&&!a.has(u)&&a.add(u);var h=l.name;h!=null&&!o.has(h)&&o.add(h)},this),this._sources=a,this._names=o,s.sources.forEach(function(l){var c=s.sourceContentFor(l);c!=null&&(t!=null&&(l=Q.join(t,l)),n!=null&&(l=Q.relative(n,l)),this.setSourceContent(l,c))},this)};ye.prototype._validateMapping=function(s,e,t,r){if(e&&typeof e.line!="number"&&typeof e.column!="number"){var n="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(n),!1;throw new Error(n)}if(!(s&&"line"in s&&"column"in s&&s.line>0&&s.column>=0&&!e&&!t&&!r)){if(s&&"line"in s&&"column"in s&&e&&"line"in e&&"column"in e&&s.line>0&&s.column>=0&&e.line>0&&e.column>=0&&t)return;var n="Invalid mapping: "+JSON.stringify({generated:s,source:t,original:e,name:r});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(n),!1;throw new Error(n)}};ye.prototype._serializeMappings=function(){for(var s=0,e=1,t=0,r=0,n=0,a=0,o="",l,c,u,h,f=this._mappings.toArray(),d=0,p=f.length;d<p;d++){if(c=f[d],l="",c.generatedLine!==e)for(s=0;c.generatedLine!==e;)l+=";",e++;else if(d>0){if(!Q.compareByGeneratedPositionsInflated(c,f[d-1]))continue;l+=","}l+=bt.encode(c.generatedColumn-s),s=c.generatedColumn,c.source!=null&&(h=this._sources.indexOf(c.source),l+=bt.encode(h-a),a=h,l+=bt.encode(c.originalLine-1-r),r=c.originalLine-1,l+=bt.encode(c.originalColumn-t),t=c.originalColumn,c.name!=null&&(u=this._names.indexOf(c.name),l+=bt.encode(u-n),n=u)),o+=l}return o};ye.prototype._generateSourcesContent=function(s,e){return s.map(function(t){if(!this._sourcesContents)return null;e!=null&&(t=Q.relative(e,t));var r=Q.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)};ye.prototype.toJSON=function(){var s={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(s.file=this._file),this._sourceRoot!=null&&(s.sourceRoot=this._sourceRoot),this._sourcesContents&&(s.sourcesContent=this._generateSourcesContent(s.sources,s.sourceRoot)),s};ye.prototype.toString=function(){return JSON.stringify(this.toJSON())};di.SourceMapGenerator=ye});var mi=he(ze=>{ze.GREATEST_LOWER_BOUND=1;ze.LEAST_UPPER_BOUND=2;function Us(i,s,e,t,r,n){var a=Math.floor((s-i)/2)+i,o=r(e,t[a],!0);return o===0?a:o>0?s-a>1?Us(a,s,e,t,r,n):n==ze.LEAST_UPPER_BOUND?s<t.length?s:-1:a:a-i>1?Us(i,a,e,t,r,n):n==ze.LEAST_UPPER_BOUND?a:i<0?-1:i}ze.search=function(s,e,t,r){if(e.length===0)return-1;var n=Us(-1,e.length,s,e,t,r||ze.GREATEST_LOWER_BOUND);if(n<0)return-1;for(;n-1>=0&&t(e[n],e[n-1],!0)===0;)--n;return n}});var xi=he(gi=>{function Va(i){function s(r,n,a){var o=r[n];r[n]=r[a],r[a]=o}function e(r,n){return Math.round(r+Math.random()*(n-r))}function t(r,n,a,o){if(a<o){var l=e(a,o),c=a-1;s(r,l,o);for(var u=r[o],h=a;h<o;h++)n(r[h],u,!1)<=0&&(c+=1,s(r,c,h));s(r,c+1,h);var f=c+1;t(r,n,a,f-1),t(r,n,f+1,o)}}return t}function $a(i){let s=Va.toString();return new Function(`return ${s}`)()(i)}var yi=new WeakMap;gi.quickSort=function(i,s,e=0){let t=yi.get(s);t===void 0&&(t=$a(s),yi.set(s,t)),t(i,s,e,i.length-1)}});var Pi=he(Kt=>{var N=Ye(),$s=mi(),Ze=js().ArraySet,qa=Ms(),Tt=xi().quickSort;function K(i,s){var e=i;return typeof i=="string"&&(e=N.parseSourceMapInput(i)),e.sections!=null?new be(e,s):new te(e,s)}K.fromSourceMap=function(i,s){return te.fromSourceMap(i,s)};K.prototype._version=3;K.prototype.__generatedMappings=null;Object.defineProperty(K.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});K.prototype.__originalMappings=null;Object.defineProperty(K.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});K.prototype._charIsMappingSeparator=function(s,e){var t=s.charAt(e);return t===";"||t===","};K.prototype._parseMappings=function(s,e){throw new Error("Subclasses must implement _parseMappings")};K.GENERATED_ORDER=1;K.ORIGINAL_ORDER=2;K.GREATEST_LOWER_BOUND=1;K.LEAST_UPPER_BOUND=2;K.prototype.eachMapping=function(s,e,t){var r=e||null,n=t||K.GENERATED_ORDER,a;switch(n){case K.GENERATED_ORDER:a=this._generatedMappings;break;case K.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var o=this.sourceRoot,l=s.bind(r),c=this._names,u=this._sources,h=this._sourceMapURL,f=0,d=a.length;f<d;f++){var p=a[f],g=p.source===null?null:u.at(p.source);g!==null&&(g=N.computeSourceURL(o,g,h)),l({source:g,generatedLine:p.generatedLine,generatedColumn:p.generatedColumn,originalLine:p.originalLine,originalColumn:p.originalColumn,name:p.name===null?null:c.at(p.name)})}};K.prototype.allGeneratedPositionsFor=function(s){var e=N.getArg(s,"line"),t={source:N.getArg(s,"source"),originalLine:e,originalColumn:N.getArg(s,"column",0)};if(t.source=this._findSourceIndex(t.source),t.source<0)return[];var r=[],n=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",N.compareByOriginalPositions,$s.LEAST_UPPER_BOUND);if(n>=0){var a=this._originalMappings[n];if(s.column===void 0)for(var o=a.originalLine;a&&a.originalLine===o;)r.push({line:N.getArg(a,"generatedLine",null),column:N.getArg(a,"generatedColumn",null),lastColumn:N.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++n];else for(var l=a.originalColumn;a&&a.originalLine===e&&a.originalColumn==l;)r.push({line:N.getArg(a,"generatedLine",null),column:N.getArg(a,"generatedColumn",null),lastColumn:N.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++n]}return r};Kt.SourceMapConsumer=K;function te(i,s){var e=i;typeof i=="string"&&(e=N.parseSourceMapInput(i));var t=N.getArg(e,"version"),r=N.getArg(e,"sources"),n=N.getArg(e,"names",[]),a=N.getArg(e,"sourceRoot",null),o=N.getArg(e,"sourcesContent",null),l=N.getArg(e,"mappings"),c=N.getArg(e,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);a&&(a=N.normalize(a)),r=r.map(String).map(N.normalize).map(function(u){return a&&N.isAbsolute(a)&&N.isAbsolute(u)?N.relative(a,u):u}),this._names=Ze.fromArray(n.map(String),!0),this._sources=Ze.fromArray(r,!0),this._absoluteSources=this._sources.toArray().map(function(u){return N.computeSourceURL(a,u,s)}),this.sourceRoot=a,this.sourcesContent=o,this._mappings=l,this._sourceMapURL=s,this.file=c}te.prototype=Object.create(K.prototype);te.prototype.consumer=K;te.prototype._findSourceIndex=function(i){var s=i;if(this.sourceRoot!=null&&(s=N.relative(this.sourceRoot,s)),this._sources.has(s))return this._sources.indexOf(s);var e;for(e=0;e<this._absoluteSources.length;++e)if(this._absoluteSources[e]==i)return e;return-1};te.fromSourceMap=function(s,e){var t=Object.create(te.prototype),r=t._names=Ze.fromArray(s._names.toArray(),!0),n=t._sources=Ze.fromArray(s._sources.toArray(),!0);t.sourceRoot=s._sourceRoot,t.sourcesContent=s._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=s._file,t._sourceMapURL=e,t._absoluteSources=t._sources.toArray().map(function(d){return N.computeSourceURL(t.sourceRoot,d,e)});for(var a=s._mappings.toArray().slice(),o=t.__generatedMappings=[],l=t.__originalMappings=[],c=0,u=a.length;c<u;c++){var h=a[c],f=new Ti;f.generatedLine=h.generatedLine,f.generatedColumn=h.generatedColumn,h.source&&(f.source=n.indexOf(h.source),f.originalLine=h.originalLine,f.originalColumn=h.originalColumn,h.name&&(f.name=r.indexOf(h.name)),l.push(f)),o.push(f)}return Tt(t.__originalMappings,N.compareByOriginalPositions),t};te.prototype._version=3;Object.defineProperty(te.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function Ti(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var Vs=N.compareByGeneratedPositionsDeflatedNoLine;function bi(i,s){let e=i.length,t=i.length-s;if(!(t<=1))if(t==2){let r=i[s],n=i[s+1];Vs(r,n)>0&&(i[s]=n,i[s+1]=r)}else if(t<20)for(let r=s;r<e;r++)for(let n=r;n>s;n--){let a=i[n-1],o=i[n];if(Vs(a,o)<=0)break;i[n-1]=o,i[n]=a}else Tt(i,Vs,s)}te.prototype._parseMappings=function(s,e){var t=1,r=0,n=0,a=0,o=0,l=0,c=s.length,u=0,h={},f={},d=[],p=[],g,y,b,P,k;let T=0;for(;u<c;)if(s.charAt(u)===";")t++,u++,r=0,bi(p,T),T=p.length;else if(s.charAt(u)===",")u++;else{for(g=new Ti,g.generatedLine=t,P=u;P<c&&!this._charIsMappingSeparator(s,P);P++);for(y=s.slice(u,P),b=[];u<P;)qa.decode(s,u,f),k=f.value,u=f.rest,b.push(k);if(b.length===2)throw new Error("Found a source, but no line and column");if(b.length===3)throw new Error("Found a source and line, but no column");if(g.generatedColumn=r+b[0],r=g.generatedColumn,b.length>1&&(g.source=o+b[1],o+=b[1],g.originalLine=n+b[2],n=g.originalLine,g.originalLine+=1,g.originalColumn=a+b[3],a=g.originalColumn,b.length>4&&(g.name=l+b[4],l+=b[4])),p.push(g),typeof g.originalLine=="number"){let A=g.source;for(;d.length<=A;)d.push(null);d[A]===null&&(d[A]=[]),d[A].push(g)}}bi(p,T),this.__generatedMappings=p;for(var E=0;E<d.length;E++)d[E]!=null&&Tt(d[E],N.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...d)};te.prototype._findMapping=function(s,e,t,r,n,a){if(s[t]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+s[t]);if(s[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+s[r]);return $s.search(s,e,n,a)};te.prototype.computeColumnSpans=function(){for(var s=0;s<this._generatedMappings.length;++s){var e=this._generatedMappings[s];if(s+1<this._generatedMappings.length){var t=this._generatedMappings[s+1];if(e.generatedLine===t.generatedLine){e.lastGeneratedColumn=t.generatedColumn-1;continue}}e.lastGeneratedColumn=1/0}};te.prototype.originalPositionFor=function(s){var e={generatedLine:N.getArg(s,"line"),generatedColumn:N.getArg(s,"column")},t=this._findMapping(e,this._generatedMappings,"generatedLine","generatedColumn",N.compareByGeneratedPositionsDeflated,N.getArg(s,"bias",K.GREATEST_LOWER_BOUND));if(t>=0){var r=this._generatedMappings[t];if(r.generatedLine===e.generatedLine){var n=N.getArg(r,"source",null);n!==null&&(n=this._sources.at(n),n=N.computeSourceURL(this.sourceRoot,n,this._sourceMapURL));var a=N.getArg(r,"name",null);return a!==null&&(a=this._names.at(a)),{source:n,line:N.getArg(r,"originalLine",null),column:N.getArg(r,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}};te.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(s){return s==null}):!1};te.prototype.sourceContentFor=function(s,e){if(!this.sourcesContent)return null;var t=this._findSourceIndex(s);if(t>=0)return this.sourcesContent[t];var r=s;this.sourceRoot!=null&&(r=N.relative(this.sourceRoot,r));var n;if(this.sourceRoot!=null&&(n=N.urlParse(this.sourceRoot))){var a=r.replace(/^file:\/\//,"");if(n.scheme=="file"&&this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];if((!n.path||n.path=="/")&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(e)return null;throw new Error('"'+r+'" is not in the SourceMap.')};te.prototype.generatedPositionFor=function(s){var e=N.getArg(s,"source");if(e=this._findSourceIndex(e),e<0)return{line:null,column:null,lastColumn:null};var t={source:e,originalLine:N.getArg(s,"line"),originalColumn:N.getArg(s,"column")},r=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",N.compareByOriginalPositions,N.getArg(s,"bias",K.GREATEST_LOWER_BOUND));if(r>=0){var n=this._originalMappings[r];if(n.source===t.source)return{line:N.getArg(n,"generatedLine",null),column:N.getArg(n,"generatedColumn",null),lastColumn:N.getArg(n,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Kt.BasicSourceMapConsumer=te;function be(i,s){var e=i;typeof i=="string"&&(e=N.parseSourceMapInput(i));var t=N.getArg(e,"version"),r=N.getArg(e,"sections");if(t!=this._version)throw new Error("Unsupported version: "+t);this._sources=new Ze,this._names=new Ze;var n={line:-1,column:0};this._sections=r.map(function(a){if(a.url)throw new Error("Support for url field in sections not implemented.");var o=N.getArg(a,"offset"),l=N.getArg(o,"line"),c=N.getArg(o,"column");if(l<n.line||l===n.line&&c<n.column)throw new Error("Section offsets must be ordered and non-overlapping.");return n=o,{generatedOffset:{generatedLine:l+1,generatedColumn:c+1},consumer:new K(N.getArg(a,"map"),s)}})}be.prototype=Object.create(K.prototype);be.prototype.constructor=K;be.prototype._version=3;Object.defineProperty(be.prototype,"sources",{get:function(){for(var i=[],s=0;s<this._sections.length;s++)for(var e=0;e<this._sections[s].consumer.sources.length;e++)i.push(this._sections[s].consumer.sources[e]);return i}});be.prototype.originalPositionFor=function(s){var e={generatedLine:N.getArg(s,"line"),generatedColumn:N.getArg(s,"column")},t=$s.search(e,this._sections,function(n,a){var o=n.generatedLine-a.generatedOffset.generatedLine;return o||n.generatedColumn-a.generatedOffset.generatedColumn}),r=this._sections[t];return r?r.consumer.originalPositionFor({line:e.generatedLine-(r.generatedOffset.generatedLine-1),column:e.generatedColumn-(r.generatedOffset.generatedLine===e.generatedLine?r.generatedOffset.generatedColumn-1:0),bias:s.bias}):{source:null,line:null,column:null,name:null}};be.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(s){return s.consumer.hasContentsOfAllSources()})};be.prototype.sourceContentFor=function(s,e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t],n=r.consumer.sourceContentFor(s,!0);if(n||n==="")return n}if(e)return null;throw new Error('"'+s+'" is not in the SourceMap.')};be.prototype.generatedPositionFor=function(s){for(var e=0;e<this._sections.length;e++){var t=this._sections[e];if(t.consumer._findSourceIndex(N.getArg(s,"source"))!==-1){var r=t.consumer.generatedPositionFor(s);if(r){var n={line:r.line+(t.generatedOffset.generatedLine-1),column:r.column+(t.generatedOffset.generatedLine===r.line?t.generatedOffset.generatedColumn-1:0)};return n}}}return{line:null,column:null}};be.prototype._parseMappings=function(s,e){this.__generatedMappings=[],this.__originalMappings=[];for(var t=0;t<this._sections.length;t++)for(var r=this._sections[t],n=r.consumer._generatedMappings,a=0;a<n.length;a++){var o=n[a],l=r.consumer._sources.at(o.source);l!==null&&(l=N.computeSourceURL(r.consumer.sourceRoot,l,this._sourceMapURL)),this._sources.add(l),l=this._sources.indexOf(l);var c=null;o.name&&(c=r.consumer._names.at(o.name),this._names.add(c),c=this._names.indexOf(c));var u={source:l,generatedLine:o.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:o.generatedColumn+(r.generatedOffset.generatedLine===o.generatedLine?r.generatedOffset.generatedColumn-1:0),originalLine:o.originalLine,originalColumn:o.originalColumn,name:c};this.__generatedMappings.push(u),typeof u.originalLine=="number"&&this.__originalMappings.push(u)}Tt(this.__generatedMappings,N.compareByGeneratedPositionsDeflated),Tt(this.__originalMappings,N.compareByOriginalPositions)};Kt.IndexedSourceMapConsumer=be});var Ei=he(Si=>{var za=Rs().SourceMapGenerator,Ht=Ye(),Wa=/(\r?\n)/,Ja=10,et="$$$isSourceNode$$$";function pe(i,s,e,t,r){this.children=[],this.sourceContents={},this.line=i??null,this.column=s??null,this.source=e??null,this.name=r??null,this[et]=!0,t!=null&&this.add(t)}pe.fromStringWithSourceMap=function(s,e,t){var r=new pe,n=s.split(Wa),a=0,o=function(){var f=p(),d=p()||"";return f+d;function p(){return a<n.length?n[a++]:void 0}},l=1,c=0,u=null;return e.eachMapping(function(f){if(u!==null)if(l<f.generatedLine)h(u,o()),l++,c=0;else{var d=n[a]||"",p=d.substr(0,f.generatedColumn-c);n[a]=d.substr(f.generatedColumn-c),c=f.generatedColumn,h(u,p),u=f;return}for(;l<f.generatedLine;)r.add(o()),l++;if(c<f.generatedColumn){var d=n[a]||"";r.add(d.substr(0,f.generatedColumn)),n[a]=d.substr(f.generatedColumn),c=f.generatedColumn}u=f},this),a<n.length&&(u&&h(u,o()),r.add(n.splice(a).join(""))),e.sources.forEach(function(f){var d=e.sourceContentFor(f);d!=null&&(t!=null&&(f=Ht.join(t,f)),r.setSourceContent(f,d))}),r;function h(f,d){if(f===null||f.source===void 0)r.add(d);else{var p=t?Ht.join(t,f.source):f.source;r.add(new pe(f.originalLine,f.originalColumn,p,d,f.name))}}};pe.prototype.add=function(s){if(Array.isArray(s))s.forEach(function(e){this.add(e)},this);else if(s[et]||typeof s=="string")s&&this.children.push(s);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+s);return this};pe.prototype.prepend=function(s){if(Array.isArray(s))for(var e=s.length-1;e>=0;e--)this.prepend(s[e]);else if(s[et]||typeof s=="string")this.children.unshift(s);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+s);return this};pe.prototype.walk=function(s){for(var e,t=0,r=this.children.length;t<r;t++)e=this.children[t],e[et]?e.walk(s):e!==""&&s(e,{source:this.source,line:this.line,column:this.column,name:this.name})};pe.prototype.join=function(s){var e,t,r=this.children.length;if(r>0){for(e=[],t=0;t<r-1;t++)e.push(this.children[t]),e.push(s);e.push(this.children[t]),this.children=e}return this};pe.prototype.replaceRight=function(s,e){var t=this.children[this.children.length-1];return t[et]?t.replaceRight(s,e):typeof t=="string"?this.children[this.children.length-1]=t.replace(s,e):this.children.push("".replace(s,e)),this};pe.prototype.setSourceContent=function(s,e){this.sourceContents[Ht.toSetString(s)]=e};pe.prototype.walkSourceContents=function(s){for(var e=0,t=this.children.length;e<t;e++)this.children[e][et]&&this.children[e].walkSourceContents(s);for(var r=Object.keys(this.sourceContents),e=0,t=r.length;e<t;e++)s(Ht.fromSetString(r[e]),this.sourceContents[r[e]])};pe.prototype.toString=function(){var s="";return this.walk(function(e){s+=e}),s};pe.prototype.toStringWithSourceMap=function(s){var e={code:"",line:1,column:0},t=new za(s),r=!1,n=null,a=null,o=null,l=null;return this.walk(function(c,u){e.code+=c,u.source!==null&&u.line!==null&&u.column!==null?((n!==u.source||a!==u.line||o!==u.column||l!==u.name)&&t.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:e.line,column:e.column},name:u.name}),n=u.source,a=u.line,o=u.column,l=u.name,r=!0):r&&(t.addMapping({generated:{line:e.line,column:e.column}}),n=null,r=!1);for(var h=0,f=c.length;h<f;h++)c.charCodeAt(h)===Ja?(e.line++,e.column=0,h+1===f?(n=null,r=!1):r&&t.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:e.line,column:e.column},name:u.name})):e.column++}),this.walkSourceContents(function(c,u){t.setSourceContent(c,u)}),{code:e.code,map:t}};Si.SourceNode=pe});var Ai=he(Xt=>{Xt.SourceMapGenerator=Rs().SourceMapGenerator;Xt.SourceMapConsumer=Pi().SourceMapConsumer;Xt.SourceNode=Ei().SourceNode});var tn=he(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});function Ka(i,s){if(i==null)return{};var e={};for(var t in i)if({}.hasOwnProperty.call(i,t)){if(s.includes(t))continue;e[t]=i[t]}return e}var ve=class{constructor(s,e,t){this.line=void 0,this.column=void 0,this.index=void 0,this.line=s,this.column=e,this.index=t}},nt=class{constructor(s,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=s,this.end=e}};function ae(i,s){let{line:e,column:t,index:r}=i;return new ve(e,t+s,r+s)}var wi="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",Ha={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:wi},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:wi}},vi={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"},Yt=i=>i.type==="UpdateExpression"?vi.UpdateExpression[`${i.prefix}`]:vi[i.type],Xa={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:s})=>`A string literal cannot be used as an exported binding without \`from\`.
2
+ var ma=Object.create;var Wt=Object.defineProperty;var ya=Object.getOwnPropertyDescriptor;var ga=Object.getOwnPropertyNames;var xa=Object.getPrototypeOf,ba=Object.prototype.hasOwnProperty;var Ta=(i,s,e)=>s in i?Wt(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var he=(i,s)=>()=>(s||i((s={exports:{}}).exports,s),s.exports),Pa=(i,s)=>{for(var e in s)Wt(i,e,{get:s[e],enumerable:!0})},Sa=(i,s,e,t)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of ga(s))!ba.call(i,r)&&r!==e&&Wt(i,r,{get:()=>s[r],enumerable:!(t=ya(s,r))||t.enumerable});return i};var Ls=(i,s,e)=>(e=i!=null?ma(xa(i)):{},Sa(s||!i||!i.__esModule?Wt(e,"default",{value:i,enumerable:!0}):e,i));var Jt=(i,s,e)=>Ta(i,typeof s!="symbol"?s+"":s,e);var Gr=he((xu,Xr)=>{"use strict";Xr.exports=function(){if(process.env.npm_config_user_agent)return Ea(process.env.npm_config_user_agent)};function Ea(i){let s=i.split(" ")[0],e=s.lastIndexOf("/"),t=s.substring(0,e);return{name:t==="npminstall"?"cnpm":t,version:s.substring(e+1)}}});var si=he(Os=>{var ti="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Os.encode=function(i){if(0<=i&&i<ti.length)return ti[i];throw new TypeError("Must be between 0 and 63: "+i)};Os.decode=function(i){var s=65,e=90,t=97,r=122,n=48,a=57,o=43,l=47,c=26,u=52;return s<=i&&i<=e?i-s:t<=i&&i<=r?i-t+c:n<=i&&i<=a?i-n+u:i==o?62:i==l?63:-1}});var Bs=he(Fs=>{var ri=si(),Ms=5,ii=1<<Ms,ni=ii-1,ai=ii;function va(i){return i<0?(-i<<1)+1:(i<<1)+0}function Ca(i){var s=(i&1)===1,e=i>>1;return s?-e:e}Fs.encode=function(s){var e="",t,r=va(s);do t=r&ni,r>>>=Ms,r>0&&(t|=ai),e+=ri.encode(t);while(r>0);return e};Fs.decode=function(s,e,t){var r=s.length,n=0,a=0,o,l;do{if(e>=r)throw new Error("Expected more digits in base 64 VLQ value.");if(l=ri.decode(s.charCodeAt(e++)),l===-1)throw new Error("Invalid base64 digit: "+s.charAt(e-1));o=!!(l&ai),l&=ni,n=n+(l<<a),a+=Ms}while(o);t.value=Ca(n),t.rest=e}});var Ye=he(ee=>{function Ia(i,s,e){if(s in i)return i[s];if(arguments.length===3)return e;throw new Error('"'+s+'" is a required argument.')}ee.getArg=Ia;var oi=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Na=/^data:.+\,.+$/;function xt(i){var s=i.match(oi);return s?{scheme:s[1],auth:s[2],host:s[3],port:s[4],path:s[5]}:null}ee.urlParse=xt;function Qe(i){var s="";return i.scheme&&(s+=i.scheme+":"),s+="//",i.auth&&(s+=i.auth+"@"),i.host&&(s+=i.host),i.port&&(s+=":"+i.port),i.path&&(s+=i.path),s}ee.urlGenerate=Qe;var ka=32;function La(i){var s=[];return function(e){for(var t=0;t<s.length;t++)if(s[t].input===e){var r=s[0];return s[0]=s[t],s[t]=r,s[0].result}var n=i(e);return s.unshift({input:e,result:n}),s.length>ka&&s.pop(),n}}var _s=La(function(s){var e=s,t=xt(s);if(t){if(!t.path)return s;e=t.path}for(var r=ee.isAbsolute(e),n=[],a=0,o=0;;)if(a=o,o=e.indexOf("/",a),o===-1){n.push(e.slice(a));break}else for(n.push(e.slice(a,o));o<e.length&&e[o]==="/";)o++;for(var l,c=0,o=n.length-1;o>=0;o--)l=n[o],l==="."?n.splice(o,1):l===".."?c++:c>0&&(l===""?(n.splice(o+1,c),c=0):(n.splice(o,2),c--));return e=n.join("/"),e===""&&(e=r?"/":"."),t?(t.path=e,Qe(t)):e});ee.normalize=_s;function li(i,s){i===""&&(i="."),s===""&&(s=".");var e=xt(s),t=xt(i);if(t&&(i=t.path||"/"),e&&!e.scheme)return t&&(e.scheme=t.scheme),Qe(e);if(e||s.match(Na))return s;if(t&&!t.host&&!t.path)return t.host=s,Qe(t);var r=s.charAt(0)==="/"?s:_s(i.replace(/\/+$/,"")+"/"+s);return t?(t.path=r,Qe(t)):r}ee.join=li;ee.isAbsolute=function(i){return i.charAt(0)==="/"||oi.test(i)};function Da(i,s){i===""&&(i="."),i=i.replace(/\/$/,"");for(var e=0;s.indexOf(i+"/")!==0;){var t=i.lastIndexOf("/");if(t<0||(i=i.slice(0,t),i.match(/^([^\/]+:\/)?\/*$/)))return s;++e}return Array(e+1).join("../")+s.substr(i.length+1)}ee.relative=Da;var ci=function(){var i=Object.create(null);return!("__proto__"in i)}();function ui(i){return i}function Oa(i){return hi(i)?"$"+i:i}ee.toSetString=ci?ui:Oa;function Ma(i){return hi(i)?i.slice(1):i}ee.fromSetString=ci?ui:Ma;function hi(i){if(!i)return!1;var s=i.length;if(s<9||i.charCodeAt(s-1)!==95||i.charCodeAt(s-2)!==95||i.charCodeAt(s-3)!==111||i.charCodeAt(s-4)!==116||i.charCodeAt(s-5)!==111||i.charCodeAt(s-6)!==114||i.charCodeAt(s-7)!==112||i.charCodeAt(s-8)!==95||i.charCodeAt(s-9)!==95)return!1;for(var e=s-10;e>=0;e--)if(i.charCodeAt(e)!==36)return!1;return!0}function Fa(i,s,e){var t=ke(i.source,s.source);return t!==0||(t=i.originalLine-s.originalLine,t!==0)||(t=i.originalColumn-s.originalColumn,t!==0||e)||(t=i.generatedColumn-s.generatedColumn,t!==0)||(t=i.generatedLine-s.generatedLine,t!==0)?t:ke(i.name,s.name)}ee.compareByOriginalPositions=Fa;function Ba(i,s,e){var t;return t=i.originalLine-s.originalLine,t!==0||(t=i.originalColumn-s.originalColumn,t!==0||e)||(t=i.generatedColumn-s.generatedColumn,t!==0)||(t=i.generatedLine-s.generatedLine,t!==0)?t:ke(i.name,s.name)}ee.compareByOriginalPositionsNoSource=Ba;function _a(i,s,e){var t=i.generatedLine-s.generatedLine;return t!==0||(t=i.generatedColumn-s.generatedColumn,t!==0||e)||(t=ke(i.source,s.source),t!==0)||(t=i.originalLine-s.originalLine,t!==0)||(t=i.originalColumn-s.originalColumn,t!==0)?t:ke(i.name,s.name)}ee.compareByGeneratedPositionsDeflated=_a;function ja(i,s,e){var t=i.generatedColumn-s.generatedColumn;return t!==0||e||(t=ke(i.source,s.source),t!==0)||(t=i.originalLine-s.originalLine,t!==0)||(t=i.originalColumn-s.originalColumn,t!==0)?t:ke(i.name,s.name)}ee.compareByGeneratedPositionsDeflatedNoLine=ja;function ke(i,s){return i===s?0:i===null?1:s===null?-1:i>s?1:-1}function Ra(i,s){var e=i.generatedLine-s.generatedLine;return e!==0||(e=i.generatedColumn-s.generatedColumn,e!==0)||(e=ke(i.source,s.source),e!==0)||(e=i.originalLine-s.originalLine,e!==0)||(e=i.originalColumn-s.originalColumn,e!==0)?e:ke(i.name,s.name)}ee.compareByGeneratedPositionsInflated=Ra;function Ua(i){return JSON.parse(i.replace(/^\)]}'[^\n]*\n/,""))}ee.parseSourceMapInput=Ua;function Va(i,s,e){if(s=s||"",i&&(i[i.length-1]!=="/"&&s[0]!=="/"&&(i+="/"),s=i+s),e){var t=xt(e);if(!t)throw new Error("sourceMapURL could not be parsed");if(t.path){var r=t.path.lastIndexOf("/");r>=0&&(t.path=t.path.substring(0,r+1))}s=li(Qe(t),s)}return _s(s)}ee.computeSourceURL=Va});var Us=he(pi=>{var js=Ye(),Rs=Object.prototype.hasOwnProperty,qe=typeof Map<"u";function Le(){this._array=[],this._set=qe?new Map:Object.create(null)}Le.fromArray=function(s,e){for(var t=new Le,r=0,n=s.length;r<n;r++)t.add(s[r],e);return t};Le.prototype.size=function(){return qe?this._set.size:Object.getOwnPropertyNames(this._set).length};Le.prototype.add=function(s,e){var t=qe?s:js.toSetString(s),r=qe?this.has(s):Rs.call(this._set,t),n=this._array.length;(!r||e)&&this._array.push(s),r||(qe?this._set.set(s,n):this._set[t]=n)};Le.prototype.has=function(s){if(qe)return this._set.has(s);var e=js.toSetString(s);return Rs.call(this._set,e)};Le.prototype.indexOf=function(s){if(qe){var e=this._set.get(s);if(e>=0)return e}else{var t=js.toSetString(s);if(Rs.call(this._set,t))return this._set[t]}throw new Error('"'+s+'" is not in the set.')};Le.prototype.at=function(s){if(s>=0&&s<this._array.length)return this._array[s];throw new Error("No element indexed by "+s)};Le.prototype.toArray=function(){return this._array.slice()};pi.ArraySet=Le});var mi=he(di=>{var fi=Ye();function $a(i,s){var e=i.generatedLine,t=s.generatedLine,r=i.generatedColumn,n=s.generatedColumn;return t>e||t==e&&n>=r||fi.compareByGeneratedPositionsInflated(i,s)<=0}function Ht(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Ht.prototype.unsortedForEach=function(s,e){this._array.forEach(s,e)};Ht.prototype.add=function(s){$a(this._last,s)?(this._last=s,this._array.push(s)):(this._sorted=!1,this._array.push(s))};Ht.prototype.toArray=function(){return this._sorted||(this._array.sort(fi.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};di.MappingList=Ht});var Vs=he(yi=>{var bt=Bs(),Q=Ye(),Xt=Us().ArraySet,qa=mi().MappingList;function ye(i){i||(i={}),this._file=Q.getArg(i,"file",null),this._sourceRoot=Q.getArg(i,"sourceRoot",null),this._skipValidation=Q.getArg(i,"skipValidation",!1),this._ignoreInvalidMapping=Q.getArg(i,"ignoreInvalidMapping",!1),this._sources=new Xt,this._names=new Xt,this._mappings=new qa,this._sourcesContents=null}ye.prototype._version=3;ye.fromSourceMap=function(s,e){var t=s.sourceRoot,r=new ye(Object.assign(e||{},{file:s.file,sourceRoot:t}));return s.eachMapping(function(n){var a={generated:{line:n.generatedLine,column:n.generatedColumn}};n.source!=null&&(a.source=n.source,t!=null&&(a.source=Q.relative(t,a.source)),a.original={line:n.originalLine,column:n.originalColumn},n.name!=null&&(a.name=n.name)),r.addMapping(a)}),s.sources.forEach(function(n){var a=n;t!==null&&(a=Q.relative(t,n)),r._sources.has(a)||r._sources.add(a);var o=s.sourceContentFor(n);o!=null&&r.setSourceContent(n,o)}),r};ye.prototype.addMapping=function(s){var e=Q.getArg(s,"generated"),t=Q.getArg(s,"original",null),r=Q.getArg(s,"source",null),n=Q.getArg(s,"name",null);!this._skipValidation&&this._validateMapping(e,t,r,n)===!1||(r!=null&&(r=String(r),this._sources.has(r)||this._sources.add(r)),n!=null&&(n=String(n),this._names.has(n)||this._names.add(n)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:t!=null&&t.line,originalColumn:t!=null&&t.column,source:r,name:n}))};ye.prototype.setSourceContent=function(s,e){var t=s;this._sourceRoot!=null&&(t=Q.relative(this._sourceRoot,t)),e!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Q.toSetString(t)]=e):this._sourcesContents&&(delete this._sourcesContents[Q.toSetString(t)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};ye.prototype.applySourceMap=function(s,e,t){var r=e;if(e==null){if(s.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);r=s.file}var n=this._sourceRoot;n!=null&&(r=Q.relative(n,r));var a=new Xt,o=new Xt;this._mappings.unsortedForEach(function(l){if(l.source===r&&l.originalLine!=null){var c=s.originalPositionFor({line:l.originalLine,column:l.originalColumn});c.source!=null&&(l.source=c.source,t!=null&&(l.source=Q.join(t,l.source)),n!=null&&(l.source=Q.relative(n,l.source)),l.originalLine=c.line,l.originalColumn=c.column,c.name!=null&&(l.name=c.name))}var u=l.source;u!=null&&!a.has(u)&&a.add(u);var h=l.name;h!=null&&!o.has(h)&&o.add(h)},this),this._sources=a,this._names=o,s.sources.forEach(function(l){var c=s.sourceContentFor(l);c!=null&&(t!=null&&(l=Q.join(t,l)),n!=null&&(l=Q.relative(n,l)),this.setSourceContent(l,c))},this)};ye.prototype._validateMapping=function(s,e,t,r){if(e&&typeof e.line!="number"&&typeof e.column!="number"){var n="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(n),!1;throw new Error(n)}if(!(s&&"line"in s&&"column"in s&&s.line>0&&s.column>=0&&!e&&!t&&!r)){if(s&&"line"in s&&"column"in s&&e&&"line"in e&&"column"in e&&s.line>0&&s.column>=0&&e.line>0&&e.column>=0&&t)return;var n="Invalid mapping: "+JSON.stringify({generated:s,source:t,original:e,name:r});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(n),!1;throw new Error(n)}};ye.prototype._serializeMappings=function(){for(var s=0,e=1,t=0,r=0,n=0,a=0,o="",l,c,u,h,f=this._mappings.toArray(),d=0,p=f.length;d<p;d++){if(c=f[d],l="",c.generatedLine!==e)for(s=0;c.generatedLine!==e;)l+=";",e++;else if(d>0){if(!Q.compareByGeneratedPositionsInflated(c,f[d-1]))continue;l+=","}l+=bt.encode(c.generatedColumn-s),s=c.generatedColumn,c.source!=null&&(h=this._sources.indexOf(c.source),l+=bt.encode(h-a),a=h,l+=bt.encode(c.originalLine-1-r),r=c.originalLine-1,l+=bt.encode(c.originalColumn-t),t=c.originalColumn,c.name!=null&&(u=this._names.indexOf(c.name),l+=bt.encode(u-n),n=u)),o+=l}return o};ye.prototype._generateSourcesContent=function(s,e){return s.map(function(t){if(!this._sourcesContents)return null;e!=null&&(t=Q.relative(e,t));var r=Q.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)};ye.prototype.toJSON=function(){var s={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(s.file=this._file),this._sourceRoot!=null&&(s.sourceRoot=this._sourceRoot),this._sourcesContents&&(s.sourcesContent=this._generateSourcesContent(s.sources,s.sourceRoot)),s};ye.prototype.toString=function(){return JSON.stringify(this.toJSON())};yi.SourceMapGenerator=ye});var gi=he(ze=>{ze.GREATEST_LOWER_BOUND=1;ze.LEAST_UPPER_BOUND=2;function $s(i,s,e,t,r,n){var a=Math.floor((s-i)/2)+i,o=r(e,t[a],!0);return o===0?a:o>0?s-a>1?$s(a,s,e,t,r,n):n==ze.LEAST_UPPER_BOUND?s<t.length?s:-1:a:a-i>1?$s(i,a,e,t,r,n):n==ze.LEAST_UPPER_BOUND?a:i<0?-1:i}ze.search=function(s,e,t,r){if(e.length===0)return-1;var n=$s(-1,e.length,s,e,t,r||ze.GREATEST_LOWER_BOUND);if(n<0)return-1;for(;n-1>=0&&t(e[n],e[n-1],!0)===0;)--n;return n}});var Ti=he(bi=>{function za(i){function s(r,n,a){var o=r[n];r[n]=r[a],r[a]=o}function e(r,n){return Math.round(r+Math.random()*(n-r))}function t(r,n,a,o){if(a<o){var l=e(a,o),c=a-1;s(r,l,o);for(var u=r[o],h=a;h<o;h++)n(r[h],u,!1)<=0&&(c+=1,s(r,c,h));s(r,c+1,h);var f=c+1;t(r,n,a,f-1),t(r,n,f+1,o)}}return t}function Wa(i){let s=za.toString();return new Function(`return ${s}`)()(i)}var xi=new WeakMap;bi.quickSort=function(i,s,e=0){let t=xi.get(s);t===void 0&&(t=Wa(s),xi.set(s,t)),t(i,s,e,i.length-1)}});var Ei=he(Gt=>{var N=Ye(),zs=gi(),Ze=Us().ArraySet,Ja=Bs(),Tt=Ti().quickSort;function K(i,s){var e=i;return typeof i=="string"&&(e=N.parseSourceMapInput(i)),e.sections!=null?new be(e,s):new te(e,s)}K.fromSourceMap=function(i,s){return te.fromSourceMap(i,s)};K.prototype._version=3;K.prototype.__generatedMappings=null;Object.defineProperty(K.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});K.prototype.__originalMappings=null;Object.defineProperty(K.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});K.prototype._charIsMappingSeparator=function(s,e){var t=s.charAt(e);return t===";"||t===","};K.prototype._parseMappings=function(s,e){throw new Error("Subclasses must implement _parseMappings")};K.GENERATED_ORDER=1;K.ORIGINAL_ORDER=2;K.GREATEST_LOWER_BOUND=1;K.LEAST_UPPER_BOUND=2;K.prototype.eachMapping=function(s,e,t){var r=e||null,n=t||K.GENERATED_ORDER,a;switch(n){case K.GENERATED_ORDER:a=this._generatedMappings;break;case K.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var o=this.sourceRoot,l=s.bind(r),c=this._names,u=this._sources,h=this._sourceMapURL,f=0,d=a.length;f<d;f++){var p=a[f],g=p.source===null?null:u.at(p.source);g!==null&&(g=N.computeSourceURL(o,g,h)),l({source:g,generatedLine:p.generatedLine,generatedColumn:p.generatedColumn,originalLine:p.originalLine,originalColumn:p.originalColumn,name:p.name===null?null:c.at(p.name)})}};K.prototype.allGeneratedPositionsFor=function(s){var e=N.getArg(s,"line"),t={source:N.getArg(s,"source"),originalLine:e,originalColumn:N.getArg(s,"column",0)};if(t.source=this._findSourceIndex(t.source),t.source<0)return[];var r=[],n=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",N.compareByOriginalPositions,zs.LEAST_UPPER_BOUND);if(n>=0){var a=this._originalMappings[n];if(s.column===void 0)for(var o=a.originalLine;a&&a.originalLine===o;)r.push({line:N.getArg(a,"generatedLine",null),column:N.getArg(a,"generatedColumn",null),lastColumn:N.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++n];else for(var l=a.originalColumn;a&&a.originalLine===e&&a.originalColumn==l;)r.push({line:N.getArg(a,"generatedLine",null),column:N.getArg(a,"generatedColumn",null),lastColumn:N.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++n]}return r};Gt.SourceMapConsumer=K;function te(i,s){var e=i;typeof i=="string"&&(e=N.parseSourceMapInput(i));var t=N.getArg(e,"version"),r=N.getArg(e,"sources"),n=N.getArg(e,"names",[]),a=N.getArg(e,"sourceRoot",null),o=N.getArg(e,"sourcesContent",null),l=N.getArg(e,"mappings"),c=N.getArg(e,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);a&&(a=N.normalize(a)),r=r.map(String).map(N.normalize).map(function(u){return a&&N.isAbsolute(a)&&N.isAbsolute(u)?N.relative(a,u):u}),this._names=Ze.fromArray(n.map(String),!0),this._sources=Ze.fromArray(r,!0),this._absoluteSources=this._sources.toArray().map(function(u){return N.computeSourceURL(a,u,s)}),this.sourceRoot=a,this.sourcesContent=o,this._mappings=l,this._sourceMapURL=s,this.file=c}te.prototype=Object.create(K.prototype);te.prototype.consumer=K;te.prototype._findSourceIndex=function(i){var s=i;if(this.sourceRoot!=null&&(s=N.relative(this.sourceRoot,s)),this._sources.has(s))return this._sources.indexOf(s);var e;for(e=0;e<this._absoluteSources.length;++e)if(this._absoluteSources[e]==i)return e;return-1};te.fromSourceMap=function(s,e){var t=Object.create(te.prototype),r=t._names=Ze.fromArray(s._names.toArray(),!0),n=t._sources=Ze.fromArray(s._sources.toArray(),!0);t.sourceRoot=s._sourceRoot,t.sourcesContent=s._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=s._file,t._sourceMapURL=e,t._absoluteSources=t._sources.toArray().map(function(d){return N.computeSourceURL(t.sourceRoot,d,e)});for(var a=s._mappings.toArray().slice(),o=t.__generatedMappings=[],l=t.__originalMappings=[],c=0,u=a.length;c<u;c++){var h=a[c],f=new Si;f.generatedLine=h.generatedLine,f.generatedColumn=h.generatedColumn,h.source&&(f.source=n.indexOf(h.source),f.originalLine=h.originalLine,f.originalColumn=h.originalColumn,h.name&&(f.name=r.indexOf(h.name)),l.push(f)),o.push(f)}return Tt(t.__originalMappings,N.compareByOriginalPositions),t};te.prototype._version=3;Object.defineProperty(te.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function Si(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var qs=N.compareByGeneratedPositionsDeflatedNoLine;function Pi(i,s){let e=i.length,t=i.length-s;if(!(t<=1))if(t==2){let r=i[s],n=i[s+1];qs(r,n)>0&&(i[s]=n,i[s+1]=r)}else if(t<20)for(let r=s;r<e;r++)for(let n=r;n>s;n--){let a=i[n-1],o=i[n];if(qs(a,o)<=0)break;i[n-1]=o,i[n]=a}else Tt(i,qs,s)}te.prototype._parseMappings=function(s,e){var t=1,r=0,n=0,a=0,o=0,l=0,c=s.length,u=0,h={},f={},d=[],p=[],g,y,b,P,k;let T=0;for(;u<c;)if(s.charAt(u)===";")t++,u++,r=0,Pi(p,T),T=p.length;else if(s.charAt(u)===",")u++;else{for(g=new Si,g.generatedLine=t,P=u;P<c&&!this._charIsMappingSeparator(s,P);P++);for(y=s.slice(u,P),b=[];u<P;)Ja.decode(s,u,f),k=f.value,u=f.rest,b.push(k);if(b.length===2)throw new Error("Found a source, but no line and column");if(b.length===3)throw new Error("Found a source and line, but no column");if(g.generatedColumn=r+b[0],r=g.generatedColumn,b.length>1&&(g.source=o+b[1],o+=b[1],g.originalLine=n+b[2],n=g.originalLine,g.originalLine+=1,g.originalColumn=a+b[3],a=g.originalColumn,b.length>4&&(g.name=l+b[4],l+=b[4])),p.push(g),typeof g.originalLine=="number"){let A=g.source;for(;d.length<=A;)d.push(null);d[A]===null&&(d[A]=[]),d[A].push(g)}}Pi(p,T),this.__generatedMappings=p;for(var E=0;E<d.length;E++)d[E]!=null&&Tt(d[E],N.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...d)};te.prototype._findMapping=function(s,e,t,r,n,a){if(s[t]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+s[t]);if(s[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+s[r]);return zs.search(s,e,n,a)};te.prototype.computeColumnSpans=function(){for(var s=0;s<this._generatedMappings.length;++s){var e=this._generatedMappings[s];if(s+1<this._generatedMappings.length){var t=this._generatedMappings[s+1];if(e.generatedLine===t.generatedLine){e.lastGeneratedColumn=t.generatedColumn-1;continue}}e.lastGeneratedColumn=1/0}};te.prototype.originalPositionFor=function(s){var e={generatedLine:N.getArg(s,"line"),generatedColumn:N.getArg(s,"column")},t=this._findMapping(e,this._generatedMappings,"generatedLine","generatedColumn",N.compareByGeneratedPositionsDeflated,N.getArg(s,"bias",K.GREATEST_LOWER_BOUND));if(t>=0){var r=this._generatedMappings[t];if(r.generatedLine===e.generatedLine){var n=N.getArg(r,"source",null);n!==null&&(n=this._sources.at(n),n=N.computeSourceURL(this.sourceRoot,n,this._sourceMapURL));var a=N.getArg(r,"name",null);return a!==null&&(a=this._names.at(a)),{source:n,line:N.getArg(r,"originalLine",null),column:N.getArg(r,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}};te.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(s){return s==null}):!1};te.prototype.sourceContentFor=function(s,e){if(!this.sourcesContent)return null;var t=this._findSourceIndex(s);if(t>=0)return this.sourcesContent[t];var r=s;this.sourceRoot!=null&&(r=N.relative(this.sourceRoot,r));var n;if(this.sourceRoot!=null&&(n=N.urlParse(this.sourceRoot))){var a=r.replace(/^file:\/\//,"");if(n.scheme=="file"&&this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];if((!n.path||n.path=="/")&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(e)return null;throw new Error('"'+r+'" is not in the SourceMap.')};te.prototype.generatedPositionFor=function(s){var e=N.getArg(s,"source");if(e=this._findSourceIndex(e),e<0)return{line:null,column:null,lastColumn:null};var t={source:e,originalLine:N.getArg(s,"line"),originalColumn:N.getArg(s,"column")},r=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",N.compareByOriginalPositions,N.getArg(s,"bias",K.GREATEST_LOWER_BOUND));if(r>=0){var n=this._originalMappings[r];if(n.source===t.source)return{line:N.getArg(n,"generatedLine",null),column:N.getArg(n,"generatedColumn",null),lastColumn:N.getArg(n,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Gt.BasicSourceMapConsumer=te;function be(i,s){var e=i;typeof i=="string"&&(e=N.parseSourceMapInput(i));var t=N.getArg(e,"version"),r=N.getArg(e,"sections");if(t!=this._version)throw new Error("Unsupported version: "+t);this._sources=new Ze,this._names=new Ze;var n={line:-1,column:0};this._sections=r.map(function(a){if(a.url)throw new Error("Support for url field in sections not implemented.");var o=N.getArg(a,"offset"),l=N.getArg(o,"line"),c=N.getArg(o,"column");if(l<n.line||l===n.line&&c<n.column)throw new Error("Section offsets must be ordered and non-overlapping.");return n=o,{generatedOffset:{generatedLine:l+1,generatedColumn:c+1},consumer:new K(N.getArg(a,"map"),s)}})}be.prototype=Object.create(K.prototype);be.prototype.constructor=K;be.prototype._version=3;Object.defineProperty(be.prototype,"sources",{get:function(){for(var i=[],s=0;s<this._sections.length;s++)for(var e=0;e<this._sections[s].consumer.sources.length;e++)i.push(this._sections[s].consumer.sources[e]);return i}});be.prototype.originalPositionFor=function(s){var e={generatedLine:N.getArg(s,"line"),generatedColumn:N.getArg(s,"column")},t=zs.search(e,this._sections,function(n,a){var o=n.generatedLine-a.generatedOffset.generatedLine;return o||n.generatedColumn-a.generatedOffset.generatedColumn}),r=this._sections[t];return r?r.consumer.originalPositionFor({line:e.generatedLine-(r.generatedOffset.generatedLine-1),column:e.generatedColumn-(r.generatedOffset.generatedLine===e.generatedLine?r.generatedOffset.generatedColumn-1:0),bias:s.bias}):{source:null,line:null,column:null,name:null}};be.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(s){return s.consumer.hasContentsOfAllSources()})};be.prototype.sourceContentFor=function(s,e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t],n=r.consumer.sourceContentFor(s,!0);if(n||n==="")return n}if(e)return null;throw new Error('"'+s+'" is not in the SourceMap.')};be.prototype.generatedPositionFor=function(s){for(var e=0;e<this._sections.length;e++){var t=this._sections[e];if(t.consumer._findSourceIndex(N.getArg(s,"source"))!==-1){var r=t.consumer.generatedPositionFor(s);if(r){var n={line:r.line+(t.generatedOffset.generatedLine-1),column:r.column+(t.generatedOffset.generatedLine===r.line?t.generatedOffset.generatedColumn-1:0)};return n}}}return{line:null,column:null}};be.prototype._parseMappings=function(s,e){this.__generatedMappings=[],this.__originalMappings=[];for(var t=0;t<this._sections.length;t++)for(var r=this._sections[t],n=r.consumer._generatedMappings,a=0;a<n.length;a++){var o=n[a],l=r.consumer._sources.at(o.source);l!==null&&(l=N.computeSourceURL(r.consumer.sourceRoot,l,this._sourceMapURL)),this._sources.add(l),l=this._sources.indexOf(l);var c=null;o.name&&(c=r.consumer._names.at(o.name),this._names.add(c),c=this._names.indexOf(c));var u={source:l,generatedLine:o.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:o.generatedColumn+(r.generatedOffset.generatedLine===o.generatedLine?r.generatedOffset.generatedColumn-1:0),originalLine:o.originalLine,originalColumn:o.originalColumn,name:c};this.__generatedMappings.push(u),typeof u.originalLine=="number"&&this.__originalMappings.push(u)}Tt(this.__generatedMappings,N.compareByGeneratedPositionsDeflated),Tt(this.__originalMappings,N.compareByOriginalPositions)};Gt.IndexedSourceMapConsumer=be});var wi=he(Ai=>{var Ka=Vs().SourceMapGenerator,Qt=Ye(),Ha=/(\r?\n)/,Xa=10,et="$$$isSourceNode$$$";function pe(i,s,e,t,r){this.children=[],this.sourceContents={},this.line=i??null,this.column=s??null,this.source=e??null,this.name=r??null,this[et]=!0,t!=null&&this.add(t)}pe.fromStringWithSourceMap=function(s,e,t){var r=new pe,n=s.split(Ha),a=0,o=function(){var f=p(),d=p()||"";return f+d;function p(){return a<n.length?n[a++]:void 0}},l=1,c=0,u=null;return e.eachMapping(function(f){if(u!==null)if(l<f.generatedLine)h(u,o()),l++,c=0;else{var d=n[a]||"",p=d.substr(0,f.generatedColumn-c);n[a]=d.substr(f.generatedColumn-c),c=f.generatedColumn,h(u,p),u=f;return}for(;l<f.generatedLine;)r.add(o()),l++;if(c<f.generatedColumn){var d=n[a]||"";r.add(d.substr(0,f.generatedColumn)),n[a]=d.substr(f.generatedColumn),c=f.generatedColumn}u=f},this),a<n.length&&(u&&h(u,o()),r.add(n.splice(a).join(""))),e.sources.forEach(function(f){var d=e.sourceContentFor(f);d!=null&&(t!=null&&(f=Qt.join(t,f)),r.setSourceContent(f,d))}),r;function h(f,d){if(f===null||f.source===void 0)r.add(d);else{var p=t?Qt.join(t,f.source):f.source;r.add(new pe(f.originalLine,f.originalColumn,p,d,f.name))}}};pe.prototype.add=function(s){if(Array.isArray(s))s.forEach(function(e){this.add(e)},this);else if(s[et]||typeof s=="string")s&&this.children.push(s);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+s);return this};pe.prototype.prepend=function(s){if(Array.isArray(s))for(var e=s.length-1;e>=0;e--)this.prepend(s[e]);else if(s[et]||typeof s=="string")this.children.unshift(s);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+s);return this};pe.prototype.walk=function(s){for(var e,t=0,r=this.children.length;t<r;t++)e=this.children[t],e[et]?e.walk(s):e!==""&&s(e,{source:this.source,line:this.line,column:this.column,name:this.name})};pe.prototype.join=function(s){var e,t,r=this.children.length;if(r>0){for(e=[],t=0;t<r-1;t++)e.push(this.children[t]),e.push(s);e.push(this.children[t]),this.children=e}return this};pe.prototype.replaceRight=function(s,e){var t=this.children[this.children.length-1];return t[et]?t.replaceRight(s,e):typeof t=="string"?this.children[this.children.length-1]=t.replace(s,e):this.children.push("".replace(s,e)),this};pe.prototype.setSourceContent=function(s,e){this.sourceContents[Qt.toSetString(s)]=e};pe.prototype.walkSourceContents=function(s){for(var e=0,t=this.children.length;e<t;e++)this.children[e][et]&&this.children[e].walkSourceContents(s);for(var r=Object.keys(this.sourceContents),e=0,t=r.length;e<t;e++)s(Qt.fromSetString(r[e]),this.sourceContents[r[e]])};pe.prototype.toString=function(){var s="";return this.walk(function(e){s+=e}),s};pe.prototype.toStringWithSourceMap=function(s){var e={code:"",line:1,column:0},t=new Ka(s),r=!1,n=null,a=null,o=null,l=null;return this.walk(function(c,u){e.code+=c,u.source!==null&&u.line!==null&&u.column!==null?((n!==u.source||a!==u.line||o!==u.column||l!==u.name)&&t.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:e.line,column:e.column},name:u.name}),n=u.source,a=u.line,o=u.column,l=u.name,r=!0):r&&(t.addMapping({generated:{line:e.line,column:e.column}}),n=null,r=!1);for(var h=0,f=c.length;h<f;h++)c.charCodeAt(h)===Xa?(e.line++,e.column=0,h+1===f?(n=null,r=!1):r&&t.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:e.line,column:e.column},name:u.name})):e.column++}),this.walkSourceContents(function(c,u){t.setSourceContent(c,u)}),{code:e.code,map:t}};Ai.SourceNode=pe});var vi=he(Yt=>{Yt.SourceMapGenerator=Vs().SourceMapGenerator;Yt.SourceMapConsumer=Ei().SourceMapConsumer;Yt.SourceNode=wi().SourceNode});var rn=he(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});function Ga(i,s){if(i==null)return{};var e={};for(var t in i)if({}.hasOwnProperty.call(i,t)){if(s.includes(t))continue;e[t]=i[t]}return e}var ve=class{constructor(s,e,t){this.line=void 0,this.column=void 0,this.index=void 0,this.line=s,this.column=e,this.index=t}},nt=class{constructor(s,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=s,this.end=e}};function ae(i,s){let{line:e,column:t,index:r}=i;return new ve(e,t+s,r+s)}var Ci="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",Qa={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Ci},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Ci}},Ii={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"},ts=i=>i.type==="UpdateExpression"?Ii.UpdateExpression[`${i.prefix}`]:Ii[i.type],Ya={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:s})=>`A string literal cannot be used as an exported binding without \`from\`.
3
3
  - Did you mean \`export { '${i}' as '${s}' } 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.
4
- - 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 ${Yt(i)}.`,InvalidLhsBinding:({ancestor:i})=>`Binding invalid left-hand side in ${Yt(i)}.`,InvalidLhsOptionalChaining:({ancestor:i})=>`Invalid optional chaining in the left-hand side of ${Yt(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(s=>JSON.stringify(s)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:i})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${i.map(s=>JSON.stringify(s)).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:s})=>`Unexpected token${s?` '${s}'.`:""}${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:s})=>`The only valid meta property for ${i} is ${i}.${s}.`,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."},Ga={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."},Qa=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),Ya={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 ${Yt({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.'},Za=["message"];function Ci(i,s,e){Object.defineProperty(i,s,{enumerable:!1,configurable:!0,value:e})}function eo({toMessage:i,code:s,reasonCode:e,syntaxPlugin:t}){let r=e==="MissingPlugin"||e==="MissingOneOfPlugins";{let n={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};n[e]&&(e=n[e])}return function n(a,o){let l=new SyntaxError;return l.code=s,l.reasonCode=e,l.loc=a,l.pos=a.index,l.syntaxPlugin=t,r&&(l.missingPlugin=o.missingPlugin),Ci(l,"clone",function(u={}){var h;let{line:f,column:d,index:p}=(h=u.loc)!=null?h:a;return n(new ve(f,d,p),Object.assign({},o,u.details))}),Ci(l,"details",o),Object.defineProperty(l,"message",{configurable:!0,get(){let c=`${i(o)} (${a.line}:${a.column})`;return this.message=c,c},set(c){Object.defineProperty(this,"message",{value:c,writable:!0})}}),l}}function Fe(i,s){if(Array.isArray(i))return t=>Fe(t,i[0]);let e={};for(let t of Object.keys(i)){let r=i[t],n=typeof r=="string"?{message:()=>r}:typeof r=="function"?{message:r}:r,{message:a}=n,o=Ka(n,Za),l=typeof a=="string"?()=>a:a;e[t]=eo(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:t,toMessage:l},s?{syntaxPlugin:s}:{},o))}return e}var m=Object.assign({},Fe(Ha),Fe(Xa),Fe(Ga),Fe`pipelineOperator`(Ya)),{defineProperty:to}=Object,Ii=(i,s)=>{i&&to(i,s,{enumerable:!1,value:i[s]})};function Pt(i){return Ii(i.loc.start,"index"),Ii(i.loc.end,"index"),i}var so=i=>class extends i{parse(){let e=Pt(super.parse());return this.options.tokens&&(e.tokens=e.tokens.map(Pt)),e}parseRegExpLiteral({pattern:e,flags:t}){let r=null;try{r=new RegExp(e,t)}catch{}let n=this.estreeParseLiteral(r);return n.regex={pattern:e,flags:t},n}parseBigIntLiteral(e){let t;try{t=BigInt(e)}catch{t=null}let r=this.estreeParseLiteral(t);return r.bigint=String(r.value||e),r}parseDecimalLiteral(e){let 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){let t=e.value;delete e.value,t.type="Literal",t.raw=t.extra.raw,t.value=t.extra.expressionValue;let r=e;return r.type="ExpressionStatement",r.expression=t,r.directive=t.extra.rawValue,delete t.extra,r}initFunction(e,t){super.initFunction(e,t),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 t;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((t=e.expression.extra)!=null&&t.parenthesized)}parseBlockBody(e,t,r,n,a){super.parseBlockBody(e,t,r,n,a);let o=e.directives.map(l=>this.directiveToStmt(l));e.body=o.concat(e.body),delete e.directives}pushClassMethod(e,t,r,n,a,o){this.parseMethod(t,r,n,a,o,"ClassMethod",!0),t.typeParameters&&(t.value.typeParameters=t.typeParameters,delete t.typeParameters),e.body.push(t)}parsePrivateName(){let e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){let t=super.getPrivateNameSV(e);return e=e,delete e.id,e.name=t,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,t){let r=super.parseLiteral(e,t);return r.raw=r.extra.raw,delete r.extra,r}parseFunctionBody(e,t,r=!1){super.parseFunctionBody(e,t,r),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,t,r,n,a,o,l=!1){let c=this.startNode();return c.kind=e.kind,c=super.parseMethod(c,t,r,n,a,o,l),c.type="FunctionExpression",delete c.kind,e.value=c,o==="ClassPrivateMethod"&&(e.computed=!1),this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return e.type==="Literal"?e.value==="constructor":super.nameIsConstructor(e)}parseClassProperty(...e){let t=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&(t.type="PropertyDefinition"),t}parseClassPrivateProperty(...e){let t=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(t.type="PropertyDefinition",t.computed=!1),t}parseObjectMethod(e,t,r,n,a){let o=super.parseObjectMethod(e,t,r,n,a);return o&&(o.type="Property",o.kind==="method"&&(o.kind="init"),o.shorthand=!1),o}parseObjectProperty(e,t,r,n){let a=super.parseObjectProperty(e,t,r,n);return a&&(a.kind="init",a.type="Property"),a}isValidLVal(e,t,r){return e==="Property"?"value":super.isValidLVal(e,t,r)}isAssignable(e,t){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,t):super.isAssignable(e,t)}toAssignable(e,t=!1){if(e!=null&&this.isObjectProperty(e)){let{key:r,value:n}=e;this.isPrivateName(r)&&this.classScope.usePrivateName(this.getPrivateNameSV(r),r.loc.start),this.toAssignable(n,t)}else super.toAssignable(e,t)}toAssignableObjectExpressionProp(e,t,r){e.type==="Property"&&(e.kind==="get"||e.kind==="set")?this.raise(m.PatternHasAccessor,e.key):e.type==="Property"&&e.method?this.raise(m.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,t,r)}finishCallExpression(e,t){let r=super.finishCallExpression(e,t);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,t){let r=this.state.lastTokStartLoc,n=super.parseExport(e,t);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;let{declaration:o}=n;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,t,r,n){let a=super.parseSubscript(e,t,r,n);if(n.optionalChainMember){if((a.type==="OptionalMemberExpression"||a.type==="OptionalCallExpression")&&(a.type=a.type.substring(8)),n.stop){let 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,t,r){return Pt(super.finishNodeAt(e,t,r))}resetStartLocation(e,t){super.resetStartLocation(e,t),Pt(e)}resetEndLocation(e,t=this.state.lastTokEndLoc){super.resetEndLocation(e,t),Pt(e)}},Je=class{constructor(s,e){this.token=void 0,this.preserveSpace=void 0,this.token=s,this.preserveSpace=!!e}},$={brace:new Je("{"),j_oTag:new Je("<tag"),j_cTag:new Je("</tag"),j_expr:new Je("<tag>...</tag>",!0)};$.template=new Je("`",!0);var _=!0,C=!0,qs=!0,St=!0,je=!0,ro=!0,ts=class{constructor(s,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=s,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}},mr=new Map;function j(i,s={}){s.keyword=i;let e=D(i,s);return mr.set(i,e),e}function ne(i,s){return D(i,{beforeExpr:_,binop:s})}var vt=-1,Oe=[],yr=[],gr=[],xr=[],br=[],Tr=[];function D(i,s={}){var e,t,r,n;return++vt,yr.push(i),gr.push((e=s.binop)!=null?e:-1),xr.push((t=s.beforeExpr)!=null?t:!1),br.push((r=s.startsExpr)!=null?r:!1),Tr.push((n=s.prefix)!=null?n:!1),Oe.push(new ts(i,s)),vt}function B(i,s={}){var e,t,r,n;return++vt,mr.set(i,vt),yr.push(i),gr.push((e=s.binop)!=null?e:-1),xr.push((t=s.beforeExpr)!=null?t:!1),br.push((r=s.startsExpr)!=null?r:!1),Tr.push((n=s.prefix)!=null?n:!1),Oe.push(new ts("name",s)),vt}var io={bracketL:D("[",{beforeExpr:_,startsExpr:C}),bracketHashL:D("#[",{beforeExpr:_,startsExpr:C}),bracketBarL:D("[|",{beforeExpr:_,startsExpr:C}),bracketR:D("]"),bracketBarR:D("|]"),braceL:D("{",{beforeExpr:_,startsExpr:C}),braceBarL:D("{|",{beforeExpr:_,startsExpr:C}),braceHashL:D("#{",{beforeExpr:_,startsExpr:C}),braceR:D("}"),braceBarR:D("|}"),parenL:D("(",{beforeExpr:_,startsExpr:C}),parenR:D(")"),comma:D(",",{beforeExpr:_}),semi:D(";",{beforeExpr:_}),colon:D(":",{beforeExpr:_}),doubleColon:D("::",{beforeExpr:_}),dot:D("."),question:D("?",{beforeExpr:_}),questionDot:D("?."),arrow:D("=>",{beforeExpr:_}),template:D("template"),ellipsis:D("...",{beforeExpr:_}),backQuote:D("`",{startsExpr:C}),dollarBraceL:D("${",{beforeExpr:_,startsExpr:C}),templateTail:D("...`",{startsExpr:C}),templateNonTail:D("...${",{beforeExpr:_,startsExpr:C}),at:D("@"),hash:D("#",{startsExpr:C}),interpreterDirective:D("#!..."),eq:D("=",{beforeExpr:_,isAssign:St}),assign:D("_=",{beforeExpr:_,isAssign:St}),slashAssign:D("_=",{beforeExpr:_,isAssign:St}),xorAssign:D("_=",{beforeExpr:_,isAssign:St}),moduloAssign:D("_=",{beforeExpr:_,isAssign:St}),incDec:D("++/--",{prefix:je,postfix:ro,startsExpr:C}),bang:D("!",{beforeExpr:_,prefix:je,startsExpr:C}),tilde:D("~",{beforeExpr:_,prefix:je,startsExpr:C}),doubleCaret:D("^^",{startsExpr:C}),doubleAt:D("@@",{startsExpr:C}),pipeline:ne("|>",0),nullishCoalescing:ne("??",1),logicalOR:ne("||",1),logicalAND:ne("&&",2),bitwiseOR:ne("|",3),bitwiseXOR:ne("^",4),bitwiseAND:ne("&",5),equality:ne("==/!=/===/!==",6),lt:ne("</>/<=/>=",7),gt:ne("</>/<=/>=",7),relational:ne("</>/<=/>=",7),bitShift:ne("<</>>/>>>",8),bitShiftL:ne("<</>>/>>>",8),bitShiftR:ne("<</>>/>>>",8),plusMin:D("+/-",{beforeExpr:_,binop:9,prefix:je,startsExpr:C}),modulo:D("%",{binop:10,startsExpr:C}),star:D("*",{binop:10}),slash:ne("/",10),exponent:D("**",{beforeExpr:_,binop:11,rightAssociative:!0}),_in:j("in",{beforeExpr:_,binop:7}),_instanceof:j("instanceof",{beforeExpr:_,binop:7}),_break:j("break"),_case:j("case",{beforeExpr:_}),_catch:j("catch"),_continue:j("continue"),_debugger:j("debugger"),_default:j("default",{beforeExpr:_}),_else:j("else",{beforeExpr:_}),_finally:j("finally"),_function:j("function",{startsExpr:C}),_if:j("if"),_return:j("return",{beforeExpr:_}),_switch:j("switch"),_throw:j("throw",{beforeExpr:_,prefix:je,startsExpr:C}),_try:j("try"),_var:j("var"),_const:j("const"),_with:j("with"),_new:j("new",{beforeExpr:_,startsExpr:C}),_this:j("this",{startsExpr:C}),_super:j("super",{startsExpr:C}),_class:j("class",{startsExpr:C}),_extends:j("extends",{beforeExpr:_}),_export:j("export"),_import:j("import",{startsExpr:C}),_null:j("null",{startsExpr:C}),_true:j("true",{startsExpr:C}),_false:j("false",{startsExpr:C}),_typeof:j("typeof",{beforeExpr:_,prefix:je,startsExpr:C}),_void:j("void",{beforeExpr:_,prefix:je,startsExpr:C}),_delete:j("delete",{beforeExpr:_,prefix:je,startsExpr:C}),_do:j("do",{isLoop:qs,beforeExpr:_}),_for:j("for",{isLoop:qs}),_while:j("while",{isLoop:qs}),_as:B("as",{startsExpr:C}),_assert:B("assert",{startsExpr:C}),_async:B("async",{startsExpr:C}),_await:B("await",{startsExpr:C}),_defer:B("defer",{startsExpr:C}),_from:B("from",{startsExpr:C}),_get:B("get",{startsExpr:C}),_let:B("let",{startsExpr:C}),_meta:B("meta",{startsExpr:C}),_of:B("of",{startsExpr:C}),_sent:B("sent",{startsExpr:C}),_set:B("set",{startsExpr:C}),_source:B("source",{startsExpr:C}),_static:B("static",{startsExpr:C}),_using:B("using",{startsExpr:C}),_yield:B("yield",{startsExpr:C}),_asserts:B("asserts",{startsExpr:C}),_checks:B("checks",{startsExpr:C}),_exports:B("exports",{startsExpr:C}),_global:B("global",{startsExpr:C}),_implements:B("implements",{startsExpr:C}),_intrinsic:B("intrinsic",{startsExpr:C}),_infer:B("infer",{startsExpr:C}),_is:B("is",{startsExpr:C}),_mixins:B("mixins",{startsExpr:C}),_proto:B("proto",{startsExpr:C}),_require:B("require",{startsExpr:C}),_satisfies:B("satisfies",{startsExpr:C}),_keyof:B("keyof",{startsExpr:C}),_readonly:B("readonly",{startsExpr:C}),_unique:B("unique",{startsExpr:C}),_abstract:B("abstract",{startsExpr:C}),_declare:B("declare",{startsExpr:C}),_enum:B("enum",{startsExpr:C}),_module:B("module",{startsExpr:C}),_namespace:B("namespace",{startsExpr:C}),_interface:B("interface",{startsExpr:C}),_type:B("type",{startsExpr:C}),_opaque:B("opaque",{startsExpr:C}),name:D("name",{startsExpr:C}),string:D("string",{startsExpr:C}),num:D("num",{startsExpr:C}),bigint:D("bigint",{startsExpr:C}),decimal:D("decimal",{startsExpr:C}),regexp:D("regexp",{startsExpr:C}),privateName:D("#name",{startsExpr:C}),eof:D("eof"),jsxName:D("jsxName"),jsxText:D("jsxText",{beforeExpr:!0}),jsxTagStart:D("jsxTagStart",{startsExpr:!0}),jsxTagEnd:D("jsxTagEnd"),placeholder:D("%%",{startsExpr:!0})};function R(i){return i>=93&&i<=132}function no(i){return i<=92}function Te(i){return i>=58&&i<=132}function Ui(i){return i>=58&&i<=136}function ao(i){return xr[i]}function Xs(i){return br[i]}function oo(i){return i>=29&&i<=33}function Ni(i){return i>=129&&i<=131}function lo(i){return i>=90&&i<=92}function Pr(i){return i>=58&&i<=92}function co(i){return i>=39&&i<=59}function uo(i){return i===34}function ho(i){return Tr[i]}function po(i){return i>=121&&i<=123}function fo(i){return i>=124&&i<=130}function Ue(i){return yr[i]}function Zt(i){return gr[i]}function mo(i){return i===57}function ss(i){return i>=24&&i<=25}function De(i){return Oe[i]}Oe[8].updateContext=i=>{i.pop()},Oe[5].updateContext=Oe[7].updateContext=Oe[23].updateContext=i=>{i.push($.brace)},Oe[22].updateContext=i=>{i[i.length-1]===$.template?i.pop():i.push($.template)},Oe[142].updateContext=i=>{i.push($.j_expr,$.j_oTag)};var Sr="\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-\u1C88\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-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\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",Vi="\u200C\u200D\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\u0898-\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",yo=new RegExp("["+Sr+"]"),go=new RegExp("["+Sr+Vi+"]");Sr=Vi=null;var $i=[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,68,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,349,41,7,1,79,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,159,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,264,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,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,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,757,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],xo=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,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,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,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,406,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,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,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,983,6,110,6,6,9,4759,9,787719,239];function Gs(i,s){let e=65536;for(let t=0,r=s.length;t<r;t+=2){if(e+=s[t],e>i)return!1;if(e+=s[t+1],e>=i)return!0}return!1}function Me(i){return i<65?i===36:i<=90?!0:i<97?i===95:i<=122?!0:i<=65535?i>=170&&yo.test(String.fromCharCode(i)):Gs(i,$i)}function st(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&&go.test(String.fromCharCode(i)):Gs(i,$i)||Gs(i,xo)}var Er={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"]},bo=new Set(Er.keyword),To=new Set(Er.strict),Po=new Set(Er.strictBind);function qi(i,s){return s&&i==="await"||i==="enum"}function zi(i,s){return qi(i,s)||To.has(i)}function Wi(i){return Po.has(i)}function Ji(i,s){return zi(i,s)||Wi(i)}function So(i){return bo.has(i)}function Eo(i,s,e){return i===64&&s===64&&Me(e)}var Ao=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 wo(i){return Ao.has(i)}var Ct=class{constructor(s){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=s}},It=class{constructor(s,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=s,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(){let s=this.currentThisScopeFlags();return(s&64)>0&&(s&2)===0}get inStaticBlock(){for(let s=this.scopeStack.length-1;;s--){let{flags:e}=this.scopeStack[s];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(s){return new Ct(s)}enter(s){this.scopeStack.push(this.createScope(s))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(s){return!!(s.flags&130||!this.parser.inModule&&s.flags&1)}declareName(s,e,t){let r=this.currentScope();if(e&8||e&16){this.checkRedeclarationInScope(r,s,e,t);let n=r.names.get(s)||0;e&16?n=n|4:(r.firstLexicalName||(r.firstLexicalName=s),n=n|2),r.names.set(s,n),e&8&&this.maybeExportDefined(r,s)}else if(e&4)for(let n=this.scopeStack.length-1;n>=0&&(r=this.scopeStack[n],this.checkRedeclarationInScope(r,s,e,t),r.names.set(s,(r.names.get(s)||0)|1),this.maybeExportDefined(r,s),!(r.flags&387));--n);this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(s)}maybeExportDefined(s,e){this.parser.inModule&&s.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(s,e,t,r){this.isRedeclaredInScope(s,e,t)&&this.parser.raise(m.VarRedeclaration,r,{identifierName:e})}isRedeclaredInScope(s,e,t){if(!(t&1))return!1;if(t&8)return s.names.has(e);let r=s.names.get(e);return t&16?(r&2)>0||!this.treatFunctionsAsVarInScope(s)&&(r&1)>0:(r&2)>0&&!(s.flags&8&&s.firstLexicalName===e)||!this.treatFunctionsAsVarInScope(s)&&(r&4)>0}checkLocalExport(s){let{name:e}=s;this.scopeStack[0].names.has(e)||this.undefinedExports.set(e,s.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let s=this.scopeStack.length-1;;s--){let{flags:e}=this.scopeStack[s];if(e&387)return e}}currentThisScopeFlags(){for(let s=this.scopeStack.length-1;;s--){let{flags:e}=this.scopeStack[s];if(e&451&&!(e&4))return e}}},Qs=class extends Ct{constructor(...s){super(...s),this.declareFunctions=new Set}},Ys=class extends It{createScope(s){return new Qs(s)}declareName(s,e,t){let r=this.currentScope();if(e&2048){this.checkRedeclarationInScope(r,s,e,t),this.maybeExportDefined(r,s),r.declareFunctions.add(s);return}super.declareName(s,e,t)}isRedeclaredInScope(s,e,t){if(super.isRedeclaredInScope(s,e,t))return!0;if(t&2048&&!s.declareFunctions.has(e)){let r=s.names.get(e);return(r&4)>0||(r&2)>0}return!1}checkLocalExport(s){this.scopeStack[0].declareFunctions.has(s.name)||super.checkLocalExport(s)}},Zs=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}hasPlugin(s){if(typeof s=="string")return this.plugins.has(s);{let[e,t]=s;if(!this.hasPlugin(e))return!1;let r=this.plugins.get(e);for(let n of Object.keys(t))if(r?.[n]!==t[n])return!1;return!0}}getPluginOption(s,e){var t;return(t=this.plugins.get(s))==null?void 0:t[e]}};function Ki(i,s){i.trailingComments===void 0?i.trailingComments=s:i.trailingComments.unshift(...s)}function vo(i,s){i.leadingComments===void 0?i.leadingComments=s:i.leadingComments.unshift(...s)}function Nt(i,s){i.innerComments===void 0?i.innerComments=s:i.innerComments.unshift(...s)}function Et(i,s,e){let t=null,r=s.length;for(;t===null&&r>0;)t=s[--r];t===null||t.start>e.start?Nt(i,e.comments):Ki(t,e.comments)}var er=class extends Zs{addComment(s){this.filename&&(s.loc.filename=this.filename);let{commentsLen:e}=this.state;this.comments.length!==e&&(this.comments.length=e),this.comments.push(s),this.state.commentsLen++}processComment(s){let{commentStack:e}=this.state,t=e.length;if(t===0)return;let r=t-1,n=e[r];n.start===s.end&&(n.leadingNode=s,r--);let{start:a}=s;for(;r>=0;r--){let o=e[r],l=o.end;if(l>a)o.containingNode=s,this.finalizeComment(o),e.splice(r,1);else{l===a&&(o.trailingNode=s);break}}}finalizeComment(s){let{comments:e}=s;if(s.leadingNode!==null||s.trailingNode!==null)s.leadingNode!==null&&Ki(s.leadingNode,e),s.trailingNode!==null&&vo(s.trailingNode,e);else{let{containingNode:t,start:r}=s;if(this.input.charCodeAt(r-1)===44)switch(t.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":Et(t,t.properties,s);break;case"CallExpression":case"OptionalCallExpression":Et(t,t.arguments,s);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":Et(t,t.params,s);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":Et(t,t.elements,s);break;case"ExportNamedDeclaration":case"ImportDeclaration":Et(t,t.specifiers,s);break;default:Nt(t,e)}else Nt(t,e)}}finalizeRemainingComments(){let{commentStack:s}=this.state;for(let e=s.length-1;e>=0;e--)this.finalizeComment(s[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(s){let{commentStack:e}=this.state,{length:t}=e;if(t===0)return;let r=e[t-1];r.leadingNode===s&&(r.leadingNode=null)}resetPreviousIdentifierLeadingComments(s){let{commentStack:e}=this.state,{length:t}=e;t!==0&&(e[t-1].trailingNode===s?e[t-1].trailingNode=null:t>=2&&e[t-2].trailingNode===s&&(e[t-2].trailingNode=null))}takeSurroundingComments(s,e,t){let{commentStack:r}=this.state,n=r.length;if(n===0)return;let a=n-1;for(;a>=0;a--){let o=r[a],l=o.end;if(o.start===t)o.leadingNode=s;else if(l===e)o.trailingNode=s;else if(l<e)break}}},Co=/\r\n|[\r\n\u2028\u2029]/,Gt=new RegExp(Co.source,"g");function rt(i){switch(i){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function ki(i,s,e){for(let t=s;t<e;t++)if(rt(i.charCodeAt(t)))return!0;return!1}var zs=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ws=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function Io(i){switch(i){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var tr=class i{constructor(){this.flags=1024,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.labels=[],this.commentsLen=0,this.commentStack=[],this.pos=0,this.type=139,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.context=[$.brace],this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}get strict(){return(this.flags&1)>0}set strict(s){s?this.flags|=1:this.flags&=-2}init({strictMode:s,sourceType:e,startLine:t,startColumn:r}){this.strict=s===!1?!1:s===!0?!0:e==="module",this.curLine=t,this.lineStart=-r,this.startLoc=this.endLoc=new ve(t,r,0)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(s){s?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(s){s?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(s){s?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(s){s?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(s){s?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(s){s?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(s){s?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(s){s?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(s){s?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(s){s?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(s){s?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(s){s?this.flags|=4096:this.flags&=-4097}curPosition(){return new ve(this.curLine,this.pos-this.lineStart,this.pos)}clone(){let s=new i;return s.flags=this.flags,s.curLine=this.curLine,s.lineStart=this.lineStart,s.startLoc=this.startLoc,s.endLoc=this.endLoc,s.errors=this.errors.slice(),s.potentialArrowAt=this.potentialArrowAt,s.noArrowAt=this.noArrowAt.slice(),s.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),s.topicContext=this.topicContext,s.labels=this.labels.slice(),s.commentsLen=this.commentsLen,s.commentStack=this.commentStack.slice(),s.pos=this.pos,s.type=this.type,s.value=this.value,s.start=this.start,s.end=this.end,s.lastTokEndLoc=this.lastTokEndLoc,s.lastTokStartLoc=this.lastTokStartLoc,s.context=this.context.slice(),s.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,s.strictErrors=this.strictErrors,s.tokensLength=this.tokensLength,s}},No=function(s){return s>=48&&s<=57},Li={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Qt={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 Di(i,s,e,t,r,n){let a=e,o=t,l=r,c="",u=null,h=e,{length:f}=s;for(;;){if(e>=f){n.unterminated(a,o,l),c+=s.slice(h,e);break}let d=s.charCodeAt(e);if(ko(i,d,s,e)){c+=s.slice(h,e);break}if(d===92){c+=s.slice(h,e);let p=Lo(s,e,t,r,i==="template",n);p.ch===null&&!u?u={pos:e,lineStart:t,curLine:r}:c+=p.ch,{pos:e,lineStart:t,curLine:r}=p,h=e}else d===8232||d===8233?(++e,++r,t=e):d===10||d===13?i==="template"?(c+=s.slice(h,e)+`
5
- `,++e,d===13&&s.charCodeAt(e)===10&&++e,++r,h=t=e):n.unterminated(a,o,l):++e}return{pos:e,str:c,firstInvalidLoc:u,lineStart:t,curLine:r,containsInvalid:!!u}}function ko(i,s,e,t){return i==="template"?s===96||s===36&&e.charCodeAt(t+1)===123:s===(i==="double"?34:39)}function Lo(i,s,e,t,r,n){let a=!r;s++;let o=c=>({pos:s,ch:c,lineStart:e,curLine:t}),l=i.charCodeAt(s++);switch(l){case 110:return o(`
6
- `);case 114:return o("\r");case 120:{let c;return{code:c,pos:s}=sr(i,s,e,t,2,!1,a,n),o(c===null?null:String.fromCharCode(c))}case 117:{let c;return{code:c,pos:s}=Xi(i,s,e,t,a,n),o(c===null?null:String.fromCodePoint(c))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:i.charCodeAt(s)===10&&++s;case 10:e=s,++t;case 8232:case 8233:return o("");case 56:case 57:if(r)return o(null);n.strictNumericEscape(s-1,e,t);default:if(l>=48&&l<=55){let c=s-1,h=/^[0-7]+/.exec(i.slice(c,s+2))[0],f=parseInt(h,8);f>255&&(h=h.slice(0,-1),f=parseInt(h,8)),s+=h.length-1;let d=i.charCodeAt(s);if(h!=="0"||d===56||d===57){if(r)return o(null);n.strictNumericEscape(c,e,t)}return o(String.fromCharCode(f))}return o(String.fromCharCode(l))}}function sr(i,s,e,t,r,n,a,o){let l=s,c;return{n:c,pos:s}=Hi(i,s,e,t,16,r,n,!1,o,!a),c===null&&(a?o.invalidEscapeSequence(l,e,t):s=l-1),{code:c,pos:s}}function Hi(i,s,e,t,r,n,a,o,l,c){let u=s,h=r===16?Li.hex:Li.decBinOct,f=r===16?Qt.hex:r===10?Qt.dec:r===8?Qt.oct:Qt.bin,d=!1,p=0;for(let g=0,y=n??1/0;g<y;++g){let b=i.charCodeAt(s),P;if(b===95&&o!=="bail"){let k=i.charCodeAt(s-1),T=i.charCodeAt(s+1);if(o){if(Number.isNaN(T)||!f(T)||h.has(k)||h.has(T)){if(c)return{n:null,pos:s};l.unexpectedNumericSeparator(s,e,t)}}else{if(c)return{n:null,pos:s};l.numericSeparatorInEscapeSequence(s,e,t)}++s;continue}if(b>=97?P=b-97+10:b>=65?P=b-65+10:No(b)?P=b-48:P=1/0,P>=r){if(P<=9&&c)return{n:null,pos:s};if(P<=9&&l.invalidDigit(s,e,t,r))P=0;else if(a)P=0,d=!0;else break}++s,p=p*r+P}return s===u||n!=null&&s-u!==n||d?{n:null,pos:s}:{n:p,pos:s}}function Xi(i,s,e,t,r,n){let a=i.charCodeAt(s),o;if(a===123){if(++s,{code:o,pos:s}=sr(i,s,e,t,i.indexOf("}",s)-s,!0,r,n),++s,o!==null&&o>1114111)if(r)n.invalidCodePoint(s,e,t);else return{code:null,pos:s}}else({code:o,pos:s}=sr(i,s,e,t,4,!1,r,n));return{code:o,pos:s}}function At(i,s,e){return new ve(e,i-s,i)}var Do=new Set([103,109,115,105,121,117,100,118]),we=class{constructor(s){this.type=s.type,this.value=s.value,this.start=s.start,this.end=s.end,this.loc=new nt(s.startLoc,s.endLoc)}},rr=class extends er{constructor(s,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(t,r,n,a)=>this.options.errorRecovery?(this.raise(m.InvalidDigit,At(t,r,n),{radix:a}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(m.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(m.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(m.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(m.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(t,r,n)=>{this.recordStrictModeErrors(m.StrictNumericEscape,At(t,r,n))},unterminated:(t,r,n)=>{throw this.raise(m.UnterminatedString,At(t-1,r,n))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(m.StrictNumericEscape),unterminated:(t,r,n)=>{throw this.raise(m.UnterminatedTemplate,At(t,r,n))}}),this.state=new tr,this.state.init(s),this.input=e,this.length=e.length,this.comments=[],this.isLookahead=!1}pushToken(s){this.tokens.length=this.state.tokensLength,this.tokens.push(s),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.options.tokens&&this.pushToken(new we(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(s){return this.match(s)?(this.next(),!0):!1}match(s){return this.state.type===s}createLookaheadState(s){return{pos:s.pos,value:null,type:s.type,start:s.start,end:s.end,context:[this.curContext()],inType:s.inType,startLoc:s.startLoc,lastTokEndLoc:s.lastTokEndLoc,curLine:s.curLine,lineStart:s.lineStart,curPosition:s.curPosition}}lookahead(){let s=this.state;this.state=this.createLookaheadState(s),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let e=this.state;return this.state=s,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(s){return zs.lastIndex=s,zs.test(this.input)?zs.lastIndex:s}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(s){return Ws.lastIndex=s,Ws.test(this.input)?Ws.lastIndex:s}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(s){let e=this.input.charCodeAt(s);if((e&64512)===55296&&++s<this.input.length){let t=this.input.charCodeAt(s);(t&64512)===56320&&(e=65536+((e&1023)<<10)+(t&1023))}return e}setStrict(s){this.state.strict=s,s&&(this.state.strictErrors.forEach(([e,t])=>this.raise(e,t)),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(s){let e;this.isLookahead||(e=this.state.curPosition());let t=this.state.pos,r=this.input.indexOf(s,t+2);if(r===-1)throw this.raise(m.UnterminatedComment,this.state.curPosition());for(this.state.pos=r+s.length,Gt.lastIndex=t+2;Gt.test(this.input)&&Gt.lastIndex<=r;)++this.state.curLine,this.state.lineStart=Gt.lastIndex;if(this.isLookahead)return;let n={type:"CommentBlock",value:this.input.slice(t+2,r),start:t,end:r+s.length,loc:new nt(e,this.state.curPosition())};return this.options.tokens&&this.pushToken(n),n}skipLineComment(s){let e=this.state.pos,t;this.isLookahead||(t=this.state.curPosition());let r=this.input.charCodeAt(this.state.pos+=s);if(this.state.pos<this.length)for(;!rt(r)&&++this.state.pos<this.length;)r=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let n=this.state.pos,o={type:"CommentLine",value:this.input.slice(e+s,n),start:e,end:n,loc:new nt(t,this.state.curPosition())};return this.options.tokens&&this.pushToken(o),o}skipSpace(){let s=this.state.pos,e=[];e:for(;this.state.pos<this.length;){let t=this.input.charCodeAt(this.state.pos);switch(t){case 32:case 160:case 9:++this.state.pos;break;case 13:this.input.charCodeAt(this.state.pos+1)===10&&++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:{let r=this.skipBlockComment("*/");r!==void 0&&(this.addComment(r),this.options.attachComment&&e.push(r));break}case 47:{let r=this.skipLineComment(2);r!==void 0&&(this.addComment(r),this.options.attachComment&&e.push(r));break}default:break e}break;default:if(Io(t))++this.state.pos;else if(t===45&&!this.inModule&&this.options.annexB){let r=this.state.pos;if(this.input.charCodeAt(r+1)===45&&this.input.charCodeAt(r+2)===62&&(s===0||this.state.lineStart>s)){let n=this.skipLineComment(3);n!==void 0&&(this.addComment(n),this.options.attachComment&&e.push(n))}else break e}else if(t===60&&!this.inModule&&this.options.annexB){let r=this.state.pos;if(this.input.charCodeAt(r+1)===33&&this.input.charCodeAt(r+2)===45&&this.input.charCodeAt(r+3)===45){let 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){let t=this.state.pos,r={start:s,end:t,comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(r)}}finishToken(s,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let t=this.state.type;this.state.type=s,this.state.value=e,this.isLookahead||this.updateContext(t)}replaceToken(s){this.state.type=s,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let s=this.state.pos+1,e=this.codePointAtPos(s);if(e>=48&&e<=57)throw this.raise(m.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?m.RecordExpressionHashIncorrectStartSyntaxType:m.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else Me(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(){let s=this.input.charCodeAt(this.state.pos+1);if(s>=48&&s<=57){this.readNumber(!0);return}s===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 s=this.input.charCodeAt(this.state.pos+1);if(s!==33)return!1;let e=this.state.pos;for(this.state.pos+=1;!rt(s)&&++this.state.pos<this.length;)s=this.input.charCodeAt(this.state.pos);let t=this.input.slice(e+2,this.state.pos);return this.finishToken(28,t),!0}readToken_mult_modulo(s){let e=s===42?55:54,t=1,r=this.input.charCodeAt(this.state.pos+1);s===42&&r===42&&(t++,r=this.input.charCodeAt(this.state.pos+2),e=57),r===61&&!this.state.inType&&(t++,e=s===37?33:30),this.finishOp(e,t)}readToken_pipe_amp(s){let e=this.input.charCodeAt(this.state.pos+1);if(e===s){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(30,3):this.finishOp(s===124?41:42,2);return}if(s===124){if(e===62){this.finishOp(39,2);return}if(this.hasPlugin("recordAndTuple")&&e===125){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(m.RecordExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(9);return}if(this.hasPlugin("recordAndTuple")&&e===93){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(m.TupleExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(4);return}}if(e===61){this.finishOp(30,2);return}this.finishOp(s===124?43:45,1)}readToken_caret(){let s=this.input.charCodeAt(this.state.pos+1);s===61&&!this.state.inType?this.finishOp(32,2):s===94&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"^^"}])?(this.finishOp(37,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(44,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"@@"}])?this.finishOp(38,2):this.finishOp(26,1)}readToken_plus_min(s){let e=this.input.charCodeAt(this.state.pos+1);if(e===s){this.finishOp(34,2);return}e===61?this.finishOp(30,2):this.finishOp(53,1)}readToken_lt(){let{pos:s}=this.state,e=this.input.charCodeAt(s+1);if(e===60){if(this.input.charCodeAt(s+2)===61){this.finishOp(30,3);return}this.finishOp(51,2);return}if(e===61){this.finishOp(49,2);return}this.finishOp(47,1)}readToken_gt(){let{pos:s}=this.state,e=this.input.charCodeAt(s+1);if(e===62){let t=this.input.charCodeAt(s+2)===62?3:2;if(this.input.charCodeAt(s+t)===61){this.finishOp(30,t+1);return}this.finishOp(52,t);return}if(e===61){this.finishOp(49,2);return}this.finishOp(48,1)}readToken_eq_excl(s){let e=this.input.charCodeAt(this.state.pos+1);if(e===61){this.finishOp(46,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(s===61&&e===62){this.state.pos+=2,this.finishToken(19);return}this.finishOp(s===61?29:35,1)}readToken_question(){let s=this.input.charCodeAt(this.state.pos+1),e=this.input.charCodeAt(this.state.pos+2);s===63?e===61?this.finishOp(30,3):this.finishOp(40,2):s===46&&!(e>=48&&e<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(s){switch(s){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(m.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(m.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:{let 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(s);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(s);return;case 124:case 38:this.readToken_pipe_amp(s);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(s);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(s);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(Me(s)){this.readWord(s);return}}throw this.raise(m.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(s)})}finishOp(s,e){let t=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(s,t)}readRegexp(){let s=this.state.startLoc,e=this.state.start+1,t,r,{pos:n}=this.state;for(;;++n){if(n>=this.length)throw this.raise(m.UnterminatedRegExp,ae(s,1));let c=this.input.charCodeAt(n);if(rt(c))throw this.raise(m.UnterminatedRegExp,ae(s,1));if(t)t=!1;else{if(c===91)r=!0;else if(c===93&&r)r=!1;else if(c===47&&!r)break;t=c===92}}let a=this.input.slice(e,n);++n;let o="",l=()=>ae(s,n+2-e);for(;n<this.length;){let c=this.codePointAtPos(n),u=String.fromCharCode(c);if(Do.has(c))c===118?o.includes("u")&&this.raise(m.IncompatibleRegExpUVFlags,l()):c===117&&o.includes("v")&&this.raise(m.IncompatibleRegExpUVFlags,l()),o.includes(u)&&this.raise(m.DuplicateRegExpFlags,l());else if(st(c)||c===92)this.raise(m.MalformedRegExpFlags,l());else break;++n,o+=u}this.state.pos=n,this.finishToken(137,{pattern:a,flags:o})}readInt(s,e,t=!1,r=!0){let{n,pos:a}=Hi(this.input,this.state.pos,this.state.lineStart,this.state.curLine,s,e,t,r,this.errorHandlers_readInt,!1);return this.state.pos=a,n}readRadixNumber(s){let e=this.state.curPosition(),t=!1;this.state.pos+=2;let r=this.readInt(s);r==null&&this.raise(m.InvalidDigit,ae(e,2),{radix:s});let n=this.input.charCodeAt(this.state.pos);if(n===110)++this.state.pos,t=!0;else if(n===109)throw this.raise(m.InvalidDecimal,e);if(Me(this.codePointAtPos(this.state.pos)))throw this.raise(m.NumberIdentifier,this.state.curPosition());if(t){let a=this.input.slice(e.index,this.state.pos).replace(/[_n]/g,"");this.finishToken(135,a);return}this.finishToken(134,r)}readNumber(s){let e=this.state.pos,t=this.state.curPosition(),r=!1,n=!1,a=!1,o=!1,l=!1;!s&&this.readInt(10)===null&&this.raise(m.InvalidNumber,this.state.curPosition());let c=this.state.pos-e>=2&&this.input.charCodeAt(e)===48;if(c){let d=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(m.StrictOctalLiteral,t),!this.state.strict){let p=d.indexOf("_");p>0&&this.raise(m.ZeroDigitNumericSeparator,ae(t,p))}l=c&&!/[89]/.test(d)}let u=this.input.charCodeAt(this.state.pos);if(u===46&&!l&&(++this.state.pos,this.readInt(10),r=!0,u=this.input.charCodeAt(this.state.pos)),(u===69||u===101)&&!l&&(u=this.input.charCodeAt(++this.state.pos),(u===43||u===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(m.InvalidOrMissingExponent,t),r=!0,o=!0,u=this.input.charCodeAt(this.state.pos)),u===110&&((r||c)&&this.raise(m.InvalidBigIntLiteral,t),++this.state.pos,n=!0),u===109&&(this.expectPlugin("decimal",this.state.curPosition()),(o||c)&&this.raise(m.InvalidDecimal,t),++this.state.pos,a=!0),Me(this.codePointAtPos(this.state.pos)))throw this.raise(m.NumberIdentifier,this.state.curPosition());let h=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(n){this.finishToken(135,h);return}if(a){this.finishToken(136,h);return}let f=l?parseInt(h,8):parseFloat(h);this.finishToken(134,f)}readCodePoint(s){let{code:e,pos:t}=Xi(this.input,this.state.pos,this.state.lineStart,this.state.curLine,s,this.errorHandlers_readCodePoint);return this.state.pos=t,e}readString(s){let{str:e,pos:t,curLine:r,lineStart:n}=Di(s===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=t+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(){let s=this.input[this.state.pos],{str:e,firstInvalidLoc:t,pos:r,curLine:n,lineStart:a}=Di("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,t&&(this.state.firstInvalidTemplateEscapePos=new ve(t.curLine,t.pos-t.lineStart,t.pos)),this.input.codePointAt(r)===96?this.finishToken(24,t?null:s+e+"`"):(this.state.pos++,this.finishToken(25,t?null:s+e+"${"))}recordStrictModeErrors(s,e){let t=e.index;this.state.strict&&!this.state.strictErrors.has(t)?this.raise(s,e):this.state.strictErrors.set(t,[s,e])}readWord1(s){this.state.containsEsc=!1;let e="",t=this.state.pos,r=this.state.pos;for(s!==void 0&&(this.state.pos+=s<=65535?1:2);this.state.pos<this.length;){let n=this.codePointAtPos(this.state.pos);if(st(n))this.state.pos+=n<=65535?1:2;else if(n===92){this.state.containsEsc=!0,e+=this.input.slice(r,this.state.pos);let a=this.state.curPosition(),o=this.state.pos===t?Me:st;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(m.MissingUnicodeEscape,this.state.curPosition()),r=this.state.pos-1;continue}++this.state.pos;let l=this.readCodePoint(!0);l!==null&&(o(l)||this.raise(m.EscapedCharNotAnIdentifier,a),e+=String.fromCodePoint(l)),r=this.state.pos}else break}return e+this.input.slice(r,this.state.pos)}readWord(s){let e=this.readWord1(s),t=mr.get(e);t!==void 0?this.finishToken(t,Ue(t)):this.finishToken(132,e)}checkKeywordEscapes(){let{type:s}=this.state;Pr(s)&&this.state.containsEsc&&this.raise(m.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:Ue(s)})}raise(s,e,t={}){let r=e instanceof ve?e:e.loc.start,n=s(r,t);if(!this.options.errorRecovery)throw n;return this.isLookahead||this.state.errors.push(n),n}raiseOverwrite(s,e,t={}){let r=e instanceof ve?e:e.loc.start,n=r.index,a=this.state.errors;for(let o=a.length-1;o>=0;o--){let l=a[o];if(l.loc.index===n)return a[o]=s(r,t);if(l.loc.index<n)break}return this.raise(s,e,t)}updateContext(s){}unexpected(s,e){throw this.raise(m.UnexpectedToken,s??this.state.startLoc,{expected:e?Ue(e):null})}expectPlugin(s,e){if(this.hasPlugin(s))return!0;throw this.raise(m.MissingPlugin,e??this.state.startLoc,{missingPlugin:[s]})}expectOnePlugin(s){if(!s.some(e=>this.hasPlugin(e)))throw this.raise(m.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:s})}errorBuilder(s){return(e,t,r)=>{this.raise(s,At(e,t,r))}}},ir=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},nr=class{constructor(s){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=s}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new ir)}exit(){let s=this.stack.pop(),e=this.current();for(let[t,r]of Array.from(s.undefinedPrivateNames))e?e.undefinedPrivateNames.has(t)||e.undefinedPrivateNames.set(t,r):this.parser.raise(m.InvalidPrivateFieldResolution,r,{identifierName:t})}declarePrivateName(s,e,t){let{privateNames:r,loneAccessors:n,undefinedPrivateNames:a}=this.current(),o=r.has(s);if(e&3){let l=o&&n.get(s);if(l){let c=l&4,u=e&4,h=l&3,f=e&3;o=h===f||c!==u,o||n.delete(s)}else o||n.set(s,e)}o&&this.parser.raise(m.PrivateNameRedeclaration,t,{identifierName:s}),r.add(s),a.delete(s)}usePrivateName(s,e){let t;for(t of this.stack)if(t.privateNames.has(s))return;t?t.undefinedPrivateNames.set(s,e):this.parser.raise(m.InvalidPrivateFieldResolution,e,{identifierName:s})}},at=class{constructor(s=0){this.type=s}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},rs=class extends at{constructor(s){super(s),this.declarationErrors=new Map}recordDeclarationError(s,e){let t=e.index;this.declarationErrors.set(t,[s,e])}clearDeclarationError(s){this.declarationErrors.delete(s)}iterateErrors(s){this.declarationErrors.forEach(s)}},ar=class{constructor(s){this.parser=void 0,this.stack=[new at],this.parser=s}enter(s){this.stack.push(s)}exit(){this.stack.pop()}recordParameterInitializerError(s,e){let t=e.loc.start,{stack:r}=this,n=r.length-1,a=r[n];for(;!a.isCertainlyParameterDeclaration();){if(a.canBeArrowParameterDeclaration())a.recordDeclarationError(s,t);else return;a=r[--n]}this.parser.raise(s,t)}recordArrowParameterBindingError(s,e){let{stack:t}=this,r=t[t.length-1],n=e.loc.start;if(r.isCertainlyParameterDeclaration())this.parser.raise(s,n);else if(r.canBeArrowParameterDeclaration())r.recordDeclarationError(s,n);else return}recordAsyncArrowParametersError(s){let{stack:e}=this,t=e.length-1,r=e[t];for(;r.canBeArrowParameterDeclaration();)r.type===2&&r.recordDeclarationError(m.AwaitBindingIdentifier,s),r=e[--t]}validateAsPattern(){let{stack:s}=this,e=s[s.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors(([t,r])=>{this.parser.raise(t,r);let n=s.length-2,a=s[n];for(;a.canBeArrowParameterDeclaration();)a.clearDeclarationError(r.index),a=s[--n]})}};function Oo(){return new at(3)}function Mo(){return new rs(1)}function Fo(){return new rs(2)}function Gi(){return new at}var or=class{constructor(){this.stacks=[]}enter(s){this.stacks.push(s)}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 es(i,s){return(i?2:0)|(s?1:0)}var lr=class extends rr{addExtra(s,e,t,r=!0){if(!s)return;let{extra:n}=s;n==null&&(n={},s.extra=n),r?n[e]=t:Object.defineProperty(n,e,{enumerable:r,value:t})}isContextual(s){return this.state.type===s&&!this.state.containsEsc}isUnparsedContextual(s,e){let t=s+e.length;if(this.input.slice(s,t)===e){let r=this.input.charCodeAt(t);return!(st(r)||(r&64512)===55296)}return!1}isLookaheadContextual(s){let e=this.nextTokenStart();return this.isUnparsedContextual(e,s)}eatContextual(s){return this.isContextual(s)?(this.next(),!0):!1}expectContextual(s,e){if(!this.eatContextual(s)){if(e!=null)throw this.raise(e,this.state.startLoc);this.unexpected(null,s)}}canInsertSemicolon(){return this.match(139)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return ki(this.input,this.state.lastTokEndLoc.index,this.state.start)}hasFollowingLineBreak(){return ki(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(s=!0){(s?this.isLineTerminator():this.eat(13))||this.raise(m.MissingSemicolon,this.state.lastTokEndLoc)}expect(s,e){this.eat(s)||this.unexpected(e,s)}tryParse(s,e=this.state.clone()){let t={node:null};try{let r=s((n=null)=>{throw t.node=n,t});if(this.state.errors.length>e.errors.length){let 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){let n=this.state;if(this.state=e,r instanceof SyntaxError)return{node:null,error:r,thrown:!0,aborted:!1,failState:n};if(r===t)return{node:t.node,error:null,thrown:!1,aborted:!0,failState:n};throw r}}checkExpressionErrors(s,e){if(!s)return!1;let{shorthandAssignLoc:t,doubleProtoLoc:r,privateKeyLoc:n,optionalParametersLoc:a}=s,o=!!t||!!r||!!a||!!n;if(!e)return o;t!=null&&this.raise(m.InvalidCoverInitializedName,t),r!=null&&this.raise(m.DuplicateProto,r),n!=null&&this.raise(m.UnexpectedPrivateField,n),a!=null&&this.unexpected(a)}isLiteralPropertyName(){return Ui(this.state.type)}isPrivateName(s){return s.type==="PrivateName"}getPrivateNameSV(s){return s.id.name}hasPropertyAsPrivateName(s){return(s.type==="MemberExpression"||s.type==="OptionalMemberExpression")&&this.isPrivateName(s.property)}isObjectProperty(s){return s.type==="ObjectProperty"}isObjectMethod(s){return s.type==="ObjectMethod"}initializeScopes(s=this.options.sourceType==="module"){let e=this.state.labels;this.state.labels=[];let t=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let r=this.inModule;this.inModule=s;let n=this.scope,a=this.getScopeHandler();this.scope=new a(this,s);let o=this.prodParam;this.prodParam=new or;let l=this.classScope;this.classScope=new nr(this);let c=this.expressionScope;return this.expressionScope=new ar(this),()=>{this.state.labels=e,this.exportedIdentifiers=t,this.inModule=r,this.scope=n,this.prodParam=o,this.classScope=l,this.expressionScope=c}}enterInitialScopes(){let s=0;this.inModule&&(s|=2),this.scope.enter(1),this.prodParam.enter(s)}checkDestructuringPrivate(s){let{privateKeyLoc:e}=s;e!==null&&this.expectPlugin("destructuringPrivate",e)}},it=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}},ot=class{constructor(s,e,t){this.type="",this.start=e,this.end=0,this.loc=new nt(t),s!=null&&s.options.ranges&&(this.range=[e,0]),s!=null&&s.filename&&(this.loc.filename=s.filename)}},Ar=ot.prototype;Ar.__clone=function(){let i=new ot(void 0,this.start,this.loc.start),s=Object.keys(this);for(let e=0,t=s.length;e<t;e++){let r=s[e];r!=="leadingComments"&&r!=="trailingComments"&&r!=="innerComments"&&(i[r]=this[r])}return i};function Bo(i){return Be(i)}function Be(i){let{type:s,start:e,end:t,loc:r,range:n,extra:a,name:o}=i,l=Object.create(Ar);return l.type=s,l.start=e,l.end=t,l.loc=r,l.range=n,l.extra=a,l.name=o,s==="Placeholder"&&(l.expectedNode=i.expectedNode),l}function _o(i){let{type:s,start:e,end:t,loc:r,range:n,extra:a}=i;if(s==="Placeholder")return Bo(i);let o=Object.create(Ar);return o.type=s,o.start=e,o.end=t,o.loc=r,o.range=n,i.raw!==void 0?o.raw=i.raw:o.extra=a,o.value=i.value,o}var cr=class extends lr{startNode(){let s=this.state.startLoc;return new ot(this,s.index,s)}startNodeAt(s){return new ot(this,s.index,s)}startNodeAtNode(s){return this.startNodeAt(s.loc.start)}finishNode(s,e){return this.finishNodeAt(s,e,this.state.lastTokEndLoc)}finishNodeAt(s,e,t){return s.type=e,s.end=t.index,s.loc.end=t,this.options.ranges&&(s.range[1]=t.index),this.options.attachComment&&this.processComment(s),s}resetStartLocation(s,e){s.start=e.index,s.loc.start=e,this.options.ranges&&(s.range[0]=e.index)}resetEndLocation(s,e=this.state.lastTokEndLoc){s.end=e.index,s.loc.end=e,this.options.ranges&&(s.range[1]=e.index)}resetStartLocationFromNode(s,e){this.resetStartLocation(s,e.loc.start)}},jo=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),O=Fe`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:i})=>`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:s})=>`Boolean enum members need to be initialized. Use either \`${i} = true,\` or \`${i} = false,\` in enum \`${s}\`.`,EnumDuplicateMemberName:({memberName:i,enumName:s})=>`Enum member names need to be unique, but the name \`${i}\` has already been used before in enum \`${s}\`.`,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:s})=>`Enum type \`${i}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${s}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:i})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${i}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:i,memberName:s,explicitType:e})=>`Enum \`${i}\` has type \`${e}\`, so the initializer of \`${s}\` needs to be a ${e} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:i,memberName:s})=>`Symbol enum members cannot be initialized. Use \`${s},\` in enum \`${i}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:i,memberName:s})=>`The enum member initializer for \`${s}\` needs to be a literal (either a boolean, number, or string) in enum \`${i}\`.`,EnumInvalidMemberName:({enumName:i,memberName:s,suggestion:e})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${s}\`, consider using \`${e}\`, in enum \`${i}\`.`,EnumNumberMemberNotInitialized:({enumName:i,memberName:s})=>`Number enum members need to be initialized, e.g. \`${s} = 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 `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:i,suggestion:s})=>`\`declare export ${i}\` is not supported. Use \`${s}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function Ro(i){return i.type==="DeclareExportAllDeclaration"||i.type==="DeclareExportDeclaration"&&(!i.declaration||i.declaration.type!=="TypeAlias"&&i.declaration.type!=="InterfaceDeclaration")}function Oi(i){return i.importKind==="type"||i.importKind==="typeof"}var Uo={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function Vo(i,s){let e=[],t=[];for(let r=0;r<i.length;r++)(s(i[r],r,i)?e:t).push(i[r]);return[e,t]}var $o=/\*?\s*@((?:no)?flow)\b/,qo=i=>class extends i{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return Ys}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}shouldParseEnums(){return!!this.getPluginOption("flow","enums")}finishToken(e,t){e!==133&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,t)}addComment(e){if(this.flowPragma===void 0){let t=$o.exec(e.value);if(t)if(t[1]==="flow")this.flowPragma="flow";else if(t[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let t=this.state.inType;this.state.inType=!0,this.expect(e||14);let r=this.flowParseType();return this.state.inType=t,r}flowParsePredicate(){let e=this.startNode(),t=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>t.index+1&&this.raise(O.UnexpectedSpaceBetweenModuloChecks,t),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let e=this.state.inType;this.state.inType=!0,this.expect(14);let t=null,r=null;return this.match(54)?(this.state.inType=e,r=this.flowParsePredicate()):(t=this.flowParseType(),this.state.inType=e,this.match(54)&&(r=this.flowParsePredicate())),[t,r]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let t=e.id=this.parseIdentifier(),r=this.startNode(),n=this.startNode();this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,this.expect(10);let 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"),t.typeAnnotation=this.finishNode(n,"TypeAnnotation"),this.resetEndLocation(t),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,t){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):(t&&this.raise(O.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,t);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();let t=e.body=this.startNode(),r=t.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(O.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(o)):(this.expectContextual(125,O.UnsupportedStatementInDeclareModule),o=this.flowParseDeclare(o,!0)),r.push(o)}this.scope.exit(),this.expect(8),this.finishNode(t,"BlockStatement");let n=null,a=!1;return r.forEach(o=>{Ro(o)?(n==="CommonJS"&&this.raise(O.AmbiguousDeclareModuleKind,o),n="ES"):o.type==="DeclareModuleExports"&&(a&&this.raise(O.DuplicateDeclareModuleExports,o),n==="ES"&&this.raise(O.AmbiguousDeclareModuleKind,o),n="CommonJS",a=!0)}),e.kind=n||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,t){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))&&!t){let r=this.state.value;throw this.raise(O.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:r,suggestion:Uo[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();let t=this.flowParseTypeAlias(e);return t.type="DeclareTypeAlias",t}flowParseDeclareOpaqueType(e){this.next();let t=this.flowParseOpaqueType(e,!0);return t.type="DeclareOpaqueType",t}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,t){if(e.id=this.flowParseRestrictedIdentifier(!t,!0),this.scope.declareName(e.id.name,t?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(!t&&this.eat(12));if(t){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:t,allowExact:!1,allowSpread:!1,allowProto:t,allowInexact:!1})}flowParseInterfaceExtends(){let 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(O.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,t,r){jo.has(e)&&this.raise(r?O.AssignReservedType:O.UnexpectedReservedType,t,{reservedType:e})}flowParseRestrictedIdentifier(e,t){return this.checkReservedType(this.state.value,this.state.startLoc,t),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,t){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,t||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){let t=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(O.MissingTypeParamDefault,t),this.finishNode(r,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,t=this.startNode();t.params=[],this.state.inType=!0,this.match(47)||this.match(142)?this.next():this.unexpected();let r=!1;do{let n=this.flowParseTypeParameter(r);t.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(t,"TypeParameterDeclaration")}flowParseTypeParameterInstantiation(){let e=this.startNode(),t=this.state.inType;e.params=[],this.state.inType=!0,this.expect(47);let 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=t,this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){let e=this.startNode(),t=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=t,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let 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,t,r){return e.static=t,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,t){return e.static=t,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,t){let r=this.startNode();return e.static=t,e.value=this.flowParseObjectTypeMethodish(r),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:t,allowSpread:r,allowProto:n,allowInexact:a}){let o=this.state.inType;this.state.inType=!0;let l=this.startNode();l.callProperties=[],l.properties=[],l.indexers=[],l.internalSlots=[];let c,u,h=!1;for(t&&this.match(6)?(this.expect(6),c=9,u=!0):(this.expect(5),c=8,u=!1),l.exact=u;!this.match(c);){let d=!1,p=null,g=null,y=this.startNode();if(n&&this.isContextual(118)){let P=this.lookahead();P.type!==14&&P.type!==17&&(this.next(),p=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){let P=this.lookahead();P.type!==14&&P.type!==17&&(this.next(),d=!0)}let b=this.flowParseVariance();if(this.eat(0))p!=null&&this.unexpected(p),this.eat(0)?(b&&this.unexpected(b.loc.start),l.internalSlots.push(this.flowParseObjectTypeInternalSlot(y,d))):l.indexers.push(this.flowParseObjectTypeIndexer(y,d,b));else if(this.match(10)||this.match(47))p!=null&&this.unexpected(p),b&&this.unexpected(b.loc.start),l.callProperties.push(this.flowParseObjectTypeCallProperty(y,d));else{let P="init";if(this.isContextual(99)||this.isContextual(104)){let T=this.lookahead();Ui(T.type)&&(P=this.state.value,this.next())}let k=this.flowParseObjectTypeProperty(y,d,p,b,P,r,a??!u);k===null?(h=!0,g=this.state.lastTokStartLoc):l.properties.push(k)}this.flowObjectTypeSemicolon(),g&&!this.match(8)&&!this.match(9)&&this.raise(O.UnexpectedExplicitInexactInObject,g)}this.expect(c),r&&(l.inexact=h);let f=this.finishNode(l,"ObjectTypeAnnotation");return this.state.inType=o,f}flowParseObjectTypeProperty(e,t,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(O.InexactInsideExact,this.state.lastTokStartLoc):this.raise(O.InexactInsideNonObject,this.state.lastTokStartLoc),n&&this.raise(O.InexactVariance,n),null):(o||this.raise(O.UnexpectedSpreadType,this.state.lastTokStartLoc),r!=null&&this.unexpected(r),n&&this.raise(O.SpreadVariance,n),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=t,e.proto=r!=null,e.kind=a;let c=!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(O.ThisParamBannedInConstructor,e.value.this)):(a!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(c=!0),e.value=this.flowParseTypeInitialiser(),e.variance=n),e.optional=c,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let t=e.kind==="get"?0:1,r=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?O.GetterMayNotHaveThisParam:O.SetterMayNotHaveThisParam,e.value.this),r!==t&&this.raise(e.kind==="get"?m.BadGetterArity:m.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(m.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,t){var r;(r=e)!=null||(e=this.state.startLoc);let n=t||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let a=this.startNodeAt(e);a.qualification=n,a.id=this.flowParseRestrictedIdentifier(!0),n=this.finishNode(a,"QualifiedTypeIdentifier")}return n}flowParseGenericType(e,t){let r=this.startNodeAt(e);return r.typeParameters=null,r.id=this.flowParseQualifiedTypeIdentifier(e,t),this.match(47)&&(r.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(r,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.pos<this.length&&!this.match(3)&&(e.types.push(this.flowParseType()),!this.match(3));)this.expect(12);return this.expect(3),this.finishNode(e,"TupleTypeAnnotation")}flowParseFunctionTypeParam(e){let t=null,r=!1,n=null,a=this.startNode(),o=this.lookahead(),l=this.state.type===78;return o.type===14||o.type===17?(l&&!e&&this.raise(O.ThisParamMustBeFirst,a),t=this.parseIdentifier(l),this.eat(17)&&(r=!0,l&&this.raise(O.ThisParamMayNotBeOptional,a)),n=this.flowParseTypeInitialiser()):n=this.flowParseType(),a.name=t,a.optional=r,a.typeAnnotation=n,this.finishNode(a,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(e){let t=this.startNodeAt(e.loc.start);return t.name=null,t.optional=!1,t.typeAnnotation=e,this.finishNode(t,"FunctionTypeParam")}flowParseFunctionTypeParams(e=[]){let t=null,r=null;for(this.match(78)&&(r=this.flowParseFunctionTypeParam(!0),r.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(t=this.flowParseFunctionTypeParam(!1)),{params:e,rest:t,_this:r}}flowIdentToTypeAnnotation(e,t,r){switch(r.name){case"any":return this.finishNode(t,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(t,"BooleanTypeAnnotation");case"mixed":return this.finishNode(t,"MixedTypeAnnotation");case"empty":return this.finishNode(t,"EmptyTypeAnnotation");case"number":return this.finishNode(t,"NumberTypeAnnotation");case"string":return this.finishNode(t,"StringTypeAnnotation");case"symbol":return this.finishNode(t,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(r.name),this.flowParseGenericType(e,r)}}flowParsePrimaryType(){let e=this.state.startLoc,t=this.startNode(),r,n,a=!1,o=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,n=this.flowParseTupleType(),this.state.noAnonFunctionType=o,n;case 47:{let l=this.startNode();return l.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),r=this.flowParseFunctionTypeParams(),l.params=r.params,l.rest=r.rest,l.this=r._this,this.expect(11),this.expect(19),l.returnType=this.flowParseType(),this.finishNode(l,"FunctionTypeAnnotation")}case 10:{let l=this.startNode();if(this.next(),!this.match(11)&&!this.match(21))if(R(this.state.type)||this.match(78)){let c=this.lookahead().type;a=c!==17&&c!==14}else a=!0;if(a){if(this.state.noAnonFunctionType=!1,n=this.flowParseType(),this.state.noAnonFunctionType=o,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),n;this.eat(12)}return n?r=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(n)]):r=this.flowParseFunctionTypeParams(),l.params=r.params,l.rest=r.rest,l.this=r._this,this.expect(11),this.expect(19),l.returnType=this.flowParseType(),l.typeParameters=null,this.finishNode(l,"FunctionTypeAnnotation")}case 133:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return t.value=this.match(85),this.next(),this.finishNode(t,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(134))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",t);if(this.match(135))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",t);throw this.raise(O.UnexpectedSubtractionOperand,this.state.startLoc)}this.unexpected();return;case 134:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 135:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(t,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(t,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(t,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(t,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(Pr(this.state.type)){let l=Ue(this.state.type);return this.next(),super.createIdentifier(t,l)}else if(R(this.state.type))return this.isContextual(129)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,t,this.parseIdentifier())}this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,t=this.flowParsePrimaryType(),r=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){let n=this.startNodeAt(e),a=this.eat(18);r=r||a,this.expect(0),!a&&this.match(3)?(n.elementType=t,this.next(),t=this.finishNode(n,"ArrayTypeAnnotation")):(n.objectType=t,n.indexType=this.flowParseType(),this.expect(3),r?(n.optional=a,t=this.finishNode(n,"OptionalIndexedAccessType")):t=this.finishNode(n,"IndexedAccessType"))}return t}flowParsePrefixType(){let e=this.startNode();return this.eat(17)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){let t=this.startNodeAt(e.loc.start);return t.params=[this.reinterpretTypeAsFunctionTypeParam(e)],t.rest=null,t.this=null,t.returnType=this.flowParseType(),t.typeParameters=null,this.finishNode(t,"FunctionTypeAnnotation")}return e}flowParseIntersectionType(){let e=this.startNode();this.eat(45);let t=this.flowParseAnonFunctionWithoutParens();for(e.types=[t];this.eat(45);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?t:this.finishNode(e,"IntersectionTypeAnnotation")}flowParseUnionType(){let e=this.startNode();this.eat(43);let t=this.flowParseIntersectionType();for(e.types=[t];this.eat(43);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?t:this.finishNode(e,"UnionTypeAnnotation")}flowParseType(){let e=this.state.inType;this.state.inType=!0;let t=this.flowParseUnionType();return this.state.inType=e,t}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){let e=this.state.startLoc,t=this.parseIdentifier();return this.flowParseGenericType(e,t)}else return this.flowParseType()}flowParseTypeAnnotation(){let e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(e){let t=e?this.parseIdentifier():this.flowParseRestrictedIdentifier();return this.match(14)&&(t.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(t)),t}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}flowParseVariance(){let e=null;return this.match(53)?(e=this.startNode(),this.state.value==="+"?e.kind="plus":e.kind="minus",this.next(),this.finishNode(e,"Variance")):e}parseFunctionBody(e,t,r=!1){if(t){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,r));return}super.parseFunctionBody(e,!1,r)}parseFunctionBodyAndFinish(e,t,r=!1){if(this.match(14)){let n=this.startNode();[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=n.typeAnnotation?this.finishNode(n,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,t,r)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){let r=this.lookahead();if(Te(r.type)){let n=this.startNode();return this.next(),this.flowParseInterface(n)}}else if(this.shouldParseEnums()&&this.isContextual(126)){let r=this.startNode();return this.next(),this.flowParseEnumDeclaration(r)}let t=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(t)&&(this.flowPragma=null),t}parseExpressionStatement(e,t,r){if(t.type==="Identifier"){if(t.name==="declare"){if(this.match(80)||R(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(R(this.state.type)){if(t.name==="interface")return this.flowParseInterface(e);if(t.name==="type")return this.flowParseTypeAlias(e);if(t.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,t,r)}shouldParseExportDeclaration(){let{type:e}=this.state;return Ni(e)||this.shouldParseEnums()&&e===126?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return Ni(e)||this.shouldParseEnums()&&e===126?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.shouldParseEnums()&&this.isContextual(126)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,t,r){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let f=this.lookaheadCharCode();if(f===44||f===61||f===58||f===41)return this.setOptionalParametersError(r),e}this.expect(17);let n=this.state.clone(),a=this.state.noArrowAt,o=this.startNodeAt(t),{consequent:l,failed:c}=this.tryParseConditionalConsequent(),[u,h]=this.getArrowLikeExpressions(l);if(c||h.length>0){let f=[...a];if(h.length>0){this.state=n,this.state.noArrowAt=f;for(let d=0;d<h.length;d++)f.push(h[d].start);({consequent:l,failed:c}=this.tryParseConditionalConsequent()),[u,h]=this.getArrowLikeExpressions(l)}c&&u.length>1&&this.raise(O.AmbiguousConditionalArrow,n.startLoc),c&&u.length===1&&(this.state=n,f.push(u[0].start),this.state.noArrowAt=f,{consequent:l,failed:c}=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);let e=this.parseMaybeAssignAllowIn(),t=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:t}}getArrowLikeExpressions(e,t){let r=[e],n=[];for(;r.length!==0;){let 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 t?(n.forEach(a=>this.finishArrowValidation(a)),[n,[]]):Vo(n,a=>a.params.every(o=>this.isAssignable(o,!0)))}finishArrowValidation(e){var t;this.toAssignableList(e.params,(t=e.extra)==null?void 0:t.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,t){let r;return this.state.noArrowParamsConversionAt.includes(e.start)?(this.state.noArrowParamsConversionAt.push(this.state.start),r=t(),this.state.noArrowParamsConversionAt.pop()):r=t(),r}parseParenItem(e,t){let r=super.parseParenItem(e,t);if(this.eat(17)&&(r.optional=!0,this.resetEndLocation(e)),this.match(14)){let n=this.startNodeAt(t);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";let t=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(t)}else if(this.isContextual(131)){e.exportKind="type";let t=this.startNode();return this.next(),this.flowParseOpaqueType(t,!1)}else if(this.isContextual(129)){e.exportKind="type";let t=this.startNode();return this.next(),this.flowParseInterface(t)}else if(this.shouldParseEnums()&&this.isContextual(126)){e.exportKind="value";let t=this.startNode();return this.next(),this.flowParseEnumDeclaration(t)}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){let{startLoc:t}=this.state,r=super.maybeParseExportNamespaceSpecifier(e);return r&&e.exportKind==="type"&&this.unexpected(t),r}parseClassId(e,t,r){super.parseClassId(e,t,r),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,t,r){let{startLoc:n}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,t))return;t.declare=!0}super.parseClassMember(e,t,r),t.declare&&(t.type!=="ClassProperty"&&t.type!=="ClassPrivateProperty"&&t.type!=="PropertyDefinition"?this.raise(O.DeclareClassElement,n):t.value&&this.raise(O.DeclareClassFieldInitializer,t.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),t="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(m.InvalidIdentifier,this.state.curPosition(),{identifierName:t}),this.finishToken(132,t)}getTokenFromCode(e){let t=this.input.charCodeAt(this.state.pos+1);e===123&&t===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?t===46?this.finishOp(18,2):this.finishOp(17,1):Eo(e,t,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,t){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,t):super.isAssignable(e,t)}toAssignable(e,t=!1){!t&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,t)}toAssignableList(e,t,r){for(let n=0;n<e.length;n++){let a=e[n];a?.type==="TypeCastExpression"&&(e[n]=this.typeCastToParameter(a))}super.toAssignableList(e,t,r)}toReferencedList(e,t){for(let n=0;n<e.length;n++){var r;let a=e[n];a&&a.type==="TypeCastExpression"&&!((r=a.extra)!=null&&r.parenthesized)&&(e.length>1||!t)&&this.raise(O.TypeCastInPattern,a.typeAnnotation)}return e}parseArrayLike(e,t,r,n){let a=super.parseArrayLike(e,t,r,n);return t&&!this.state.maybeInArrowParameters&&this.toReferencedList(a.elements),a}isValidLVal(e,t,r){return e==="TypeCastExpression"||super.isValidLVal(e,t,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,t,r,n,a,o){if(t.variance&&this.unexpected(t.variance.loc.start),delete t.variance,this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,t,r,n,a,o),t.params&&a){let l=t.params;l.length>0&&this.isThisParam(l[0])&&this.raise(O.ThisParamBannedInConstructor,t)}else if(t.type==="MethodDefinition"&&a&&t.value.params){let l=t.value.params;l.length>0&&this.isThisParam(l[0])&&this.raise(O.ThisParamBannedInConstructor,t)}}pushClassPrivateMethod(e,t,r,n){t.variance&&this.unexpected(t.variance.loc.start),delete t.variance,this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,t,r,n)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&this.match(47)&&(e.superTypeParameters=this.flowParseTypeParameterInstantiation()),this.isContextual(113)){this.next();let t=e.implements=[];do{let r=this.startNode();r.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?r.typeParameters=this.flowParseTypeParameterInstantiation():r.typeParameters=null,t.push(this.finishNode(r,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let t=this.getObjectOrClassMethodParams(e);if(t.length>0){let r=t[0];this.isThisParam(r)&&e.kind==="get"?this.raise(O.GetterMayNotHaveThisParam,r):this.isThisParam(r)&&this.raise(O.SetterMayNotHaveThisParam,r)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,t,r,n,a,o,l){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let c;this.match(47)&&!o&&(c=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let u=super.parseObjPropValue(e,t,r,n,a,o,l);return c&&((u.value||u).typeParameters=c),u}parseAssignableListItemTypes(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(O.PatternIsOptional,e),this.isThisParam(e)&&this.raise(O.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(O.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(O.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,t){let r=super.parseMaybeDefault(e,t);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(O.TypeBeforeInitializer,r.typeAnnotation),r}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(O.ImportReflectionHasImportType,e.specifiers[0].loc.start)}parseImportSpecifierLocal(e,t,r){t.local=Oi(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,r))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){if(!e)return!0;let t=this.lookaheadCharCode();return t===123||t===42}return!e&&this.isContextual(87)}applyImportPhase(e,t,r,n){if(super.applyImportPhase(e,t,r,n),t){if(!r&&this.match(65))return;e.exportKind=r==="type"?r:"value"}else r==="type"&&this.match(55)&&this.unexpected(),e.importKind=r==="type"||r==="typeof"?r:"value"}parseImportSpecifier(e,t,r,n,a){let o=e.imported,l=null;o.type==="Identifier"&&(o.name==="type"?l="type":o.name==="typeof"&&(l="typeof"));let c=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){let h=this.parseIdentifier(!0);l!==null&&!Te(this.state.type)?(e.imported=h,e.importKind=l,e.local=Be(h)):(e.imported=o,e.importKind=null,e.local=this.parseIdentifier())}else{if(l!==null&&Te(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=l;else{if(t)throw this.raise(m.ImportBindingIsString,e,{importName:o.value});e.imported=o,e.importKind=null}this.eatContextual(93)?e.local=this.parseIdentifier():(c=!0,e.local=Be(e.imported))}let u=Oi(e);return r&&u&&this.raise(O.ImportTypeShorthandOnlyInPureImport,e),(r||u)&&this.checkReservedType(e.local.name,e.local.loc.start,!0),c&&!r&&!u&&this.checkReservedWord(e.local.name,e.loc.start,!0,!0),this.finishImportSpecifier(e,"ImportSpecifier")}parseBindingAtom(){switch(this.state.type){case 78:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(e,t){let r=e.kind;r!=="get"&&r!=="set"&&this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),this.match(14)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){if(this.match(14)){let r=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=r}return super.parseAsyncArrowFromCallExpression(e,t)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,t){var r;let n=null,a;if(this.hasPlugin("jsx")&&(this.match(142)||this.match(47))){if(n=this.state.clone(),a=this.tryParse(()=>super.parseMaybeAssign(e,t),n),!a.error)return a.node;let{context:c}=this.state,u=c[c.length-1];(u===$.j_oTag||u===$.j_expr)&&c.pop()}if((r=a)!=null&&r.error||this.match(47)){var o,l;n=n||this.state.clone();let c,u=this.tryParse(f=>{var d;c=this.flowParseTypeParameterDeclaration();let p=this.forwardNoArrowParamsConversionAt(c,()=>{let y=super.parseMaybeAssign(e,t);return this.resetStartLocationFromNode(y,c),y});(d=p.extra)!=null&&d.parenthesized&&f();let g=this.maybeUnwrapTypeCastExpression(p);return g.type!=="ArrowFunctionExpression"&&f(),g.typeParameters=c,this.resetStartLocationFromNode(g,c),p},n),h=null;if(u.node&&this.maybeUnwrapTypeCastExpression(u.node).type==="ArrowFunctionExpression"){if(!u.error&&!u.aborted)return u.node.async&&this.raise(O.UnexpectedTypeParameterBeforeAsyncArrowFunction,c),u.node;h=u.node}if((o=a)!=null&&o.node)return this.state=a.failState,a.node;if(h)return this.state=u.failState,h;throw(l=a)!=null&&l.thrown?a.error:u.thrown?u.error:this.raise(O.UnexpectedTokenAfterTypeParameter,c)}return super.parseMaybeAssign(e,t)}parseArrow(e){if(this.match(14)){let t=this.tryParse(()=>{let r=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let 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(t.thrown)return null;t.error&&(this.state=t.failState),e.returnType=t.node.typeAnnotation?this.finishNode(t.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,t){this.state.noArrowParamsConversionAt.includes(e.start)?e.params=t:super.setArrowFunctionParameters(e,t)}checkParams(e,t,r,n=!0){if(!(r&&this.state.noArrowParamsConversionAt.includes(e.start))){for(let a=0;a<e.params.length;a++)this.isThisParam(e.params[a])&&a>0&&this.raise(O.ThisParamMustBeFirst,e.params[a]);super.checkParams(e,t,r,n)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.state.start))}parseSubscripts(e,t,r){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(t.index)){this.next();let n=this.startNodeAt(t);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)){let n=this.state.clone(),a=this.tryParse(l=>this.parseAsyncArrowWithTypeParameters(t)||l(),n);if(!a.error&&!a.aborted)return a.node;let o=this.tryParse(()=>super.parseSubscripts(e,t,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,t,r)}parseSubscript(e,t,r,n){if(this.match(18)&&this.isLookaheadToken_lt()){if(n.optionalChainMember=!0,r)return n.stop=!0,e;this.next();let a=this.startNodeAt(t);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)){let a=this.startNodeAt(t);a.callee=e;let 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,t,r,n)}parseNewCallee(e){super.parseNewCallee(e);let t=null;this.shouldParseTypes()&&this.match(47)&&(t=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=t}parseAsyncArrowWithTypeParameters(e){let t=this.startNodeAt(e);if(this.parseFunctionParams(t,!1),!!this.parseArrow(t))return super.parseArrowExpression(t,void 0,!0)}readToken_mult_modulo(e){let t=this.input.charCodeAt(this.state.pos+1);if(e===42&&t===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let t=this.input.charCodeAt(this.state.pos+1);if(e===124&&t===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,t){let r=super.parseTopLevel(e,t);return this.state.hasFlowComment&&this.raise(O.UnterminatedFlowComment,this.state.curPosition()),r}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(O.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,t=2;for(;[32,9].includes(this.input.charCodeAt(e+t));)t++;let r=this.input.charCodeAt(t+e),n=this.input.charCodeAt(t+e+1);return r===58&&n===58?t+2:this.input.slice(t+e,t+e+12)==="flow-include"?t+12:r===58&&n!==58?t:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(m.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:t,memberName:r}){this.raise(O.EnumBooleanMemberNotInitialized,e,{memberName:r,enumName:t})}flowEnumErrorInvalidMemberInitializer(e,t){return this.raise(t.explicitType?t.explicitType==="symbol"?O.EnumInvalidMemberInitializerSymbolType:O.EnumInvalidMemberInitializerPrimaryType:O.EnumInvalidMemberInitializerUnknownType,e,t)}flowEnumErrorNumberMemberNotInitialized(e,t){this.raise(O.EnumNumberMemberNotInitialized,e,t)}flowEnumErrorStringMemberInconsistentlyInitialized(e,t){this.raise(O.EnumStringMemberInconsistentlyInitialized,e,t)}flowEnumMemberInit(){let e=this.state.startLoc,t=()=>this.match(12)||this.match(8);switch(this.state.type){case 134:{let r=this.parseNumericLiteral(this.state.value);return t()?{type:"number",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 133:{let r=this.parseStringLiteral(this.state.value);return t()?{type:"string",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 85:case 86:{let r=this.parseBooleanLiteral(this.match(85));return t()?{type:"boolean",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,t=this.parseIdentifier(!0),r=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:t,init:r}}flowEnumCheckExplicitTypeMismatch(e,t,r){let{explicitType:n}=t;n!==null&&n!==r&&this.flowEnumErrorInvalidMemberInitializer(e,t)}flowEnumMembers({enumName:e,explicitType:t}){let r=new Set,n={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},a=!1;for(;!this.match(8);){if(this.eat(21)){a=!0;break}let o=this.startNode(),{id:l,init:c}=this.flowEnumMemberRaw(),u=l.name;if(u==="")continue;/^[a-z]/.test(u)&&this.raise(O.EnumInvalidMemberName,l,{memberName:u,suggestion:u[0].toUpperCase()+u.slice(1),enumName:e}),r.has(u)&&this.raise(O.EnumDuplicateMemberName,l,{memberName:u,enumName:e}),r.add(u);let h={enumName:e,explicitType:t,memberName:u};switch(o.id=l,c.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(c.loc,h,"boolean"),o.init=c.value,n.booleanMembers.push(this.finishNode(o,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(c.loc,h,"number"),o.init=c.value,n.numberMembers.push(this.finishNode(o,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(c.loc,h,"string"),o.init=c.value,n.stringMembers.push(this.finishNode(o,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(c.loc,h);case"none":switch(t){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(c.loc,h);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(c.loc,h);break;default:n.defaultedMembers.push(this.finishNode(o,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:n,hasUnknownMembers:a}}flowEnumStringMembers(e,t,{enumName:r}){if(e.length===0)return t;if(t.length===0)return e;if(t.length>e.length){for(let n of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(n,{enumName:r});return t}else{for(let n of t)this.flowEnumErrorStringMemberInconsistentlyInitialized(n,{enumName:r});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!R(this.state.type))throw this.raise(O.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:t}=this.state;return this.next(),t!=="boolean"&&t!=="number"&&t!=="string"&&t!=="symbol"&&this.raise(O.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:t}),t}flowEnumBody(e,t){let r=t.name,n=t.loc.start,a=this.flowEnumParseExplicitType({enumName:r});this.expect(5);let{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:{let c=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let u=o.booleanMembers.length,h=o.numberMembers.length,f=o.stringMembers.length,d=o.defaultedMembers.length;if(!u&&!h&&!f&&!d)return c();if(!u&&!h)return e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!h&&!f&&u>=d){for(let 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&&!f&&h>=d){for(let 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(O.EnumInconsistentMemberValues,n,{enumName:r}),c()}}}flowParseEnumDeclaration(e){let t=this.parseIdentifier();return e.id=t,e.body=this.flowEnumBody(this.startNode(),t),this.finishNode(e,"EnumDeclaration")}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let t=this.input.charCodeAt(e+1);return t!==60&&t!==61}return!1}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},zo={__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"},We=Fe`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:s})=>`Unexpected token \`${i}\`. Did you mean \`${s}\` 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 Re(i){return i?i.type==="JSXOpeningFragment"||i.type==="JSXClosingFragment":!1}function tt(i){if(i.type==="JSXIdentifier")return i.name;if(i.type==="JSXNamespacedName")return i.namespace.name+":"+i.name.name;if(i.type==="JSXMemberExpression")return tt(i.object)+"."+tt(i.property);throw new Error("Node had unexpected type: "+i.type)}var Wo=i=>class extends i{jsxReadToken(){let e="",t=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(We.UnterminatedJsxContent,this.state.startLoc);let 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(t,this.state.pos),this.finishToken(141,e);return;case 38:e+=this.input.slice(t,this.state.pos),e+=this.jsxReadEntity(),t=this.state.pos;break;case 62:case 125:default:rt(r)?(e+=this.input.slice(t,this.state.pos),e+=this.jsxReadNewLine(!0),t=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let t=this.input.charCodeAt(this.state.pos),r;return++this.state.pos,t===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,r=e?`
4
+ - 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 ${ts(i)}.`,InvalidLhsBinding:({ancestor:i})=>`Binding invalid left-hand side in ${ts(i)}.`,InvalidLhsOptionalChaining:({ancestor:i})=>`Invalid optional chaining in the left-hand side of ${ts(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(s=>JSON.stringify(s)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:i})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${i.map(s=>JSON.stringify(s)).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:s})=>`Unexpected token${s?` '${s}'.`:""}${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:s})=>`The only valid meta property for ${i} is ${i}.${s}.`,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."},Za={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."},eo=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),to={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 ${ts({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.'},so=["message"];function Ni(i,s,e){Object.defineProperty(i,s,{enumerable:!1,configurable:!0,value:e})}function ro({toMessage:i,code:s,reasonCode:e,syntaxPlugin:t}){let r=e==="MissingPlugin"||e==="MissingOneOfPlugins";{let n={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};n[e]&&(e=n[e])}return function n(a,o){let l=new SyntaxError;return l.code=s,l.reasonCode=e,l.loc=a,l.pos=a.index,l.syntaxPlugin=t,r&&(l.missingPlugin=o.missingPlugin),Ni(l,"clone",function(u={}){var h;let{line:f,column:d,index:p}=(h=u.loc)!=null?h:a;return n(new ve(f,d,p),Object.assign({},o,u.details))}),Ni(l,"details",o),Object.defineProperty(l,"message",{configurable:!0,get(){let c=`${i(o)} (${a.line}:${a.column})`;return this.message=c,c},set(c){Object.defineProperty(this,"message",{value:c,writable:!0})}}),l}}function Fe(i,s){if(Array.isArray(i))return t=>Fe(t,i[0]);let e={};for(let t of Object.keys(i)){let r=i[t],n=typeof r=="string"?{message:()=>r}:typeof r=="function"?{message:r}:r,{message:a}=n,o=Ga(n,so),l=typeof a=="string"?()=>a:a;e[t]=ro(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:t,toMessage:l},s?{syntaxPlugin:s}:{},o))}return e}var m=Object.assign({},Fe(Qa),Fe(Ya),Fe(Za),Fe`pipelineOperator`(to)),{defineProperty:io}=Object,ki=(i,s)=>{i&&io(i,s,{enumerable:!1,value:i[s]})};function Pt(i){return ki(i.loc.start,"index"),ki(i.loc.end,"index"),i}var no=i=>class extends i{parse(){let e=Pt(super.parse());return this.options.tokens&&(e.tokens=e.tokens.map(Pt)),e}parseRegExpLiteral({pattern:e,flags:t}){let r=null;try{r=new RegExp(e,t)}catch{}let n=this.estreeParseLiteral(r);return n.regex={pattern:e,flags:t},n}parseBigIntLiteral(e){let t;try{t=BigInt(e)}catch{t=null}let r=this.estreeParseLiteral(t);return r.bigint=String(r.value||e),r}parseDecimalLiteral(e){let 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){let t=e.value;delete e.value,t.type="Literal",t.raw=t.extra.raw,t.value=t.extra.expressionValue;let r=e;return r.type="ExpressionStatement",r.expression=t,r.directive=t.extra.rawValue,delete t.extra,r}initFunction(e,t){super.initFunction(e,t),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 t;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((t=e.expression.extra)!=null&&t.parenthesized)}parseBlockBody(e,t,r,n,a){super.parseBlockBody(e,t,r,n,a);let o=e.directives.map(l=>this.directiveToStmt(l));e.body=o.concat(e.body),delete e.directives}pushClassMethod(e,t,r,n,a,o){this.parseMethod(t,r,n,a,o,"ClassMethod",!0),t.typeParameters&&(t.value.typeParameters=t.typeParameters,delete t.typeParameters),e.body.push(t)}parsePrivateName(){let e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){let t=super.getPrivateNameSV(e);return e=e,delete e.id,e.name=t,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,t){let r=super.parseLiteral(e,t);return r.raw=r.extra.raw,delete r.extra,r}parseFunctionBody(e,t,r=!1){super.parseFunctionBody(e,t,r),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,t,r,n,a,o,l=!1){let c=this.startNode();return c.kind=e.kind,c=super.parseMethod(c,t,r,n,a,o,l),c.type="FunctionExpression",delete c.kind,e.value=c,o==="ClassPrivateMethod"&&(e.computed=!1),this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return e.type==="Literal"?e.value==="constructor":super.nameIsConstructor(e)}parseClassProperty(...e){let t=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&(t.type="PropertyDefinition"),t}parseClassPrivateProperty(...e){let t=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(t.type="PropertyDefinition",t.computed=!1),t}parseObjectMethod(e,t,r,n,a){let o=super.parseObjectMethod(e,t,r,n,a);return o&&(o.type="Property",o.kind==="method"&&(o.kind="init"),o.shorthand=!1),o}parseObjectProperty(e,t,r,n){let a=super.parseObjectProperty(e,t,r,n);return a&&(a.kind="init",a.type="Property"),a}isValidLVal(e,t,r){return e==="Property"?"value":super.isValidLVal(e,t,r)}isAssignable(e,t){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,t):super.isAssignable(e,t)}toAssignable(e,t=!1){if(e!=null&&this.isObjectProperty(e)){let{key:r,value:n}=e;this.isPrivateName(r)&&this.classScope.usePrivateName(this.getPrivateNameSV(r),r.loc.start),this.toAssignable(n,t)}else super.toAssignable(e,t)}toAssignableObjectExpressionProp(e,t,r){e.type==="Property"&&(e.kind==="get"||e.kind==="set")?this.raise(m.PatternHasAccessor,e.key):e.type==="Property"&&e.method?this.raise(m.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,t,r)}finishCallExpression(e,t){let r=super.finishCallExpression(e,t);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,t){let r=this.state.lastTokStartLoc,n=super.parseExport(e,t);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;let{declaration:o}=n;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,t,r,n){let a=super.parseSubscript(e,t,r,n);if(n.optionalChainMember){if((a.type==="OptionalMemberExpression"||a.type==="OptionalCallExpression")&&(a.type=a.type.substring(8)),n.stop){let 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,t,r){return Pt(super.finishNodeAt(e,t,r))}resetStartLocation(e,t){super.resetStartLocation(e,t),Pt(e)}resetEndLocation(e,t=this.state.lastTokEndLoc){super.resetEndLocation(e,t),Pt(e)}},Je=class{constructor(s,e){this.token=void 0,this.preserveSpace=void 0,this.token=s,this.preserveSpace=!!e}},$={brace:new Je("{"),j_oTag:new Je("<tag"),j_cTag:new Je("</tag"),j_expr:new Je("<tag>...</tag>",!0)};$.template=new Je("`",!0);var _=!0,C=!0,Ws=!0,St=!0,je=!0,ao=!0,is=class{constructor(s,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=s,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}},gr=new Map;function j(i,s={}){s.keyword=i;let e=D(i,s);return gr.set(i,e),e}function ne(i,s){return D(i,{beforeExpr:_,binop:s})}var vt=-1,Oe=[],xr=[],br=[],Tr=[],Pr=[],Sr=[];function D(i,s={}){var e,t,r,n;return++vt,xr.push(i),br.push((e=s.binop)!=null?e:-1),Tr.push((t=s.beforeExpr)!=null?t:!1),Pr.push((r=s.startsExpr)!=null?r:!1),Sr.push((n=s.prefix)!=null?n:!1),Oe.push(new is(i,s)),vt}function B(i,s={}){var e,t,r,n;return++vt,gr.set(i,vt),xr.push(i),br.push((e=s.binop)!=null?e:-1),Tr.push((t=s.beforeExpr)!=null?t:!1),Pr.push((r=s.startsExpr)!=null?r:!1),Sr.push((n=s.prefix)!=null?n:!1),Oe.push(new is("name",s)),vt}var oo={bracketL:D("[",{beforeExpr:_,startsExpr:C}),bracketHashL:D("#[",{beforeExpr:_,startsExpr:C}),bracketBarL:D("[|",{beforeExpr:_,startsExpr:C}),bracketR:D("]"),bracketBarR:D("|]"),braceL:D("{",{beforeExpr:_,startsExpr:C}),braceBarL:D("{|",{beforeExpr:_,startsExpr:C}),braceHashL:D("#{",{beforeExpr:_,startsExpr:C}),braceR:D("}"),braceBarR:D("|}"),parenL:D("(",{beforeExpr:_,startsExpr:C}),parenR:D(")"),comma:D(",",{beforeExpr:_}),semi:D(";",{beforeExpr:_}),colon:D(":",{beforeExpr:_}),doubleColon:D("::",{beforeExpr:_}),dot:D("."),question:D("?",{beforeExpr:_}),questionDot:D("?."),arrow:D("=>",{beforeExpr:_}),template:D("template"),ellipsis:D("...",{beforeExpr:_}),backQuote:D("`",{startsExpr:C}),dollarBraceL:D("${",{beforeExpr:_,startsExpr:C}),templateTail:D("...`",{startsExpr:C}),templateNonTail:D("...${",{beforeExpr:_,startsExpr:C}),at:D("@"),hash:D("#",{startsExpr:C}),interpreterDirective:D("#!..."),eq:D("=",{beforeExpr:_,isAssign:St}),assign:D("_=",{beforeExpr:_,isAssign:St}),slashAssign:D("_=",{beforeExpr:_,isAssign:St}),xorAssign:D("_=",{beforeExpr:_,isAssign:St}),moduloAssign:D("_=",{beforeExpr:_,isAssign:St}),incDec:D("++/--",{prefix:je,postfix:ao,startsExpr:C}),bang:D("!",{beforeExpr:_,prefix:je,startsExpr:C}),tilde:D("~",{beforeExpr:_,prefix:je,startsExpr:C}),doubleCaret:D("^^",{startsExpr:C}),doubleAt:D("@@",{startsExpr:C}),pipeline:ne("|>",0),nullishCoalescing:ne("??",1),logicalOR:ne("||",1),logicalAND:ne("&&",2),bitwiseOR:ne("|",3),bitwiseXOR:ne("^",4),bitwiseAND:ne("&",5),equality:ne("==/!=/===/!==",6),lt:ne("</>/<=/>=",7),gt:ne("</>/<=/>=",7),relational:ne("</>/<=/>=",7),bitShift:ne("<</>>/>>>",8),bitShiftL:ne("<</>>/>>>",8),bitShiftR:ne("<</>>/>>>",8),plusMin:D("+/-",{beforeExpr:_,binop:9,prefix:je,startsExpr:C}),modulo:D("%",{binop:10,startsExpr:C}),star:D("*",{binop:10}),slash:ne("/",10),exponent:D("**",{beforeExpr:_,binop:11,rightAssociative:!0}),_in:j("in",{beforeExpr:_,binop:7}),_instanceof:j("instanceof",{beforeExpr:_,binop:7}),_break:j("break"),_case:j("case",{beforeExpr:_}),_catch:j("catch"),_continue:j("continue"),_debugger:j("debugger"),_default:j("default",{beforeExpr:_}),_else:j("else",{beforeExpr:_}),_finally:j("finally"),_function:j("function",{startsExpr:C}),_if:j("if"),_return:j("return",{beforeExpr:_}),_switch:j("switch"),_throw:j("throw",{beforeExpr:_,prefix:je,startsExpr:C}),_try:j("try"),_var:j("var"),_const:j("const"),_with:j("with"),_new:j("new",{beforeExpr:_,startsExpr:C}),_this:j("this",{startsExpr:C}),_super:j("super",{startsExpr:C}),_class:j("class",{startsExpr:C}),_extends:j("extends",{beforeExpr:_}),_export:j("export"),_import:j("import",{startsExpr:C}),_null:j("null",{startsExpr:C}),_true:j("true",{startsExpr:C}),_false:j("false",{startsExpr:C}),_typeof:j("typeof",{beforeExpr:_,prefix:je,startsExpr:C}),_void:j("void",{beforeExpr:_,prefix:je,startsExpr:C}),_delete:j("delete",{beforeExpr:_,prefix:je,startsExpr:C}),_do:j("do",{isLoop:Ws,beforeExpr:_}),_for:j("for",{isLoop:Ws}),_while:j("while",{isLoop:Ws}),_as:B("as",{startsExpr:C}),_assert:B("assert",{startsExpr:C}),_async:B("async",{startsExpr:C}),_await:B("await",{startsExpr:C}),_defer:B("defer",{startsExpr:C}),_from:B("from",{startsExpr:C}),_get:B("get",{startsExpr:C}),_let:B("let",{startsExpr:C}),_meta:B("meta",{startsExpr:C}),_of:B("of",{startsExpr:C}),_sent:B("sent",{startsExpr:C}),_set:B("set",{startsExpr:C}),_source:B("source",{startsExpr:C}),_static:B("static",{startsExpr:C}),_using:B("using",{startsExpr:C}),_yield:B("yield",{startsExpr:C}),_asserts:B("asserts",{startsExpr:C}),_checks:B("checks",{startsExpr:C}),_exports:B("exports",{startsExpr:C}),_global:B("global",{startsExpr:C}),_implements:B("implements",{startsExpr:C}),_intrinsic:B("intrinsic",{startsExpr:C}),_infer:B("infer",{startsExpr:C}),_is:B("is",{startsExpr:C}),_mixins:B("mixins",{startsExpr:C}),_proto:B("proto",{startsExpr:C}),_require:B("require",{startsExpr:C}),_satisfies:B("satisfies",{startsExpr:C}),_keyof:B("keyof",{startsExpr:C}),_readonly:B("readonly",{startsExpr:C}),_unique:B("unique",{startsExpr:C}),_abstract:B("abstract",{startsExpr:C}),_declare:B("declare",{startsExpr:C}),_enum:B("enum",{startsExpr:C}),_module:B("module",{startsExpr:C}),_namespace:B("namespace",{startsExpr:C}),_interface:B("interface",{startsExpr:C}),_type:B("type",{startsExpr:C}),_opaque:B("opaque",{startsExpr:C}),name:D("name",{startsExpr:C}),string:D("string",{startsExpr:C}),num:D("num",{startsExpr:C}),bigint:D("bigint",{startsExpr:C}),decimal:D("decimal",{startsExpr:C}),regexp:D("regexp",{startsExpr:C}),privateName:D("#name",{startsExpr:C}),eof:D("eof"),jsxName:D("jsxName"),jsxText:D("jsxText",{beforeExpr:!0}),jsxTagStart:D("jsxTagStart",{startsExpr:!0}),jsxTagEnd:D("jsxTagEnd"),placeholder:D("%%",{startsExpr:!0})};function R(i){return i>=93&&i<=132}function lo(i){return i<=92}function Te(i){return i>=58&&i<=132}function $i(i){return i>=58&&i<=136}function co(i){return Tr[i]}function Qs(i){return Pr[i]}function uo(i){return i>=29&&i<=33}function Li(i){return i>=129&&i<=131}function ho(i){return i>=90&&i<=92}function Er(i){return i>=58&&i<=92}function po(i){return i>=39&&i<=59}function fo(i){return i===34}function mo(i){return Sr[i]}function yo(i){return i>=121&&i<=123}function go(i){return i>=124&&i<=130}function Ue(i){return xr[i]}function ss(i){return br[i]}function xo(i){return i===57}function ns(i){return i>=24&&i<=25}function De(i){return Oe[i]}Oe[8].updateContext=i=>{i.pop()},Oe[5].updateContext=Oe[7].updateContext=Oe[23].updateContext=i=>{i.push($.brace)},Oe[22].updateContext=i=>{i[i.length-1]===$.template?i.pop():i.push($.template)},Oe[142].updateContext=i=>{i.push($.j_expr,$.j_oTag)};var Ar="\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-\u1C88\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-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\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",qi="\u200C\u200D\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\u0898-\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",bo=new RegExp("["+Ar+"]"),To=new RegExp("["+Ar+qi+"]");Ar=qi=null;var zi=[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,68,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,349,41,7,1,79,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,159,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,264,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,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,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,757,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],Po=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,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,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,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,406,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,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,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,983,6,110,6,6,9,4759,9,787719,239];function Ys(i,s){let e=65536;for(let t=0,r=s.length;t<r;t+=2){if(e+=s[t],e>i)return!1;if(e+=s[t+1],e>=i)return!0}return!1}function Me(i){return i<65?i===36:i<=90?!0:i<97?i===95:i<=122?!0:i<=65535?i>=170&&bo.test(String.fromCharCode(i)):Ys(i,zi)}function st(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&&To.test(String.fromCharCode(i)):Ys(i,zi)||Ys(i,Po)}var wr={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"]},So=new Set(wr.keyword),Eo=new Set(wr.strict),Ao=new Set(wr.strictBind);function Wi(i,s){return s&&i==="await"||i==="enum"}function Ji(i,s){return Wi(i,s)||Eo.has(i)}function Ki(i){return Ao.has(i)}function Hi(i,s){return Ji(i,s)||Ki(i)}function wo(i){return So.has(i)}function vo(i,s,e){return i===64&&s===64&&Me(e)}var Co=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 Io(i){return Co.has(i)}var Ct=class{constructor(s){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=s}},It=class{constructor(s,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=s,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(){let s=this.currentThisScopeFlags();return(s&64)>0&&(s&2)===0}get inStaticBlock(){for(let s=this.scopeStack.length-1;;s--){let{flags:e}=this.scopeStack[s];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(s){return new Ct(s)}enter(s){this.scopeStack.push(this.createScope(s))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(s){return!!(s.flags&130||!this.parser.inModule&&s.flags&1)}declareName(s,e,t){let r=this.currentScope();if(e&8||e&16){this.checkRedeclarationInScope(r,s,e,t);let n=r.names.get(s)||0;e&16?n=n|4:(r.firstLexicalName||(r.firstLexicalName=s),n=n|2),r.names.set(s,n),e&8&&this.maybeExportDefined(r,s)}else if(e&4)for(let n=this.scopeStack.length-1;n>=0&&(r=this.scopeStack[n],this.checkRedeclarationInScope(r,s,e,t),r.names.set(s,(r.names.get(s)||0)|1),this.maybeExportDefined(r,s),!(r.flags&387));--n);this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(s)}maybeExportDefined(s,e){this.parser.inModule&&s.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(s,e,t,r){this.isRedeclaredInScope(s,e,t)&&this.parser.raise(m.VarRedeclaration,r,{identifierName:e})}isRedeclaredInScope(s,e,t){if(!(t&1))return!1;if(t&8)return s.names.has(e);let r=s.names.get(e);return t&16?(r&2)>0||!this.treatFunctionsAsVarInScope(s)&&(r&1)>0:(r&2)>0&&!(s.flags&8&&s.firstLexicalName===e)||!this.treatFunctionsAsVarInScope(s)&&(r&4)>0}checkLocalExport(s){let{name:e}=s;this.scopeStack[0].names.has(e)||this.undefinedExports.set(e,s.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let s=this.scopeStack.length-1;;s--){let{flags:e}=this.scopeStack[s];if(e&387)return e}}currentThisScopeFlags(){for(let s=this.scopeStack.length-1;;s--){let{flags:e}=this.scopeStack[s];if(e&451&&!(e&4))return e}}},Zs=class extends Ct{constructor(...s){super(...s),this.declareFunctions=new Set}},er=class extends It{createScope(s){return new Zs(s)}declareName(s,e,t){let r=this.currentScope();if(e&2048){this.checkRedeclarationInScope(r,s,e,t),this.maybeExportDefined(r,s),r.declareFunctions.add(s);return}super.declareName(s,e,t)}isRedeclaredInScope(s,e,t){if(super.isRedeclaredInScope(s,e,t))return!0;if(t&2048&&!s.declareFunctions.has(e)){let r=s.names.get(e);return(r&4)>0||(r&2)>0}return!1}checkLocalExport(s){this.scopeStack[0].declareFunctions.has(s.name)||super.checkLocalExport(s)}},tr=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}hasPlugin(s){if(typeof s=="string")return this.plugins.has(s);{let[e,t]=s;if(!this.hasPlugin(e))return!1;let r=this.plugins.get(e);for(let n of Object.keys(t))if(r?.[n]!==t[n])return!1;return!0}}getPluginOption(s,e){var t;return(t=this.plugins.get(s))==null?void 0:t[e]}};function Xi(i,s){i.trailingComments===void 0?i.trailingComments=s:i.trailingComments.unshift(...s)}function No(i,s){i.leadingComments===void 0?i.leadingComments=s:i.leadingComments.unshift(...s)}function Nt(i,s){i.innerComments===void 0?i.innerComments=s:i.innerComments.unshift(...s)}function Et(i,s,e){let t=null,r=s.length;for(;t===null&&r>0;)t=s[--r];t===null||t.start>e.start?Nt(i,e.comments):Xi(t,e.comments)}var sr=class extends tr{addComment(s){this.filename&&(s.loc.filename=this.filename);let{commentsLen:e}=this.state;this.comments.length!==e&&(this.comments.length=e),this.comments.push(s),this.state.commentsLen++}processComment(s){let{commentStack:e}=this.state,t=e.length;if(t===0)return;let r=t-1,n=e[r];n.start===s.end&&(n.leadingNode=s,r--);let{start:a}=s;for(;r>=0;r--){let o=e[r],l=o.end;if(l>a)o.containingNode=s,this.finalizeComment(o),e.splice(r,1);else{l===a&&(o.trailingNode=s);break}}}finalizeComment(s){let{comments:e}=s;if(s.leadingNode!==null||s.trailingNode!==null)s.leadingNode!==null&&Xi(s.leadingNode,e),s.trailingNode!==null&&No(s.trailingNode,e);else{let{containingNode:t,start:r}=s;if(this.input.charCodeAt(r-1)===44)switch(t.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":Et(t,t.properties,s);break;case"CallExpression":case"OptionalCallExpression":Et(t,t.arguments,s);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":Et(t,t.params,s);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":Et(t,t.elements,s);break;case"ExportNamedDeclaration":case"ImportDeclaration":Et(t,t.specifiers,s);break;default:Nt(t,e)}else Nt(t,e)}}finalizeRemainingComments(){let{commentStack:s}=this.state;for(let e=s.length-1;e>=0;e--)this.finalizeComment(s[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(s){let{commentStack:e}=this.state,{length:t}=e;if(t===0)return;let r=e[t-1];r.leadingNode===s&&(r.leadingNode=null)}resetPreviousIdentifierLeadingComments(s){let{commentStack:e}=this.state,{length:t}=e;t!==0&&(e[t-1].trailingNode===s?e[t-1].trailingNode=null:t>=2&&e[t-2].trailingNode===s&&(e[t-2].trailingNode=null))}takeSurroundingComments(s,e,t){let{commentStack:r}=this.state,n=r.length;if(n===0)return;let a=n-1;for(;a>=0;a--){let o=r[a],l=o.end;if(o.start===t)o.leadingNode=s;else if(l===e)o.trailingNode=s;else if(l<e)break}}},ko=/\r\n|[\r\n\u2028\u2029]/,Zt=new RegExp(ko.source,"g");function rt(i){switch(i){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function Di(i,s,e){for(let t=s;t<e;t++)if(rt(i.charCodeAt(t)))return!0;return!1}var Js=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ks=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function Lo(i){switch(i){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var rr=class i{constructor(){this.flags=1024,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.labels=[],this.commentsLen=0,this.commentStack=[],this.pos=0,this.type=139,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.context=[$.brace],this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}get strict(){return(this.flags&1)>0}set strict(s){s?this.flags|=1:this.flags&=-2}init({strictMode:s,sourceType:e,startLine:t,startColumn:r}){this.strict=s===!1?!1:s===!0?!0:e==="module",this.curLine=t,this.lineStart=-r,this.startLoc=this.endLoc=new ve(t,r,0)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(s){s?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(s){s?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(s){s?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(s){s?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(s){s?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(s){s?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(s){s?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(s){s?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(s){s?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(s){s?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(s){s?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(s){s?this.flags|=4096:this.flags&=-4097}curPosition(){return new ve(this.curLine,this.pos-this.lineStart,this.pos)}clone(){let s=new i;return s.flags=this.flags,s.curLine=this.curLine,s.lineStart=this.lineStart,s.startLoc=this.startLoc,s.endLoc=this.endLoc,s.errors=this.errors.slice(),s.potentialArrowAt=this.potentialArrowAt,s.noArrowAt=this.noArrowAt.slice(),s.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),s.topicContext=this.topicContext,s.labels=this.labels.slice(),s.commentsLen=this.commentsLen,s.commentStack=this.commentStack.slice(),s.pos=this.pos,s.type=this.type,s.value=this.value,s.start=this.start,s.end=this.end,s.lastTokEndLoc=this.lastTokEndLoc,s.lastTokStartLoc=this.lastTokStartLoc,s.context=this.context.slice(),s.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,s.strictErrors=this.strictErrors,s.tokensLength=this.tokensLength,s}},Do=function(s){return s>=48&&s<=57},Oi={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},es={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 Mi(i,s,e,t,r,n){let a=e,o=t,l=r,c="",u=null,h=e,{length:f}=s;for(;;){if(e>=f){n.unterminated(a,o,l),c+=s.slice(h,e);break}let d=s.charCodeAt(e);if(Oo(i,d,s,e)){c+=s.slice(h,e);break}if(d===92){c+=s.slice(h,e);let p=Mo(s,e,t,r,i==="template",n);p.ch===null&&!u?u={pos:e,lineStart:t,curLine:r}:c+=p.ch,{pos:e,lineStart:t,curLine:r}=p,h=e}else d===8232||d===8233?(++e,++r,t=e):d===10||d===13?i==="template"?(c+=s.slice(h,e)+`
5
+ `,++e,d===13&&s.charCodeAt(e)===10&&++e,++r,h=t=e):n.unterminated(a,o,l):++e}return{pos:e,str:c,firstInvalidLoc:u,lineStart:t,curLine:r,containsInvalid:!!u}}function Oo(i,s,e,t){return i==="template"?s===96||s===36&&e.charCodeAt(t+1)===123:s===(i==="double"?34:39)}function Mo(i,s,e,t,r,n){let a=!r;s++;let o=c=>({pos:s,ch:c,lineStart:e,curLine:t}),l=i.charCodeAt(s++);switch(l){case 110:return o(`
6
+ `);case 114:return o("\r");case 120:{let c;return{code:c,pos:s}=ir(i,s,e,t,2,!1,a,n),o(c===null?null:String.fromCharCode(c))}case 117:{let c;return{code:c,pos:s}=Qi(i,s,e,t,a,n),o(c===null?null:String.fromCodePoint(c))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:i.charCodeAt(s)===10&&++s;case 10:e=s,++t;case 8232:case 8233:return o("");case 56:case 57:if(r)return o(null);n.strictNumericEscape(s-1,e,t);default:if(l>=48&&l<=55){let c=s-1,h=/^[0-7]+/.exec(i.slice(c,s+2))[0],f=parseInt(h,8);f>255&&(h=h.slice(0,-1),f=parseInt(h,8)),s+=h.length-1;let d=i.charCodeAt(s);if(h!=="0"||d===56||d===57){if(r)return o(null);n.strictNumericEscape(c,e,t)}return o(String.fromCharCode(f))}return o(String.fromCharCode(l))}}function ir(i,s,e,t,r,n,a,o){let l=s,c;return{n:c,pos:s}=Gi(i,s,e,t,16,r,n,!1,o,!a),c===null&&(a?o.invalidEscapeSequence(l,e,t):s=l-1),{code:c,pos:s}}function Gi(i,s,e,t,r,n,a,o,l,c){let u=s,h=r===16?Oi.hex:Oi.decBinOct,f=r===16?es.hex:r===10?es.dec:r===8?es.oct:es.bin,d=!1,p=0;for(let g=0,y=n??1/0;g<y;++g){let b=i.charCodeAt(s),P;if(b===95&&o!=="bail"){let k=i.charCodeAt(s-1),T=i.charCodeAt(s+1);if(o){if(Number.isNaN(T)||!f(T)||h.has(k)||h.has(T)){if(c)return{n:null,pos:s};l.unexpectedNumericSeparator(s,e,t)}}else{if(c)return{n:null,pos:s};l.numericSeparatorInEscapeSequence(s,e,t)}++s;continue}if(b>=97?P=b-97+10:b>=65?P=b-65+10:Do(b)?P=b-48:P=1/0,P>=r){if(P<=9&&c)return{n:null,pos:s};if(P<=9&&l.invalidDigit(s,e,t,r))P=0;else if(a)P=0,d=!0;else break}++s,p=p*r+P}return s===u||n!=null&&s-u!==n||d?{n:null,pos:s}:{n:p,pos:s}}function Qi(i,s,e,t,r,n){let a=i.charCodeAt(s),o;if(a===123){if(++s,{code:o,pos:s}=ir(i,s,e,t,i.indexOf("}",s)-s,!0,r,n),++s,o!==null&&o>1114111)if(r)n.invalidCodePoint(s,e,t);else return{code:null,pos:s}}else({code:o,pos:s}=ir(i,s,e,t,4,!1,r,n));return{code:o,pos:s}}function At(i,s,e){return new ve(e,i-s,i)}var Fo=new Set([103,109,115,105,121,117,100,118]),we=class{constructor(s){this.type=s.type,this.value=s.value,this.start=s.start,this.end=s.end,this.loc=new nt(s.startLoc,s.endLoc)}},nr=class extends sr{constructor(s,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(t,r,n,a)=>this.options.errorRecovery?(this.raise(m.InvalidDigit,At(t,r,n),{radix:a}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(m.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(m.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(m.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(m.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(t,r,n)=>{this.recordStrictModeErrors(m.StrictNumericEscape,At(t,r,n))},unterminated:(t,r,n)=>{throw this.raise(m.UnterminatedString,At(t-1,r,n))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(m.StrictNumericEscape),unterminated:(t,r,n)=>{throw this.raise(m.UnterminatedTemplate,At(t,r,n))}}),this.state=new rr,this.state.init(s),this.input=e,this.length=e.length,this.comments=[],this.isLookahead=!1}pushToken(s){this.tokens.length=this.state.tokensLength,this.tokens.push(s),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.options.tokens&&this.pushToken(new we(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(s){return this.match(s)?(this.next(),!0):!1}match(s){return this.state.type===s}createLookaheadState(s){return{pos:s.pos,value:null,type:s.type,start:s.start,end:s.end,context:[this.curContext()],inType:s.inType,startLoc:s.startLoc,lastTokEndLoc:s.lastTokEndLoc,curLine:s.curLine,lineStart:s.lineStart,curPosition:s.curPosition}}lookahead(){let s=this.state;this.state=this.createLookaheadState(s),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let e=this.state;return this.state=s,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(s){return Js.lastIndex=s,Js.test(this.input)?Js.lastIndex:s}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(s){return Ks.lastIndex=s,Ks.test(this.input)?Ks.lastIndex:s}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(s){let e=this.input.charCodeAt(s);if((e&64512)===55296&&++s<this.input.length){let t=this.input.charCodeAt(s);(t&64512)===56320&&(e=65536+((e&1023)<<10)+(t&1023))}return e}setStrict(s){this.state.strict=s,s&&(this.state.strictErrors.forEach(([e,t])=>this.raise(e,t)),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(s){let e;this.isLookahead||(e=this.state.curPosition());let t=this.state.pos,r=this.input.indexOf(s,t+2);if(r===-1)throw this.raise(m.UnterminatedComment,this.state.curPosition());for(this.state.pos=r+s.length,Zt.lastIndex=t+2;Zt.test(this.input)&&Zt.lastIndex<=r;)++this.state.curLine,this.state.lineStart=Zt.lastIndex;if(this.isLookahead)return;let n={type:"CommentBlock",value:this.input.slice(t+2,r),start:t,end:r+s.length,loc:new nt(e,this.state.curPosition())};return this.options.tokens&&this.pushToken(n),n}skipLineComment(s){let e=this.state.pos,t;this.isLookahead||(t=this.state.curPosition());let r=this.input.charCodeAt(this.state.pos+=s);if(this.state.pos<this.length)for(;!rt(r)&&++this.state.pos<this.length;)r=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let n=this.state.pos,o={type:"CommentLine",value:this.input.slice(e+s,n),start:e,end:n,loc:new nt(t,this.state.curPosition())};return this.options.tokens&&this.pushToken(o),o}skipSpace(){let s=this.state.pos,e=[];e:for(;this.state.pos<this.length;){let t=this.input.charCodeAt(this.state.pos);switch(t){case 32:case 160:case 9:++this.state.pos;break;case 13:this.input.charCodeAt(this.state.pos+1)===10&&++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:{let r=this.skipBlockComment("*/");r!==void 0&&(this.addComment(r),this.options.attachComment&&e.push(r));break}case 47:{let r=this.skipLineComment(2);r!==void 0&&(this.addComment(r),this.options.attachComment&&e.push(r));break}default:break e}break;default:if(Lo(t))++this.state.pos;else if(t===45&&!this.inModule&&this.options.annexB){let r=this.state.pos;if(this.input.charCodeAt(r+1)===45&&this.input.charCodeAt(r+2)===62&&(s===0||this.state.lineStart>s)){let n=this.skipLineComment(3);n!==void 0&&(this.addComment(n),this.options.attachComment&&e.push(n))}else break e}else if(t===60&&!this.inModule&&this.options.annexB){let r=this.state.pos;if(this.input.charCodeAt(r+1)===33&&this.input.charCodeAt(r+2)===45&&this.input.charCodeAt(r+3)===45){let 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){let t=this.state.pos,r={start:s,end:t,comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(r)}}finishToken(s,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let t=this.state.type;this.state.type=s,this.state.value=e,this.isLookahead||this.updateContext(t)}replaceToken(s){this.state.type=s,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let s=this.state.pos+1,e=this.codePointAtPos(s);if(e>=48&&e<=57)throw this.raise(m.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?m.RecordExpressionHashIncorrectStartSyntaxType:m.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else Me(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(){let s=this.input.charCodeAt(this.state.pos+1);if(s>=48&&s<=57){this.readNumber(!0);return}s===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 s=this.input.charCodeAt(this.state.pos+1);if(s!==33)return!1;let e=this.state.pos;for(this.state.pos+=1;!rt(s)&&++this.state.pos<this.length;)s=this.input.charCodeAt(this.state.pos);let t=this.input.slice(e+2,this.state.pos);return this.finishToken(28,t),!0}readToken_mult_modulo(s){let e=s===42?55:54,t=1,r=this.input.charCodeAt(this.state.pos+1);s===42&&r===42&&(t++,r=this.input.charCodeAt(this.state.pos+2),e=57),r===61&&!this.state.inType&&(t++,e=s===37?33:30),this.finishOp(e,t)}readToken_pipe_amp(s){let e=this.input.charCodeAt(this.state.pos+1);if(e===s){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(30,3):this.finishOp(s===124?41:42,2);return}if(s===124){if(e===62){this.finishOp(39,2);return}if(this.hasPlugin("recordAndTuple")&&e===125){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(m.RecordExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(9);return}if(this.hasPlugin("recordAndTuple")&&e===93){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(m.TupleExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(4);return}}if(e===61){this.finishOp(30,2);return}this.finishOp(s===124?43:45,1)}readToken_caret(){let s=this.input.charCodeAt(this.state.pos+1);s===61&&!this.state.inType?this.finishOp(32,2):s===94&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"^^"}])?(this.finishOp(37,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(44,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"@@"}])?this.finishOp(38,2):this.finishOp(26,1)}readToken_plus_min(s){let e=this.input.charCodeAt(this.state.pos+1);if(e===s){this.finishOp(34,2);return}e===61?this.finishOp(30,2):this.finishOp(53,1)}readToken_lt(){let{pos:s}=this.state,e=this.input.charCodeAt(s+1);if(e===60){if(this.input.charCodeAt(s+2)===61){this.finishOp(30,3);return}this.finishOp(51,2);return}if(e===61){this.finishOp(49,2);return}this.finishOp(47,1)}readToken_gt(){let{pos:s}=this.state,e=this.input.charCodeAt(s+1);if(e===62){let t=this.input.charCodeAt(s+2)===62?3:2;if(this.input.charCodeAt(s+t)===61){this.finishOp(30,t+1);return}this.finishOp(52,t);return}if(e===61){this.finishOp(49,2);return}this.finishOp(48,1)}readToken_eq_excl(s){let e=this.input.charCodeAt(this.state.pos+1);if(e===61){this.finishOp(46,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(s===61&&e===62){this.state.pos+=2,this.finishToken(19);return}this.finishOp(s===61?29:35,1)}readToken_question(){let s=this.input.charCodeAt(this.state.pos+1),e=this.input.charCodeAt(this.state.pos+2);s===63?e===61?this.finishOp(30,3):this.finishOp(40,2):s===46&&!(e>=48&&e<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(s){switch(s){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(m.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(m.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:{let 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(s);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(s);return;case 124:case 38:this.readToken_pipe_amp(s);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(s);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(s);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(Me(s)){this.readWord(s);return}}throw this.raise(m.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(s)})}finishOp(s,e){let t=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(s,t)}readRegexp(){let s=this.state.startLoc,e=this.state.start+1,t,r,{pos:n}=this.state;for(;;++n){if(n>=this.length)throw this.raise(m.UnterminatedRegExp,ae(s,1));let c=this.input.charCodeAt(n);if(rt(c))throw this.raise(m.UnterminatedRegExp,ae(s,1));if(t)t=!1;else{if(c===91)r=!0;else if(c===93&&r)r=!1;else if(c===47&&!r)break;t=c===92}}let a=this.input.slice(e,n);++n;let o="",l=()=>ae(s,n+2-e);for(;n<this.length;){let c=this.codePointAtPos(n),u=String.fromCharCode(c);if(Fo.has(c))c===118?o.includes("u")&&this.raise(m.IncompatibleRegExpUVFlags,l()):c===117&&o.includes("v")&&this.raise(m.IncompatibleRegExpUVFlags,l()),o.includes(u)&&this.raise(m.DuplicateRegExpFlags,l());else if(st(c)||c===92)this.raise(m.MalformedRegExpFlags,l());else break;++n,o+=u}this.state.pos=n,this.finishToken(137,{pattern:a,flags:o})}readInt(s,e,t=!1,r=!0){let{n,pos:a}=Gi(this.input,this.state.pos,this.state.lineStart,this.state.curLine,s,e,t,r,this.errorHandlers_readInt,!1);return this.state.pos=a,n}readRadixNumber(s){let e=this.state.curPosition(),t=!1;this.state.pos+=2;let r=this.readInt(s);r==null&&this.raise(m.InvalidDigit,ae(e,2),{radix:s});let n=this.input.charCodeAt(this.state.pos);if(n===110)++this.state.pos,t=!0;else if(n===109)throw this.raise(m.InvalidDecimal,e);if(Me(this.codePointAtPos(this.state.pos)))throw this.raise(m.NumberIdentifier,this.state.curPosition());if(t){let a=this.input.slice(e.index,this.state.pos).replace(/[_n]/g,"");this.finishToken(135,a);return}this.finishToken(134,r)}readNumber(s){let e=this.state.pos,t=this.state.curPosition(),r=!1,n=!1,a=!1,o=!1,l=!1;!s&&this.readInt(10)===null&&this.raise(m.InvalidNumber,this.state.curPosition());let c=this.state.pos-e>=2&&this.input.charCodeAt(e)===48;if(c){let d=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(m.StrictOctalLiteral,t),!this.state.strict){let p=d.indexOf("_");p>0&&this.raise(m.ZeroDigitNumericSeparator,ae(t,p))}l=c&&!/[89]/.test(d)}let u=this.input.charCodeAt(this.state.pos);if(u===46&&!l&&(++this.state.pos,this.readInt(10),r=!0,u=this.input.charCodeAt(this.state.pos)),(u===69||u===101)&&!l&&(u=this.input.charCodeAt(++this.state.pos),(u===43||u===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(m.InvalidOrMissingExponent,t),r=!0,o=!0,u=this.input.charCodeAt(this.state.pos)),u===110&&((r||c)&&this.raise(m.InvalidBigIntLiteral,t),++this.state.pos,n=!0),u===109&&(this.expectPlugin("decimal",this.state.curPosition()),(o||c)&&this.raise(m.InvalidDecimal,t),++this.state.pos,a=!0),Me(this.codePointAtPos(this.state.pos)))throw this.raise(m.NumberIdentifier,this.state.curPosition());let h=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(n){this.finishToken(135,h);return}if(a){this.finishToken(136,h);return}let f=l?parseInt(h,8):parseFloat(h);this.finishToken(134,f)}readCodePoint(s){let{code:e,pos:t}=Qi(this.input,this.state.pos,this.state.lineStart,this.state.curLine,s,this.errorHandlers_readCodePoint);return this.state.pos=t,e}readString(s){let{str:e,pos:t,curLine:r,lineStart:n}=Mi(s===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=t+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(){let s=this.input[this.state.pos],{str:e,firstInvalidLoc:t,pos:r,curLine:n,lineStart:a}=Mi("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,t&&(this.state.firstInvalidTemplateEscapePos=new ve(t.curLine,t.pos-t.lineStart,t.pos)),this.input.codePointAt(r)===96?this.finishToken(24,t?null:s+e+"`"):(this.state.pos++,this.finishToken(25,t?null:s+e+"${"))}recordStrictModeErrors(s,e){let t=e.index;this.state.strict&&!this.state.strictErrors.has(t)?this.raise(s,e):this.state.strictErrors.set(t,[s,e])}readWord1(s){this.state.containsEsc=!1;let e="",t=this.state.pos,r=this.state.pos;for(s!==void 0&&(this.state.pos+=s<=65535?1:2);this.state.pos<this.length;){let n=this.codePointAtPos(this.state.pos);if(st(n))this.state.pos+=n<=65535?1:2;else if(n===92){this.state.containsEsc=!0,e+=this.input.slice(r,this.state.pos);let a=this.state.curPosition(),o=this.state.pos===t?Me:st;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(m.MissingUnicodeEscape,this.state.curPosition()),r=this.state.pos-1;continue}++this.state.pos;let l=this.readCodePoint(!0);l!==null&&(o(l)||this.raise(m.EscapedCharNotAnIdentifier,a),e+=String.fromCodePoint(l)),r=this.state.pos}else break}return e+this.input.slice(r,this.state.pos)}readWord(s){let e=this.readWord1(s),t=gr.get(e);t!==void 0?this.finishToken(t,Ue(t)):this.finishToken(132,e)}checkKeywordEscapes(){let{type:s}=this.state;Er(s)&&this.state.containsEsc&&this.raise(m.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:Ue(s)})}raise(s,e,t={}){let r=e instanceof ve?e:e.loc.start,n=s(r,t);if(!this.options.errorRecovery)throw n;return this.isLookahead||this.state.errors.push(n),n}raiseOverwrite(s,e,t={}){let r=e instanceof ve?e:e.loc.start,n=r.index,a=this.state.errors;for(let o=a.length-1;o>=0;o--){let l=a[o];if(l.loc.index===n)return a[o]=s(r,t);if(l.loc.index<n)break}return this.raise(s,e,t)}updateContext(s){}unexpected(s,e){throw this.raise(m.UnexpectedToken,s??this.state.startLoc,{expected:e?Ue(e):null})}expectPlugin(s,e){if(this.hasPlugin(s))return!0;throw this.raise(m.MissingPlugin,e??this.state.startLoc,{missingPlugin:[s]})}expectOnePlugin(s){if(!s.some(e=>this.hasPlugin(e)))throw this.raise(m.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:s})}errorBuilder(s){return(e,t,r)=>{this.raise(s,At(e,t,r))}}},ar=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},or=class{constructor(s){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=s}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new ar)}exit(){let s=this.stack.pop(),e=this.current();for(let[t,r]of Array.from(s.undefinedPrivateNames))e?e.undefinedPrivateNames.has(t)||e.undefinedPrivateNames.set(t,r):this.parser.raise(m.InvalidPrivateFieldResolution,r,{identifierName:t})}declarePrivateName(s,e,t){let{privateNames:r,loneAccessors:n,undefinedPrivateNames:a}=this.current(),o=r.has(s);if(e&3){let l=o&&n.get(s);if(l){let c=l&4,u=e&4,h=l&3,f=e&3;o=h===f||c!==u,o||n.delete(s)}else o||n.set(s,e)}o&&this.parser.raise(m.PrivateNameRedeclaration,t,{identifierName:s}),r.add(s),a.delete(s)}usePrivateName(s,e){let t;for(t of this.stack)if(t.privateNames.has(s))return;t?t.undefinedPrivateNames.set(s,e):this.parser.raise(m.InvalidPrivateFieldResolution,e,{identifierName:s})}},at=class{constructor(s=0){this.type=s}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},as=class extends at{constructor(s){super(s),this.declarationErrors=new Map}recordDeclarationError(s,e){let t=e.index;this.declarationErrors.set(t,[s,e])}clearDeclarationError(s){this.declarationErrors.delete(s)}iterateErrors(s){this.declarationErrors.forEach(s)}},lr=class{constructor(s){this.parser=void 0,this.stack=[new at],this.parser=s}enter(s){this.stack.push(s)}exit(){this.stack.pop()}recordParameterInitializerError(s,e){let t=e.loc.start,{stack:r}=this,n=r.length-1,a=r[n];for(;!a.isCertainlyParameterDeclaration();){if(a.canBeArrowParameterDeclaration())a.recordDeclarationError(s,t);else return;a=r[--n]}this.parser.raise(s,t)}recordArrowParameterBindingError(s,e){let{stack:t}=this,r=t[t.length-1],n=e.loc.start;if(r.isCertainlyParameterDeclaration())this.parser.raise(s,n);else if(r.canBeArrowParameterDeclaration())r.recordDeclarationError(s,n);else return}recordAsyncArrowParametersError(s){let{stack:e}=this,t=e.length-1,r=e[t];for(;r.canBeArrowParameterDeclaration();)r.type===2&&r.recordDeclarationError(m.AwaitBindingIdentifier,s),r=e[--t]}validateAsPattern(){let{stack:s}=this,e=s[s.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors(([t,r])=>{this.parser.raise(t,r);let n=s.length-2,a=s[n];for(;a.canBeArrowParameterDeclaration();)a.clearDeclarationError(r.index),a=s[--n]})}};function Bo(){return new at(3)}function _o(){return new as(1)}function jo(){return new as(2)}function Yi(){return new at}var cr=class{constructor(){this.stacks=[]}enter(s){this.stacks.push(s)}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 rs(i,s){return(i?2:0)|(s?1:0)}var ur=class extends nr{addExtra(s,e,t,r=!0){if(!s)return;let{extra:n}=s;n==null&&(n={},s.extra=n),r?n[e]=t:Object.defineProperty(n,e,{enumerable:r,value:t})}isContextual(s){return this.state.type===s&&!this.state.containsEsc}isUnparsedContextual(s,e){let t=s+e.length;if(this.input.slice(s,t)===e){let r=this.input.charCodeAt(t);return!(st(r)||(r&64512)===55296)}return!1}isLookaheadContextual(s){let e=this.nextTokenStart();return this.isUnparsedContextual(e,s)}eatContextual(s){return this.isContextual(s)?(this.next(),!0):!1}expectContextual(s,e){if(!this.eatContextual(s)){if(e!=null)throw this.raise(e,this.state.startLoc);this.unexpected(null,s)}}canInsertSemicolon(){return this.match(139)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return Di(this.input,this.state.lastTokEndLoc.index,this.state.start)}hasFollowingLineBreak(){return Di(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(s=!0){(s?this.isLineTerminator():this.eat(13))||this.raise(m.MissingSemicolon,this.state.lastTokEndLoc)}expect(s,e){this.eat(s)||this.unexpected(e,s)}tryParse(s,e=this.state.clone()){let t={node:null};try{let r=s((n=null)=>{throw t.node=n,t});if(this.state.errors.length>e.errors.length){let 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){let n=this.state;if(this.state=e,r instanceof SyntaxError)return{node:null,error:r,thrown:!0,aborted:!1,failState:n};if(r===t)return{node:t.node,error:null,thrown:!1,aborted:!0,failState:n};throw r}}checkExpressionErrors(s,e){if(!s)return!1;let{shorthandAssignLoc:t,doubleProtoLoc:r,privateKeyLoc:n,optionalParametersLoc:a}=s,o=!!t||!!r||!!a||!!n;if(!e)return o;t!=null&&this.raise(m.InvalidCoverInitializedName,t),r!=null&&this.raise(m.DuplicateProto,r),n!=null&&this.raise(m.UnexpectedPrivateField,n),a!=null&&this.unexpected(a)}isLiteralPropertyName(){return $i(this.state.type)}isPrivateName(s){return s.type==="PrivateName"}getPrivateNameSV(s){return s.id.name}hasPropertyAsPrivateName(s){return(s.type==="MemberExpression"||s.type==="OptionalMemberExpression")&&this.isPrivateName(s.property)}isObjectProperty(s){return s.type==="ObjectProperty"}isObjectMethod(s){return s.type==="ObjectMethod"}initializeScopes(s=this.options.sourceType==="module"){let e=this.state.labels;this.state.labels=[];let t=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let r=this.inModule;this.inModule=s;let n=this.scope,a=this.getScopeHandler();this.scope=new a(this,s);let o=this.prodParam;this.prodParam=new cr;let l=this.classScope;this.classScope=new or(this);let c=this.expressionScope;return this.expressionScope=new lr(this),()=>{this.state.labels=e,this.exportedIdentifiers=t,this.inModule=r,this.scope=n,this.prodParam=o,this.classScope=l,this.expressionScope=c}}enterInitialScopes(){let s=0;this.inModule&&(s|=2),this.scope.enter(1),this.prodParam.enter(s)}checkDestructuringPrivate(s){let{privateKeyLoc:e}=s;e!==null&&this.expectPlugin("destructuringPrivate",e)}},it=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}},ot=class{constructor(s,e,t){this.type="",this.start=e,this.end=0,this.loc=new nt(t),s!=null&&s.options.ranges&&(this.range=[e,0]),s!=null&&s.filename&&(this.loc.filename=s.filename)}},vr=ot.prototype;vr.__clone=function(){let i=new ot(void 0,this.start,this.loc.start),s=Object.keys(this);for(let e=0,t=s.length;e<t;e++){let r=s[e];r!=="leadingComments"&&r!=="trailingComments"&&r!=="innerComments"&&(i[r]=this[r])}return i};function Ro(i){return Be(i)}function Be(i){let{type:s,start:e,end:t,loc:r,range:n,extra:a,name:o}=i,l=Object.create(vr);return l.type=s,l.start=e,l.end=t,l.loc=r,l.range=n,l.extra=a,l.name=o,s==="Placeholder"&&(l.expectedNode=i.expectedNode),l}function Uo(i){let{type:s,start:e,end:t,loc:r,range:n,extra:a}=i;if(s==="Placeholder")return Ro(i);let o=Object.create(vr);return o.type=s,o.start=e,o.end=t,o.loc=r,o.range=n,i.raw!==void 0?o.raw=i.raw:o.extra=a,o.value=i.value,o}var hr=class extends ur{startNode(){let s=this.state.startLoc;return new ot(this,s.index,s)}startNodeAt(s){return new ot(this,s.index,s)}startNodeAtNode(s){return this.startNodeAt(s.loc.start)}finishNode(s,e){return this.finishNodeAt(s,e,this.state.lastTokEndLoc)}finishNodeAt(s,e,t){return s.type=e,s.end=t.index,s.loc.end=t,this.options.ranges&&(s.range[1]=t.index),this.options.attachComment&&this.processComment(s),s}resetStartLocation(s,e){s.start=e.index,s.loc.start=e,this.options.ranges&&(s.range[0]=e.index)}resetEndLocation(s,e=this.state.lastTokEndLoc){s.end=e.index,s.loc.end=e,this.options.ranges&&(s.range[1]=e.index)}resetStartLocationFromNode(s,e){this.resetStartLocation(s,e.loc.start)}},Vo=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),O=Fe`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:i})=>`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:s})=>`Boolean enum members need to be initialized. Use either \`${i} = true,\` or \`${i} = false,\` in enum \`${s}\`.`,EnumDuplicateMemberName:({memberName:i,enumName:s})=>`Enum member names need to be unique, but the name \`${i}\` has already been used before in enum \`${s}\`.`,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:s})=>`Enum type \`${i}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${s}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:i})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${i}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:i,memberName:s,explicitType:e})=>`Enum \`${i}\` has type \`${e}\`, so the initializer of \`${s}\` needs to be a ${e} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:i,memberName:s})=>`Symbol enum members cannot be initialized. Use \`${s},\` in enum \`${i}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:i,memberName:s})=>`The enum member initializer for \`${s}\` needs to be a literal (either a boolean, number, or string) in enum \`${i}\`.`,EnumInvalidMemberName:({enumName:i,memberName:s,suggestion:e})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${s}\`, consider using \`${e}\`, in enum \`${i}\`.`,EnumNumberMemberNotInitialized:({enumName:i,memberName:s})=>`Number enum members need to be initialized, e.g. \`${s} = 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 `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:i,suggestion:s})=>`\`declare export ${i}\` is not supported. Use \`${s}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function $o(i){return i.type==="DeclareExportAllDeclaration"||i.type==="DeclareExportDeclaration"&&(!i.declaration||i.declaration.type!=="TypeAlias"&&i.declaration.type!=="InterfaceDeclaration")}function Fi(i){return i.importKind==="type"||i.importKind==="typeof"}var qo={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function zo(i,s){let e=[],t=[];for(let r=0;r<i.length;r++)(s(i[r],r,i)?e:t).push(i[r]);return[e,t]}var Wo=/\*?\s*@((?:no)?flow)\b/,Jo=i=>class extends i{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return er}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}shouldParseEnums(){return!!this.getPluginOption("flow","enums")}finishToken(e,t){e!==133&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,t)}addComment(e){if(this.flowPragma===void 0){let t=Wo.exec(e.value);if(t)if(t[1]==="flow")this.flowPragma="flow";else if(t[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let t=this.state.inType;this.state.inType=!0,this.expect(e||14);let r=this.flowParseType();return this.state.inType=t,r}flowParsePredicate(){let e=this.startNode(),t=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>t.index+1&&this.raise(O.UnexpectedSpaceBetweenModuloChecks,t),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let e=this.state.inType;this.state.inType=!0,this.expect(14);let t=null,r=null;return this.match(54)?(this.state.inType=e,r=this.flowParsePredicate()):(t=this.flowParseType(),this.state.inType=e,this.match(54)&&(r=this.flowParsePredicate())),[t,r]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let t=e.id=this.parseIdentifier(),r=this.startNode(),n=this.startNode();this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,this.expect(10);let 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"),t.typeAnnotation=this.finishNode(n,"TypeAnnotation"),this.resetEndLocation(t),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,t){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):(t&&this.raise(O.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,t);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();let t=e.body=this.startNode(),r=t.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(O.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(o)):(this.expectContextual(125,O.UnsupportedStatementInDeclareModule),o=this.flowParseDeclare(o,!0)),r.push(o)}this.scope.exit(),this.expect(8),this.finishNode(t,"BlockStatement");let n=null,a=!1;return r.forEach(o=>{$o(o)?(n==="CommonJS"&&this.raise(O.AmbiguousDeclareModuleKind,o),n="ES"):o.type==="DeclareModuleExports"&&(a&&this.raise(O.DuplicateDeclareModuleExports,o),n==="ES"&&this.raise(O.AmbiguousDeclareModuleKind,o),n="CommonJS",a=!0)}),e.kind=n||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,t){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))&&!t){let r=this.state.value;throw this.raise(O.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:r,suggestion:qo[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();let t=this.flowParseTypeAlias(e);return t.type="DeclareTypeAlias",t}flowParseDeclareOpaqueType(e){this.next();let t=this.flowParseOpaqueType(e,!0);return t.type="DeclareOpaqueType",t}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,t){if(e.id=this.flowParseRestrictedIdentifier(!t,!0),this.scope.declareName(e.id.name,t?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(!t&&this.eat(12));if(t){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:t,allowExact:!1,allowSpread:!1,allowProto:t,allowInexact:!1})}flowParseInterfaceExtends(){let 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(O.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,t,r){Vo.has(e)&&this.raise(r?O.AssignReservedType:O.UnexpectedReservedType,t,{reservedType:e})}flowParseRestrictedIdentifier(e,t){return this.checkReservedType(this.state.value,this.state.startLoc,t),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,t){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,t||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){let t=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(O.MissingTypeParamDefault,t),this.finishNode(r,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,t=this.startNode();t.params=[],this.state.inType=!0,this.match(47)||this.match(142)?this.next():this.unexpected();let r=!1;do{let n=this.flowParseTypeParameter(r);t.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(t,"TypeParameterDeclaration")}flowParseTypeParameterInstantiation(){let e=this.startNode(),t=this.state.inType;e.params=[],this.state.inType=!0,this.expect(47);let 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=t,this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){let e=this.startNode(),t=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=t,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let 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,t,r){return e.static=t,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,t){return e.static=t,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,t){let r=this.startNode();return e.static=t,e.value=this.flowParseObjectTypeMethodish(r),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:t,allowSpread:r,allowProto:n,allowInexact:a}){let o=this.state.inType;this.state.inType=!0;let l=this.startNode();l.callProperties=[],l.properties=[],l.indexers=[],l.internalSlots=[];let c,u,h=!1;for(t&&this.match(6)?(this.expect(6),c=9,u=!0):(this.expect(5),c=8,u=!1),l.exact=u;!this.match(c);){let d=!1,p=null,g=null,y=this.startNode();if(n&&this.isContextual(118)){let P=this.lookahead();P.type!==14&&P.type!==17&&(this.next(),p=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){let P=this.lookahead();P.type!==14&&P.type!==17&&(this.next(),d=!0)}let b=this.flowParseVariance();if(this.eat(0))p!=null&&this.unexpected(p),this.eat(0)?(b&&this.unexpected(b.loc.start),l.internalSlots.push(this.flowParseObjectTypeInternalSlot(y,d))):l.indexers.push(this.flowParseObjectTypeIndexer(y,d,b));else if(this.match(10)||this.match(47))p!=null&&this.unexpected(p),b&&this.unexpected(b.loc.start),l.callProperties.push(this.flowParseObjectTypeCallProperty(y,d));else{let P="init";if(this.isContextual(99)||this.isContextual(104)){let T=this.lookahead();$i(T.type)&&(P=this.state.value,this.next())}let k=this.flowParseObjectTypeProperty(y,d,p,b,P,r,a??!u);k===null?(h=!0,g=this.state.lastTokStartLoc):l.properties.push(k)}this.flowObjectTypeSemicolon(),g&&!this.match(8)&&!this.match(9)&&this.raise(O.UnexpectedExplicitInexactInObject,g)}this.expect(c),r&&(l.inexact=h);let f=this.finishNode(l,"ObjectTypeAnnotation");return this.state.inType=o,f}flowParseObjectTypeProperty(e,t,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(O.InexactInsideExact,this.state.lastTokStartLoc):this.raise(O.InexactInsideNonObject,this.state.lastTokStartLoc),n&&this.raise(O.InexactVariance,n),null):(o||this.raise(O.UnexpectedSpreadType,this.state.lastTokStartLoc),r!=null&&this.unexpected(r),n&&this.raise(O.SpreadVariance,n),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=t,e.proto=r!=null,e.kind=a;let c=!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(O.ThisParamBannedInConstructor,e.value.this)):(a!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(c=!0),e.value=this.flowParseTypeInitialiser(),e.variance=n),e.optional=c,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let t=e.kind==="get"?0:1,r=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?O.GetterMayNotHaveThisParam:O.SetterMayNotHaveThisParam,e.value.this),r!==t&&this.raise(e.kind==="get"?m.BadGetterArity:m.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(m.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,t){var r;(r=e)!=null||(e=this.state.startLoc);let n=t||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let a=this.startNodeAt(e);a.qualification=n,a.id=this.flowParseRestrictedIdentifier(!0),n=this.finishNode(a,"QualifiedTypeIdentifier")}return n}flowParseGenericType(e,t){let r=this.startNodeAt(e);return r.typeParameters=null,r.id=this.flowParseQualifiedTypeIdentifier(e,t),this.match(47)&&(r.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(r,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.pos<this.length&&!this.match(3)&&(e.types.push(this.flowParseType()),!this.match(3));)this.expect(12);return this.expect(3),this.finishNode(e,"TupleTypeAnnotation")}flowParseFunctionTypeParam(e){let t=null,r=!1,n=null,a=this.startNode(),o=this.lookahead(),l=this.state.type===78;return o.type===14||o.type===17?(l&&!e&&this.raise(O.ThisParamMustBeFirst,a),t=this.parseIdentifier(l),this.eat(17)&&(r=!0,l&&this.raise(O.ThisParamMayNotBeOptional,a)),n=this.flowParseTypeInitialiser()):n=this.flowParseType(),a.name=t,a.optional=r,a.typeAnnotation=n,this.finishNode(a,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(e){let t=this.startNodeAt(e.loc.start);return t.name=null,t.optional=!1,t.typeAnnotation=e,this.finishNode(t,"FunctionTypeParam")}flowParseFunctionTypeParams(e=[]){let t=null,r=null;for(this.match(78)&&(r=this.flowParseFunctionTypeParam(!0),r.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(t=this.flowParseFunctionTypeParam(!1)),{params:e,rest:t,_this:r}}flowIdentToTypeAnnotation(e,t,r){switch(r.name){case"any":return this.finishNode(t,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(t,"BooleanTypeAnnotation");case"mixed":return this.finishNode(t,"MixedTypeAnnotation");case"empty":return this.finishNode(t,"EmptyTypeAnnotation");case"number":return this.finishNode(t,"NumberTypeAnnotation");case"string":return this.finishNode(t,"StringTypeAnnotation");case"symbol":return this.finishNode(t,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(r.name),this.flowParseGenericType(e,r)}}flowParsePrimaryType(){let e=this.state.startLoc,t=this.startNode(),r,n,a=!1,o=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,n=this.flowParseTupleType(),this.state.noAnonFunctionType=o,n;case 47:{let l=this.startNode();return l.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),r=this.flowParseFunctionTypeParams(),l.params=r.params,l.rest=r.rest,l.this=r._this,this.expect(11),this.expect(19),l.returnType=this.flowParseType(),this.finishNode(l,"FunctionTypeAnnotation")}case 10:{let l=this.startNode();if(this.next(),!this.match(11)&&!this.match(21))if(R(this.state.type)||this.match(78)){let c=this.lookahead().type;a=c!==17&&c!==14}else a=!0;if(a){if(this.state.noAnonFunctionType=!1,n=this.flowParseType(),this.state.noAnonFunctionType=o,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),n;this.eat(12)}return n?r=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(n)]):r=this.flowParseFunctionTypeParams(),l.params=r.params,l.rest=r.rest,l.this=r._this,this.expect(11),this.expect(19),l.returnType=this.flowParseType(),l.typeParameters=null,this.finishNode(l,"FunctionTypeAnnotation")}case 133:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return t.value=this.match(85),this.next(),this.finishNode(t,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(134))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",t);if(this.match(135))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",t);throw this.raise(O.UnexpectedSubtractionOperand,this.state.startLoc)}this.unexpected();return;case 134:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 135:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(t,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(t,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(t,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(t,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(Er(this.state.type)){let l=Ue(this.state.type);return this.next(),super.createIdentifier(t,l)}else if(R(this.state.type))return this.isContextual(129)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,t,this.parseIdentifier())}this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,t=this.flowParsePrimaryType(),r=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){let n=this.startNodeAt(e),a=this.eat(18);r=r||a,this.expect(0),!a&&this.match(3)?(n.elementType=t,this.next(),t=this.finishNode(n,"ArrayTypeAnnotation")):(n.objectType=t,n.indexType=this.flowParseType(),this.expect(3),r?(n.optional=a,t=this.finishNode(n,"OptionalIndexedAccessType")):t=this.finishNode(n,"IndexedAccessType"))}return t}flowParsePrefixType(){let e=this.startNode();return this.eat(17)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){let t=this.startNodeAt(e.loc.start);return t.params=[this.reinterpretTypeAsFunctionTypeParam(e)],t.rest=null,t.this=null,t.returnType=this.flowParseType(),t.typeParameters=null,this.finishNode(t,"FunctionTypeAnnotation")}return e}flowParseIntersectionType(){let e=this.startNode();this.eat(45);let t=this.flowParseAnonFunctionWithoutParens();for(e.types=[t];this.eat(45);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?t:this.finishNode(e,"IntersectionTypeAnnotation")}flowParseUnionType(){let e=this.startNode();this.eat(43);let t=this.flowParseIntersectionType();for(e.types=[t];this.eat(43);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?t:this.finishNode(e,"UnionTypeAnnotation")}flowParseType(){let e=this.state.inType;this.state.inType=!0;let t=this.flowParseUnionType();return this.state.inType=e,t}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){let e=this.state.startLoc,t=this.parseIdentifier();return this.flowParseGenericType(e,t)}else return this.flowParseType()}flowParseTypeAnnotation(){let e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(e){let t=e?this.parseIdentifier():this.flowParseRestrictedIdentifier();return this.match(14)&&(t.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(t)),t}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}flowParseVariance(){let e=null;return this.match(53)?(e=this.startNode(),this.state.value==="+"?e.kind="plus":e.kind="minus",this.next(),this.finishNode(e,"Variance")):e}parseFunctionBody(e,t,r=!1){if(t){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,r));return}super.parseFunctionBody(e,!1,r)}parseFunctionBodyAndFinish(e,t,r=!1){if(this.match(14)){let n=this.startNode();[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=n.typeAnnotation?this.finishNode(n,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,t,r)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){let r=this.lookahead();if(Te(r.type)){let n=this.startNode();return this.next(),this.flowParseInterface(n)}}else if(this.shouldParseEnums()&&this.isContextual(126)){let r=this.startNode();return this.next(),this.flowParseEnumDeclaration(r)}let t=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(t)&&(this.flowPragma=null),t}parseExpressionStatement(e,t,r){if(t.type==="Identifier"){if(t.name==="declare"){if(this.match(80)||R(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(R(this.state.type)){if(t.name==="interface")return this.flowParseInterface(e);if(t.name==="type")return this.flowParseTypeAlias(e);if(t.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,t,r)}shouldParseExportDeclaration(){let{type:e}=this.state;return Li(e)||this.shouldParseEnums()&&e===126?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return Li(e)||this.shouldParseEnums()&&e===126?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.shouldParseEnums()&&this.isContextual(126)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,t,r){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let f=this.lookaheadCharCode();if(f===44||f===61||f===58||f===41)return this.setOptionalParametersError(r),e}this.expect(17);let n=this.state.clone(),a=this.state.noArrowAt,o=this.startNodeAt(t),{consequent:l,failed:c}=this.tryParseConditionalConsequent(),[u,h]=this.getArrowLikeExpressions(l);if(c||h.length>0){let f=[...a];if(h.length>0){this.state=n,this.state.noArrowAt=f;for(let d=0;d<h.length;d++)f.push(h[d].start);({consequent:l,failed:c}=this.tryParseConditionalConsequent()),[u,h]=this.getArrowLikeExpressions(l)}c&&u.length>1&&this.raise(O.AmbiguousConditionalArrow,n.startLoc),c&&u.length===1&&(this.state=n,f.push(u[0].start),this.state.noArrowAt=f,{consequent:l,failed:c}=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);let e=this.parseMaybeAssignAllowIn(),t=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:t}}getArrowLikeExpressions(e,t){let r=[e],n=[];for(;r.length!==0;){let 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 t?(n.forEach(a=>this.finishArrowValidation(a)),[n,[]]):zo(n,a=>a.params.every(o=>this.isAssignable(o,!0)))}finishArrowValidation(e){var t;this.toAssignableList(e.params,(t=e.extra)==null?void 0:t.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,t){let r;return this.state.noArrowParamsConversionAt.includes(e.start)?(this.state.noArrowParamsConversionAt.push(this.state.start),r=t(),this.state.noArrowParamsConversionAt.pop()):r=t(),r}parseParenItem(e,t){let r=super.parseParenItem(e,t);if(this.eat(17)&&(r.optional=!0,this.resetEndLocation(e)),this.match(14)){let n=this.startNodeAt(t);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";let t=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(t)}else if(this.isContextual(131)){e.exportKind="type";let t=this.startNode();return this.next(),this.flowParseOpaqueType(t,!1)}else if(this.isContextual(129)){e.exportKind="type";let t=this.startNode();return this.next(),this.flowParseInterface(t)}else if(this.shouldParseEnums()&&this.isContextual(126)){e.exportKind="value";let t=this.startNode();return this.next(),this.flowParseEnumDeclaration(t)}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){let{startLoc:t}=this.state,r=super.maybeParseExportNamespaceSpecifier(e);return r&&e.exportKind==="type"&&this.unexpected(t),r}parseClassId(e,t,r){super.parseClassId(e,t,r),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,t,r){let{startLoc:n}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,t))return;t.declare=!0}super.parseClassMember(e,t,r),t.declare&&(t.type!=="ClassProperty"&&t.type!=="ClassPrivateProperty"&&t.type!=="PropertyDefinition"?this.raise(O.DeclareClassElement,n):t.value&&this.raise(O.DeclareClassFieldInitializer,t.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),t="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(m.InvalidIdentifier,this.state.curPosition(),{identifierName:t}),this.finishToken(132,t)}getTokenFromCode(e){let t=this.input.charCodeAt(this.state.pos+1);e===123&&t===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?t===46?this.finishOp(18,2):this.finishOp(17,1):vo(e,t,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,t){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,t):super.isAssignable(e,t)}toAssignable(e,t=!1){!t&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,t)}toAssignableList(e,t,r){for(let n=0;n<e.length;n++){let a=e[n];a?.type==="TypeCastExpression"&&(e[n]=this.typeCastToParameter(a))}super.toAssignableList(e,t,r)}toReferencedList(e,t){for(let n=0;n<e.length;n++){var r;let a=e[n];a&&a.type==="TypeCastExpression"&&!((r=a.extra)!=null&&r.parenthesized)&&(e.length>1||!t)&&this.raise(O.TypeCastInPattern,a.typeAnnotation)}return e}parseArrayLike(e,t,r,n){let a=super.parseArrayLike(e,t,r,n);return t&&!this.state.maybeInArrowParameters&&this.toReferencedList(a.elements),a}isValidLVal(e,t,r){return e==="TypeCastExpression"||super.isValidLVal(e,t,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,t,r,n,a,o){if(t.variance&&this.unexpected(t.variance.loc.start),delete t.variance,this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,t,r,n,a,o),t.params&&a){let l=t.params;l.length>0&&this.isThisParam(l[0])&&this.raise(O.ThisParamBannedInConstructor,t)}else if(t.type==="MethodDefinition"&&a&&t.value.params){let l=t.value.params;l.length>0&&this.isThisParam(l[0])&&this.raise(O.ThisParamBannedInConstructor,t)}}pushClassPrivateMethod(e,t,r,n){t.variance&&this.unexpected(t.variance.loc.start),delete t.variance,this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,t,r,n)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&this.match(47)&&(e.superTypeParameters=this.flowParseTypeParameterInstantiation()),this.isContextual(113)){this.next();let t=e.implements=[];do{let r=this.startNode();r.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?r.typeParameters=this.flowParseTypeParameterInstantiation():r.typeParameters=null,t.push(this.finishNode(r,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let t=this.getObjectOrClassMethodParams(e);if(t.length>0){let r=t[0];this.isThisParam(r)&&e.kind==="get"?this.raise(O.GetterMayNotHaveThisParam,r):this.isThisParam(r)&&this.raise(O.SetterMayNotHaveThisParam,r)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,t,r,n,a,o,l){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let c;this.match(47)&&!o&&(c=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let u=super.parseObjPropValue(e,t,r,n,a,o,l);return c&&((u.value||u).typeParameters=c),u}parseAssignableListItemTypes(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(O.PatternIsOptional,e),this.isThisParam(e)&&this.raise(O.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(O.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(O.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,t){let r=super.parseMaybeDefault(e,t);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(O.TypeBeforeInitializer,r.typeAnnotation),r}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(O.ImportReflectionHasImportType,e.specifiers[0].loc.start)}parseImportSpecifierLocal(e,t,r){t.local=Fi(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,r))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){if(!e)return!0;let t=this.lookaheadCharCode();return t===123||t===42}return!e&&this.isContextual(87)}applyImportPhase(e,t,r,n){if(super.applyImportPhase(e,t,r,n),t){if(!r&&this.match(65))return;e.exportKind=r==="type"?r:"value"}else r==="type"&&this.match(55)&&this.unexpected(),e.importKind=r==="type"||r==="typeof"?r:"value"}parseImportSpecifier(e,t,r,n,a){let o=e.imported,l=null;o.type==="Identifier"&&(o.name==="type"?l="type":o.name==="typeof"&&(l="typeof"));let c=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){let h=this.parseIdentifier(!0);l!==null&&!Te(this.state.type)?(e.imported=h,e.importKind=l,e.local=Be(h)):(e.imported=o,e.importKind=null,e.local=this.parseIdentifier())}else{if(l!==null&&Te(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=l;else{if(t)throw this.raise(m.ImportBindingIsString,e,{importName:o.value});e.imported=o,e.importKind=null}this.eatContextual(93)?e.local=this.parseIdentifier():(c=!0,e.local=Be(e.imported))}let u=Fi(e);return r&&u&&this.raise(O.ImportTypeShorthandOnlyInPureImport,e),(r||u)&&this.checkReservedType(e.local.name,e.local.loc.start,!0),c&&!r&&!u&&this.checkReservedWord(e.local.name,e.loc.start,!0,!0),this.finishImportSpecifier(e,"ImportSpecifier")}parseBindingAtom(){switch(this.state.type){case 78:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(e,t){let r=e.kind;r!=="get"&&r!=="set"&&this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),this.match(14)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){if(this.match(14)){let r=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=r}return super.parseAsyncArrowFromCallExpression(e,t)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,t){var r;let n=null,a;if(this.hasPlugin("jsx")&&(this.match(142)||this.match(47))){if(n=this.state.clone(),a=this.tryParse(()=>super.parseMaybeAssign(e,t),n),!a.error)return a.node;let{context:c}=this.state,u=c[c.length-1];(u===$.j_oTag||u===$.j_expr)&&c.pop()}if((r=a)!=null&&r.error||this.match(47)){var o,l;n=n||this.state.clone();let c,u=this.tryParse(f=>{var d;c=this.flowParseTypeParameterDeclaration();let p=this.forwardNoArrowParamsConversionAt(c,()=>{let y=super.parseMaybeAssign(e,t);return this.resetStartLocationFromNode(y,c),y});(d=p.extra)!=null&&d.parenthesized&&f();let g=this.maybeUnwrapTypeCastExpression(p);return g.type!=="ArrowFunctionExpression"&&f(),g.typeParameters=c,this.resetStartLocationFromNode(g,c),p},n),h=null;if(u.node&&this.maybeUnwrapTypeCastExpression(u.node).type==="ArrowFunctionExpression"){if(!u.error&&!u.aborted)return u.node.async&&this.raise(O.UnexpectedTypeParameterBeforeAsyncArrowFunction,c),u.node;h=u.node}if((o=a)!=null&&o.node)return this.state=a.failState,a.node;if(h)return this.state=u.failState,h;throw(l=a)!=null&&l.thrown?a.error:u.thrown?u.error:this.raise(O.UnexpectedTokenAfterTypeParameter,c)}return super.parseMaybeAssign(e,t)}parseArrow(e){if(this.match(14)){let t=this.tryParse(()=>{let r=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let 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(t.thrown)return null;t.error&&(this.state=t.failState),e.returnType=t.node.typeAnnotation?this.finishNode(t.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,t){this.state.noArrowParamsConversionAt.includes(e.start)?e.params=t:super.setArrowFunctionParameters(e,t)}checkParams(e,t,r,n=!0){if(!(r&&this.state.noArrowParamsConversionAt.includes(e.start))){for(let a=0;a<e.params.length;a++)this.isThisParam(e.params[a])&&a>0&&this.raise(O.ThisParamMustBeFirst,e.params[a]);super.checkParams(e,t,r,n)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.state.start))}parseSubscripts(e,t,r){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(t.index)){this.next();let n=this.startNodeAt(t);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)){let n=this.state.clone(),a=this.tryParse(l=>this.parseAsyncArrowWithTypeParameters(t)||l(),n);if(!a.error&&!a.aborted)return a.node;let o=this.tryParse(()=>super.parseSubscripts(e,t,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,t,r)}parseSubscript(e,t,r,n){if(this.match(18)&&this.isLookaheadToken_lt()){if(n.optionalChainMember=!0,r)return n.stop=!0,e;this.next();let a=this.startNodeAt(t);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)){let a=this.startNodeAt(t);a.callee=e;let 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,t,r,n)}parseNewCallee(e){super.parseNewCallee(e);let t=null;this.shouldParseTypes()&&this.match(47)&&(t=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=t}parseAsyncArrowWithTypeParameters(e){let t=this.startNodeAt(e);if(this.parseFunctionParams(t,!1),!!this.parseArrow(t))return super.parseArrowExpression(t,void 0,!0)}readToken_mult_modulo(e){let t=this.input.charCodeAt(this.state.pos+1);if(e===42&&t===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let t=this.input.charCodeAt(this.state.pos+1);if(e===124&&t===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,t){let r=super.parseTopLevel(e,t);return this.state.hasFlowComment&&this.raise(O.UnterminatedFlowComment,this.state.curPosition()),r}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(O.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,t=2;for(;[32,9].includes(this.input.charCodeAt(e+t));)t++;let r=this.input.charCodeAt(t+e),n=this.input.charCodeAt(t+e+1);return r===58&&n===58?t+2:this.input.slice(t+e,t+e+12)==="flow-include"?t+12:r===58&&n!==58?t:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(m.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:t,memberName:r}){this.raise(O.EnumBooleanMemberNotInitialized,e,{memberName:r,enumName:t})}flowEnumErrorInvalidMemberInitializer(e,t){return this.raise(t.explicitType?t.explicitType==="symbol"?O.EnumInvalidMemberInitializerSymbolType:O.EnumInvalidMemberInitializerPrimaryType:O.EnumInvalidMemberInitializerUnknownType,e,t)}flowEnumErrorNumberMemberNotInitialized(e,t){this.raise(O.EnumNumberMemberNotInitialized,e,t)}flowEnumErrorStringMemberInconsistentlyInitialized(e,t){this.raise(O.EnumStringMemberInconsistentlyInitialized,e,t)}flowEnumMemberInit(){let e=this.state.startLoc,t=()=>this.match(12)||this.match(8);switch(this.state.type){case 134:{let r=this.parseNumericLiteral(this.state.value);return t()?{type:"number",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 133:{let r=this.parseStringLiteral(this.state.value);return t()?{type:"string",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 85:case 86:{let r=this.parseBooleanLiteral(this.match(85));return t()?{type:"boolean",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,t=this.parseIdentifier(!0),r=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:t,init:r}}flowEnumCheckExplicitTypeMismatch(e,t,r){let{explicitType:n}=t;n!==null&&n!==r&&this.flowEnumErrorInvalidMemberInitializer(e,t)}flowEnumMembers({enumName:e,explicitType:t}){let r=new Set,n={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},a=!1;for(;!this.match(8);){if(this.eat(21)){a=!0;break}let o=this.startNode(),{id:l,init:c}=this.flowEnumMemberRaw(),u=l.name;if(u==="")continue;/^[a-z]/.test(u)&&this.raise(O.EnumInvalidMemberName,l,{memberName:u,suggestion:u[0].toUpperCase()+u.slice(1),enumName:e}),r.has(u)&&this.raise(O.EnumDuplicateMemberName,l,{memberName:u,enumName:e}),r.add(u);let h={enumName:e,explicitType:t,memberName:u};switch(o.id=l,c.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(c.loc,h,"boolean"),o.init=c.value,n.booleanMembers.push(this.finishNode(o,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(c.loc,h,"number"),o.init=c.value,n.numberMembers.push(this.finishNode(o,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(c.loc,h,"string"),o.init=c.value,n.stringMembers.push(this.finishNode(o,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(c.loc,h);case"none":switch(t){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(c.loc,h);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(c.loc,h);break;default:n.defaultedMembers.push(this.finishNode(o,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:n,hasUnknownMembers:a}}flowEnumStringMembers(e,t,{enumName:r}){if(e.length===0)return t;if(t.length===0)return e;if(t.length>e.length){for(let n of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(n,{enumName:r});return t}else{for(let n of t)this.flowEnumErrorStringMemberInconsistentlyInitialized(n,{enumName:r});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!R(this.state.type))throw this.raise(O.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:t}=this.state;return this.next(),t!=="boolean"&&t!=="number"&&t!=="string"&&t!=="symbol"&&this.raise(O.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:t}),t}flowEnumBody(e,t){let r=t.name,n=t.loc.start,a=this.flowEnumParseExplicitType({enumName:r});this.expect(5);let{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:{let c=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let u=o.booleanMembers.length,h=o.numberMembers.length,f=o.stringMembers.length,d=o.defaultedMembers.length;if(!u&&!h&&!f&&!d)return c();if(!u&&!h)return e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!h&&!f&&u>=d){for(let 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&&!f&&h>=d){for(let 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(O.EnumInconsistentMemberValues,n,{enumName:r}),c()}}}flowParseEnumDeclaration(e){let t=this.parseIdentifier();return e.id=t,e.body=this.flowEnumBody(this.startNode(),t),this.finishNode(e,"EnumDeclaration")}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let t=this.input.charCodeAt(e+1);return t!==60&&t!==61}return!1}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},Ko={__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"},We=Fe`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:s})=>`Unexpected token \`${i}\`. Did you mean \`${s}\` 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 Re(i){return i?i.type==="JSXOpeningFragment"||i.type==="JSXClosingFragment":!1}function tt(i){if(i.type==="JSXIdentifier")return i.name;if(i.type==="JSXNamespacedName")return i.namespace.name+":"+i.name.name;if(i.type==="JSXMemberExpression")return tt(i.object)+"."+tt(i.property);throw new Error("Node had unexpected type: "+i.type)}var Ho=i=>class extends i{jsxReadToken(){let e="",t=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(We.UnterminatedJsxContent,this.state.startLoc);let 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(t,this.state.pos),this.finishToken(141,e);return;case 38:e+=this.input.slice(t,this.state.pos),e+=this.jsxReadEntity(),t=this.state.pos;break;case 62:case 125:default:rt(r)?(e+=this.input.slice(t,this.state.pos),e+=this.jsxReadNewLine(!0),t=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let t=this.input.charCodeAt(this.state.pos),r;return++this.state.pos,t===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,r=e?`
7
7
  `:`\r
8
- `):r=String.fromCharCode(t),++this.state.curLine,this.state.lineStart=this.state.pos,r}jsxReadString(e){let t="",r=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(m.UnterminatedString,this.state.startLoc);let n=this.input.charCodeAt(this.state.pos);if(n===e)break;n===38?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadEntity(),r=this.state.pos):rt(n)?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadNewLine(!1),r=this.state.pos):++this.state.pos}t+=this.input.slice(r,this.state.pos++),this.finishToken(133,t)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let t=10;this.codePointAtPos(this.state.pos)===120&&(t=16,++this.state.pos);let r=this.readInt(t,void 0,!1,"bail");if(r!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(r)}else{let t=0,r=!1;for(;t++<10&&this.state.pos<this.length&&!(r=this.codePointAtPos(this.state.pos)===59);)++this.state.pos;if(r){let n=this.input.slice(e,this.state.pos),a=zo[n];if(++this.state.pos,a)return a}}return this.state.pos=e,"&"}jsxReadWord(){let e,t=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(st(e)||e===45);this.finishToken(140,this.input.slice(t,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(140)?e.name=this.state.value:Pr(this.state.type)?e.name=Ue(this.state.type):this.unexpected(),this.next(),this.finishNode(e,"JSXIdentifier")}jsxParseNamespacedName(){let e=this.state.startLoc,t=this.jsxParseIdentifier();if(!this.eat(14))return t;let r=this.startNodeAt(e);return r.namespace=t,r.name=this.jsxParseIdentifier(),this.finishNode(r,"JSXNamespacedName")}jsxParseElementName(){let e=this.state.startLoc,t=this.jsxParseNamespacedName();if(t.type==="JSXNamespacedName")return t;for(;this.eat(16);){let r=this.startNodeAt(e);r.object=t,r.property=this.jsxParseIdentifier(),t=this.finishNode(r,"JSXMemberExpression")}return t}jsxParseAttributeValue(){let e;switch(this.state.type){case 5:return e=this.startNode(),this.setContext($.brace),this.next(),e=this.jsxParseExpressionContainer(e,$.j_oTag),e.expression.type==="JSXEmptyExpression"&&this.raise(We.AttributeIsEmpty,e),e;case 142:case 133:return this.parseExprAtom();default:throw this.raise(We.UnsupportedJsxValue,this.state.startLoc)}}jsxParseEmptyExpression(){let e=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(e,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(e){return this.next(),e.expression=this.parseExpression(),this.setContext($.j_expr),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXSpreadChild")}jsxParseExpressionContainer(e,t){if(this.match(8))e.expression=this.jsxParseEmptyExpression();else{let r=this.parseExpression();e.expression=r}return this.setContext(t),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXExpressionContainer")}jsxParseAttribute(){let e=this.startNode();return this.match(5)?(this.setContext($.brace),this.next(),this.expect(21),e.argument=this.parseMaybeAssignAllowIn(),this.setContext($.j_oTag),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXSpreadAttribute")):(e.name=this.jsxParseNamespacedName(),e.value=this.eat(29)?this.jsxParseAttributeValue():null,this.finishNode(e,"JSXAttribute"))}jsxParseOpeningElementAt(e){let t=this.startNodeAt(e);return this.eat(143)?this.finishNode(t,"JSXOpeningFragment"):(t.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(t))}jsxParseOpeningElementAfterName(e){let t=[];for(;!this.match(56)&&!this.match(143);)t.push(this.jsxParseAttribute());return e.attributes=t,e.selfClosing=this.eat(56),this.expect(143),this.finishNode(e,"JSXOpeningElement")}jsxParseClosingElementAt(e){let t=this.startNodeAt(e);return this.eat(143)?this.finishNode(t,"JSXClosingFragment"):(t.name=this.jsxParseElementName(),this.expect(143),this.finishNode(t,"JSXClosingElement"))}jsxParseElementAt(e){let t=this.startNodeAt(e),r=[],n=this.jsxParseOpeningElementAt(e),a=null;if(!n.selfClosing){e:for(;;)switch(this.state.type){case 142:if(e=this.state.startLoc,this.next(),this.eat(56)){a=this.jsxParseClosingElementAt(e);break e}r.push(this.jsxParseElementAt(e));break;case 141:r.push(this.parseLiteral(this.state.value,"JSXText"));break;case 5:{let o=this.startNode();this.setContext($.brace),this.next(),this.match(21)?r.push(this.jsxParseSpreadChild(o)):r.push(this.jsxParseExpressionContainer(o,$.j_expr));break}default:this.unexpected()}Re(n)&&!Re(a)&&a!==null?this.raise(We.MissingClosingTagFragment,a):!Re(n)&&Re(a)?this.raise(We.MissingClosingTagElement,a,{openingTagName:tt(n.name)}):!Re(n)&&!Re(a)&&tt(a.name)!==tt(n.name)&&this.raise(We.MissingClosingTagElement,a,{openingTagName:tt(n.name)})}if(Re(n)?(t.openingFragment=n,t.closingFragment=a):(t.openingElement=n,t.closingElement=a),t.children=r,this.match(47))throw this.raise(We.UnwrappedAdjacentJSXElements,this.state.startLoc);return Re(n)?this.finishNode(t,"JSXFragment"):this.finishNode(t,"JSXElement")}jsxParseElement(){let e=this.state.startLoc;return this.next(),this.jsxParseElementAt(e)}setContext(e){let{context:t}=this.state;t[t.length-1]=e}parseExprAtom(e){return this.match(142)?this.jsxParseElement():this.match(47)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(142),this.jsxParseElement()):super.parseExprAtom(e)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(e){let t=this.curContext();if(t===$.j_expr){this.jsxReadToken();return}if(t===$.j_oTag||t===$.j_cTag){if(Me(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(143);return}if((e===34||e===39)&&t===$.j_oTag){this.jsxReadString(e);return}}if(e===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(142);return}super.getTokenFromCode(e)}updateContext(e){let{context:t,type:r}=this.state;if(r===56&&e===142)t.splice(-2,2,$.j_cTag),this.state.canStartJSXElement=!1;else if(r===142)t.push($.j_oTag);else if(r===143){let n=t[t.length-1];n===$.j_oTag&&e===56||n===$.j_cTag?(t.pop(),this.state.canStartJSXElement=t[t.length-1]===$.j_expr):(this.setContext($.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=ao(r)}},ur=class extends Ct{constructor(...s){super(...s),this.tsNames=new Map}},hr=class extends It{constructor(...s){super(...s),this.importsStack=[]}createScope(s){return this.importsStack.push(new Set),new ur(s)}enter(s){s===256&&this.importsStack.push(new Set),super.enter(s)}exit(){let s=super.exit();return s===256&&this.importsStack.pop(),s}hasImport(s,e){let t=this.importsStack.length;if(this.importsStack[t-1].has(s))return!0;if(!e&&t>1){for(let r=0;r<t-1;r++)if(this.importsStack[r].has(s))return!0}return!1}declareName(s,e,t){if(e&4096){this.hasImport(s,!0)&&this.parser.raise(m.VarRedeclaration,t,{identifierName:s}),this.importsStack[this.importsStack.length-1].add(s);return}let r=this.currentScope(),n=r.tsNames.get(s)||0;if(e&1024){this.maybeExportDefined(r,s),r.tsNames.set(s,n|16);return}super.declareName(s,e,t),e&2&&(e&1||(this.checkRedeclarationInScope(r,s,e,t),this.maybeExportDefined(r,s)),n=n|1),e&256&&(n=n|2),e&512&&(n=n|4),e&128&&(n=n|8),n&&r.tsNames.set(s,n)}isRedeclaredInScope(s,e,t){let r=s.tsNames.get(e);if((r&2)>0){if(t&256){let n=!!(t&512),a=(r&4)>0;return n!==a}return!0}return t&128&&(r&8)>0?s.names.get(e)&2?!!(t&1):!1:t&2&&(r&1)>0?!0:super.isRedeclaredInScope(s,e,t)}checkLocalExport(s){let{name:e}=s;if(this.hasImport(e))return;let t=this.scopeStack.length;for(let r=t-1;r>=0;r--){let a=this.scopeStack[r].tsNames.get(e);if((a&1)>0||(a&16)>0)return}super.checkLocalExport(s)}},Qi=i=>i.type==="ParenthesizedExpression"?Qi(i.expression):i,pr=class extends cr{toAssignable(s,e=!1){var t,r;let n;switch((s.type==="ParenthesizedExpression"||(t=s.extra)!=null&&t.parenthesized)&&(n=Qi(s),e?n.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(m.InvalidParenthesizedAssignment,s):n.type!=="MemberExpression"&&!this.isOptionalMemberExpression(n)&&this.raise(m.InvalidParenthesizedAssignment,s):this.raise(m.InvalidParenthesizedAssignment,s)),s.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":s.type="ObjectPattern";for(let o=0,l=s.properties.length,c=l-1;o<l;o++){var a;let u=s.properties[o],h=o===c;this.toAssignableObjectExpressionProp(u,h,e),h&&u.type==="RestElement"&&(a=s.extra)!=null&&a.trailingCommaLoc&&this.raise(m.RestTrailingComma,s.extra.trailingCommaLoc)}break;case"ObjectProperty":{let{key:o,value:l}=s;this.isPrivateName(o)&&this.classScope.usePrivateName(this.getPrivateNameSV(o),o.loc.start),this.toAssignable(l,e);break}case"SpreadElement":throw new Error("Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.");case"ArrayExpression":s.type="ArrayPattern",this.toAssignableList(s.elements,(r=s.extra)==null?void 0:r.trailingCommaLoc,e);break;case"AssignmentExpression":s.operator!=="="&&this.raise(m.MissingEqInAssignment,s.left.loc.end),s.type="AssignmentPattern",delete s.operator,this.toAssignable(s.left,e);break;case"ParenthesizedExpression":this.toAssignable(n,e);break}}toAssignableObjectExpressionProp(s,e,t){if(s.type==="ObjectMethod")this.raise(s.kind==="get"||s.kind==="set"?m.PatternHasAccessor:m.PatternHasMethod,s.key);else if(s.type==="SpreadElement"){s.type="RestElement";let r=s.argument;this.checkToRestConversion(r,!1),this.toAssignable(r,t),e||this.raise(m.RestTrailingComma,s)}else this.toAssignable(s,t)}toAssignableList(s,e,t){let r=s.length-1;for(let n=0;n<=r;n++){let a=s[n];if(a){if(a.type==="SpreadElement"){a.type="RestElement";let o=a.argument;this.checkToRestConversion(o,!0),this.toAssignable(o,t)}else this.toAssignable(a,t);a.type==="RestElement"&&(n<r?this.raise(m.RestTrailingComma,a):e&&this.raise(m.RestTrailingComma,e))}}}isAssignable(s,e){switch(s.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let t=s.properties.length-1;return s.properties.every((r,n)=>r.type!=="ObjectMethod"&&(n===t||r.type!=="SpreadElement")&&this.isAssignable(r))}case"ObjectProperty":return this.isAssignable(s.value);case"SpreadElement":return this.isAssignable(s.argument);case"ArrayExpression":return s.elements.every(t=>t===null||this.isAssignable(t));case"AssignmentExpression":return s.operator==="=";case"ParenthesizedExpression":return this.isAssignable(s.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(s,e){return s}toReferencedListDeep(s,e){this.toReferencedList(s,e);for(let t of s)t?.type==="ArrayExpression"&&this.toReferencedListDeep(t.elements)}parseSpread(s){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(s,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){let s=this.startNode();return this.next(),s.argument=this.parseBindingAtom(),this.finishNode(s,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let s=this.startNode();return this.next(),s.elements=this.parseBindingList(3,93,1),this.finishNode(s,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(s,e,t){let r=t&1,n=[],a=!0;for(;!this.eat(s);)if(a?a=!1:this.expect(12),r&&this.match(12))n.push(null);else{if(this.eat(s))break;if(this.match(21)){if(n.push(this.parseAssignableListItemTypes(this.parseRestBinding(),t)),!this.checkCommaAfterRest(e)){this.expect(s);break}}else{let o=[];for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(m.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)o.push(this.parseDecorator());n.push(this.parseAssignableListItem(t,o))}}return n}parseBindingRestProperty(s){return this.next(),s.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(s,"RestElement")}parseBindingProperty(){let{type:s,startLoc:e}=this.state;if(s===21)return this.parseBindingRestProperty(this.startNode());let t=this.startNode();return s===138?(this.expectPlugin("destructuringPrivate",e),this.classScope.usePrivateName(this.state.value,e),t.key=this.parsePrivateName()):this.parsePropertyName(t),t.method=!1,this.parseObjPropValue(t,e,!1,!1,!0,!1)}parseAssignableListItem(s,e){let t=this.parseMaybeDefault();this.parseAssignableListItemTypes(t,s);let r=this.parseMaybeDefault(t.loc.start,t);return e.length&&(t.decorators=e),r}parseAssignableListItemTypes(s,e){return s}parseMaybeDefault(s,e){var t,r;if((t=s)!=null||(s=this.state.startLoc),e=(r=e)!=null?r:this.parseBindingAtom(),!this.eat(29))return e;let n=this.startNodeAt(s);return n.left=e,n.right=this.parseMaybeAssignAllowIn(),this.finishNode(n,"AssignmentPattern")}isValidLVal(s,e,t){switch(s){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(s){return s.type==="OptionalMemberExpression"}checkLVal(s,e,t=64,r=!1,n=!1,a=!1){var o;let l=s.type;if(this.isObjectMethod(s))return;let c=this.isOptionalMemberExpression(s);if(c||l==="MemberExpression"){c&&(this.expectPlugin("optionalChainingAssign",s.loc.start),e.type!=="AssignmentExpression"&&this.raise(m.InvalidLhsOptionalChaining,s,{ancestor:e})),t!==64&&this.raise(m.InvalidPropertyBindingPattern,s);return}if(l==="Identifier"){this.checkIdentifier(s,t,n);let{name:g}=s;r&&(r.has(g)?this.raise(m.ParamDupe,s):r.add(g));return}let u=this.isValidLVal(l,!(a||(o=s.extra)!=null&&o.parenthesized)&&e.type==="AssignmentExpression",t);if(u===!0)return;if(u===!1){let g=t===64?m.InvalidLhs:m.InvalidLhsBinding;this.raise(g,s,{ancestor:e});return}let h,f;typeof u=="string"?(h=u,f=l==="ParenthesizedExpression"):[h,f]=u;let d=l==="ArrayPattern"||l==="ObjectPattern"?{type:l}:e,p=s[h];if(Array.isArray(p))for(let g of p)g&&this.checkLVal(g,d,t,r,n,f);else p&&this.checkLVal(p,d,t,r,n,f)}checkIdentifier(s,e,t=!1){this.state.strict&&(t?Ji(s.name,this.inModule):Wi(s.name))&&(e===64?this.raise(m.StrictEvalArguments,s,{referenceName:s.name}):this.raise(m.StrictEvalArgumentsBinding,s,{bindingName:s.name})),e&8192&&s.name==="let"&&this.raise(m.LetInLexicalBinding,s),e&64||this.declareNameFromIdentifier(s,e)}declareNameFromIdentifier(s,e){this.scope.declareName(s.name,e,s.loc.start)}checkToRestConversion(s,e){switch(s.type){case"ParenthesizedExpression":this.checkToRestConversion(s.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(m.InvalidRestAssignmentPattern,s)}}checkCommaAfterRest(s){return this.match(12)?(this.raise(this.lookaheadCharCode()===s?m.RestTrailingComma:m.ElementAfterRest,this.state.startLoc),!0):!1}};function Jo(i){if(i==null)throw new Error(`Unexpected ${i} value.`);return i}function Mi(i){if(!i)throw new Error("Assert fail")}var I=Fe`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 `<T,>() => ...`.",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 Ko(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 Fi(i){return i==="private"||i==="public"||i==="protected"}function Ho(i){return i==="in"||i==="out"}var Xo=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:I.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:I.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:I.InvalidModifierOnTypeParameter})}getScopeHandler(){return hr}tsIsIdentifier(){return R(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,t){if(!R(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let r=this.state.value;if(e.includes(r)){if(t&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return r}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:t,stopOnStartOfClassStaticBlock:r,errorTemplate:n=I.InvalidModifierOnTypeMember},a){let o=(c,u,h,f)=>{u===h&&a[f]&&this.raise(I.InvalidModifiersOrder,c,{orderedModifiers:[h,f]})},l=(c,u,h,f)=>{(a[h]&&u===f||a[f]&&u===h)&&this.raise(I.IncompatibleModifiers,c,{modifiers:[h,f]})};for(;;){let{startLoc:c}=this.state,u=this.tsParseModifier(e.concat(t??[]),r);if(!u)break;Fi(u)?a.accessibility?this.raise(I.DuplicateAccessibilityModifier,c,{modifier:u}):(o(c,u,u,"override"),o(c,u,u,"static"),o(c,u,u,"readonly"),a.accessibility=u):Ho(u)?(a[u]&&this.raise(I.DuplicateModifier,c,{modifier:u}),a[u]=!0,o(c,u,"in","out")):(hasOwnProperty.call(a,u)?this.raise(I.DuplicateModifier,c,{modifier:u}):(o(c,u,"static","readonly"),o(c,u,"static","override"),o(c,u,"override","readonly"),o(c,u,"abstract","override"),l(c,u,"declare","override"),l(c,u,"static","abstract")),a[u]=!0),t!=null&&t.includes(u)&&this.raise(n,c,{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,t){let r=[];for(;!this.tsIsListTerminator(e);)r.push(t());return r}tsParseDelimitedList(e,t,r){return Jo(this.tsParseDelimitedListWorker(e,t,!0,r))}tsParseDelimitedListWorker(e,t,r,n){let a=[],o=-1;for(;!this.tsIsListTerminator(e);){o=-1;let l=t();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,t,r,n,a){n||(r?this.expect(0):this.expect(47));let o=this.tsParseDelimitedList(e,t,a);return r?this.expect(3):this.expect(48),o}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(133)||this.raise(I.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=super.parseExprAtom(),(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))&&(e.options=null),this.eat(12)&&(this.expectImportAttributesPlugin(),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 t=this.parseIdentifier(e);for(;this.eat(16);){let r=this.startNodeAtNode(t);r.left=t,r.right=this.parseIdentifier(e),t=this.finishNode(r,"TSQualifiedName")}return t}tsParseTypeReference(){let 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();let t=this.startNodeAtNode(e);return t.parameterName=e,t.typeAnnotation=this.tsParseTypeAnnotation(!1),t.asserts=!1,this.finishNode(t,"TSTypePredicate")}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){let 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){let t=this.startNode();return e(t),t.name=this.tsParseTypeParameterName(),t.constraint=this.tsEatThenParseType(81),t.default=this.tsEatThenParseType(29),this.finishNode(t,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let t=this.startNode();this.match(47)||this.match(142)?this.next():this.unexpected();let r={value:-1};return t.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,r),t.params.length===0&&this.raise(I.EmptyTypeParameters,t),r.value!==-1&&this.addExtra(t,"trailingComma",r.value),this.finishNode(t,"TSTypeParameterDeclaration")}tsFillSignature(e,t){let r=e===19,n="parameters",a="typeAnnotation";t.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),t[n]=this.tsParseBindingListForSignature(),r?t[a]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(t[a]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let t of e){let{type:r}=t;(r==="AssignmentPattern"||r==="TSParameterProperty")&&this.raise(I.UnsupportedSignatureParameterKind,t,{type:r})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,t){return this.tsFillSignature(14,t),this.tsParseTypeMemberSemicolon(),this.finishNode(t,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),R(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);let t=this.parseIdentifier();t.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(t),this.expect(3),e.parameters=[t];let r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,t){this.eat(17)&&(e.optional=!0);let r=e;if(this.match(10)||this.match(47)){t&&this.raise(I.ReadonlyForMethodSignature,e);let n=r;n.kind&&this.match(47)&&this.raise(I.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,n),this.tsParseTypeMemberSemicolon();let a="parameters",o="typeAnnotation";if(n.kind==="get")n[a].length>0&&(this.raise(m.BadGetterArity,this.state.curPosition()),this.isThisParam(n[a][0])&&this.raise(I.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(n.kind==="set"){if(n[a].length!==1)this.raise(m.BadSetterArity,this.state.curPosition());else{let l=n[a][0];this.isThisParam(l)&&this.raise(I.AccessorCannotDeclareThisParameter,this.state.curPosition()),l.type==="Identifier"&&l.optional&&this.raise(I.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),l.type==="RestElement"&&this.raise(I.SetAccessorCannotHaveRestParameter,this.state.curPosition())}n[o]&&this.raise(I.SetAccessorCannotHaveReturnType,n[o])}else n.kind="method";return this.finishNode(n,"TSMethodSignature")}else{let n=r;t&&(n.readonly=!0);let a=this.tsTryParseTypeAnnotation();return a&&(n.typeAnnotation=a),this.tsParseTypeMemberSemicolon(),this.finishNode(n,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){let 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);let t=this.tsTryParseIndexSignature(e);return t||(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(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let 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(){let 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);{let t=this.startNode();t.name=this.tsParseTypeParameterName(),t.constraint=this.tsExpectThenParseType(58),e.typeParameter=this.finishNode(t,"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(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let t=!1;return e.elementTypes.forEach(r=>{let{type:n}=r;t&&n!=="TSRestType"&&n!=="TSOptionalType"&&!(n==="TSNamedTupleMember"&&r.optional)&&this.raise(I.OptionalTypeBeforeRequired,r),t||(t=n==="TSNamedTupleMember"&&r.optional||n==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let{startLoc:e}=this.state,t=this.eat(21),r,n,a,o,c=Te(this.state.type)?this.lookaheadCharCode():null;if(c===58)r=!0,a=!1,n=this.parseIdentifier(!0),this.expect(14),o=this.tsParseType();else if(c===63){a=!0;let u=this.state.startLoc,h=this.state.value,f=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(r=!0,n=this.createIdentifier(this.startNodeAt(u),h),this.expect(17),this.expect(14),o=this.tsParseType()):(r=!1,o=f,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(I.TupleOptionalAfterType,this.state.lastTokStartLoc))):(u=this.startNodeAtNode(o),u.optional=a,this.raise(I.InvalidTupleMemberLabel,o),u.label=o,u.elementType=this.tsParseType()),o=this.finishNode(u,"TSNamedTupleMember")}else if(a){let u=this.startNodeAtNode(o);u.typeAnnotation=o,o=this.finishNode(u,"TSOptionalType")}if(t){let u=this.startNodeAt(e);u.typeAnnotation=o,o=this.finishNode(u,"TSRestType")}return o}tsParseParenthesizedType(){let e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,t){let r=this.startNode();return e==="TSConstructorType"&&(r.abstract=!!t,t&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,r)),this.finishNode(r,e)}tsParseLiteralTypeNode(){let 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(){let e=this.startNode();return e.literal=super.parseTemplate(!1),this.finishNode(e,"TSLiteralType")}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let 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==="-"){let e=this.startNode(),t=this.lookahead();return t.type!==134&&t.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:{let{type:e}=this.state;if(R(e)||e===88||e===84){let t=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":Ko(this.state.value);if(t!==void 0&&this.lookaheadCharCode()!==46){let r=this.startNode();return this.next(),this.finishNode(r,t)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let e=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let t=this.startNodeAtNode(e);t.elementType=e,this.expect(3),e=this.finishNode(t,"TSArrayType")}else{let t=this.startNodeAtNode(e);t.objectType=e,t.indexType=this.tsParseType(),this.expect(3),e=this.finishNode(t,"TSIndexedAccessType")}return e}tsParseTypeOperator(){let e=this.startNode(),t=this.state.value;return this.next(),e.operator=t,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),t==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(I.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(115);let t=this.startNode();return t.name=this.tsParseTypeParameterName(),t.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(t,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){return po(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,t,r){let n=this.startNode(),a=this.eat(r),o=[];do o.push(t());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(R(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:e}=this.state,t=e.length;try{return this.parseObjectLike(8,!0),e.length===t}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,t=e.length;try{return super.parseBindingList(3,93,1),e.length===t}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(()=>{let t=this.startNode();this.expect(e);let 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),t.typeAnnotation=l,this.finishNode(t,"TSTypeAnnotation")}let a=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!a)return n?(r.parameterName=this.parseIdentifier(),r.asserts=n,r.typeAnnotation=null,t.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(t,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,t);let o=this.tsParseTypeAnnotation(!1);return r.parameterName=a,r.typeAnnotation=o,r.asserts=n,t.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(t,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;let e=this.state.containsEsc;return this.next(),!R(this.state.type)&&!this.match(78)?!1:(e&&this.raise(m.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,t=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),t.typeAnnotation=this.tsParseType()}),this.finishNode(t,"TSTypeAnnotation")}tsParseType(){Mi(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;let t=this.startNodeAtNode(e);return t.checkType=e,t.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),t.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),t.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(t,"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(I.ReservedTypeAssertion,this.state.startLoc);let 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){let t=this.state.startLoc,r=this.tsParseDelimitedList("HeritageClauseElement",()=>{let n=this.startNode();return n.expression=this.tsParseEntityName(),this.match(47)&&(n.typeParameters=this.tsParseTypeArguments()),this.finishNode(n,"TSExpressionWithTypeArguments")});return r.length||this.raise(I.EmptyHeritageClauseType,t,{token:e}),r}tsParseInterfaceDeclaration(e,t={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),t.declare&&(e.declare=!0),R(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(I.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let 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){let t=this.startNode();return this.next(),this.finishNode(t,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInNoContext(e){let t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}tsInType(e){let t=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=t}}tsInDisallowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}tsInAllowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}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(){let 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,t={}){return t.const&&(e.const=!0),t.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(){let 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,t=!1){if(e.id=this.parseIdentifier(),t||this.checkIdentifier(e.id,1024),this.eat(16)){let 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,t,r){e.isExport=r||!1,e.id=t||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);let n=this.tsParseModuleReference();return e.importKind==="type"&&n.type!=="TSExternalModuleReference"&&this.raise(I.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(){let 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){let t=this.state.clone(),r=e();return this.state=t,r}tsTryParseAndCatch(e){let t=this.tryParse(r=>e()||r());if(!(t.aborted||!t.node))return t.error&&(this.state=t.failState),t.node}tsTryParse(e){let t=this.state.clone(),r=e();if(r!==void 0&&r!==!1)return r;this.state=t}tsTryParseDeclare(e){if(this.isLineTerminator())return;let t=this.state.type,r;return this.isContextual(100)&&(t=74,r="let"),this.tsInAmbientContext(()=>{switch(t){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:{let n=this.tsParseInterfaceDeclaration(e,{declare:!0});if(n)return n}default:if(R(t))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,t,r){switch(t.name){case"declare":{let n=this.tsTryParseDeclare(e);return n&&(n.declare=!0),n}case"global":if(this.match(5)){this.scope.enter(256),this.prodParam.enter(0);let n=e;return n.global=!0,n.id=t,n.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(n,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,t.name,!1,r)}}tsParseDeclaration(e,t,r,n){switch(t){case"abstract":if(this.tsCheckLineTerminator(r)&&(this.match(80)||R(this.state.type)))return this.tsParseAbstractDeclaration(e,n);break;case"module":if(this.tsCheckLineTerminator(r)){if(this.match(133))return this.tsParseAmbientExternalModuleDeclaration(e);if(R(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(r)&&R(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(r)&&R(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;let t=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let r=this.tsTryParseAndCatch(()=>{let 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=t,!!r)return super.parseArrowExpression(r,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){let 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(I.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===$.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return fo(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseAssignableListItem(e,t){let r=this.state.startLoc,n={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},n);let a=n.accessibility,o=n.override,l=n.readonly;!(e&4)&&(a||l||o)&&this.raise(I.UnexpectedParameterModifier,r);let c=this.parseMaybeDefault();this.parseAssignableListItemTypes(c,e);let u=this.parseMaybeDefault(c.loc.start,c);if(a||l||o){let h=this.startNodeAt(r);return t.length&&(h.decorators=t),a&&(h.accessibility=a),l&&(h.readonly=l),o&&(h.override=o),u.type!=="Identifier"&&u.type!=="AssignmentPattern"&&this.raise(I.UnsupportedParameterPropertyKind,h),h.parameter=u,this.finishNode(h,"TSParameterProperty")}return t.length&&(c.decorators=t),u}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let t of e.params)t.type!=="Identifier"&&t.optional&&!this.state.isAmbientContext&&this.raise(I.PatternIsOptional,t)}setArrowFunctionParameters(e,t,r){super.setArrowFunctionParameters(e,t,r),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,t,r=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let n=t==="FunctionDeclaration"?"TSDeclareFunction":t==="ClassMethod"||t==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return n&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,n):n==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(I.DeclareFunctionHasImplementation,e),e.declare)?super.parseFunctionBodyAndFinish(e,n,r):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,t,r))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(t=>{t?.type==="TSTypeCastExpression"&&this.raise(I.UnexpectedTypeAnnotation,t.typeAnnotation)})}toReferencedList(e,t){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,t,r,n){let a=super.parseArrayLike(e,t,r,n);return a.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(a.elements),a}parseSubscript(e,t,r,n){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let o=this.startNodeAt(t);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,l=this.tsTryParseAndCatch(()=>{if(!r&&this.atPossibleAsyncArrow(e)){let f=this.tsTryParseGenericAsyncArrowFunction(t);if(f)return f}let c=this.tsParseTypeArgumentsInExpression();if(!c)return;if(a&&!this.match(10)){o=this.state.curPosition();return}if(ss(this.state.type)){let f=super.parseTaggedTemplateExpression(e,t,n);return f.typeParameters=c,f}if(!r&&this.eat(10)){let f=this.startNodeAt(t);return f.callee=e,f.arguments=this.parseCallExpressionArguments(11,!1),this.tsCheckForInvalidTypeCasts(f.arguments),f.typeParameters=c,n.optionalChainMember&&(f.optional=a),this.finishCallExpression(f,n.optionalChainMember)}let u=this.state.type;if(u===48||u===52||u!==10&&Xs(u)&&!this.hasPrecedingLineBreak())return;let h=this.startNodeAt(t);return h.expression=e,h.typeParameters=c,this.finishNode(h,"TSInstantiationExpression")});if(o&&this.unexpected(o,10),l)return l.type==="TSInstantiationExpression"&&(this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(I.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),l}return super.parseSubscript(e,t,r,n)}parseNewCallee(e){var t;super.parseNewCallee(e);let{callee:r}=e;r.type==="TSInstantiationExpression"&&!((t=r.extra)!=null&&t.parenthesized)&&(e.typeParameters=r.typeParameters,e.callee=r.expression)}parseExprOp(e,t,r){let n;if(Zt(58)>r&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(n=this.isContextual(120)))){let a=this.startNodeAt(t);return a.expression=e,a.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(n&&this.raise(m.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(a,n?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(a,t,r)}return super.parseExprOp(e,t,r)}checkReservedWord(e,t,r,n){this.state.isAmbientContext||super.checkReservedWord(e,t,r,n)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(I.ImportReflectionHasImportType,e.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){let t=this.lookaheadCharCode();return e?t===123||t===42:t!==61}return!e&&this.isContextual(87)}applyImportPhase(e,t,r,n){super.applyImportPhase(e,t,r,n),t?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 t;if(R(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){let r=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,r);t=super.parseImportSpecifiersAndAfter(e,r)}else t=super.parseImport(e);return t.importKind==="type"&&t.specifiers.length>1&&t.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(I.TypeImportCannotSpecifyDefaultAndNamed,t),t}parseExport(e,t){if(this.match(83)){this.next();let r=e,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)){let r=e;return r.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(r,"TSExportAssignment")}else if(this.eatContextual(93)){let r=e;return this.expectContextual(128),r.id=this.parseIdentifier(),this.semicolon(),this.finishNode(r,"TSNamespaceExportDeclaration")}else return super.parseExport(e,t)}isAbstractClass(){return this.isContextual(124)&&this.lookahead().type===80}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(129)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,t,r=!1){let{isAmbientContext:n}=this.state,a=super.parseVarStatement(e,t,r||n);if(!n)return a;for(let{id:o,init:l}of a.declarations)l&&(t!=="const"||o.typeAnnotation?this.raise(I.InitializerNotAllowedInAmbientContext,l):Qo(l,this.hasPlugin("estree"))||this.raise(I.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,l));return a}parseStatementContent(e,t){if(this.match(75)&&this.isLookaheadContextual("enum")){let 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)){let r=this.tsParseInterfaceDeclaration(this.startNode());if(r)return r}return super.parseStatementContent(e,t)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,t){return t.some(r=>Fi(r)?e.accessibility===r:!!e[r])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(e,t,r){let n=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:n,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:I.InvalidModifierOnTypeParameterPositions},t);let a=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(t,n)&&this.raise(I.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,t)):this.parseClassMemberWithIsStatic(e,t,r,!!t.static)};t.declare?this.tsInAmbientContext(a):a()}parseClassMemberWithIsStatic(e,t,r,n){let a=this.tsTryParseIndexSignature(t);if(a){e.body.push(a),t.abstract&&this.raise(I.IndexSignatureHasAbstract,t),t.accessibility&&this.raise(I.IndexSignatureHasAccessibility,t,{modifier:t.accessibility}),t.declare&&this.raise(I.IndexSignatureHasDeclare,t),t.override&&this.raise(I.IndexSignatureHasOverride,t);return}!this.state.inAbstractClass&&t.abstract&&this.raise(I.NonAbstractClassHasAbstractMethod,t),t.override&&(r.hadSuperClass||this.raise(I.OverrideNotInSubClass,t)),super.parseClassMemberWithIsStatic(e,t,r,n)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(I.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(I.ClassMethodHasDeclare,e)}parseExpressionStatement(e,t,r){return(t.type==="Identifier"?this.tsParseExpressionStatement(e,t,r):void 0)||super.parseExpressionStatement(e,t,r)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,t,r){if(!this.state.maybeInArrowParameters||!this.match(17))return super.parseConditional(e,t,r);let n=this.tryParse(()=>super.parseConditional(e,t));return n.node?(n.error&&(this.state=n.failState),n.node):(n.error&&super.setOptionalParametersError(r,n.error),e)}parseParenItem(e,t){let r=super.parseParenItem(e,t);if(this.eat(17)&&(r.optional=!0,this.resetEndLocation(e)),this.match(14)){let n=this.startNodeAt(t);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));let t=this.state.startLoc,r=this.eatContextual(125);if(r&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(I.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let a=R(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return a?((a.type==="TSInterfaceDeclaration"||a.type==="TSTypeAliasDeclaration"||r)&&(e.exportKind="type"),r&&(this.resetStartLocation(a,t),a.declare=!0),a):null}parseClassId(e,t,r,n){if((!t||r)&&this.isContextual(113))return;super.parseClassId(e,t,r,e.declare?1024:8331);let 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));let t=this.tsTryParseTypeAnnotation();t&&(e.typeAnnotation=t)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(I.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){let{key:t}=e;this.raise(I.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:t.type==="Identifier"&&!e.computed?t.name:`[${this.input.slice(t.start,t.end)}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(I.PrivateElementHasAbstract,e),e.accessibility&&this.raise(I.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(I.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,t,r,n,a,o){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);l&&a&&this.raise(I.ConstructorHasTypeParameters,l);let{declare:c=!1,kind:u}=t;c&&(u==="get"||u==="set")&&this.raise(I.DeclareAccessor,t,{kind:u}),l&&(t.typeParameters=l),super.pushClassMethod(e,t,r,n,a,o)}pushClassPrivateMethod(e,t,r,n){let a=this.tsTryParseTypeParameters(this.tsParseConstModifier);a&&(t.typeParameters=a),super.pushClassPrivateMethod(e,t,r,n)}declareClassPrivateMethodInScope(e,t){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&!hasOwnProperty.call(e.value,"body")||super.declareClassPrivateMethodInScope(e,t))}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,t,r,n,a,o,l){let c=this.tsTryParseTypeParameters(this.tsParseConstModifier);return c&&(e.typeParameters=c),super.parseObjPropValue(e,t,r,n,a,o,l)}parseFunctionParams(e,t){let r=this.tsTryParseTypeParameters(this.tsParseConstModifier);r&&(e.typeParameters=r),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let r=this.tsTryParseTypeAnnotation();r&&(e.id.typeAnnotation=r,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,t)}parseMaybeAssign(e,t){var r,n,a,o,l;let c,u,h;if(this.hasPlugin("jsx")&&(this.match(142)||this.match(47))){if(c=this.state.clone(),u=this.tryParse(()=>super.parseMaybeAssign(e,t),c),!u.error)return u.node;let{context:p}=this.state,g=p[p.length-1];(g===$.j_oTag||g===$.j_expr)&&p.pop()}if(!((r=u)!=null&&r.error)&&!this.match(47))return super.parseMaybeAssign(e,t);(!c||c===this.state)&&(c=this.state.clone());let f,d=this.tryParse(p=>{var g,y;f=this.tsParseTypeParameters(this.tsParseConstModifier);let b=super.parseMaybeAssign(e,t);return(b.type!=="ArrowFunctionExpression"||(g=b.extra)!=null&&g.parenthesized)&&p(),((y=f)==null?void 0:y.params.length)!==0&&this.resetStartLocationFromNode(b,f),b.typeParameters=f,b},c);if(!d.error&&!d.aborted)return f&&this.reportReservedArrowTypeParam(f),d.node;if(!u&&(Mi(!this.hasPlugin("jsx")),h=this.tryParse(()=>super.parseMaybeAssign(e,t),c),!h.error))return h.node;if((n=u)!=null&&n.node)return this.state=u.failState,u.node;if(d.node)return this.state=d.failState,f&&this.reportReservedArrowTypeParam(f),d.node;if((a=h)!=null&&a.node)return this.state=h.failState,h.node;throw((o=u)==null?void 0:o.error)||d.error||((l=h)==null?void 0:l.error)}reportReservedArrowTypeParam(e){var t;e.params.length===1&&!e.params[0].constraint&&!((t=e.extra)!=null&&t.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(I.ReservedArrowTypeParam,e)}parseMaybeUnary(e,t){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,t)}parseArrow(e){if(this.match(14)){let t=this.tryParse(r=>{let n=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&r(),n});if(t.aborted)return;t.thrown||(t.error&&(this.state=t.failState),e.returnType=t.node)}return super.parseArrow(e)}parseAssignableListItemTypes(e,t){if(!(t&2))return e;this.eat(17)&&(e.optional=!0);let r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.resetEndLocation(e),e}isAssignable(e,t){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,t);case"TSParameterProperty":return!0;default:return super.isAssignable(e,t)}}toAssignable(e,t=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,t);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":t?this.expressionScope.recordArrowParameterBindingError(I.UnexpectedTypeCastInParameter,e):this.raise(I.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,t);break;case"AssignmentExpression":!t&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,t)}}toAssignableParenthesizedExpression(e,t){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,t);break;default:super.toAssignable(e,t)}}checkToRestConversion(e,t){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,t)}}isValidLVal(e,t,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||!t)&&["expression",!0];default:return super.isValidLVal(e,t,r)}}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e){if(this.match(47)||this.match(51)){let t=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let r=super.parseMaybeDecoratorArguments(e);return r.typeParameters=t,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,t){let r=super.parseMaybeDefault(e,t);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(I.TypeAnnotationAfterAssign,r.typeAnnotation),r}getTokenFromCode(e){if(this.state.inType){if(e===62){this.finishOp(48,1);return}if(e===60){this.finishOp(47,1);return}}super.getTokenFromCode(e)}reScan_lt_gt(){let{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}toAssignableList(e,t,r){for(let n=0;n<e.length;n++){let a=e[n];a?.type==="TSTypeCastExpression"&&(e[n]=this.typeCastToParameter(a))}super.toAssignableList(e,t,r)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}shouldParseArrow(e){return this.match(14)?e.every(t=>this.isAssignable(t,!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)){let t=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());t&&(e.typeParameters=t)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let t=super.getGetterSetterExpectedParamCount(e),n=this.getObjectOrClassMethodParams(e)[0];return n&&this.isThisParam(n)?t+1:t}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:t,strict:r}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=t,this.state.strict=r}}parseClass(e,t,r){let n=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,t,r)}finally{this.state.inAbstractClass=n}}tsParseAbstractDeclaration(e,t){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(t,this.parseClass(e,!0,!1));if(this.isContextual(129)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(I.NonClassMethodPropertyHasAbstractModifer,e),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,t,r,n,a,o,l){let c=super.parseMethod(e,t,r,n,a,o,l);if(c.abstract&&(this.hasPlugin("estree")?!!c.value.body:!!c.body)){let{key:h}=c;this.raise(I.AbstractMethodHasImplementation,c,{methodName:h.type==="Identifier"&&!c.computed?h.name:`[${this.input.slice(h.start,h.end)}]`})}return c}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,t,r,n){return!t&&n?(this.parseTypeOnlyImportExportSpecifier(e,!1,r),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,t,r,n))}parseImportSpecifier(e,t,r,n,a){return!t&&n?(this.parseTypeOnlyImportExportSpecifier(e,!0,r),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,t,r,n,r?4098:4096))}parseTypeOnlyImportExportSpecifier(e,t,r){let n=t?"imported":"local",a=t?"local":"exported",o=e[n],l,c=!1,u=!0,h=o.loc.start;if(this.isContextual(93)){let d=this.parseIdentifier();if(this.isContextual(93)){let p=this.parseIdentifier();Te(this.state.type)?(c=!0,o=d,l=t?this.parseIdentifier():this.parseModuleExportName(),u=!1):(l=p,u=!1)}else Te(this.state.type)?(u=!1,l=t?this.parseIdentifier():this.parseModuleExportName()):(c=!0,o=d)}else Te(this.state.type)&&(c=!0,t?(o=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(o.name,o.loc.start,!0,!0)):o=this.parseModuleExportName());c&&r&&this.raise(t?I.TypeModifierIsUsedInTypeImports:I.TypeModifierIsUsedInTypeExports,h),e[n]=o,e[a]=l;let f=t?"importKind":"exportKind";e[f]=c?"type":"value",u&&this.eatContextual(93)&&(e[a]=t?this.parseIdentifier():this.parseModuleExportName()),e[a]||(e[a]=Be(e[n])),t&&this.checkIdentifier(e[a],c?4098:4096)}};function Go(i){if(i.type!=="MemberExpression")return!1;let{computed:s,property:e}=i;return s&&e.type!=="StringLiteral"&&(e.type!=="TemplateLiteral"||e.expressions.length>0)?!1:Zi(i.object)}function Qo(i,s){var e;let{type:t}=i;if((e=i.extra)!=null&&e.parenthesized)return!1;if(s){if(t==="Literal"){let{value:r}=i;if(typeof r=="string"||typeof r=="boolean")return!0}}else if(t==="StringLiteral"||t==="BooleanLiteral")return!0;return!!(Yi(i,s)||Yo(i,s)||t==="TemplateLiteral"&&i.expressions.length===0||Go(i))}function Yi(i,s){return s?i.type==="Literal"&&(typeof i.value=="number"||"bigint"in i):i.type==="NumericLiteral"||i.type==="BigIntLiteral"}function Yo(i,s){if(i.type==="UnaryExpression"){let{operator:e,argument:t}=i;if(e==="-"&&Yi(t,s))return!0}return!1}function Zi(i){return i.type==="Identifier"?!0:i.type!=="MemberExpression"||i.computed?!1:Zi(i.object)}var Bi=Fe`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),Zo=i=>class extends i{parsePlaceholder(e){if(this.match(144)){let t=this.startNode();return this.next(),this.assertNoSpace(),t.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(144),this.finishPlaceholder(t,e)}}finishPlaceholder(e,t){let r=e;return(!r.expectedNode||!r.type)&&(r=this.finishNode(r,"Placeholder")),r.expectedNode=t,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,t,r,n){e!==void 0&&super.checkReservedWord(e,t,r,n)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,t,r){return e==="Placeholder"||super.isValidLVal(e,t,r)}toAssignable(e,t){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,t)}chStartsBindingIdentifier(e,t){return!!(super.chStartsBindingIdentifier(e,t)||this.lookahead().type===144)}verifyBreakContinue(e,t){e.label&&e.label.type==="Placeholder"||super.verifyBreakContinue(e,t)}parseExpressionStatement(e,t){var r;if(t.type!=="Placeholder"||(r=t.extra)!=null&&r.parenthesized)return super.parseExpressionStatement(e,t);if(this.match(14)){let a=e;return a.label=this.finishPlaceholder(t,"Identifier"),this.next(),a.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(a,"LabeledStatement")}this.semicolon();let n=e;return n.name=t.name,this.finishPlaceholder(n,"Statement")}parseBlock(e,t,r){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,t,r)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,t,r){let n=t?"ClassDeclaration":"ClassExpression";this.next();let 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||!t)return e.id=null,e.body=this.finishPlaceholder(o,"ClassBody"),this.finishNode(e,n);throw this.raise(Bi.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(e,t,r);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,a),this.finishNode(e,n)}parseExport(e,t){let r=this.parsePlaceholder("Identifier");if(!r)return super.parseExport(e,t);let 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");let a=this.startNode();return a.exported=r,n.specifiers=[this.finishNode(a,"ExportDefaultSpecifier")],super.parseExport(n,t)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(Ue(144),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,t){var r;return(r=e.specifiers)!=null&&r.length?!0:super.maybeParseExportDefaultSpecifier(e,t)}checkExport(e){let{specifiers:t}=e;t!=null&&t.length&&(e.specifiers=t.filter(r=>r.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=t}parseImport(e){let t=this.parsePlaceholder("Identifier");if(!t)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(98)&&!this.match(12))return e.source=this.finishPlaceholder(t,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let r=this.startNodeAtNode(t);return r.local=t,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(Bi.UnexpectedSpace,this.state.lastTokEndLoc)}},el=i=>class extends i{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,t=this.startNode();if(this.next(),R(this.state.type)){let r=this.parseIdentifierName(),n=this.createIdentifier(t,r);if(n.type="V8IntrinsicIdentifier",this.match(10))return n}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},_i=["minimal","fsharp","hack","smart"],ji=["^^","@@","^","%","#"];function tl(i){if(i.has("decorators")){if(i.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let e=i.get("decorators").decoratorsBeforeExport;if(e!=null&&typeof e!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let t=i.get("decorators").allowCallParenthesized;if(t!=null&&typeof t!="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 s;let e=i.get("pipelineOperator").proposal;if(!_i.includes(e)){let r=_i.map(n=>`"${n}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${r}.`)}let t=((s=i.get("recordAndTuple"))==null?void 0:s.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.");let r=i.get("pipelineOperator").topicToken;if(!ji.includes(r)){let n=ji.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==="#"&&t)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",i.get("recordAndTuple")])}\`.`)}else if(e==="smart"&&t)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("importAttributes")&&i.has("importAssertions"))throw new Error("Cannot combine importAssertions and importAttributes plugins.");if(i.has("recordAndTuple")){let e=i.get("recordAndTuple").syntaxType;if(e!=null){let t=["hash","bar"];if(!t.includes(e))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+t.map(r=>`'${r}'`).join(", "))}}if(i.has("asyncDoExpressions")&&!i.has("doExpressions")){let 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'.")}var en={estree:so,jsx:Wo,flow:qo,typescript:Xo,v8intrinsic:el,placeholders:Zo},sl=Object.keys(en),Js={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 rl(i){if(i==null)return Object.assign({},Js);if(i.annexB!=null&&i.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");let s={};for(let t of Object.keys(Js)){var e;s[t]=(e=i[t])!=null?e:Js[t]}return s}var fr=class extends pr{checkProto(s,e,t,r){if(s.type==="SpreadElement"||this.isObjectMethod(s)||s.computed||s.shorthand)return;let n=s.key;if((n.type==="Identifier"?n.name:n.value)==="__proto__"){if(e){this.raise(m.RecordNoProto,n);return}t.used&&(r?r.doubleProtoLoc===null&&(r.doubleProtoLoc=n.loc.start):this.raise(m.DuplicateProto,n)),t.used=!0}}shouldExitDescending(s,e){return s.type==="ArrowFunctionExpression"&&s.start===e}getExpression(){this.enterInitialScopes(),this.nextToken();let s=this.parseExpression();return this.match(139)||this.unexpected(),this.finalizeRemainingComments(),s.comments=this.comments,s.errors=this.state.errors,this.options.tokens&&(s.tokens=this.tokens),s}parseExpression(s,e){return s?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(s){let e=this.state.startLoc,t=this.parseMaybeAssign(s);if(this.match(12)){let r=this.startNodeAt(e);for(r.expressions=[t];this.eat(12);)r.expressions.push(this.parseMaybeAssign(s));return this.toReferencedList(r.expressions),this.finishNode(r,"SequenceExpression")}return t}parseMaybeAssignDisallowIn(s,e){return this.disallowInAnd(()=>this.parseMaybeAssign(s,e))}parseMaybeAssignAllowIn(s,e){return this.allowInAnd(()=>this.parseMaybeAssign(s,e))}setOptionalParametersError(s,e){var t;s.optionalParametersLoc=(t=e?.loc)!=null?t:this.state.startLoc}parseMaybeAssign(s,e){let t=this.state.startLoc;if(this.isContextual(108)&&this.prodParam.hasYield){let o=this.parseYield();return e&&(o=e.call(this,o,t)),o}let r;s?r=!1:(s=new it,r=!0);let{type:n}=this.state;(n===10||R(n))&&(this.state.potentialArrowAt=this.state.start);let a=this.parseMaybeConditional(s);if(e&&(a=e.call(this,a,t)),oo(this.state.type)){let o=this.startNodeAt(t),l=this.state.value;if(o.operator=l,this.match(29)){this.toAssignable(a,!0),o.left=a;let c=t.index;s.doubleProtoLoc!=null&&s.doubleProtoLoc.index>=c&&(s.doubleProtoLoc=null),s.shorthandAssignLoc!=null&&s.shorthandAssignLoc.index>=c&&(s.shorthandAssignLoc=null),s.privateKeyLoc!=null&&s.privateKeyLoc.index>=c&&(this.checkDestructuringPrivate(s),s.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(s,!0);return a}parseMaybeConditional(s){let e=this.state.startLoc,t=this.state.potentialArrowAt,r=this.parseExprOps(s);return this.shouldExitDescending(r,t)?r:this.parseConditional(r,e,s)}parseConditional(s,e,t){if(this.eat(17)){let r=this.startNodeAt(e);return r.test=s,r.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),r.alternate=this.parseMaybeAssign(),this.finishNode(r,"ConditionalExpression")}return s}parseMaybeUnaryOrPrivate(s){return this.match(138)?this.parsePrivateName():this.parseMaybeUnary(s)}parseExprOps(s){let e=this.state.startLoc,t=this.state.potentialArrowAt,r=this.parseMaybeUnaryOrPrivate(s);return this.shouldExitDescending(r,t)?r:this.parseExprOp(r,e,-1)}parseExprOp(s,e,t){if(this.isPrivateName(s)){let n=this.getPrivateNameSV(s);(t>=Zt(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(m.PrivateInExpectedIn,s,{identifierName:n}),this.classScope.usePrivateName(n,s.loc.start)}let r=this.state.type;if(co(r)&&(this.prodParam.hasIn||!this.match(58))){let n=Zt(r);if(n>t){if(r===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return s;this.checkPipelineAtInfixOperator(s,e)}let a=this.startNodeAt(e);a.left=s,a.operator=this.state.value;let o=r===41||r===42,l=r===40;if(l&&(n=Zt(42)),this.next(),r===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(m.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);a.right=this.parseExprOpRightExpr(r,n);let c=this.finishNode(a,o||l?"LogicalExpression":"BinaryExpression"),u=this.state.type;if(l&&(u===41||u===42)||o&&u===40)throw this.raise(m.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(c,e,t)}}return s}parseExprOpRightExpr(s,e){let t=this.state.startLoc;switch(s){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(m.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(s,e),t)});case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}default:return this.parseExprOpBaseRightExpr(s,e)}}parseExprOpBaseRightExpr(s,e){let t=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),t,mo(s)?e-1:e)}parseHackPipeBody(){var s;let{startLoc:e}=this.state,t=this.parseMaybeAssign();return Qa.has(t.type)&&!((s=t.extra)!=null&&s.parenthesized)&&this.raise(m.PipeUnparenthesizedBody,e,{type:t.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(m.PipeTopicUnused,e),t}checkExponentialAfterUnary(s){this.match(57)&&this.raise(m.UnexpectedTokenUnaryExponentiation,s.argument)}parseMaybeUnary(s,e){let t=this.state.startLoc,r=this.isContextual(96);if(r&&this.recordAwaitIfAllowed()){this.next();let l=this.parseAwait(t);return e||this.checkExponentialAfterUnary(l),l}let n=this.match(34),a=this.startNode();if(ho(this.state.type)){a.operator=this.state.value,a.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let l=this.match(89);if(this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(s,!0),this.state.strict&&l){let c=a.argument;c.type==="Identifier"?this.raise(m.StrictDelete,a):this.hasPropertyAsPrivateName(c)&&this.raise(m.DeletePrivateField,a)}if(!n)return e||this.checkExponentialAfterUnary(a),this.finishNode(a,"UnaryExpression")}let o=this.parseUpdate(a,n,s);if(r){let{type:l}=this.state;if((this.hasPlugin("v8intrinsic")?Xs(l):Xs(l)&&!this.match(54))&&!this.isAmbiguousAwait())return this.raiseOverwrite(m.AwaitNotInAsyncContext,t),this.parseAwait(t)}return o}parseUpdate(s,e,t){if(e){let a=s;return this.checkLVal(a.argument,this.finishNode(a,"UpdateExpression")),s}let r=this.state.startLoc,n=this.parseExprSubscripts(t);if(this.checkExpressionErrors(t,!1))return n;for(;uo(this.state.type)&&!this.canInsertSemicolon();){let 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(s){let e=this.state.startLoc,t=this.state.potentialArrowAt,r=this.parseExprAtom(s);return this.shouldExitDescending(r,t)?r:this.parseSubscripts(r,e)}parseSubscripts(s,e,t){let r={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(s),stop:!1};do s=this.parseSubscript(s,e,t,r),r.maybeAsyncArrow=!1;while(!r.stop);return s}parseSubscript(s,e,t,r){let{type:n}=this.state;if(!t&&n===15)return this.parseBind(s,e,t,r);if(ss(n))return this.parseTaggedTemplateExpression(s,e,r);let a=!1;if(n===18){if(t&&(this.raise(m.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return r.stop=!0,s;r.optionalChainMember=a=!0,this.next()}if(!t&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(s,e,r,a);{let o=this.eat(0);return o||a||this.eat(16)?this.parseMember(s,e,r,o,a):(r.stop=!0,s)}}parseMember(s,e,t,r,n){let a=this.startNodeAt(e);return a.object=s,a.computed=r,r?(a.property=this.parseExpression(),this.expect(3)):this.match(138)?(s.type==="Super"&&this.raise(m.SuperPrivateField,e),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),t.optionalChainMember?(a.optional=n,this.finishNode(a,"OptionalMemberExpression")):this.finishNode(a,"MemberExpression")}parseBind(s,e,t,r){let n=this.startNodeAt(e);return n.object=s,this.next(),n.callee=this.parseNoCallExpr(),r.stop=!0,this.parseSubscripts(this.finishNode(n,"BindExpression"),e,t)}parseCoverCallAndAsyncArrowHead(s,e,t,r){let n=this.state.maybeInArrowParameters,a=null;this.state.maybeInArrowParameters=!0,this.next();let o=this.startNodeAt(e);o.callee=s;let{maybeAsyncArrow:l,optionalChainMember:c}=t;l&&(this.expressionScope.enter(Fo()),a=new it),c&&(o.optional=r),r?o.arguments=this.parseCallExpressionArguments(11):o.arguments=this.parseCallExpressionArguments(11,s.type==="Import",s.type!=="Super",o,a);let u=this.finishCallExpression(o,c);return l&&this.shouldParseAsyncArrow()&&!r?(t.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(s,e){this.toReferencedListDeep(s.arguments,e)}parseTaggedTemplateExpression(s,e,t){let r=this.startNodeAt(e);return r.tag=s,r.quasi=this.parseTemplate(!0),t.optionalChainMember&&this.raise(m.OptionalChainingNoTemplate,e),this.finishNode(r,"TaggedTemplateExpression")}atPossibleAsyncArrow(s){return s.type==="Identifier"&&s.name==="async"&&this.state.lastTokEndLoc.index===s.end&&!this.canInsertSemicolon()&&s.end-s.start===5&&s.start===this.state.potentialArrowAt}expectImportAttributesPlugin(){this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes")}finishCallExpression(s,e){if(s.callee.type==="Import")if(s.arguments.length===2&&(this.hasPlugin("moduleAttributes")||this.expectImportAttributesPlugin()),s.arguments.length===0||s.arguments.length>2)this.raise(m.ImportCallArity,s,{maxArgumentCount:this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")||this.hasPlugin("moduleAttributes")?2:1});else for(let t of s.arguments)t.type==="SpreadElement"&&this.raise(m.ImportCallSpreadArgument,t);return this.finishNode(s,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(s,e,t,r,n){let a=[],o=!0,l=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(s);){if(o)o=!1;else if(this.expect(12),this.match(s)){e&&!this.hasPlugin("importAttributes")&&!this.hasPlugin("importAssertions")&&!this.hasPlugin("moduleAttributes")&&this.raise(m.ImportCallArgumentTrailingComma,this.state.lastTokStartLoc),r&&this.addTrailingCommaExtraToNode(r),this.next();break}a.push(this.parseExprListItem(!1,n,t))}return this.state.inFSharpPipelineDirectBody=l,a}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(s,e){var t;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(s,e.arguments,!0,(t=e.extra)==null?void 0:t.trailingCommaLoc),e.innerComments&&Nt(s,e.innerComments),e.callee.trailingComments&&Nt(s,e.callee.trailingComments),s}parseNoCallExpr(){let s=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),s,!0)}parseExprAtom(s){let e,t=null,{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(m.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 136:return this.parseDecimalLiteral(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:{let 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,s);case 6:case 7:return this.parseObjectLike(this.state.type===6?9:8,!1,!0);case 5:return this.parseObjectLike(8,!1,!1,s);case 68:return this.parseFunctionOrFunctionSent();case 26:t=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(t,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;let n=e.callee=this.parseNoCallExpr();if(n.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(m.UnsupportedBind,n)}case 138:return this.raise(m.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:{let n=this.getPluginOption("pipelineOperator","proposal");if(n)return this.parseTopicReference(n);this.unexpected();break}case 47:{let n=this.input.codePointAt(this.nextTokenStart());Me(n)||n===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(R(r)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let n=this.state.potentialArrowAt===this.state.start,a=this.state.containsEsc,o=this.parseIdentifier();if(!a&&o.name==="async"&&!this.canInsertSemicolon()){let{type:l}=this.state;if(l===68)return this.resetPreviousNodeTrailingComments(o),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(o));if(R(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(s,e){let t=this.getPluginOption("pipelineOperator","proposal");if(t)return this.state.type=s,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=ae(this.state.endLoc,-1),this.parseTopicReference(t);this.unexpected()}parseTopicReference(s){let e=this.startNode(),t=this.state.startLoc,r=this.state.type;return this.next(),this.finishTopicReference(e,t,s,r)}finishTopicReference(s,e,t,r){if(this.testTopicReferenceConfiguration(t,e,r)){let n=t==="smart"?"PipelinePrimaryTopicReference":"TopicReference";return this.topicReferenceIsAllowedInCurrentContext()||this.raise(t==="smart"?m.PrimaryTopicNotAllowed:m.PipeTopicUnbound,e),this.registerTopicReference(),this.finishNode(s,n)}else throw this.raise(m.PipeTopicUnconfiguredToken,e,{token:Ue(r)})}testTopicReferenceConfiguration(s,e,t){switch(s){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:Ue(t)}]);case"smart":return t===27;default:throw this.raise(m.PipeTopicRequiresHackPipes,e)}}parseAsyncArrowUnaryFunction(s){this.prodParam.enter(es(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(m.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(s,e,!0)}parseDo(s,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),s.async=e,this.next();let t=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(2),s.body=this.parseBlock(),this.prodParam.exit()):s.body=this.parseBlock(),this.state.labels=t,this.finishNode(s,"DoExpression")}parseSuper(){let s=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!this.options.allowSuperOutsideMethod?this.raise(m.SuperNotAllowed,s):!this.scope.allowSuper&&!this.options.allowSuperOutsideMethod&&this.raise(m.UnexpectedSuper,s),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(m.UnsupportedSuper,s),this.finishNode(s,"Super")}parsePrivateName(){let s=this.startNode(),e=this.startNodeAt(ae(this.state.startLoc,1)),t=this.state.value;return this.next(),s.id=this.createIdentifier(e,t),this.finishNode(s,"PrivateName")}parseFunctionOrFunctionSent(){let s=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(s),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(s,e,"sent")}return this.parseFunction(s)}parseMetaProperty(s,e,t){s.meta=e;let r=this.state.containsEsc;return s.property=this.parseIdentifier(!0),(s.property.name!==t||r)&&this.raise(m.UnsupportedMetaProperty,s.property,{target:e.name,onlyValidPropertyName:t}),this.finishNode(s,"MetaProperty")}parseImportMetaProperty(s){let e=this.createIdentifier(this.startNodeAtNode(s),"import");if(this.next(),this.isContextual(101))this.inModule||this.raise(m.ImportMetaOutsideModule,e),this.sawUnambiguousESM=!0;else if(this.isContextual(105)||this.isContextual(97)){let t=this.isContextual(105);if(t||this.unexpected(),this.expectPlugin(t?"sourcePhaseImports":"deferredImportEvaluation"),!this.options.createImportExpressions)throw this.raise(m.DynamicImportPhaseRequiresImportExpressions,this.state.startLoc,{phase:this.state.value});return this.next(),s.phase=t?"source":"defer",this.parseImportCall(s)}return this.parseMetaProperty(s,e,"meta")}parseLiteralAtNode(s,e,t){return this.addExtra(t,"rawValue",s),this.addExtra(t,"raw",this.input.slice(t.start,this.state.end)),t.value=s,this.next(),this.finishNode(t,e)}parseLiteral(s,e){let t=this.startNode();return this.parseLiteralAtNode(s,e,t)}parseStringLiteral(s){return this.parseLiteral(s,"StringLiteral")}parseNumericLiteral(s){return this.parseLiteral(s,"NumericLiteral")}parseBigIntLiteral(s){return this.parseLiteral(s,"BigIntLiteral")}parseDecimalLiteral(s){return this.parseLiteral(s,"DecimalLiteral")}parseRegExpLiteral(s){let e=this.startNode();return this.addExtra(e,"raw",this.input.slice(e.start,this.state.end)),e.pattern=s.pattern,e.flags=s.flags,this.next(),this.finishNode(e,"RegExpLiteral")}parseBooleanLiteral(s){let e=this.startNode();return e.value=s,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){let s=this.startNode();return this.next(),this.finishNode(s,"NullLiteral")}parseParenAndDistinguishExpression(s){let e=this.state.startLoc,t;this.next(),this.expressionScope.enter(Mo());let r=this.state.maybeInArrowParameters,n=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let a=this.state.startLoc,o=[],l=new it,c=!0,u,h;for(;!this.match(11);){if(c)c=!1;else if(this.expect(12,l.optionalParametersLoc===null?null:l.optionalParametersLoc),this.match(11)){h=this.state.startLoc;break}if(this.match(21)){let 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))}let f=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=r,this.state.inFSharpPipelineDirectBody=n;let d=this.startNodeAt(e);return s&&this.shouldParseArrow(o)&&(d=this.parseArrow(d))?(this.checkDestructuringPrivate(l),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(d,o,!1),d):(this.expressionScope.exit(),o.length||this.unexpected(this.state.lastTokStartLoc),h&&this.unexpected(h),u&&this.unexpected(u),this.checkExpressionErrors(l,!0),this.toReferencedListDeep(o,!0),o.length>1?(t=this.startNodeAt(a),t.expressions=o,this.finishNode(t,"SequenceExpression"),this.resetEndLocation(t,f)):t=o[0],this.wrapParenthesis(e,t))}wrapParenthesis(s,e){if(!this.options.createParenthesizedExpressions)return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",s.index),this.takeSurroundingComments(e,s.index,this.state.lastTokEndLoc.index),e;let t=this.startNodeAt(s);return t.expression=e,this.finishNode(t,"ParenthesizedExpression")}shouldParseArrow(s){return!this.canInsertSemicolon()}parseArrow(s){if(this.eat(19))return s}parseParenItem(s,e){return s}parseNewOrNewTarget(){let s=this.startNode();if(this.next(),this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(s),"new");this.next();let t=this.parseMetaProperty(s,e,"target");return!this.scope.inNonArrowFunction&&!this.scope.inClass&&!this.options.allowNewTargetOutsideFunction&&this.raise(m.UnexpectedNewTarget,t),t}return this.parseNew(s)}parseNew(s){if(this.parseNewCallee(s),this.eat(10)){let e=this.parseExprList(11);this.toReferencedList(e),s.arguments=e}else s.arguments=[];return this.finishNode(s,"NewExpression")}parseNewCallee(s){let e=this.match(83),t=this.parseNoCallExpr();s.callee=t,e&&(t.type==="Import"||t.type==="ImportExpression")&&this.raise(m.ImportCallNotNewExpression,t)}parseTemplateElement(s){let{start:e,startLoc:t,end:r,value:n}=this.state,a=e+1,o=this.startNodeAt(ae(t,1));n===null&&(s||this.raise(m.InvalidEscapeSequenceTemplate,ae(this.state.firstInvalidTemplateEscapePos,1)));let l=this.match(24),c=l?-1:-2,u=r+c;o.value={raw:this.input.slice(a,u).replace(/\r\n?/g,`
9
- `),cooked:n===null?null:n.slice(1,c)},o.tail=l,this.next();let h=this.finishNode(o,"TemplateElement");return this.resetEndLocation(h,ae(this.state.lastTokEndLoc,c)),h}parseTemplate(s){let e=this.startNode(),t=this.parseTemplateElement(s),r=[t],n=[];for(;!t.tail;)n.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),r.push(t=this.parseTemplateElement(s));return e.expressions=n,e.quasis=r,this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(s,e,t,r){t&&this.expectPlugin("recordAndTuple");let n=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=Object.create(null),o=!0,l=this.startNode();for(l.properties=[],this.next();!this.match(s);){if(o)o=!1;else if(this.expect(12),this.match(s)){this.addTrailingCommaExtraToNode(l);break}let u;e?u=this.parseBindingProperty():(u=this.parsePropertyDefinition(r),this.checkProto(u,t,a,r)),t&&!this.isObjectProperty(u)&&u.type!=="SpreadElement"&&this.raise(m.InvalidRecordProperty,u),u.shorthand&&this.addExtra(u,"shorthand",!0),l.properties.push(u)}this.next(),this.state.inFSharpPipelineDirectBody=n;let c="ObjectExpression";return e?c="ObjectPattern":t&&(c="RecordExpression"),this.finishNode(l,c)}addTrailingCommaExtraToNode(s){this.addExtra(s,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(s,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(s){return!s.computed&&s.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(s){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(m.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)e.push(this.parseDecorator());let t=this.startNode(),r=!1,n=!1,a;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(t.decorators=e,e=[]),t.method=!1,s&&(a=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(t);let l=this.state.containsEsc;if(this.parsePropertyName(t,s),!o&&!l&&this.maybeAsyncOrAccessorProp(t)){let{key:c}=t,u=c.name;u==="async"&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(c),o=this.eat(55),this.parsePropertyName(t)),(u==="get"||u==="set")&&(n=!0,this.resetPreviousNodeTrailingComments(c),t.kind=u,this.match(55)&&(o=!0,this.raise(m.AccessorIsGenerator,this.state.curPosition(),{kind:u}),this.next()),this.parsePropertyName(t))}return this.parseObjPropValue(t,a,o,r,!1,n,s)}getGetterSetterExpectedParamCount(s){return s.kind==="get"?0:1}getObjectOrClassMethodParams(s){return s.params}checkGetterSetterParams(s){var e;let t=this.getGetterSetterExpectedParamCount(s),r=this.getObjectOrClassMethodParams(s);r.length!==t&&this.raise(s.kind==="get"?m.BadGetterArity:m.BadSetterArity,s),s.kind==="set"&&((e=r[r.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(m.BadSetterRestParameter,s)}parseObjectMethod(s,e,t,r,n){if(n){let a=this.parseMethod(s,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(a),a}if(t||e||this.match(10))return r&&this.unexpected(),s.kind="method",s.method=!0,this.parseMethod(s,e,t,!1,!1,"ObjectMethod")}parseObjectProperty(s,e,t,r){if(s.shorthand=!1,this.eat(14))return s.value=t?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(r),this.finishNode(s,"ObjectProperty");if(!s.computed&&s.key.type==="Identifier"){if(this.checkReservedWord(s.key.name,s.key.loc.start,!0,!1),t)s.value=this.parseMaybeDefault(e,Be(s.key));else if(this.match(29)){let n=this.state.startLoc;r!=null?r.shorthandAssignLoc===null&&(r.shorthandAssignLoc=n):this.raise(m.InvalidCoverInitializedName,n),s.value=this.parseMaybeDefault(e,Be(s.key))}else s.value=Be(s.key);return s.shorthand=!0,this.finishNode(s,"ObjectProperty")}}parseObjPropValue(s,e,t,r,n,a,o){let l=this.parseObjectMethod(s,t,r,n,a)||this.parseObjectProperty(s,e,n,o);return l||this.unexpected(),l}parsePropertyName(s,e){if(this.eat(0))s.computed=!0,s.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:t,value:r}=this.state,n;if(Te(t))n=this.parseIdentifier(!0);else switch(t){case 134:n=this.parseNumericLiteral(r);break;case 133:n=this.parseStringLiteral(r);break;case 135:n=this.parseBigIntLiteral(r);break;case 136:n=this.parseDecimalLiteral(r);break;case 138:{let a=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=a):this.raise(m.UnexpectedPrivateField,a),n=this.parsePrivateName();break}default:this.unexpected()}s.key=n,t!==138&&(s.computed=!1)}}initFunction(s,e){s.id=null,s.generator=!1,s.async=e}parseMethod(s,e,t,r,n,a,o=!1){this.initFunction(s,t),s.generator=e,this.scope.enter(18|(o?64:0)|(n?32:0)),this.prodParam.enter(es(t,s.generator)),this.parseFunctionParams(s,r);let l=this.parseFunctionBodyAndFinish(s,a,!0);return this.prodParam.exit(),this.scope.exit(),l}parseArrayLike(s,e,t,r){t&&this.expectPlugin("recordAndTuple");let n=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=this.startNode();return this.next(),a.elements=this.parseExprList(s,!t,r,a),this.state.inFSharpPipelineDirectBody=n,this.finishNode(a,t?"TupleExpression":"ArrayExpression")}parseArrowExpression(s,e,t,r){this.scope.enter(6);let n=es(t,!1);!this.match(5)&&this.prodParam.hasIn&&(n|=8),this.prodParam.enter(n),this.initFunction(s,t);let a=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(s,e,r)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(s,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=a,this.finishNode(s,"ArrowFunctionExpression")}setArrowFunctionParameters(s,e,t){this.toAssignableList(e,t,!1),s.params=e}parseFunctionBodyAndFinish(s,e,t=!1){return this.parseFunctionBody(s,!1,t),this.finishNode(s,e)}parseFunctionBody(s,e,t=!1){let r=e&&!this.match(5);if(this.expressionScope.enter(Gi()),r)s.body=this.parseMaybeAssign(),this.checkParams(s,!1,e,!1);else{let n=this.state.strict,a=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),s.body=this.parseBlock(!0,!1,o=>{let l=!this.isSimpleParamList(s.params);o&&l&&this.raise(m.IllegalLanguageModeDirective,(s.kind==="method"||s.kind==="constructor")&&s.key?s.key.loc.end:s);let c=!n&&this.state.strict;this.checkParams(s,!this.state.strict&&!e&&!t&&!l,e,c),this.state.strict&&s.id&&this.checkIdentifier(s.id,65,c)}),this.prodParam.exit(),this.state.labels=a}this.expressionScope.exit()}isSimpleParameter(s){return s.type==="Identifier"}isSimpleParamList(s){for(let e=0,t=s.length;e<t;e++)if(!this.isSimpleParameter(s[e]))return!1;return!0}checkParams(s,e,t,r=!0){let n=!e&&new Set,a={type:"FormalParameters"};for(let o of s.params)this.checkLVal(o,a,5,n,r)}parseExprList(s,e,t,r){let n=[],a=!0;for(;!this.eat(s);){if(a)a=!1;else if(this.expect(12),this.match(s)){r&&this.addTrailingCommaExtraToNode(r),this.next();break}n.push(this.parseExprListItem(e,t))}return n}parseExprListItem(s,e,t){let r;if(this.match(12))s||this.raise(m.UnexpectedToken,this.state.curPosition(),{unexpected:","}),r=null;else if(this.match(21)){let n=this.state.startLoc;r=this.parseParenItem(this.parseSpread(e),n)}else if(this.match(17)){this.expectPlugin("partialApplication"),t||this.raise(m.UnexpectedArgumentPlaceholder,this.state.startLoc);let n=this.startNode();this.next(),r=this.finishNode(n,"ArgumentPlaceholder")}else r=this.parseMaybeAssignAllowIn(e,this.parseParenItem);return r}parseIdentifier(s){let e=this.startNode(),t=this.parseIdentifierName(s);return this.createIdentifier(e,t)}createIdentifier(s,e){return s.name=e,s.loc.identifierName=e,this.finishNode(s,"Identifier")}parseIdentifierName(s){let e,{startLoc:t,type:r}=this.state;Te(r)?e=this.state.value:this.unexpected();let n=no(r);return s?n&&this.replaceToken(132):this.checkReservedWord(e,t,n,!1),this.next(),e}checkReservedWord(s,e,t,r){if(s.length>10||!wo(s))return;if(t&&So(s)){this.raise(m.UnexpectedKeyword,e,{keyword:s});return}if((this.state.strict?r?Ji:zi:qi)(s,this.inModule)){this.raise(m.UnexpectedReservedWord,e,{reservedWord:s});return}else if(s==="yield"){if(this.prodParam.hasYield){this.raise(m.YieldBindingIdentifier,e);return}}else if(s==="await"){if(this.prodParam.hasAwait){this.raise(m.AwaitBindingIdentifier,e);return}if(this.scope.inStaticBlock){this.raise(m.AwaitBindingIdentifierInStaticBlock,e);return}this.expressionScope.recordAsyncArrowParametersError(e)}else if(s==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(m.ArgumentsInClass,e);return}}recordAwaitIfAllowed(){let s=this.prodParam.hasAwait||this.options.allowAwaitOutsideFunction&&!this.scope.inFunction;return s&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),s}parseAwait(s){let e=this.startNodeAt(s);return this.expressionScope.recordParameterInitializerError(m.AwaitExpressionFormalParameter,e),this.eat(55)&&this.raise(m.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;let{type:s}=this.state;return s===53||s===10||s===0||ss(s)||s===102&&!this.state.containsEsc||s===137||s===56||this.hasPlugin("v8intrinsic")&&s===54}parseYield(){let s=this.startNode();this.expressionScope.recordParameterInitializerError(m.YieldInParameter,s),this.next();let e=!1,t=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:t=this.parseMaybeAssign()}return s.delegate=e,s.argument=t,this.finishNode(s,"YieldExpression")}parseImportCall(s){return this.next(),s.source=this.parseMaybeAssignAllowIn(),(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))&&(s.options=null),this.eat(12)&&(this.expectImportAttributesPlugin(),this.match(11)||(s.options=this.parseMaybeAssignAllowIn(),this.eat(12))),this.expect(11),this.finishNode(s,"ImportExpression")}checkPipelineAtInfixOperator(s,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&s.type==="SequenceExpression"&&this.raise(m.PipelineHeadSequenceExpression,e)}parseSmartPipelineBodyInStyle(s,e){if(this.isSimpleReference(s)){let t=this.startNodeAt(e);return t.callee=s,this.finishNode(t,"PipelineBareFunction")}else{let t=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),t.expression=s,this.finishNode(t,"PipelineTopicExpression")}}isSimpleReference(s){switch(s.type){case"MemberExpression":return!s.computed&&this.isSimpleReference(s.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(s){if(this.match(19))throw this.raise(m.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(m.PipelineTopicUnused,s)}withTopicBindingContext(s){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return s()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(s){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return s()}finally{this.state.topicContext=e}}else return s()}withSoloAwaitPermittingContext(s){let e=this.state.soloAwait;this.state.soloAwait=!0;try{return s()}finally{this.state.soloAwait=e}}allowInAnd(s){let e=this.prodParam.currentFlags();if(8&~e){this.prodParam.enter(e|8);try{return s()}finally{this.prodParam.exit()}}return s()}disallowInAnd(s){let e=this.prodParam.currentFlags();if(8&e){this.prodParam.enter(e&-9);try{return s()}finally{this.prodParam.exit()}}return s()}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(s){let e=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let t=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let r=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,s);return this.state.inFSharpPipelineDirectBody=t,r}parseModuleExpression(){this.expectPlugin("moduleBlocks");let s=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let e=this.startNodeAt(this.state.endLoc);this.next();let t=this.initializeScopes(!0);this.enterInitialScopes();try{s.body=this.parseProgram(e,8,"module")}finally{t()}return this.finishNode(s,"ModuleExpression")}parsePropertyNamePrefixOperator(s){}},Ks={kind:1},il={kind:2},nl=/[\uD800-\uDFFF]/u,Hs=/in(?:stanceof)?/y;function al(i,s){for(let e=0;e<i.length;e++){let t=i[e],{type:r}=t;if(typeof r=="number"){{if(r===138){let{loc:n,start:a,value:o,end:l}=t,c=a+1,u=ae(n.start,1);i.splice(e,1,new we({type:De(27),value:"#",start:a,end:c,startLoc:n.start,endLoc:u}),new we({type:De(132),value:o,start:c,end:l,startLoc:u,endLoc:n.end})),e++;continue}if(ss(r)){let{loc:n,start:a,value:o,end:l}=t,c=a+1,u=ae(n.start,1),h;s.charCodeAt(a)===96?h=new we({type:De(22),value:"`",start:a,end:c,startLoc:n.start,endLoc:u}):h=new we({type:De(8),value:"}",start:a,end:c,startLoc:n.start,endLoc:u});let f,d,p,g;r===24?(d=l-1,p=ae(n.end,-1),f=o===null?null:o.slice(1,-1),g=new we({type:De(22),value:"`",start:d,end:l,startLoc:p,endLoc:n.end})):(d=l-2,p=ae(n.end,-2),f=o===null?null:o.slice(1,-2),g=new we({type:De(23),value:"${",start:d,end:l,startLoc:p,endLoc:n.end})),i.splice(e,1,h,new we({type:De(20),value:f,start:c,end:d,startLoc:u,endLoc:p}),g),e+=2;continue}}t.type=De(r)}}return i}var dr=class extends fr{parseTopLevel(s,e){return s.program=this.parseProgram(e),s.comments=this.comments,this.options.tokens&&(s.tokens=al(this.tokens,this.input)),this.finishNode(s,"File")}parseProgram(s,e=139,t=this.options.sourceType){if(s.sourceType=t,s.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(s,!0,!0,e),this.inModule){if(!this.options.allowUndeclaredExports&&this.scope.undefinedExports.size>0)for(let[n,a]of Array.from(this.scope.undefinedExports))this.raise(m.ModuleExportUndefined,a,{localName:n});this.addExtra(s,"topLevelAwait",this.state.hasTopLevelAwait)}let r;return e===139?r=this.finishNode(s,"Program"):r=this.finishNodeAt(s,"Program",ae(this.state.startLoc,-1)),r}stmtToDirective(s){let e=s;e.type="Directive",e.value=e.expression,delete e.expression;let t=e.value,r=t.value,n=this.input.slice(t.start,t.end),a=t.value=n.slice(1,-1);return this.addExtra(t,"raw",n),this.addExtra(t,"rawValue",a),this.addExtra(t,"expressionValue",r),t.type="DirectiveLiteral",e}parseInterpreterDirective(){if(!this.match(28))return null;let s=this.startNode();return s.value=this.state.value,this.next(),this.finishNode(s,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(s,e){if(Me(s)){if(Hs.lastIndex=e,Hs.test(this.input)){let t=this.codePointAtPos(Hs.lastIndex);if(!st(t)&&t!==92)return!1}return!0}else return s===92}chStartsBindingPattern(s){return s===91||s===123}hasFollowingBindingAtom(){let s=this.nextTokenStart(),e=this.codePointAtPos(s);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,s)}hasInLineFollowingBindingIdentifierOrBrace(){let s=this.nextTokenInLineStart(),e=this.codePointAtPos(s);return e===123||this.chStartsBindingIdentifier(e,s)}startsUsingForOf(){let{type:s,containsEsc:e}=this.lookahead();if(s===102&&!e)return!1;if(R(s)&&!this.hasFollowingLineBreak())return this.expectPlugin("explicitResourceManagement"),!0}startsAwaitUsing(){let s=this.nextTokenInLineStart();if(this.isUnparsedContextual(s,"using")){s=this.nextTokenInLineStartSince(s+5);let e=this.codePointAtPos(s);if(this.chStartsBindingIdentifier(e,s))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(s=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,s&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(s){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(s,e)}parseStatementContent(s,e){let t=this.state.type,r=this.startNode(),n=!!(s&2),a=!!(s&4),o=s&1;switch(t){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?m.StrictFunction:this.options.annexB?m.SloppyFunctionAnnexB:m.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(m.UnexpectedLexicalDeclaration,r):this.raise(m.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(m.UnexpectedUsingDeclaration,this.state.startLoc):n||this.raise(m.UnexpectedLexicalDeclaration,this.state.startLoc),this.parseVarStatement(r,"using");case 100:{if(this.state.containsEsc)break;let u=this.nextTokenStart(),h=this.codePointAtPos(u);if(h!==91&&(!n&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(h,u)&&h!==123))break}case 75:n||this.raise(m.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let 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:{let u=this.lookaheadCharCode();if(u===40||u===46)break}case 82:{!this.options.allowImportExportEverywhere&&!o&&this.raise(m.UnexpectedImportExport,this.state.startLoc),this.next();let u;return t===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(m.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(r,!0,!n&&a)}let l=this.state.value,c=this.parseExpression();return R(t)&&c.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(r,l,c,s):this.parseExpressionStatement(r,c,e)}assertModuleNodeAllowed(s){!this.options.allowImportExportEverywhere&&!this.inModule&&this.raise(m.ImportOutsideModule,s)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(s,e,t){return s&&(e.decorators&&e.decorators.length>0?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(m.DecoratorsBeforeAfterExport,e.decorators[0]),e.decorators.unshift(...s)):e.decorators=s,this.resetStartLocationFromNode(e,s[0]),t&&this.resetStartLocationFromNode(t,e)),e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(s){let e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))s||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(m.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(m.UnexpectedLeadingDecorator,this.state.startLoc);return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let s=this.startNode();if(this.next(),this.hasPlugin("decorators")){let e=this.state.startLoc,t;if(this.match(10)){let r=this.state.startLoc;this.next(),t=this.parseExpression(),this.expect(11),t=this.wrapParenthesis(r,t);let n=this.state.startLoc;s.expression=this.parseMaybeDecoratorArguments(t),this.getPluginOption("decorators","allowCallParenthesized")===!1&&s.expression!==t&&this.raise(m.DecoratorArgumentsOutsideParentheses,n)}else{for(t=this.parseIdentifier(!1);this.eat(16);){let r=this.startNodeAt(e);r.object=t,this.match(138)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),r.property=this.parsePrivateName()):r.property=this.parseIdentifier(!0),r.computed=!1,t=this.finishNode(r,"MemberExpression")}s.expression=this.parseMaybeDecoratorArguments(t)}}else s.expression=this.parseExprSubscripts();return this.finishNode(s,"Decorator")}parseMaybeDecoratorArguments(s){if(this.eat(10)){let e=this.startNodeAtNode(s);return e.callee=s,e.arguments=this.parseCallExpressionArguments(11,!1),this.toReferencedList(e.arguments),this.finishNode(e,"CallExpression")}return s}parseBreakContinueStatement(s,e){return this.next(),this.isLineTerminator()?s.label=null:(s.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(s,e),this.finishNode(s,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(s,e){let t;for(t=0;t<this.state.labels.length;++t){let r=this.state.labels[t];if((s.label==null||r.name===s.label.name)&&(r.kind!=null&&(e||r.kind===1)||s.label&&e))break}if(t===this.state.labels.length){let r=e?"BreakStatement":"ContinueStatement";this.raise(m.IllegalBreakContinue,s,{type:r})}}parseDebuggerStatement(s){return this.next(),this.semicolon(),this.finishNode(s,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let s=this.parseExpression();return this.expect(11),s}parseDoWhileStatement(s){return this.next(),this.state.labels.push(Ks),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),s.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(s,"DoWhileStatement")}parseForStatement(s){this.next(),this.state.labels.push(Ks);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(s,null);let t=this.isContextual(100);{let l=this.isContextual(96)&&this.startsAwaitUsing(),c=l||this.isContextual(107)&&this.startsUsingForOf(),u=t&&this.hasFollowingBindingAtom()||c;if(this.match(74)||this.match(75)||u){let h=this.startNode(),f;l?(f="await using",this.recordAwaitIfAllowed()||this.raise(m.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):f=this.state.value,this.next(),this.parseVar(h,!0,f);let d=this.finishNode(h,"VariableDeclaration"),p=this.match(58);return p&&c&&this.raise(m.ForInUsing,d),(p||this.isContextual(102))&&d.declarations.length===1?this.parseForIn(s,d,e):(e!==null&&this.unexpected(e),this.parseFor(s,d))}}let r=this.isContextual(95),n=new it,a=this.parseExpression(!0,n),o=this.isContextual(102);if(o&&(t&&this.raise(m.ForOfLet,a),e===null&&r&&a.type==="Identifier"&&this.raise(m.ForOfAsync,a)),o||this.match(58)){this.checkDestructuringPrivate(n),this.toAssignable(a,!0);let l=o?"ForOfStatement":"ForInStatement";return this.checkLVal(a,{type:l}),this.parseForIn(s,a,e)}else this.checkExpressionErrors(n,!0);return e!==null&&this.unexpected(e),this.parseFor(s,a)}parseFunctionStatement(s,e,t){return this.next(),this.parseFunction(s,1|(t?2:0)|(e?8:0))}parseIfStatement(s){return this.next(),s.test=this.parseHeaderExpression(),s.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),s.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(s,"IfStatement")}parseReturnStatement(s){return!this.prodParam.hasReturn&&!this.options.allowReturnOutsideFunction&&this.raise(m.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?s.argument=null:(s.argument=this.parseExpression(),this.semicolon()),this.finishNode(s,"ReturnStatement")}parseSwitchStatement(s){this.next(),s.discriminant=this.parseHeaderExpression();let e=s.cases=[];this.expect(5),this.state.labels.push(il),this.scope.enter(0);let t;for(let r;!this.match(8);)if(this.match(61)||this.match(65)){let n=this.match(61);t&&this.finishNode(t,"SwitchCase"),e.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(r&&this.raise(m.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),r=!0,t.test=null),this.expect(14)}else t?t.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(s,"SwitchStatement")}parseThrowStatement(s){return this.next(),this.hasPrecedingLineBreak()&&this.raise(m.NewlineAfterThrow,this.state.lastTokEndLoc),s.argument=this.parseExpression(),this.semicolon(),this.finishNode(s,"ThrowStatement")}parseCatchClauseParam(){let s=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&s.type==="Identifier"?8:0),this.checkLVal(s,{type:"CatchClause"},9),s}parseTryStatement(s){if(this.next(),s.block=this.parseBlock(),s.handler=null,this.match(62)){let 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(),s.handler=this.finishNode(e,"CatchClause")}return s.finalizer=this.eat(67)?this.parseBlock():null,!s.handler&&!s.finalizer&&this.raise(m.NoCatchOrFinally,s),this.finishNode(s,"TryStatement")}parseVarStatement(s,e,t=!1){return this.next(),this.parseVar(s,!1,e,t),this.semicolon(),this.finishNode(s,"VariableDeclaration")}parseWhileStatement(s){return this.next(),s.test=this.parseHeaderExpression(),this.state.labels.push(Ks),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(s,"WhileStatement")}parseWithStatement(s){return this.state.strict&&this.raise(m.StrictWith,this.state.startLoc),this.next(),s.object=this.parseHeaderExpression(),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(s,"WithStatement")}parseEmptyStatement(s){return this.next(),this.finishNode(s,"EmptyStatement")}parseLabeledStatement(s,e,t,r){for(let a of this.state.labels)a.name===e&&this.raise(m.LabelRedeclaration,t,{labelName:e});let n=lo(this.state.type)?1:this.match(71)?2:null;for(let a=this.state.labels.length-1;a>=0;a--){let o=this.state.labels[a];if(o.statementStart===s.start)o.statementStart=this.state.start,o.kind=n;else break}return this.state.labels.push({name:e,kind:n,statementStart:this.state.start}),s.body=r&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),s.label=t,this.finishNode(s,"LabeledStatement")}parseExpressionStatement(s,e,t){return s.expression=e,this.semicolon(),this.finishNode(s,"ExpressionStatement")}parseBlock(s=!1,e=!0,t){let r=this.startNode();return s&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(r,s,!1,8,t),e&&this.scope.exit(),this.finishNode(r,"BlockStatement")}isValidDirective(s){return s.type==="ExpressionStatement"&&s.expression.type==="StringLiteral"&&!s.expression.extra.parenthesized}parseBlockBody(s,e,t,r,n){let a=s.body=[],o=s.directives=[];this.parseBlockOrModuleBlockBody(a,e?o:void 0,t,r,n)}parseBlockOrModuleBlockBody(s,e,t,r,n){let a=this.state.strict,o=!1,l=!1;for(;!this.match(r);){let c=t?this.parseModuleItem():this.parseStatementListItem();if(e&&!l){if(this.isValidDirective(c)){let u=this.stmtToDirective(c);e.push(u),!o&&u.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}l=!0,this.state.strictErrors.clear()}s.push(c)}n?.call(this,o),a||this.setStrict(!1),this.next()}parseFor(s,e){return s.init=e,this.semicolon(!1),s.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),s.update=this.match(11)?null:this.parseExpression(),this.expect(11),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(s,"ForStatement")}parseForIn(s,e,t){let r=this.match(58);return this.next(),r?t!==null&&this.unexpected(t):s.await=t!==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(m.ForInOfLoopInitializer,e,{type:r?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(m.InvalidLhs,e,{ancestor:{type:"ForStatement"}}),s.left=e,s.right=r?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(s,r?"ForInStatement":"ForOfStatement")}parseVar(s,e,t,r=!1){let n=s.declarations=[];for(s.kind=t;;){let a=this.startNode();if(this.parseVarId(a,t),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(m.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(t==="const"||t==="using"||t==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(m.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:t})),n.push(this.finishNode(a,"VariableDeclarator")),!this.eat(12))break}return s}parseVarId(s,e){let t=this.parseBindingAtom();(e==="using"||e==="await using")&&(t.type==="ArrayPattern"||t.type==="ObjectPattern")&&this.raise(m.UsingDeclarationHasBindingPattern,t.loc.start),this.checkLVal(t,{type:"VariableDeclarator"},e==="var"?5:8201),s.id=t}parseAsyncFunctionExpression(s){return this.parseFunction(s,8)}parseFunction(s,e=0){let t=e&2,r=!!(e&1),n=r&&!(e&4),a=!!(e&8);this.initFunction(s,a),this.match(55)&&(t&&this.raise(m.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),s.generator=!0),r&&(s.id=this.parseFunctionId(n));let o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(es(a,s.generator)),r||(s.id=this.parseFunctionId()),this.parseFunctionParams(s,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(s,r?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),r&&!t&&this.registerFunctionStatementId(s),this.state.maybeInArrowParameters=o,s}parseFunctionId(s){return s||R(this.state.type)?this.parseIdentifier():null}parseFunctionParams(s,e){this.expect(10),this.expressionScope.enter(Oo()),s.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(s){s.id&&this.scope.declareName(s.id.name,!this.options.annexB||this.state.strict||s.generator||s.async?this.scope.treatFunctionsAsVar?5:8201:17,s.id.loc.start)}parseClass(s,e,t){this.next();let r=this.state.strict;return this.state.strict=!0,this.parseClassId(s,e,t),this.parseClassSuper(s),s.body=this.parseClassBody(!!s.superClass,r),this.finishNode(s,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(s){return s.type==="Identifier"&&s.name==="constructor"||s.type==="StringLiteral"&&s.value==="constructor"}isNonstaticConstructor(s){return!s.computed&&!s.static&&this.nameIsConstructor(s.key)}parseClassBody(s,e){this.classScope.enter();let t={hadConstructor:!1,hadSuperClass:s},r=[],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(m.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){r.push(this.parseDecorator());continue}let a=this.startNode();r.length&&(a.decorators=r,this.resetStartLocationFromNode(a,r[0]),r=[]),this.parseClassMember(n,a,t),a.kind==="constructor"&&a.decorators&&a.decorators.length>0&&this.raise(m.DecoratorConstructor,a)}}),this.state.strict=e,this.next(),r.length)throw this.raise(m.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(n,"ClassBody")}parseClassMemberFromModifier(s,e){let t=this.parseIdentifier(!0);if(this.isClassMethod()){let r=e;return r.kind="method",r.computed=!1,r.key=t,r.static=!1,this.pushClassMethod(s,r,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let r=e;return r.computed=!1,r.key=t,r.static=!1,s.body.push(this.parseClassProperty(r)),!0}return this.resetPreviousNodeTrailingComments(t),!1}parseClassMember(s,e,t){let r=this.isContextual(106);if(r){if(this.parseClassMemberFromModifier(s,e))return;if(this.eat(5)){this.parseClassStaticBlock(s,e);return}}this.parseClassMemberWithIsStatic(s,e,t,r)}parseClassMemberWithIsStatic(s,e,t,r){let n=e,a=e,o=e,l=e,c=e,u=n,h=n;if(e.static=r,this.parsePropertyNamePrefixOperator(e),this.eat(55)){u.kind="method";let b=this.match(138);if(this.parseClassElementName(u),b){this.pushClassPrivateMethod(s,a,!0,!1);return}this.isNonstaticConstructor(n)&&this.raise(m.ConstructorIsGenerator,n.key),this.pushClassMethod(s,n,!0,!1,!1,!1);return}let f=!this.state.containsEsc&&R(this.state.type),d=this.parseClassElementName(e),p=f?d.name:null,g=this.isPrivateName(d),y=this.state.startLoc;if(this.parsePostMemberNameModifiers(h),this.isClassMethod()){if(u.kind="method",g){this.pushClassPrivateMethod(s,a,!1,!1);return}let b=this.isNonstaticConstructor(n),P=!1;b&&(n.kind="constructor",t.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(m.DuplicateConstructor,d),b&&this.hasPlugin("typescript")&&e.override&&this.raise(m.OverrideOnConstructor,d),t.hadConstructor=!0,P=t.hadSuperClass),this.pushClassMethod(s,n,!1,!1,b,P)}else if(this.isClassProperty())g?this.pushClassPrivateProperty(s,l):this.pushClassProperty(s,o);else if(p==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(d);let b=this.eat(55);h.optional&&this.unexpected(y),u.kind="method";let P=this.match(138);this.parseClassElementName(u),this.parsePostMemberNameModifiers(h),P?this.pushClassPrivateMethod(s,a,b,!0):(this.isNonstaticConstructor(n)&&this.raise(m.ConstructorIsAsync,n.key),this.pushClassMethod(s,n,b,!0,!1,!1))}else if((p==="get"||p==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(d),u.kind=p;let b=this.match(138);this.parseClassElementName(n),b?this.pushClassPrivateMethod(s,a,!1,!1):(this.isNonstaticConstructor(n)&&this.raise(m.ConstructorIsAccessor,n.key),this.pushClassMethod(s,n,!1,!1,!1,!1)),this.checkGetterSetterParams(n)}else if(p==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(d);let b=this.match(138);this.parseClassElementName(o),this.pushClassAccessorProperty(s,c,b)}else this.isLineTerminator()?g?this.pushClassPrivateProperty(s,l):this.pushClassProperty(s,o):this.unexpected()}parseClassElementName(s){let{type:e,value:t}=this.state;if((e===132||e===133)&&s.static&&t==="prototype"&&this.raise(m.StaticPrototype,this.state.startLoc),e===138){t==="constructor"&&this.raise(m.ConstructorClassPrivateField,this.state.startLoc);let r=this.parsePrivateName();return s.key=r,r}return this.parsePropertyName(s),s.key}parseClassStaticBlock(s,e){var t;this.scope.enter(208);let r=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let n=e.body=[];this.parseBlockOrModuleBlockBody(n,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=r,s.body.push(this.finishNode(e,"StaticBlock")),(t=e.decorators)!=null&&t.length&&this.raise(m.DecoratorStaticBlock,e)}pushClassProperty(s,e){!e.computed&&this.nameIsConstructor(e.key)&&this.raise(m.ConstructorClassField,e.key),s.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(s,e){let t=this.parseClassPrivateProperty(e);s.body.push(t),this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),0,t.key.loc.start)}pushClassAccessorProperty(s,e,t){!t&&!e.computed&&this.nameIsConstructor(e.key)&&this.raise(m.ConstructorClassField,e.key);let r=this.parseClassAccessorProperty(e);s.body.push(r),t&&this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.loc.start)}pushClassMethod(s,e,t,r,n,a){s.body.push(this.parseMethod(e,t,r,n,a,"ClassMethod",!0))}pushClassPrivateMethod(s,e,t,r){let n=this.parseMethod(e,t,r,!1,!1,"ClassPrivateMethod",!0);s.body.push(n);let a=n.kind==="get"?n.static?6:2:n.kind==="set"?n.static?5:1:0;this.declareClassPrivateMethodInScope(n,a)}declareClassPrivateMethodInScope(s,e){this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),e,s.key.loc.start)}parsePostMemberNameModifiers(s){}parseClassPrivateProperty(s){return this.parseInitializer(s),this.semicolon(),this.finishNode(s,"ClassPrivateProperty")}parseClassProperty(s){return this.parseInitializer(s),this.semicolon(),this.finishNode(s,"ClassProperty")}parseClassAccessorProperty(s){return this.parseInitializer(s),this.semicolon(),this.finishNode(s,"ClassAccessorProperty")}parseInitializer(s){this.scope.enter(80),this.expressionScope.enter(Gi()),this.prodParam.enter(0),s.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(s,e,t,r=8331){if(R(this.state.type))s.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(s.id,r);else if(t||!e)s.id=null;else throw this.raise(m.MissingClassName,this.state.startLoc)}parseClassSuper(s){s.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(s,e){let t=this.parseMaybeImportPhase(s,!0),r=this.maybeParseExportDefaultSpecifier(s,t),n=!r||this.eat(12),a=n&&this.eatExportStar(s),o=a&&this.maybeParseExportNamespaceSpecifier(s),l=n&&(!o||this.eat(12)),c=r||a;if(a&&!o){if(r&&this.unexpected(),e)throw this.raise(m.UnsupportedDecoratorExport,s);return this.parseExportFrom(s,!0),this.finishNode(s,"ExportAllDeclaration")}let u=this.maybeParseExportNamedSpecifiers(s);r&&n&&!a&&!u&&this.unexpected(null,5),o&&l&&this.unexpected(null,98);let h;if(c||u){if(h=!1,e)throw this.raise(m.UnsupportedDecoratorExport,s);this.parseExportFrom(s,c)}else h=this.maybeParseExportDeclaration(s);if(c||u||h){var f;let d=s;if(this.checkExport(d,!0,!1,!!d.source),((f=d.declaration)==null?void 0:f.type)==="ClassDeclaration")this.maybeTakeDecorators(e,d.declaration,d);else if(e)throw this.raise(m.UnsupportedDecoratorExport,s);return this.finishNode(d,"ExportNamedDeclaration")}if(this.eat(65)){let d=s,p=this.parseExportDefaultExpression();if(d.declaration=p,p.type==="ClassDeclaration")this.maybeTakeDecorators(e,p,d);else if(e)throw this.raise(m.UnsupportedDecoratorExport,s);return this.checkExport(d,!0,!0),this.finishNode(d,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(s){return this.eat(55)}maybeParseExportDefaultSpecifier(s,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e?.loc.start);let t=e||this.parseIdentifier(!0),r=this.startNodeAtNode(t);return r.exported=t,s.specifiers=[this.finishNode(r,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(s){if(this.isContextual(93)){var e,t;(t=(e=s).specifiers)!=null||(e.specifiers=[]);let r=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),r.exported=this.parseModuleExportName(),s.specifiers.push(this.finishNode(r,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(s){if(this.match(5)){let e=s;e.specifiers||(e.specifiers=[]);let t=e.exportKind==="type";return e.specifiers.push(...this.parseExportSpecifiers(t)),e.source=null,e.declaration=null,this.hasPlugin("importAssertions")&&(e.assertions=[]),!0}return!1}maybeParseExportDeclaration(s){return this.shouldParseExportDeclaration()?(s.specifiers=[],s.source=null,this.hasPlugin("importAssertions")&&(s.assertions=[]),s.declaration=this.parseExportDeclaration(s),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let s=this.nextTokenInLineStart();return this.isUnparsedContextual(s,"function")}parseExportDefaultExpression(){let s=this.startNode();if(this.match(68))return this.next(),this.parseFunction(s,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(s,13);if(this.match(80))return this.parseClass(s,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(m.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(m.UnsupportedDefaultExport,this.state.startLoc);let e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(s){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:s}=this.state;if(R(s)){if(s===95&&!this.state.containsEsc||s===100)return!1;if((s===130||s===129)&&!this.state.containsEsc){let{type:r}=this.lookahead();if(R(r)&&r!==98||r===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let e=this.nextTokenStart(),t=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||R(this.state.type)&&t)return!0;if(this.match(65)&&t){let r=this.input.charCodeAt(this.nextTokenStartSince(e+4));return r===34||r===39}return!1}parseExportFrom(s,e){this.eatContextual(98)?(s.source=this.parseImportSource(),this.checkExport(s),this.maybeParseImportAttributes(s),this.checkJSONModuleImport(s)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:s}=this.state;return s===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(m.DecoratorBeforeExport,this.state.startLoc),!0):this.isContextual(107)?(this.raise(m.UsingDeclarationExport,this.state.startLoc),!0):this.isContextual(96)&&this.startsAwaitUsing()?(this.raise(m.UsingDeclarationExport,this.state.startLoc),!0):s===74||s===75||s===68||s===80||this.isLet()||this.isAsyncFunction()}checkExport(s,e,t,r){if(e){var n;if(t){if(this.checkDuplicateExports(s,"default"),this.hasPlugin("exportDefaultFrom")){var a;let o=s.declaration;o.type==="Identifier"&&o.name==="from"&&o.end-o.start===4&&!((a=o.extra)!=null&&a.parenthesized)&&this.raise(m.ExportDefaultFromAsIdentifier,o)}}else if((n=s.specifiers)!=null&&n.length)for(let o of s.specifiers){let{exported:l}=o,c=l.type==="Identifier"?l.name:l.value;if(this.checkDuplicateExports(o,c),!r&&o.local){let{local:u}=o;u.type!=="Identifier"?this.raise(m.ExportBindingIsString,o,{localName:u.value,exportName:c}):(this.checkReservedWord(u.name,u.loc.start,!0,!1),this.scope.checkLocalExport(u))}}else if(s.declaration){let o=s.declaration;if(o.type==="FunctionDeclaration"||o.type==="ClassDeclaration"){let{id:l}=o;if(!l)throw new Error("Assertion failure");this.checkDuplicateExports(s,l.name)}else if(o.type==="VariableDeclaration")for(let l of o.declarations)this.checkDeclaration(l.id)}}}checkDeclaration(s){if(s.type==="Identifier")this.checkDuplicateExports(s,s.name);else if(s.type==="ObjectPattern")for(let e of s.properties)this.checkDeclaration(e);else if(s.type==="ArrayPattern")for(let e of s.elements)e&&this.checkDeclaration(e);else s.type==="ObjectProperty"?this.checkDeclaration(s.value):s.type==="RestElement"?this.checkDeclaration(s.argument):s.type==="AssignmentPattern"&&this.checkDeclaration(s.left)}checkDuplicateExports(s,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(m.DuplicateDefaultExport,s):this.raise(m.DuplicateExport,s,{exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(s){let e=[],t=!0;for(this.expect(5);!this.eat(8);){if(t)t=!1;else if(this.expect(12),this.eat(8))break;let r=this.isContextual(130),n=this.match(133),a=this.startNode();a.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(a,n,s,r))}return e}parseExportSpecifier(s,e,t,r){return this.eatContextual(93)?s.exported=this.parseModuleExportName():e?s.exported=_o(s.local):s.exported||(s.exported=Be(s.local)),this.finishNode(s,"ExportSpecifier")}parseModuleExportName(){if(this.match(133)){let s=this.parseStringLiteral(this.state.value),e=nl.exec(s.value);return e&&this.raise(m.ModuleExportNameHasLoneSurrogate,s,{surrogateCharCode:e[0].charCodeAt(0)}),s}return this.parseIdentifier(!0)}isJSONModuleImport(s){return s.assertions!=null?s.assertions.some(({key:e,value:t})=>t.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(s){let{specifiers:e}=s,t=e.length===1?e[0].type:null;if(s.phase==="source")t!=="ImportDefaultSpecifier"&&this.raise(m.SourcePhaseImportRequiresDefault,e[0].loc.start);else if(s.phase==="defer")t!=="ImportNamespaceSpecifier"&&this.raise(m.DeferImportRequiresNamespace,e[0].loc.start);else if(s.module){var r;t!=="ImportDefaultSpecifier"&&this.raise(m.ImportReflectionNotBinding,e[0].loc.start),((r=s.assertions)==null?void 0:r.length)>0&&this.raise(m.ImportReflectionHasAssertion,e[0].loc.start)}}checkJSONModuleImport(s){if(this.isJSONModuleImport(s)&&s.type!=="ExportAllDeclaration"){let{specifiers:e}=s;if(e!=null){let t=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"});t!==void 0&&this.raise(m.ImportJSONBindingNotDefault,t.loc.start)}}}isPotentialImportPhase(s){return s?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(s,e,t,r){e||(t==="module"?(this.expectPlugin("importReflection",r),s.module=!0):this.hasPlugin("importReflection")&&(s.module=!1),t==="source"?(this.expectPlugin("sourcePhaseImports",r),s.phase="source"):t==="defer"?(this.expectPlugin("deferredImportEvaluation",r),s.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(s.phase=null))}parseMaybeImportPhase(s,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(s,e,null),null;let t=this.parseIdentifier(!0),{type:r}=this.state;return(Te(r)?r!==98||this.lookaheadCharCode()===102:r!==12)?(this.resetPreviousIdentifierLeadingComments(t),this.applyImportPhase(s,e,t.name,t.loc.start),null):(this.applyImportPhase(s,e,null),t)}isPrecedingIdImportPhase(s){let{type:e}=this.state;return R(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(s){return this.match(133)?this.parseImportSourceAndAttributes(s):this.parseImportSpecifiersAndAfter(s,this.parseMaybeImportPhase(s,!1))}parseImportSpecifiersAndAfter(s,e){s.specifiers=[];let r=!this.maybeParseDefaultImportSpecifier(s,e)||this.eat(12),n=r&&this.maybeParseStarImportSpecifier(s);return r&&!n&&this.parseNamedImportSpecifiers(s),this.expectContextual(98),this.parseImportSourceAndAttributes(s)}parseImportSourceAndAttributes(s){var e;return(e=s.specifiers)!=null||(s.specifiers=[]),s.source=this.parseImportSource(),this.maybeParseImportAttributes(s),this.checkImportReflection(s),this.checkJSONModuleImport(s),this.semicolon(),this.finishNode(s,"ImportDeclaration")}parseImportSource(){return this.match(133)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(s,e,t){e.local=this.parseIdentifier(),s.specifiers.push(this.finishImportSpecifier(e,t))}finishImportSpecifier(s,e,t=8201){return this.checkLVal(s.local,{type:e},t),this.finishNode(s,e)}parseImportAttributes(){this.expect(5);let s=[],e=new Set;do{if(this.match(8))break;let t=this.startNode(),r=this.state.value;if(e.has(r)&&this.raise(m.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:r}),e.add(r),this.match(133)?t.key=this.parseStringLiteral(r):t.key=this.parseIdentifier(!0),this.expect(14),!this.match(133))throw this.raise(m.ModuleAttributeInvalidValue,this.state.startLoc);t.value=this.parseStringLiteral(this.state.value),s.push(this.finishNode(t,"ImportAttribute"))}while(this.eat(12));return this.expect(8),s}parseModuleAttributes(){let s=[],e=new Set;do{let t=this.startNode();if(t.key=this.parseIdentifier(!0),t.key.name!=="type"&&this.raise(m.ModuleAttributeDifferentFromType,t.key),e.has(t.key.name)&&this.raise(m.ModuleAttributesWithDuplicateKeys,t.key,{key:t.key.name}),e.add(t.key.name),this.expect(14),!this.match(133))throw this.raise(m.ModuleAttributeInvalidValue,this.state.startLoc);t.value=this.parseStringLiteral(this.state.value),s.push(this.finishNode(t,"ImportAttribute"))}while(this.eat(12));return s}maybeParseImportAttributes(s){let e,t=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?e=this.parseModuleAttributes():(this.expectImportAttributesPlugin(),e=this.parseImportAttributes()),t=!0}else if(this.isContextual(94)&&!this.hasPrecedingLineBreak())this.hasPlugin("importAttributes")?(this.getPluginOption("importAttributes","deprecatedAssertSyntax")!==!0&&this.raise(m.ImportAttributesUseAssert,this.state.startLoc),this.addExtra(s,"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;!t&&this.hasPlugin("importAssertions")?s.assertions=e:s.attributes=e}maybeParseDefaultImportSpecifier(s,e){if(e){let t=this.startNodeAtNode(e);return t.local=e,s.specifiers.push(this.finishImportSpecifier(t,"ImportDefaultSpecifier")),!0}else if(Te(this.state.type))return this.parseImportSpecifierLocal(s,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(s){if(this.match(55)){let e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(s,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(s){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(m.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let t=this.startNode(),r=this.match(133),n=this.isContextual(130);t.imported=this.parseModuleExportName();let a=this.parseImportSpecifier(t,r,s.importKind==="type"||s.importKind==="typeof",n,void 0);s.specifiers.push(a)}}parseImportSpecifier(s,e,t,r,n){if(this.eatContextual(93))s.local=this.parseIdentifier();else{let{imported:a}=s;if(e)throw this.raise(m.ImportBindingIsString,s,{importName:a.value});this.checkReservedWord(a.name,s.loc.start,!0,!0),s.local||(s.local=Be(a))}return this.finishImportSpecifier(s,"ImportSpecifier",n)}isThisParam(s){return s.type==="Identifier"&&s.name==="this"}},is=class extends dr{constructor(s,e,t){s=rl(s),super(s,e),this.options=s,this.initializeScopes(),this.plugins=t,this.filename=s.sourceFilename}getScopeHandler(){return It}parse(){this.enterInitialScopes();let s=this.startNode(),e=this.startNode();return this.nextToken(),s.errors=null,this.parseTopLevel(s,e),s.errors=this.state.errors,s.comments.length=this.state.commentsLen,s}};function ol(i,s){var e;if(((e=s)==null?void 0:e.sourceType)==="unambiguous"){s=Object.assign({},s);try{s.sourceType="module";let t=wt(s,i),r=t.parse();if(t.sawUnambiguousESM)return r;if(t.ambiguousScriptDifferentAst)try{return s.sourceType="script",wt(s,i).parse()}catch{}else r.program.sourceType="script";return r}catch(t){try{return s.sourceType="script",wt(s,i).parse()}catch{}throw t}}else return wt(s,i).parse()}function ll(i,s){let e=wt(s,i);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function cl(i){let s={};for(let e of Object.keys(i))s[e]=De(i[e]);return s}var ul=cl(io);function wt(i,s){let e=is,t=new Map;if(i!=null&&i.plugins){for(let r of i.plugins){let n,a;typeof r=="string"?n=r:[n,a]=r,t.has(n)||t.set(n,a||{})}tl(t),e=hl(t)}return new e(i,s,t)}var Ri=new Map;function hl(i){let s=[];for(let r of sl)i.has(r)&&s.push(r);let e=s.join("|"),t=Ri.get(e);if(!t){t=is;for(let r of s)t=en[r](t);Ri.set(e,t)}return t}kt.parse=ol;kt.parseExpression=ll;kt.tokTypes=ul});import{access as qc,mkdir as zc,readdir as ra,readFile as Wc,stat as Jc,unlink as Kc,writeFile as Hc}from"fs/promises";import{createHash as Xc}from"crypto";import{existsSync as ie,readdirSync as Gc,readFileSync as ta,statSync as Qc,unlinkSync as Yc}from"fs";import{homedir as Zc,hostname as eu}from"os";import V from"path";import tu from"typescript";import su from"launch-editor";async function Jr(i,s){let e=i.resolve("/");for(let t=0;t<20;t++){let r=i.join(s,"package.json"),n=await i.readFile(r);if(n)return JSON.parse(n);if(s===e)break;s=i.dirname(s)}return null}var Xr=Ns(Hr(),1);function Gr(){try{let i=(0,Xr.default)();if(i?.name)return i.name}catch{}return"npm"}async function Yr(i){let s=[],e=await Jr(i,i.getRepoRootDir());if(e){let t=await Pa(e,i);s.push(...t)}return s}async function Pa(i,s){let e=[];if(i&&typeof i=="object"){let t=new Set(Object.keys({...i.dependencies,...i.devDependencies}));for(let r of Sa)if(t.has(r)&&!e.some(n=>n.name===r)){let n={name:r};Qr.has(r)&&(n.version=await Qr.get(r)(s)),e.push(n)}}return e}function ks(i){let s=parseInt(i);return Number.isNaN(s)?void 0:s}var Qr=new Map([["next",async i=>{if(!i.spawnSync)return;let s=Gr(),e=s==="npm"?"npx":s,{stdout:t}=i.spawnSync(e,["next","-v"],{encoding:"utf8"});if(!t)return;let r=t.match(/(Next.js v)([\d.]+)/g);if(!r)return;let n=r[0].split("Next.js v")[1],[a,o,l]=n.split(".");return{major:ks(a),minor:ks(o),patch:ks(l)}}]]),Sa=["@shopify/remix-oxygen","@shopify/hydrogen","@builder.io/qwik-city","@remix-run/react","@sveltejs/kit","astro","gatsby","next","nuxt","@builder.io/qwik","@angular/core","react","solid-js","svelte","vue"];import{spawnSync as yt}from"child_process";var zr={};xa(zr,{MagicastError:()=>se,builders:()=>Vc,detectCodeFormat:()=>Qn,generateCode:()=>qr,loadFile:()=>Rc,parseExpression:()=>Zn,parseModule:()=>Yn,writeFile:()=>Uc});import{promises as Ir}from"fs";var Ps=Ns(Ai(),1),gn=Ns(tn(),1);function de(i){var s=i.use(G),e=s.Type,t=s.builtInTypes,r=t.number;function n(c){return e.from(u=>r.check(u)&&u>=c,r+" >= "+c)}let a={null:function(){return null},emptyArray:function(){return[]},false:function(){return!1},true:function(){return!0},undefined:function(){},"use strict":function(){return"use strict"}};var o=e.or(t.string,t.number,t.boolean,t.null,t.undefined);let l=e.from(c=>{if(c===null)return!0;var u=typeof c;return!(u==="object"||u==="function")},o.toString());return{geq:n,defaults:a,isPrimitive:l}}function q(i){try{var s=i(),e=s.exports,t=e.default}catch{return}t&&t!==e&&typeof e=="object"&&(Object.assign(t,e,{default:t}),e.__esModule&&Object.defineProperty(t,"__esModule",{value:!0}),s.exports=t)}var pl=Object.defineProperty,fl=(i,s,e)=>s in i?pl(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e,oe=(i,s,e)=>(fl(i,typeof s!="symbol"?s+"":s,e),e),xn=Object.prototype,ds=xn.toString,ge=xn.hasOwnProperty,Ge=class{assert(s,e){if(!this.check(s,e)){var t=jr(s);throw new Error(t+" does not match type "+this)}return!0}arrayOf(){let s=this;return new Rt(s)}},Rt=class extends Ge{constructor(s){super(),this.elemType=s,oe(this,"kind","ArrayType")}toString(){return"["+this.elemType+"]"}check(s,e){return Array.isArray(s)&&s.every(t=>this.elemType.check(t,e))}},ms=class extends Ge{constructor(s){super(),this.value=s,oe(this,"kind","IdentityType")}toString(){return String(this.value)}check(s,e){let t=s===this.value;return!t&&typeof e=="function"&&e(this,s),t}},ys=class extends Ge{constructor(s){super(),this.fields=s,oe(this,"kind","ObjectType")}toString(){return"{ "+this.fields.join(", ")+" }"}check(s,e){return ds.call(s)===ds.call({})&&this.fields.every(t=>t.type.check(s[t.name],e))}},gs=class extends Ge{constructor(s){super(),this.types=s,oe(this,"kind","OrType")}toString(){return this.types.join(" | ")}check(s,e){return this.types.some(t=>t.check(s,!!e))?!0:(typeof e=="function"&&e(this,s),!1)}},Xe=class extends Ge{constructor(s,e){super(),this.name=s,this.predicate=e,oe(this,"kind","PredicateType")}toString(){return this.name}check(s,e){let t=this.predicate(s,e);return!t&&typeof e=="function"&&e(this,s),t}},_t=class i{constructor(s,e){this.type=s,this.typeName=e,oe(this,"baseNames",[]),oe(this,"ownFields",Object.create(null)),oe(this,"allSupertypes",Object.create(null)),oe(this,"supertypeList",[]),oe(this,"allFields",Object.create(null)),oe(this,"fieldNames",[]),oe(this,"finalized",!1),oe(this,"buildable",!1),oe(this,"buildParams",[])}isSupertypeOf(s){if(s instanceof i){if(this.finalized!==!0||s.finalized!==!0)throw new Error("");return ge.call(s.allSupertypes,this.typeName)}else throw new Error(s+" is not a Def")}checkAllFields(s,e){var t=this.allFields;if(this.finalized!==!0)throw new Error(""+this.typeName);function r(n){var a=t[n],o=a.type,l=a.getValue(s);return o.check(l,e)}return s!==null&&typeof s=="object"&&Object.keys(t).every(r)}bases(...s){var e=this.baseNames;if(this.finalized){if(s.length!==e.length)throw new Error("");for(var t=0;t<s.length;t++)if(s[t]!==e[t])throw new Error("");return this}return s.forEach(r=>{e.indexOf(r)<0&&e.push(r)}),this}},xs=class{constructor(s,e,t,r){this.name=s,this.type=e,this.defaultFn=t,oe(this,"hidden"),this.hidden=!!r}toString(){return JSON.stringify(this.name)+": "+this.type}getValue(s){var e=s[this.name];return typeof e<"u"||typeof this.defaultFn=="function"&&(e=this.defaultFn.call(s)),e}};function jr(i){return Array.isArray(i)?"["+i.map(jr).join(", ")+"]":i&&typeof i=="object"?"{ "+Object.keys(i).map(function(s){return s+": "+i[s]}).join(", ")+" }":JSON.stringify(i)}function G(i){let s={or(...w){return new gs(w.map(v=>s.from(v)))},from(w,v){if(w instanceof Rt||w instanceof ms||w instanceof ys||w instanceof gs||w instanceof Xe)return w;if(w instanceof _t)return w.type;if(o.check(w)){if(w.length!==1)throw new Error("only one element type is permitted for typed arrays");return new Rt(s.from(w[0]))}if(l.check(w))return new ys(Object.keys(w).map(F=>new xs(F,s.from(w[F],F))));if(typeof w=="function"){var M=e.indexOf(w);if(M>=0)return t[M];if(typeof v!="string")throw new Error("missing name");return new Xe(v,w)}return new ms(w)},def(w){return ge.call(b,w)?b[w]:b[w]=new k(w)},hasDef(w){return ge.call(b,w)}};var e=[],t=[];function r(w,v){let M=ds.call(v),F=new Xe(w,z=>ds.call(z)===M);return v&&typeof v.constructor=="function"&&(e.push(v.constructor),t.push(F)),F}let n=r("string","truthy"),a=r("function",function(){}),o=r("array",[]),l=r("object",{}),c=r("RegExp",/./),u=r("Date",new Date),h=r("number",3),f=r("boolean",!0),d=r("null",null),p=r("undefined",void 0),g=typeof BigInt=="function"?r("BigInt",BigInt(1234)):new Xe("BigInt",()=>!1),y={string:n,function:a,array:o,object:l,RegExp:c,Date:u,number:h,boolean:f,null:d,undefined:p,BigInt:g};var b=Object.create(null);function P(w){if(w&&typeof w=="object"){var v=w.type;if(typeof v=="string"&&ge.call(b,v)){var M=b[v];if(M.finalized)return M}}return null}class k extends _t{constructor(v){super(new Xe(v,(M,F)=>this.check(M,F)),v)}check(v,M){if(this.finalized!==!0)throw new Error("prematurely checking unfinalized type "+this.typeName);if(v===null||typeof v!="object")return!1;var F=P(v);return F?M&&F===this?this.checkAllFields(v,M):this.isSupertypeOf(F)?M?F.checkAllFields(v,M)&&this.checkAllFields(v,!1):!0:!1:this.typeName==="SourceLocation"||this.typeName==="Position"?this.checkAllFields(v,M):!1}build(...v){if(this.buildParams=v,this.buildable)return this;this.field("type",String,()=>this.typeName),this.buildable=!0;let M=(z,J,X,me)=>{if(!ge.call(z,J)){var Ne=this.allFields;if(!ge.call(Ne,J))throw new Error(""+J);var zt=Ne[J],ua=zt.type,gt;if(me)gt=X;else if(zt.defaultFn)gt=zt.defaultFn.call(z);else{var ha="no value or default function given for field "+JSON.stringify(J)+" of "+this.typeName+"("+this.buildParams.map(function(pa){return Ne[pa]}).join(", ")+")";throw new Error(ha)}if(!ua.check(gt))throw new Error(jr(gt)+" does not match field "+zt+" of type "+this.typeName);z[J]=gt}},F=(...z)=>{var J=z.length;if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var X=Object.create(L);if(this.buildParams.forEach(function(me,Ne){Ne<J?M(X,me,z[Ne],!0):M(X,me,null,!1)}),Object.keys(this.allFields).forEach(function(me){M(X,me,null,!1)}),X.type!==this.typeName)throw new Error("");return X};return F.from=z=>{if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var J=Object.create(L);if(Object.keys(this.allFields).forEach(function(X){ge.call(z,X)?M(J,X,z[X],!0):M(J,X,null,!1)}),J.type!==this.typeName)throw new Error("");return J},Object.defineProperty(A,ue(this.typeName),{enumerable:!0,value:F}),this}field(v,M,F,z){return this.finalized?(console.error("Ignoring attempt to redefine field "+JSON.stringify(v)+" of finalized type "+JSON.stringify(this.typeName)),this):(this.ownFields[v]=new xs(v,s.from(M),F,z),this)}finalize(){if(!this.finalized){var v=this.allFields,M=this.allSupertypes;this.baseNames.forEach(z=>{var J=b[z];if(J instanceof _t)J.finalize(),Cs(v,J.allFields),Cs(M,J.allSupertypes);else{var X="unknown supertype name "+JSON.stringify(z)+" for subtype "+JSON.stringify(this.typeName);throw new Error(X)}}),Cs(v,this.ownFields),M[this.typeName]=this,this.fieldNames.length=0;for(var F in v)ge.call(v,F)&&!v[F].hidden&&this.fieldNames.push(F);Object.defineProperty(Wr,this.typeName,{enumerable:!0,value:this.type}),this.finalized=!0,la(this.typeName,this.supertypeList),this.buildable&&this.supertypeList.lastIndexOf("Expression")>=0&&oa(this.typeName)}}}function T(w){if(!ge.call(b,w))throw new Error("");var v=b[w];if(v.finalized!==!0)throw new Error("");return v.supertypeList.slice(1)}function E(w){for(var v={},M=Object.keys(b),F=M.length,z=0;z<F;++z){var J=M[z],X=b[J];if(X.finalized!==!0)throw new Error(""+J);for(var me=0;me<X.supertypeList.length;++me){var Ne=X.supertypeList[me];if(ge.call(w,Ne)){v[J]=Ne;break}}}return v}var A=Object.create(null),L={};function W(w,v){var M=L[w];return p.check(v)?delete L[w]:(a.assert(v),Object.defineProperty(L,w,{enumerable:!0,configurable:!0,value:v})),M}function ue(w){return w.replace(/^[A-Z]+/,function(v){var M=v.length;switch(M){case 0:return"";case 1:return v.toLowerCase();default:return v.slice(0,M-1).toLowerCase()+v.charAt(M-1)}})}function Ae(w){return w=ue(w),w.replace(/(Expression)?$/,"Statement")}var Wr={};function ws(w){var v=P(w);if(v)return v.fieldNames.slice(0);if("type"in w)throw new Error("did not recognize object of type "+JSON.stringify(w.type));return Object.keys(w)}function vs(w,v){var M=P(w);if(M){var F=M.allFields[v];if(F)return F.getValue(w)}return w&&w[v]}function na(w,v,M){ws(w).forEach(function(F){v.call(this,F,vs(w,F))},M)}function aa(w,v,M){return ws(w).some(function(F){return v.call(this,F,vs(w,F))},M)}function oa(w){var v=Ae(w);if(A[v])return;var M=A[ue(w)];if(!M)return;let F=function(...z){return A.expressionStatement(M.apply(A,z))};F.from=function(...z){return A.expressionStatement(M.from.apply(A,z))},A[v]=F}function la(w,v){v.length=0,v.push(w);for(var M=Object.create(null),F=0;F<v.length;++F){w=v[F];var z=b[w];if(z.finalized!==!0)throw new Error("");ge.call(M,w)&&delete v[M[w]],M[w]=F,v.push.apply(v,z.baseNames)}for(var J=0,X=J,me=v.length;X<me;++X)ge.call(v,X)&&(v[J++]=v[X]);v.length=J}function Cs(w,v){return Object.keys(v).forEach(function(M){w[M]=v[M]}),w}function ca(){Object.keys(b).forEach(function(w){b[w].finalize()})}return{Type:s,builtInTypes:y,getSupertypeNames:T,computeSupertypeLookupTable:E,builders:A,defineMethod:W,getBuilderName:ue,getStatementBuilderName:Ae,namedTypes:Wr,getFieldNames:ws,getFieldValue:vs,eachField:na,someField:aa,finalize:ca}}q(()=>module);var dl=Object.prototype,ns=dl.hasOwnProperty;function bn(i){var s=i.use(G),e=s.builtInTypes.array,t=s.builtInTypes.number;let r=function h(f,d,p){if(!(this instanceof h))throw new Error("Path constructor cannot be invoked without 'new'");if(d){if(!(d instanceof h))throw new Error("")}else d=null,p=null;this.value=f,this.parentPath=d,this.name=p,this.__childCache=null};var n=r.prototype;function a(h){return h.__childCache||(h.__childCache=Object.create(null))}function o(h,f){var d=a(h),p=h.getValueProperty(f),g=d[f];return(!ns.call(d,f)||g.value!==p)&&(g=d[f]=new h.constructor(p,h,f)),g}n.getValueProperty=function(f){return this.value[f]},n.get=function(...f){for(var d=this,p=f.length,g=0;g<p;++g)d=o(d,f[g]);return d},n.each=function(f,d){for(var p=[],g=this.value.length,y=0,y=0;y<g;++y)ns.call(this.value,y)&&(p[y]=this.get(y));for(d=d||this,y=0;y<g;++y)ns.call(p,y)&&f.call(d,p[y])},n.map=function(f,d){var p=[];return this.each(function(g){p.push(f.call(this,g))},d),p},n.filter=function(f,d){var p=[];return this.each(function(g){f.call(this,g)&&p.push(g)},d),p};function l(){}function c(h,f,d,p){if(e.assert(h.value),f===0)return l;var g=h.value.length;if(g<1)return l;var y=arguments.length;y===2?(d=0,p=g):y===3?(d=Math.max(d,0),p=g):(d=Math.max(d,0),p=Math.min(p,g)),t.assert(d),t.assert(p);for(var b=Object.create(null),P=a(h),k=d;k<p;++k)if(ns.call(h.value,k)){var T=h.get(k);if(T.name!==k)throw new Error("");var E=k+f;T.name=E,b[E]=T,delete P[k]}return delete P.length,function(){for(var A in b){var L=b[A];if(L.name!==+A)throw new Error("");P[A]=L,h.value[A]=L.value}}}n.shift=function(){var f=c(this,-1),d=this.value.shift();return f(),d},n.unshift=function(...f){var d=c(this,f.length),p=this.value.unshift.apply(this.value,f);return d(),p},n.push=function(...f){return e.assert(this.value),delete a(this).length,this.value.push.apply(this.value,f)},n.pop=function(){e.assert(this.value);var f=a(this);return delete f[this.value.length-1],delete f.length,this.value.pop()},n.insertAt=function(f){var d=arguments.length,p=c(this,d-1,f);if(p===l&&d<=1)return this;f=Math.max(f,0);for(var g=1;g<d;++g)this.value[f+g-1]=arguments[g];return p(),this},n.insertBefore=function(...f){for(var d=this.parentPath,p=f.length,g=[this.name],y=0;y<p;++y)g.push(f[y]);return d.insertAt.apply(d,g)},n.insertAfter=function(...f){for(var d=this.parentPath,p=f.length,g=[this.name+1],y=0;y<p;++y)g.push(f[y]);return d.insertAt.apply(d,g)};function u(h){if(!(h instanceof r))throw new Error("");var f=h.parentPath;if(!f)return h;var d=f.value,p=a(f);if(d[h.name]===h.value)p[h.name]=h;else if(e.check(d)){var g=d.indexOf(h.value);g>=0&&(p[h.name=g]=h)}else d[h.name]=h.value,p[h.name]=h;if(d[h.name]!==h.value)throw new Error("");if(h.parentPath.get(h.name)!==h)throw new Error("");return h}return n.replace=function(f){var d=[],p=this.parentPath.value,g=a(this.parentPath),y=arguments.length;if(u(this),e.check(p)){for(var b=p.length,P=c(this.parentPath,y-1,this.name+1),k=[this.name,1],T=0;T<y;++T)k.push(arguments[T]);var E=p.splice.apply(p,k);if(E[0]!==this.value)throw new Error("");if(p.length!==b-1+y)throw new Error("");if(P(),y===0)delete this.value,delete g[this.name],this.__childCache=null;else{if(p[this.name]!==f)throw new Error("");for(this.value!==f&&(this.value=f,this.__childCache=null),T=0;T<y;++T)d.push(this.parentPath.get(this.name+T));if(d[0]!==this)throw new Error("")}}else if(y===1)this.value!==f&&(this.__childCache=null),this.value=p[this.name]=f,d.push(this);else if(y===0)delete p[this.name],delete this.value,this.__childCache=null;else throw new Error("Could not replace path");return d},r}q(()=>module);var lt=Object.prototype.hasOwnProperty;function ml(i){var s=i.use(G),e=s.Type,t=s.namedTypes,r=t.Node,n=t.Expression,a=s.builtInTypes.array,o=s.builders;let l=function T(E,A){if(!(this instanceof T))throw new Error("Scope constructor cannot be invoked without 'new'");u.check(E.value)||c.assert(E.value);var L;if(A){if(!(A instanceof T))throw new Error("");L=A.depth+1}else A=null,L=0;Object.defineProperties(this,{path:{value:E},node:{value:E.value},isGlobal:{value:!A,enumerable:!0},depth:{value:L},parent:{value:A},bindings:{value:{}},types:{value:{}}})};var c=e.or(t.Program,t.Function,t.CatchClause),u=e.or(t.Function,t.ClassDeclaration,t.ClassExpression,t.InterfaceDeclaration,t.TSInterfaceDeclaration,t.TypeAlias,t.TSTypeAliasDeclaration),h=e.or(t.TypeParameter,t.TSTypeParameter);l.isEstablishedBy=function(T){return c.check(T)||u.check(T)};var f=l.prototype;f.didScan=!1,f.declares=function(T){return this.scan(),lt.call(this.bindings,T)},f.declaresType=function(T){return this.scan(),lt.call(this.types,T)},f.declareTemporary=function(T){if(T){if(!/^[a-z$_]/i.test(T))throw new Error("")}else T="t$";T+=this.depth.toString(36)+"$",this.scan();for(var E=0;this.declares(T+E);)++E;var A=T+E;return this.bindings[A]=s.builders.identifier(A)},f.injectTemporary=function(T,E){T||(T=this.declareTemporary());var A=this.path.get("body");return t.BlockStatement.check(A.value)&&(A=A.get("body")),A.unshift(o.variableDeclaration("var",[o.variableDeclarator(T,E||null)])),T},f.scan=function(T){if(T||!this.didScan){for(var E in this.bindings)delete this.bindings[E];for(var E in this.types)delete this.types[E];d(this.path,this.bindings,this.types),this.didScan=!0}},f.getBindings=function(){return this.scan(),this.bindings},f.getTypes=function(){return this.scan(),this.types};function d(T,E,A){var L=T.value;if(u.check(L)){let W=T.get("typeParameters","params");a.check(W.value)&&W.each(ue=>{k(ue,A)})}c.check(L)&&(t.CatchClause.check(L)?b(T.get("param"),E):p(T,E,A))}function p(T,E,A){var L=T.value;T.parent&&t.FunctionExpression.check(T.parent.node)&&T.parent.node.id&&b(T.parent.get("id"),E),L&&(a.check(L)?T.each(W=>{y(W,E,A)}):t.Function.check(L)?(T.get("params").each(W=>{b(W,E)}),y(T.get("body"),E,A),p(T.get("typeParameters"),E,A)):t.TypeAlias&&t.TypeAlias.check(L)||t.InterfaceDeclaration&&t.InterfaceDeclaration.check(L)||t.TSTypeAliasDeclaration&&t.TSTypeAliasDeclaration.check(L)||t.TSInterfaceDeclaration&&t.TSInterfaceDeclaration.check(L)?P(T.get("id"),A):t.VariableDeclarator.check(L)?(b(T.get("id"),E),y(T.get("init"),E,A)):L.type==="ImportSpecifier"||L.type==="ImportNamespaceSpecifier"||L.type==="ImportDefaultSpecifier"?b(T.get(L.local?"local":L.name?"name":"id"),E):r.check(L)&&!n.check(L)&&s.eachField(L,function(W,ue){var Ae=T.get(W);if(!g(Ae,ue))throw new Error("");y(Ae,E,A)}))}function g(T,E){return!!(T.value===E||Array.isArray(T.value)&&T.value.length===0&&Array.isArray(E)&&E.length===0)}function y(T,E,A){var L=T.value;if(!(!L||n.check(L)))if(t.FunctionDeclaration.check(L)&&L.id!==null)b(T.get("id"),E);else if(t.ClassDeclaration&&t.ClassDeclaration.check(L)&&L.id!==null)b(T.get("id"),E),p(T.get("typeParameters"),E,A);else if(t.InterfaceDeclaration&&t.InterfaceDeclaration.check(L)||t.TSInterfaceDeclaration&&t.TSInterfaceDeclaration.check(L))P(T.get("id"),A);else if(c.check(L)){if(t.CatchClause.check(L)&&t.Identifier.check(L.param)){var W=L.param.name,ue=lt.call(E,W);p(T.get("body"),E,A),ue||delete E[W]}}else p(T,E,A)}function b(T,E){var A=T.value;t.Pattern.assert(A),t.Identifier.check(A)?lt.call(E,A.name)?E[A.name].push(T):E[A.name]=[T]:t.AssignmentPattern&&t.AssignmentPattern.check(A)?b(T.get("left"),E):t.ObjectPattern&&t.ObjectPattern.check(A)?T.get("properties").each(function(L){var W=L.value;t.Pattern.check(W)?b(L,E):t.Property.check(W)||t.ObjectProperty&&t.ObjectProperty.check(W)?b(L.get("value"),E):t.SpreadProperty&&t.SpreadProperty.check(W)&&b(L.get("argument"),E)}):t.ArrayPattern&&t.ArrayPattern.check(A)?T.get("elements").each(function(L){var W=L.value;t.Pattern.check(W)?b(L,E):t.SpreadElement&&t.SpreadElement.check(W)&&b(L.get("argument"),E)}):t.PropertyPattern&&t.PropertyPattern.check(A)?b(T.get("pattern"),E):(t.SpreadElementPattern&&t.SpreadElementPattern.check(A)||t.RestElement&&t.RestElement.check(A)||t.SpreadPropertyPattern&&t.SpreadPropertyPattern.check(A))&&b(T.get("argument"),E)}function P(T,E){var A=T.value;t.Pattern.assert(A),t.Identifier.check(A)&&(lt.call(E,A.name)?E[A.name].push(T):E[A.name]=[T])}function k(T,E){var A=T.value;h.assert(A),lt.call(E,A.name)?E[A.name].push(T):E[A.name]=[T]}return f.lookup=function(T){for(var E=this;E&&!E.declares(T);E=E.parent);return E},f.lookupType=function(T){for(var E=this;E&&!E.declaresType(T);E=E.parent);return E},f.getGlobalScope=function(){for(var T=this;!T.isGlobal;)T=T.parent;return T},l}q(()=>module);function Tn(i){var s=i.use(G),e=s.namedTypes,t=s.builders,r=s.builtInTypes.number,n=s.builtInTypes.array,a=i.use(bn),o=i.use(ml);let l=function y(b,P,k){if(!(this instanceof y))throw new Error("NodePath constructor cannot be invoked without 'new'");a.call(this,b,P,k)};var c=l.prototype=Object.create(a.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}});Object.defineProperties(c,{node:{get:function(){return Object.defineProperty(this,"node",{configurable:!0,value:this._computeNode()}),this.node}},parent:{get:function(){return Object.defineProperty(this,"parent",{configurable:!0,value:this._computeParent()}),this.parent}},scope:{get:function(){return Object.defineProperty(this,"scope",{configurable:!0,value:this._computeScope()}),this.scope}}}),c.replace=function(){return delete this.node,delete this.parent,delete this.scope,a.prototype.replace.apply(this,arguments)},c.prune=function(){var y=this.parent;return this.replace(),p(y)},c._computeNode=function(){var y=this.value;if(e.Node.check(y))return y;var b=this.parentPath;return b&&b.node||null},c._computeParent=function(){var y=this.value,b=this.parentPath;if(!e.Node.check(y)){for(;b&&!e.Node.check(b.value);)b=b.parentPath;b&&(b=b.parentPath)}for(;b&&!e.Node.check(b.value);)b=b.parentPath;return b||null},c._computeScope=function(){var y=this.value,b=this.parentPath,P=b&&b.scope;return e.Node.check(y)&&o.isEstablishedBy(y)&&(P=new o(this,P)),P||null},c.getValueProperty=function(y){return s.getFieldValue(this.value,y)},c.needsParens=function(y){var b=this.parentPath;if(!b)return!1;var P=this.value;if(!e.Expression.check(P)||P.type==="Identifier")return!1;for(;!e.Node.check(b.value);)if(b=b.parentPath,!b)return!1;var k=b.value;switch(P.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return k.type==="MemberExpression"&&this.name==="object"&&k.object===P;case"BinaryExpression":case"LogicalExpression":switch(k.type){case"CallExpression":return this.name==="callee"&&k.callee===P;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return this.name==="object"&&k.object===P;case"BinaryExpression":case"LogicalExpression":{let T=P,E=k.operator,A=h[E],L=T.operator,W=h[L];if(A>W)return!0;if(A===W&&this.name==="right"){if(k.right!==T)throw new Error("Nodes must be equal");return!0}}default:return!1}case"SequenceExpression":switch(k.type){case"ForStatement":return!1;case"ExpressionStatement":return this.name!=="expression";default:return!0}case"YieldExpression":switch(k.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"Literal":return k.type==="MemberExpression"&&r.check(P.value)&&this.name==="object"&&k.object===P;case"AssignmentExpression":case"ConditionalExpression":switch(k.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return this.name==="callee"&&k.callee===P;case"ConditionalExpression":return this.name==="test"&&k.test===P;case"MemberExpression":return this.name==="object"&&k.object===P;default:return!1}default:if(k.type==="NewExpression"&&this.name==="callee"&&k.callee===P)return f(P)}return!!(y!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function u(y){return e.BinaryExpression.check(y)||e.LogicalExpression.check(y)}var h={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(y,b){y.forEach(function(P){h[P]=b})});function f(y){return e.CallExpression.check(y)?!0:n.check(y)?y.some(f):e.Node.check(y)?s.someField(y,function(b,P){return f(P)}):!1}c.canBeFirstInStatement=function(){var y=this.node;return!e.FunctionExpression.check(y)&&!e.ObjectExpression.check(y)},c.firstInStatement=function(){return d(this)};function d(y){for(var b,P;y.parent;y=y.parent){if(b=y.node,P=y.parent.node,e.BlockStatement.check(P)&&y.parent.name==="body"&&y.name===0){if(P.body[0]!==b)throw new Error("Nodes must be equal");return!0}if(e.ExpressionStatement.check(P)&&y.name==="expression"){if(P.expression!==b)throw new Error("Nodes must be equal");return!0}if(e.SequenceExpression.check(P)&&y.parent.name==="expressions"&&y.name===0){if(P.expressions[0]!==b)throw new Error("Nodes must be equal");continue}if(e.CallExpression.check(P)&&y.name==="callee"){if(P.callee!==b)throw new Error("Nodes must be equal");continue}if(e.MemberExpression.check(P)&&y.name==="object"){if(P.object!==b)throw new Error("Nodes must be equal");continue}if(e.ConditionalExpression.check(P)&&y.name==="test"){if(P.test!==b)throw new Error("Nodes must be equal");continue}if(u(P)&&y.name==="left"){if(P.left!==b)throw new Error("Nodes must be equal");continue}if(e.UnaryExpression.check(P)&&!P.prefix&&y.name==="argument"){if(P.argument!==b)throw new Error("Nodes must be equal");continue}return!1}return!0}function p(y){if(e.VariableDeclaration.check(y.node)){var b=y.get("declarations").value;if(!b||b.length===0)return y.prune()}else if(e.ExpressionStatement.check(y.node)){if(!y.get("expression").value)return y.prune()}else e.IfStatement.check(y.node)&&g(y);return y}function g(y){var b=y.get("test").value,P=y.get("alternate").value,k=y.get("consequent").value;if(!k&&!P){var T=t.expressionStatement(b);y.replace(T)}else if(!k&&P){var E=t.unaryExpression("!",b,!0);e.UnaryExpression.check(b)&&b.operator==="!"&&(E=b.argument),y.get("test").replace(E),y.get("consequent").replace(P),y.get("alternate").replace()}}return l}q(()=>module);var as=Object.prototype.hasOwnProperty;function yl(i){var s=i.use(G),e=i.use(Tn),t=s.builtInTypes.array,r=s.builtInTypes.object,n=s.builtInTypes.function,a;let o=function p(){if(!(this instanceof p))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=l(this),this._shouldVisitComments=as.call(this._methodNameTable,"Block")||as.call(this._methodNameTable,"Line"),this.Context=f(this),this._visiting=!1,this._changeReported=!1};function l(p){var g=Object.create(null);for(var y in p)/^visit[A-Z]/.test(y)&&(g[y.slice(5)]=!0);for(var b=s.computeSupertypeLookupTable(g),P=Object.create(null),k=Object.keys(b),T=k.length,E=0;E<T;++E){var A=k[E];y="visit"+b[A],n.check(p[y])&&(P[A]=y)}return P}o.fromMethodsObject=function(g){if(g instanceof o)return g;if(!r.check(g))return new o;let y=function P(){if(!(this instanceof P))throw new Error("Visitor constructor cannot be invoked without 'new'");o.call(this)};var b=y.prototype=Object.create(u);return b.constructor=y,c(b,g),c(y,o),n.assert(y.fromMethodsObject),n.assert(y.visit),new y};function c(p,g){for(var y in g)as.call(g,y)&&(p[y]=g[y]);return p}o.visit=function(g,y){return o.fromMethodsObject(y).visit(g)};var u=o.prototype;u.visit=function(){if(this._visiting)throw new Error("Recursively calling visitor.visit(path) resets visitor state. Try this.visit(path) or this.traverse(path) instead.");this._visiting=!0,this._changeReported=!1,this._abortRequested=!1;for(var p=arguments.length,g=new Array(p),y=0;y<p;++y)g[y]=arguments[y];g[0]instanceof e||(g[0]=new e({root:g[0]}).get("root")),this.reset.apply(this,g);var b;try{var P=this.visitWithoutReset(g[0]);b=!0}finally{if(this._visiting=!1,!b&&this._abortRequested)return g[0].value}return P},u.AbortRequest=function(){},u.abort=function(){var p=this;p._abortRequested=!0;var g=new p.AbortRequest;throw g.cancel=function(){p._abortRequested=!1},g},u.reset=function(p){},u.visitWithoutReset=function(p){if(this instanceof this.Context)return this.visitor.visitWithoutReset(p);if(!(p instanceof e))throw new Error("");var g=p.value,y=g&&typeof g=="object"&&typeof g.type=="string"&&this._methodNameTable[g.type];if(y){var b=this.acquireContext(p);try{return b.invokeVisitorMethod(y)}finally{this.releaseContext(b)}}else return h(p,this)};function h(p,g){if(!(p instanceof e))throw new Error("");if(!(g instanceof o))throw new Error("");var y=p.value;if(t.check(y))p.each(g.visitWithoutReset,g);else if(r.check(y)){var b=s.getFieldNames(y);g._shouldVisitComments&&y.comments&&b.indexOf("comments")<0&&b.push("comments");for(var P=b.length,k=[],T=0;T<P;++T){var E=b[T];as.call(y,E)||(y[E]=s.getFieldValue(y,E)),k.push(p.get(E))}for(var T=0;T<P;++T)g.visitWithoutReset(k[T])}return p.value}u.acquireContext=function(p){return this._reusableContextStack.length===0?new this.Context(p):this._reusableContextStack.pop().reset(p)},u.releaseContext=function(p){if(!(p instanceof this.Context))throw new Error("");this._reusableContextStack.push(p),p.currentPath=null},u.reportChanged=function(){this._changeReported=!0},u.wasChangeReported=function(){return this._changeReported};function f(p){function g(b){if(!(this instanceof g))throw new Error("");if(!(this instanceof o))throw new Error("");if(!(b instanceof e))throw new Error("");Object.defineProperty(this,"visitor",{value:p,writable:!1,enumerable:!0,configurable:!1}),this.currentPath=b,this.needToCallTraverse=!0,Object.seal(this)}if(!(p instanceof o))throw new Error("");var y=g.prototype=Object.create(p);return y.constructor=g,c(y,d),g}var d=Object.create(null);return d.reset=function(g){if(!(this instanceof this.Context))throw new Error("");if(!(g instanceof e))throw new Error("");return this.currentPath=g,this.needToCallTraverse=!0,this},d.invokeVisitorMethod=function(g){if(!(this instanceof this.Context))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");var y=this.visitor[g].call(this,this.currentPath);if(y===!1?this.needToCallTraverse=!1:y!==a&&(this.currentPath=this.currentPath.replace(y)[0],this.needToCallTraverse&&this.traverse(this.currentPath)),this.needToCallTraverse!==!1)throw new Error("Must either call this.traverse or return false in "+g);var b=this.currentPath;return b&&b.value},d.traverse=function(g,y){if(!(this instanceof this.Context))throw new Error("");if(!(g instanceof e))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");return this.needToCallTraverse=!1,h(g,o.fromMethodsObject(y||this.visitor))},d.visit=function(g,y){if(!(this instanceof this.Context))throw new Error("");if(!(g instanceof e))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");return this.needToCallTraverse=!1,o.fromMethodsObject(y||this.visitor).visitWithoutReset(g)},d.reportChanged=function(){this.visitor.reportChanged()},d.abort=function(){this.needToCallTraverse=!1,this.visitor.abort()},o}q(()=>module);function gl(i){var s=i.use(G),e=s.getFieldNames,t=s.getFieldValue,r=s.builtInTypes.array,n=s.builtInTypes.object,a=s.builtInTypes.Date,o=s.builtInTypes.RegExp,l=Object.prototype.hasOwnProperty;function c(p,g,y){return r.check(y)?y.length=0:y=null,h(p,g,y)}c.assert=function(p,g){var y=[];if(!c(p,g,y))if(y.length===0){if(p!==g)throw new Error("Nodes must be equal")}else throw new Error("Nodes differ in the following path: "+y.map(u).join(""))};function u(p){return/[_$a-z][_$a-z0-9]*/i.test(p)?"."+p:"["+JSON.stringify(p)+"]"}function h(p,g,y){return p===g?!0:r.check(p)?f(p,g,y):n.check(p)?d(p,g,y):a.check(p)?a.check(g)&&+p==+g:o.check(p)?o.check(g)&&p.source===g.source&&p.global===g.global&&p.multiline===g.multiline&&p.ignoreCase===g.ignoreCase:p==g}function f(p,g,y){r.assert(p);var b=p.length;if(!r.check(g)||g.length!==b)return y&&y.push("length"),!1;for(var P=0;P<b;++P){if(y&&y.push(P),P in p!=P in g||!h(p[P],g[P],y))return!1;if(y){var k=y.pop();if(k!==P)throw new Error(""+k)}}return!0}function d(p,g,y){if(n.assert(p),!n.check(g))return!1;if(p.type!==g.type)return y&&y.push("type"),!1;var b=e(p),P=b.length,k=e(g),T=k.length;if(P===T){for(var E=0;E<P;++E){var A=b[E],L=t(p,A),W=t(g,A);if(y&&y.push(A),!h(L,W,y))return!1;if(y){var ue=y.pop();if(ue!==A)throw new Error(""+ue)}}return!0}if(!y)return!1;var Ae=Object.create(null);for(E=0;E<P;++E)Ae[b[E]]=!0;for(E=0;E<T;++E){if(A=k[E],!l.call(Ae,A))return y.push(A),!1;delete Ae[A]}for(A in Ae){y.push(A);break}return!1}return c}q(()=>module);function xl(i){let s=bl(),e=s.use(G);i.forEach(s.use),e.finalize();let t=s.use(yl);return{Type:e.Type,builtInTypes:e.builtInTypes,namedTypes:e.namedTypes,builders:e.builders,defineMethod:e.defineMethod,getFieldNames:e.getFieldNames,getFieldValue:e.getFieldValue,eachField:e.eachField,someField:e.someField,getSupertypeNames:e.getSupertypeNames,getBuilderName:e.getBuilderName,astNodesAreEquivalent:s.use(gl),finalize:e.finalize,Path:s.use(bn),NodePath:s.use(Tn),PathVisitor:t,use:s.use,visit:t.visit}}function bl(){let i=[],s=[];function e(r){var n=i.indexOf(r);return n===-1&&(n=i.length,i.push(r),s[n]=r(t)),s[n]}var t={use:e};return t}q(()=>module);function Pn(){return{BinaryOperators:["==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof"],AssignmentOperators:["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&="],LogicalOperators:["||","&&"]}}q(()=>module);function Sn(i){let s=i.use(Pn);return s.BinaryOperators.indexOf("**")<0&&s.BinaryOperators.push("**"),s.AssignmentOperators.indexOf("**=")<0&&s.AssignmentOperators.push("**="),s}q(()=>module);function En(i){let s=i.use(Sn);return s.LogicalOperators.indexOf("??")<0&&s.LogicalOperators.push("??"),s}q(()=>module);function Tl(i){let s=i.use(En);return s.LogicalOperators.forEach(e=>{let t=e+"=";s.AssignmentOperators.indexOf(t)<0&&s.AssignmentOperators.push(t)}),s}q(()=>module);function Pl(i){var s=i.use(G),e=s.Type,t=e.def,r=e.or,n=i.use(de),a=n.defaults,o=n.geq;let{BinaryOperators:l,AssignmentOperators:c,LogicalOperators:u}=i.use(Pn);t("Printable").field("loc",r(t("SourceLocation"),null),a.null,!0),t("Node").bases("Printable").field("type",String).field("comments",r([t("Comment")],null),a.null,!0),t("SourceLocation").field("start",t("Position")).field("end",t("Position")).field("source",r(String,null),a.null),t("Position").field("line",o(1)).field("column",o(0)),t("File").bases("Node").build("program","name").field("program",t("Program")).field("name",r(String,null),a.null),t("Program").bases("Node").build("body").field("body",[t("Statement")]),t("Function").bases("Node").field("id",r(t("Identifier"),null),a.null).field("params",[t("Pattern")]).field("body",t("BlockStatement")).field("generator",Boolean,a.false).field("async",Boolean,a.false),t("Statement").bases("Node"),t("EmptyStatement").bases("Statement").build(),t("BlockStatement").bases("Statement").build("body").field("body",[t("Statement")]),t("ExpressionStatement").bases("Statement").build("expression").field("expression",t("Expression")),t("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",t("Expression")).field("consequent",t("Statement")).field("alternate",r(t("Statement"),null),a.null),t("LabeledStatement").bases("Statement").build("label","body").field("label",t("Identifier")).field("body",t("Statement")),t("BreakStatement").bases("Statement").build("label").field("label",r(t("Identifier"),null),a.null),t("ContinueStatement").bases("Statement").build("label").field("label",r(t("Identifier"),null),a.null),t("WithStatement").bases("Statement").build("object","body").field("object",t("Expression")).field("body",t("Statement")),t("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",t("Expression")).field("cases",[t("SwitchCase")]).field("lexical",Boolean,a.false),t("ReturnStatement").bases("Statement").build("argument").field("argument",r(t("Expression"),null)),t("ThrowStatement").bases("Statement").build("argument").field("argument",t("Expression")),t("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",t("BlockStatement")).field("handler",r(t("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[t("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[t("CatchClause")],a.emptyArray).field("finalizer",r(t("BlockStatement"),null),a.null),t("CatchClause").bases("Node").build("param","guard","body").field("param",t("Pattern")).field("guard",r(t("Expression"),null),a.null).field("body",t("BlockStatement")),t("WhileStatement").bases("Statement").build("test","body").field("test",t("Expression")).field("body",t("Statement")),t("DoWhileStatement").bases("Statement").build("body","test").field("body",t("Statement")).field("test",t("Expression")),t("ForStatement").bases("Statement").build("init","test","update","body").field("init",r(t("VariableDeclaration"),t("Expression"),null)).field("test",r(t("Expression"),null)).field("update",r(t("Expression"),null)).field("body",t("Statement")),t("ForInStatement").bases("Statement").build("left","right","body").field("left",r(t("VariableDeclaration"),t("Expression"))).field("right",t("Expression")).field("body",t("Statement")),t("DebuggerStatement").bases("Statement").build(),t("Declaration").bases("Statement"),t("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",t("Identifier")),t("FunctionExpression").bases("Function","Expression").build("id","params","body"),t("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",r("var","let","const")).field("declarations",[t("VariableDeclarator")]),t("VariableDeclarator").bases("Node").build("id","init").field("id",t("Pattern")).field("init",r(t("Expression"),null),a.null),t("Expression").bases("Node"),t("ThisExpression").bases("Expression").build(),t("ArrayExpression").bases("Expression").build("elements").field("elements",[r(t("Expression"),null)]),t("ObjectExpression").bases("Expression").build("properties").field("properties",[t("Property")]),t("Property").bases("Node").build("kind","key","value").field("kind",r("init","get","set")).field("key",r(t("Literal"),t("Identifier"))).field("value",t("Expression")),t("SequenceExpression").bases("Expression").build("expressions").field("expressions",[t("Expression")]);var h=r("-","+","!","~","typeof","void","delete");t("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",h).field("argument",t("Expression")).field("prefix",Boolean,a.true);let f=r(...l);t("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",f).field("left",t("Expression")).field("right",t("Expression"));let d=r(...c);t("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",d).field("left",r(t("Pattern"),t("MemberExpression"))).field("right",t("Expression"));var p=r("++","--");t("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",p).field("argument",t("Expression")).field("prefix",Boolean);var g=r(...u);t("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",g).field("left",t("Expression")).field("right",t("Expression")),t("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",t("Expression")).field("consequent",t("Expression")).field("alternate",t("Expression")),t("NewExpression").bases("Expression").build("callee","arguments").field("callee",t("Expression")).field("arguments",[t("Expression")]),t("CallExpression").bases("Expression").build("callee","arguments").field("callee",t("Expression")).field("arguments",[t("Expression")]),t("MemberExpression").bases("Expression").build("object","property","computed").field("object",t("Expression")).field("property",r(t("Identifier"),t("Expression"))).field("computed",Boolean,function(){var y=this.property.type;return y==="Literal"||y==="MemberExpression"||y==="BinaryExpression"}),t("Pattern").bases("Node"),t("SwitchCase").bases("Node").build("test","consequent").field("test",r(t("Expression"),null)).field("consequent",[t("Statement")]),t("Identifier").bases("Expression","Pattern").build("name").field("name",String).field("optional",Boolean,a.false),t("Literal").bases("Expression").build("value").field("value",r(String,Boolean,null,Number,RegExp,BigInt)),t("Comment").bases("Printable").field("value",String).field("leading",Boolean,a.true).field("trailing",Boolean,a.false)}q(()=>module);function Sl(i){i.use(Pl);let s=i.use(G),e=s.Type.def,t=s.Type.or,r=i.use(de).defaults;e("Function").field("generator",Boolean,r.false).field("expression",Boolean,r.false).field("defaults",[t(e("Expression"),null)],r.emptyArray).field("rest",t(e("Identifier"),null),r.null),e("RestElement").bases("Pattern").build("argument").field("argument",e("Pattern")).field("typeAnnotation",t(e("TypeAnnotation"),e("TSTypeAnnotation"),null),r.null),e("SpreadElementPattern").bases("Pattern").build("argument").field("argument",e("Pattern")),e("FunctionDeclaration").build("id","params","body","generator","expression").field("id",t(e("Identifier"),null)),e("FunctionExpression").build("id","params","body","generator","expression"),e("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,r.null).field("body",t(e("BlockStatement"),e("Expression"))).field("generator",!1,r.false),e("ForOfStatement").bases("Statement").build("left","right","body").field("left",t(e("VariableDeclaration"),e("Pattern"))).field("right",e("Expression")).field("body",e("Statement")),e("YieldExpression").bases("Expression").build("argument","delegate").field("argument",t(e("Expression"),null)).field("delegate",Boolean,r.false),e("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",e("Expression")).field("blocks",[e("ComprehensionBlock")]).field("filter",t(e("Expression"),null)),e("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",e("Expression")).field("blocks",[e("ComprehensionBlock")]).field("filter",t(e("Expression"),null)),e("ComprehensionBlock").bases("Node").build("left","right","each").field("left",e("Pattern")).field("right",e("Expression")).field("each",Boolean),e("Property").field("key",t(e("Literal"),e("Identifier"),e("Expression"))).field("value",t(e("Expression"),e("Pattern"))).field("method",Boolean,r.false).field("shorthand",Boolean,r.false).field("computed",Boolean,r.false),e("ObjectProperty").field("shorthand",Boolean,r.false),e("PropertyPattern").bases("Pattern").build("key","pattern").field("key",t(e("Literal"),e("Identifier"),e("Expression"))).field("pattern",e("Pattern")).field("computed",Boolean,r.false),e("ObjectPattern").bases("Pattern").build("properties").field("properties",[t(e("PropertyPattern"),e("Property"))]),e("ArrayPattern").bases("Pattern").build("elements").field("elements",[t(e("Pattern"),null)]),e("SpreadElement").bases("Node").build("argument").field("argument",e("Expression")),e("ArrayExpression").field("elements",[t(e("Expression"),e("SpreadElement"),e("RestElement"),null)]),e("NewExpression").field("arguments",[t(e("Expression"),e("SpreadElement"))]),e("CallExpression").field("arguments",[t(e("Expression"),e("SpreadElement"))]),e("AssignmentPattern").bases("Pattern").build("left","right").field("left",e("Pattern")).field("right",e("Expression")),e("MethodDefinition").bases("Declaration").build("kind","key","value","static").field("kind",t("constructor","method","get","set")).field("key",e("Expression")).field("value",e("Function")).field("computed",Boolean,r.false).field("static",Boolean,r.false);let n=t(e("MethodDefinition"),e("VariableDeclarator"),e("ClassPropertyDefinition"),e("ClassProperty"),e("StaticBlock"));e("ClassProperty").bases("Declaration").build("key").field("key",t(e("Literal"),e("Identifier"),e("Expression"))).field("computed",Boolean,r.false),e("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",n),e("ClassBody").bases("Declaration").build("body").field("body",[n]),e("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",t(e("Identifier"),null)).field("body",e("ClassBody")).field("superClass",t(e("Expression"),null),r.null),e("ClassExpression").bases("Expression").build("id","body","superClass").field("id",t(e("Identifier"),null),r.null).field("body",e("ClassBody")).field("superClass",t(e("Expression"),null),r.null),e("Super").bases("Expression").build(),e("Specifier").bases("Node"),e("ModuleSpecifier").bases("Specifier").field("local",t(e("Identifier"),null),r.null).field("id",t(e("Identifier"),null),r.null).field("name",t(e("Identifier"),null),r.null),e("ImportSpecifier").bases("ModuleSpecifier").build("imported","local").field("imported",e("Identifier")),e("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local"),e("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local"),e("ImportDeclaration").bases("Declaration").build("specifiers","source","importKind").field("specifiers",[t(e("ImportSpecifier"),e("ImportNamespaceSpecifier"),e("ImportDefaultSpecifier"))],r.emptyArray).field("source",e("Literal")).field("importKind",t("value","type"),function(){return"value"}),e("ExportNamedDeclaration").bases("Declaration").build("declaration","specifiers","source").field("declaration",t(e("Declaration"),null)).field("specifiers",[e("ExportSpecifier")],r.emptyArray).field("source",t(e("Literal"),null),r.null),e("ExportSpecifier").bases("ModuleSpecifier").build("local","exported").field("exported",e("Identifier")),e("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",t(e("Declaration"),e("Expression"))),e("ExportAllDeclaration").bases("Declaration").build("source").field("source",e("Literal")),e("TaggedTemplateExpression").bases("Expression").build("tag","quasi").field("tag",e("Expression")).field("quasi",e("TemplateLiteral")),e("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[e("TemplateElement")]).field("expressions",[e("Expression")]),e("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:String,raw:String}).field("tail",Boolean),e("MetaProperty").bases("Expression").build("meta","property").field("meta",e("Identifier")).field("property",e("Identifier"))}q(()=>module);function El(i){i.use(Sn),i.use(Sl)}q(()=>module);function Al(i){i.use(El);let e=i.use(G).Type.def,t=i.use(de).defaults;e("Function").field("async",Boolean,t.false),e("AwaitExpression").bases("Expression").build("argument").field("argument",e("Expression"))}q(()=>module);function wl(i){i.use(Al);let s=i.use(G),e=s.Type.def,t=s.Type.or,r=i.use(de).defaults;e("ForOfStatement").field("await",Boolean,r.false),e("SpreadProperty").bases("Node").build("argument").field("argument",e("Expression")),e("ObjectExpression").field("properties",[t(e("Property"),e("SpreadProperty"),e("SpreadElement"))]),e("TemplateElement").field("value",{cooked:t(String,null),raw:String}),e("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",e("Pattern")),e("ObjectPattern").field("properties",[t(e("PropertyPattern"),e("Property"),e("RestElement"),e("SpreadPropertyPattern"))])}q(()=>module);function vl(i){i.use(wl);let s=i.use(G),e=s.Type.def,t=s.Type.or,r=i.use(de).defaults;e("CatchClause").field("param",t(e("Pattern"),null),r.null)}q(()=>module);function Cl(i){i.use(En),i.use(vl);let s=i.use(G),e=s.Type.def,t=s.Type.or,n=i.use(de).defaults;e("ImportExpression").bases("Expression").build("source").field("source",e("Expression")),e("ExportAllDeclaration").bases("Declaration").build("source","exported").field("source",e("Literal")).field("exported",t(e("Identifier"),null,void 0),n.null),e("ChainElement").bases("Node").field("optional",Boolean,n.false),e("CallExpression").bases("Expression","ChainElement"),e("MemberExpression").bases("Expression","ChainElement"),e("ChainExpression").bases("Expression").build("expression").field("expression",e("ChainElement")),e("OptionalCallExpression").bases("CallExpression").build("callee","arguments","optional").field("optional",Boolean,n.true),e("OptionalMemberExpression").bases("MemberExpression").build("object","property","computed","optional").field("optional",Boolean,n.true)}q(()=>module);function Il(i){i.use(Tl),i.use(Cl)}q(()=>module);function Nl(i){i.use(Il);let e=i.use(G).Type.def;e("StaticBlock").bases("Declaration").build("body").field("body",[e("Statement")])}q(()=>module);function qt(i){i.use(Nl);let s=i.use(G),e=s.Type,t=s.Type.def,r=e.or,a=i.use(de).defaults;t("AwaitExpression").build("argument","all").field("argument",r(t("Expression"),null)).field("all",Boolean,a.false),t("Decorator").bases("Node").build("expression").field("expression",t("Expression")),t("Property").field("decorators",r([t("Decorator")],null),a.null),t("MethodDefinition").field("decorators",r([t("Decorator")],null),a.null),t("PrivateName").bases("Expression","Pattern").build("id").field("id",t("Identifier")),t("ClassPrivateProperty").bases("ClassProperty").build("key","value").field("key",t("PrivateName")).field("value",r(t("Expression"),null),a.null),t("ImportAttribute").bases("Node").build("key","value").field("key",r(t("Identifier"),t("Literal"))).field("value",t("Expression")),["ImportDeclaration","ExportAllDeclaration","ExportNamedDeclaration"].forEach(o=>{t(o).field("assertions",[t("ImportAttribute")],a.emptyArray)}),t("RecordExpression").bases("Expression").build("properties").field("properties",[r(t("ObjectProperty"),t("ObjectMethod"),t("SpreadElement"))]),t("TupleExpression").bases("Expression").build("elements").field("elements",[r(t("Expression"),t("SpreadElement"),null)]),t("ModuleExpression").bases("Node").build("body").field("body",t("Program"))}q(()=>module);function kl(i){i.use(qt);let s=i.use(G),e=s.Type.def,t=s.Type.or,r=i.use(de).defaults;e("JSXAttribute").bases("Node").build("name","value").field("name",t(e("JSXIdentifier"),e("JSXNamespacedName"))).field("value",t(e("Literal"),e("JSXExpressionContainer"),e("JSXElement"),e("JSXFragment"),null),r.null),e("JSXIdentifier").bases("Identifier").build("name").field("name",String),e("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",e("JSXIdentifier")).field("name",e("JSXIdentifier")),e("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",t(e("JSXIdentifier"),e("JSXMemberExpression"))).field("property",e("JSXIdentifier")).field("computed",Boolean,r.false);let n=t(e("JSXIdentifier"),e("JSXNamespacedName"),e("JSXMemberExpression"));e("JSXSpreadAttribute").bases("Node").build("argument").field("argument",e("Expression"));let a=[t(e("JSXAttribute"),e("JSXSpreadAttribute"))];e("JSXExpressionContainer").bases("Expression").build("expression").field("expression",t(e("Expression"),e("JSXEmptyExpression")));let o=[t(e("JSXText"),e("JSXExpressionContainer"),e("JSXSpreadChild"),e("JSXElement"),e("JSXFragment"),e("Literal"))];e("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",e("JSXOpeningElement")).field("closingElement",t(e("JSXClosingElement"),null),r.null).field("children",o,r.emptyArray).field("name",n,function(){return this.openingElement.name},!0).field("selfClosing",Boolean,function(){return this.openingElement.selfClosing},!0).field("attributes",a,function(){return this.openingElement.attributes},!0),e("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",n).field("attributes",a,r.emptyArray).field("selfClosing",Boolean,r.false),e("JSXClosingElement").bases("Node").build("name").field("name",n),e("JSXFragment").bases("Expression").build("openingFragment","closingFragment","children").field("openingFragment",e("JSXOpeningFragment")).field("closingFragment",e("JSXClosingFragment")).field("children",o,r.emptyArray),e("JSXOpeningFragment").bases("Node").build(),e("JSXClosingFragment").bases("Node").build(),e("JSXText").bases("Literal").build("value","raw").field("value",String).field("raw",String,function(){return this.value}),e("JSXEmptyExpression").bases("Node").build(),e("JSXSpreadChild").bases("Node").build("expression").field("expression",e("Expression"))}q(()=>module);function An(i){var s=i.use(G),e=s.Type.def,t=s.Type.or,r=i.use(de).defaults,n=t(e("TypeAnnotation"),e("TSTypeAnnotation"),null),a=t(e("TypeParameterDeclaration"),e("TSTypeParameterDeclaration"),null);e("Identifier").field("typeAnnotation",n,r.null),e("ObjectPattern").field("typeAnnotation",n,r.null),e("Function").field("returnType",n,r.null).field("typeParameters",a,r.null),e("ClassProperty").build("key","value","typeAnnotation","static").field("value",t(e("Expression"),null)).field("static",Boolean,r.false).field("typeAnnotation",n,r.null),["ClassDeclaration","ClassExpression"].forEach(o=>{e(o).field("typeParameters",a,r.null).field("superTypeParameters",t(e("TypeParameterInstantiation"),e("TSTypeParameterInstantiation"),null),r.null).field("implements",t([e("ClassImplements")],[e("TSExpressionWithTypeArguments")]),r.emptyArray)})}q(()=>module);function wn(i){i.use(qt),i.use(An);let s=i.use(G),e=s.Type.def,t=s.Type.or,r=i.use(de).defaults;e("Flow").bases("Node"),e("FlowType").bases("Flow"),e("AnyTypeAnnotation").bases("FlowType").build(),e("EmptyTypeAnnotation").bases("FlowType").build(),e("MixedTypeAnnotation").bases("FlowType").build(),e("VoidTypeAnnotation").bases("FlowType").build(),e("SymbolTypeAnnotation").bases("FlowType").build(),e("NumberTypeAnnotation").bases("FlowType").build(),e("BigIntTypeAnnotation").bases("FlowType").build(),e("NumberLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),e("NumericLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),e("BigIntLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",null).field("raw",String),e("StringTypeAnnotation").bases("FlowType").build(),e("StringLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",String).field("raw",String),e("BooleanTypeAnnotation").bases("FlowType").build(),e("BooleanLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Boolean).field("raw",String),e("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",e("FlowType")),e("NullableTypeAnnotation").bases("FlowType").build("typeAnnotation").field("typeAnnotation",e("FlowType")),e("NullLiteralTypeAnnotation").bases("FlowType").build(),e("NullTypeAnnotation").bases("FlowType").build(),e("ThisTypeAnnotation").bases("FlowType").build(),e("ExistsTypeAnnotation").bases("FlowType").build(),e("ExistentialTypeParam").bases("FlowType").build(),e("FunctionTypeAnnotation").bases("FlowType").build("params","returnType","rest","typeParameters").field("params",[e("FunctionTypeParam")]).field("returnType",e("FlowType")).field("rest",t(e("FunctionTypeParam"),null)).field("typeParameters",t(e("TypeParameterDeclaration"),null)),e("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",t(e("Identifier"),null)).field("typeAnnotation",e("FlowType")).field("optional",Boolean),e("ArrayTypeAnnotation").bases("FlowType").build("elementType").field("elementType",e("FlowType")),e("ObjectTypeAnnotation").bases("FlowType").build("properties","indexers","callProperties").field("properties",[t(e("ObjectTypeProperty"),e("ObjectTypeSpreadProperty"))]).field("indexers",[e("ObjectTypeIndexer")],r.emptyArray).field("callProperties",[e("ObjectTypeCallProperty")],r.emptyArray).field("inexact",t(Boolean,void 0),r.undefined).field("exact",Boolean,r.false).field("internalSlots",[e("ObjectTypeInternalSlot")],r.emptyArray),e("Variance").bases("Node").build("kind").field("kind",t("plus","minus"));let n=t(e("Variance"),"plus","minus",null);e("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",t(e("Literal"),e("Identifier"))).field("value",e("FlowType")).field("optional",Boolean).field("variance",n,r.null),e("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",e("Identifier")).field("key",e("FlowType")).field("value",e("FlowType")).field("variance",n,r.null).field("static",Boolean,r.false),e("ObjectTypeCallProperty").bases("Node").build("value").field("value",e("FunctionTypeAnnotation")).field("static",Boolean,r.false),e("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",t(e("Identifier"),e("QualifiedTypeIdentifier"))).field("id",e("Identifier")),e("GenericTypeAnnotation").bases("FlowType").build("id","typeParameters").field("id",t(e("Identifier"),e("QualifiedTypeIdentifier"))).field("typeParameters",t(e("TypeParameterInstantiation"),null)),e("MemberTypeAnnotation").bases("FlowType").build("object","property").field("object",e("Identifier")).field("property",t(e("MemberTypeAnnotation"),e("GenericTypeAnnotation"))),e("IndexedAccessType").bases("FlowType").build("objectType","indexType").field("objectType",e("FlowType")).field("indexType",e("FlowType")),e("OptionalIndexedAccessType").bases("FlowType").build("objectType","indexType","optional").field("objectType",e("FlowType")).field("indexType",e("FlowType")).field("optional",Boolean),e("UnionTypeAnnotation").bases("FlowType").build("types").field("types",[e("FlowType")]),e("IntersectionTypeAnnotation").bases("FlowType").build("types").field("types",[e("FlowType")]),e("TypeofTypeAnnotation").bases("FlowType").build("argument").field("argument",e("FlowType")),e("ObjectTypeSpreadProperty").bases("Node").build("argument").field("argument",e("FlowType")),e("ObjectTypeInternalSlot").bases("Node").build("id","value","optional","static","method").field("id",e("Identifier")).field("value",e("FlowType")).field("optional",Boolean).field("static",Boolean).field("method",Boolean),e("TypeParameterDeclaration").bases("Node").build("params").field("params",[e("TypeParameter")]),e("TypeParameterInstantiation").bases("Node").build("params").field("params",[e("FlowType")]),e("TypeParameter").bases("FlowType").build("name","variance","bound","default").field("name",String).field("variance",n,r.null).field("bound",t(e("TypeAnnotation"),null),r.null).field("default",t(e("FlowType"),null),r.null),e("ClassProperty").field("variance",n,r.null),e("ClassImplements").bases("Node").build("id").field("id",e("Identifier")).field("superClass",t(e("Expression"),null),r.null).field("typeParameters",t(e("TypeParameterInstantiation"),null),r.null),e("InterfaceTypeAnnotation").bases("FlowType").build("body","extends").field("body",e("ObjectTypeAnnotation")).field("extends",t([e("InterfaceExtends")],null),r.null),e("InterfaceDeclaration").bases("Declaration").build("id","body","extends").field("id",e("Identifier")).field("typeParameters",t(e("TypeParameterDeclaration"),null),r.null).field("body",e("ObjectTypeAnnotation")).field("extends",[e("InterfaceExtends")]),e("DeclareInterface").bases("InterfaceDeclaration").build("id","body","extends"),e("InterfaceExtends").bases("Node").build("id").field("id",e("Identifier")).field("typeParameters",t(e("TypeParameterInstantiation"),null),r.null),e("TypeAlias").bases("Declaration").build("id","typeParameters","right").field("id",e("Identifier")).field("typeParameters",t(e("TypeParameterDeclaration"),null)).field("right",e("FlowType")),e("DeclareTypeAlias").bases("TypeAlias").build("id","typeParameters","right"),e("OpaqueType").bases("Declaration").build("id","typeParameters","impltype","supertype").field("id",e("Identifier")).field("typeParameters",t(e("TypeParameterDeclaration"),null)).field("impltype",e("FlowType")).field("supertype",t(e("FlowType"),null)),e("DeclareOpaqueType").bases("OpaqueType").build("id","typeParameters","supertype").field("impltype",t(e("FlowType"),null)),e("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",e("Expression")).field("typeAnnotation",e("TypeAnnotation")),e("TupleTypeAnnotation").bases("FlowType").build("types").field("types",[e("FlowType")]),e("DeclareVariable").bases("Statement").build("id").field("id",e("Identifier")),e("DeclareFunction").bases("Statement").build("id").field("id",e("Identifier")).field("predicate",t(e("FlowPredicate"),null),r.null),e("DeclareClass").bases("InterfaceDeclaration").build("id"),e("DeclareModule").bases("Statement").build("id","body").field("id",t(e("Identifier"),e("Literal"))).field("body",e("BlockStatement")),e("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation",e("TypeAnnotation")),e("DeclareExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",t(e("DeclareVariable"),e("DeclareFunction"),e("DeclareClass"),e("FlowType"),e("TypeAlias"),e("DeclareOpaqueType"),e("InterfaceDeclaration"),null)).field("specifiers",[t(e("ExportSpecifier"),e("ExportBatchSpecifier"))],r.emptyArray).field("source",t(e("Literal"),null),r.null),e("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source",t(e("Literal"),null),r.null),e("ImportDeclaration").field("importKind",t("value","type","typeof"),()=>"value"),e("FlowPredicate").bases("Flow"),e("InferredPredicate").bases("FlowPredicate").build(),e("DeclaredPredicate").bases("FlowPredicate").build("value").field("value",e("Expression")),e("Function").field("predicate",t(e("FlowPredicate"),null),r.null),e("CallExpression").field("typeArguments",t(null,e("TypeParameterInstantiation")),r.null),e("NewExpression").field("typeArguments",t(null,e("TypeParameterInstantiation")),r.null),e("EnumDeclaration").bases("Declaration").build("id","body").field("id",e("Identifier")).field("body",t(e("EnumBooleanBody"),e("EnumNumberBody"),e("EnumStringBody"),e("EnumSymbolBody"))),e("EnumBooleanBody").build("members","explicitType").field("members",[e("EnumBooleanMember")]).field("explicitType",Boolean),e("EnumNumberBody").build("members","explicitType").field("members",[e("EnumNumberMember")]).field("explicitType",Boolean),e("EnumStringBody").build("members","explicitType").field("members",t([e("EnumStringMember")],[e("EnumDefaultedMember")])).field("explicitType",Boolean),e("EnumSymbolBody").build("members").field("members",[e("EnumDefaultedMember")]),e("EnumBooleanMember").build("id","init").field("id",e("Identifier")).field("init",t(e("Literal"),Boolean)),e("EnumNumberMember").build("id","init").field("id",e("Identifier")).field("init",e("Literal")),e("EnumStringMember").build("id","init").field("id",e("Identifier")).field("init",e("Literal")),e("EnumDefaultedMember").build("id").field("id",e("Identifier"))}q(()=>module);function Ll(i){i.use(qt);var s=i.use(G),e=i.use(de).defaults,t=s.Type.def,r=s.Type.or;t("VariableDeclaration").field("declarations",[r(t("VariableDeclarator"),t("Identifier"))]),t("Property").field("value",r(t("Expression"),t("Pattern"))),t("ArrayPattern").field("elements",[r(t("Pattern"),t("SpreadElement"),null)]),t("ObjectPattern").field("properties",[r(t("Property"),t("PropertyPattern"),t("SpreadPropertyPattern"),t("SpreadProperty"))]),t("ExportSpecifier").bases("ModuleSpecifier").build("id","name"),t("ExportBatchSpecifier").bases("Specifier").build(),t("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",r(t("Declaration"),t("Expression"),null)).field("specifiers",[r(t("ExportSpecifier"),t("ExportBatchSpecifier"))],e.emptyArray).field("source",r(t("Literal"),null),e.null),t("Block").bases("Comment").build("value","leading","trailing"),t("Line").bases("Comment").build("value","leading","trailing")}q(()=>module);function vn(i){i.use(qt);let s=i.use(G),e=i.use(de).defaults,t=s.Type.def,r=s.Type.or,{undefined:n}=s.builtInTypes;t("Noop").bases("Statement").build(),t("DoExpression").bases("Expression").build("body").field("body",[t("Statement")]),t("BindExpression").bases("Expression").build("object","callee").field("object",r(t("Expression"),null)).field("callee",t("Expression")),t("ParenthesizedExpression").bases("Expression").build("expression").field("expression",t("Expression")),t("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported",t("Identifier")),t("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported",t("Identifier")),t("CommentBlock").bases("Comment").build("value","leading","trailing"),t("CommentLine").bases("Comment").build("value","leading","trailing"),t("Directive").bases("Node").build("value").field("value",t("DirectiveLiteral")),t("DirectiveLiteral").bases("Node","Expression").build("value").field("value",String,e["use strict"]),t("InterpreterDirective").bases("Node").build("value").field("value",String),t("BlockStatement").bases("Statement").build("body").field("body",[t("Statement")]).field("directives",[t("Directive")],e.emptyArray),t("Program").bases("Node").build("body").field("body",[t("Statement")]).field("directives",[t("Directive")],e.emptyArray).field("interpreter",r(t("InterpreterDirective"),null),e.null);function a(u=String,h){return["extra",{rawValue:u,raw:String},function(){let d=s.getFieldValue(this,"value");return{rawValue:d,raw:h?h(d):String(d)}}]}t("StringLiteral").bases("Literal").build("value").field("value",String).field(...a(String,u=>JSON.stringify(u))),t("NumericLiteral").bases("Literal").build("value").field("value",Number).field("raw",r(String,null),e.null).field(...a(Number)),t("BigIntLiteral").bases("Literal").build("value").field("value",r(String,Number)).field(...a(String,u=>u+"n")),t("DecimalLiteral").bases("Literal").build("value").field("value",String).field(...a(String,u=>u+"m")),t("NullLiteral").bases("Literal").build().field("value",null,e.null),t("BooleanLiteral").bases("Literal").build("value").field("value",Boolean),t("RegExpLiteral").bases("Literal").build("pattern","flags").field("pattern",String).field("flags",String).field("value",RegExp,function(){return new RegExp(this.pattern,this.flags)}).field(...a(r(RegExp,n),u=>`/${u.pattern}/${u.flags||""}`)).field("regex",{pattern:String,flags:String},function(){return{pattern:this.pattern,flags:this.flags}});var o=r(t("Property"),t("ObjectMethod"),t("ObjectProperty"),t("SpreadProperty"),t("SpreadElement"));t("ObjectExpression").bases("Expression").build("properties").field("properties",[o]),t("ObjectMethod").bases("Node","Function").build("kind","key","params","body","computed").field("kind",r("method","get","set")).field("key",r(t("Literal"),t("Identifier"),t("Expression"))).field("params",[t("Pattern")]).field("body",t("BlockStatement")).field("computed",Boolean,e.false).field("generator",Boolean,e.false).field("async",Boolean,e.false).field("accessibility",r(t("Literal"),null),e.null).field("decorators",r([t("Decorator")],null),e.null),t("ObjectProperty").bases("Node").build("key","value").field("key",r(t("Literal"),t("Identifier"),t("Expression"))).field("value",r(t("Expression"),t("Pattern"))).field("accessibility",r(t("Literal"),null),e.null).field("computed",Boolean,e.false);var l=r(t("MethodDefinition"),t("VariableDeclarator"),t("ClassPropertyDefinition"),t("ClassProperty"),t("ClassPrivateProperty"),t("ClassMethod"),t("ClassPrivateMethod"),t("ClassAccessorProperty"),t("StaticBlock"));t("ClassBody").bases("Declaration").build("body").field("body",[l]),t("ClassMethod").bases("Declaration","Function").build("kind","key","params","body","computed","static").field("key",r(t("Literal"),t("Identifier"),t("Expression"))),t("ClassPrivateMethod").bases("Declaration","Function").build("key","params","body","kind","computed","static").field("key",t("PrivateName")),t("ClassAccessorProperty").bases("Declaration").build("key","value","decorators","computed","static").field("key",r(t("Literal"),t("Identifier"),t("PrivateName"),t("Expression"))).field("value",r(t("Expression"),null),e.null),["ClassMethod","ClassPrivateMethod"].forEach(u=>{t(u).field("kind",r("get","set","method","constructor"),()=>"method").field("body",t("BlockStatement")).field("access",r("public","private","protected",null),e.null)}),["ClassMethod","ClassPrivateMethod","ClassAccessorProperty"].forEach(u=>{t(u).field("computed",Boolean,e.false).field("static",Boolean,e.false).field("abstract",Boolean,e.false).field("accessibility",r("public","private","protected",null),e.null).field("decorators",r([t("Decorator")],null),e.null).field("definite",Boolean,e.false).field("optional",Boolean,e.false).field("override",Boolean,e.false).field("readonly",Boolean,e.false)});var c=r(t("Property"),t("PropertyPattern"),t("SpreadPropertyPattern"),t("SpreadProperty"),t("ObjectProperty"),t("RestProperty"),t("RestElement"));t("ObjectPattern").bases("Pattern").build("properties").field("properties",[c]).field("decorators",r([t("Decorator")],null),e.null),t("SpreadProperty").bases("Node").build("argument").field("argument",t("Expression")),t("RestProperty").bases("Node").build("argument").field("argument",t("Expression")),t("ForAwaitStatement").bases("Statement").build("left","right","body").field("left",r(t("VariableDeclaration"),t("Expression"))).field("right",t("Expression")).field("body",t("Statement")),t("Import").bases("Expression").build()}q(()=>module);function Dl(i){let e=i.use(G).Type.def;i.use(vn),i.use(wn),e("V8IntrinsicIdentifier").bases("Expression").build("name").field("name",String),e("TopicReference").bases("Expression").build()}q(()=>module);function Ol(i){i.use(vn),i.use(An);var s=i.use(G),e=s.namedTypes,t=s.Type.def,r=s.Type.or,n=i.use(de).defaults,a=s.Type.from(function(u,h){return!!(e.StringLiteral&&e.StringLiteral.check(u,h)||e.Literal&&e.Literal.check(u,h)&&typeof u.value=="string")},"StringLiteral");t("TSType").bases("Node");var o=r(t("Identifier"),t("TSQualifiedName"));t("TSTypeReference").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("typeName","typeParameters").field("typeName",o),t("TSHasOptionalTypeParameterInstantiation").field("typeParameters",r(t("TSTypeParameterInstantiation"),null),n.null),t("TSHasOptionalTypeParameters").field("typeParameters",r(t("TSTypeParameterDeclaration"),null,void 0),n.null),t("TSHasOptionalTypeAnnotation").field("typeAnnotation",r(t("TSTypeAnnotation"),null),n.null),t("TSQualifiedName").bases("Node").build("left","right").field("left",o).field("right",o),t("TSAsExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",t("Expression")).field("typeAnnotation",t("TSType")).field("extra",r({parenthesized:Boolean},null),n.null),t("TSTypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",t("Expression")).field("typeAnnotation",t("TSType")),t("TSSatisfiesExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",t("Expression")).field("typeAnnotation",t("TSType")),t("TSNonNullExpression").bases("Expression","Pattern").build("expression").field("expression",t("Expression")),["TSAnyKeyword","TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword","TSIntrinsicKeyword","TSThisType"].forEach(u=>{t(u).bases("TSType").build()}),t("TSArrayType").bases("TSType").build("elementType").field("elementType",t("TSType")),t("TSLiteralType").bases("TSType").build("literal").field("literal",r(t("NumericLiteral"),t("StringLiteral"),t("BooleanLiteral"),t("TemplateLiteral"),t("UnaryExpression"),t("BigIntLiteral"))),t("TemplateLiteral").field("expressions",r([t("Expression")],[t("TSType")])),["TSUnionType","TSIntersectionType"].forEach(u=>{t(u).bases("TSType").build("types").field("types",[t("TSType")])}),t("TSConditionalType").bases("TSType").build("checkType","extendsType","trueType","falseType").field("checkType",t("TSType")).field("extendsType",t("TSType")).field("trueType",t("TSType")).field("falseType",t("TSType")),t("TSInferType").bases("TSType").build("typeParameter").field("typeParameter",t("TSTypeParameter")),t("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation",t("TSType"));var l=[r(t("Identifier"),t("RestElement"),t("ArrayPattern"),t("ObjectPattern"))];["TSFunctionType","TSConstructorType"].forEach(u=>{t(u).bases("TSType","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters").field("parameters",l)}),t("TSDeclareFunction").bases("Declaration","TSHasOptionalTypeParameters").build("id","params","returnType").field("declare",Boolean,n.false).field("async",Boolean,n.false).field("generator",Boolean,n.false).field("id",r(t("Identifier"),null),n.null).field("params",[t("Pattern")]).field("returnType",r(t("TSTypeAnnotation"),t("Noop"),null),n.null),t("TSDeclareMethod").bases("Declaration","TSHasOptionalTypeParameters").build("key","params","returnType").field("async",Boolean,n.false).field("generator",Boolean,n.false).field("params",[t("Pattern")]).field("abstract",Boolean,n.false).field("accessibility",r("public","private","protected",void 0),n.undefined).field("static",Boolean,n.false).field("computed",Boolean,n.false).field("optional",Boolean,n.false).field("key",r(t("Identifier"),t("StringLiteral"),t("NumericLiteral"),t("Expression"))).field("kind",r("get","set","method","constructor"),function(){return"method"}).field("access",r("public","private","protected",void 0),n.undefined).field("decorators",r([t("Decorator")],null),n.null).field("returnType",r(t("TSTypeAnnotation"),t("Noop"),null),n.null),t("TSMappedType").bases("TSType").build("typeParameter","typeAnnotation").field("readonly",r(Boolean,"+","-"),n.false).field("typeParameter",t("TSTypeParameter")).field("optional",r(Boolean,"+","-"),n.false).field("typeAnnotation",r(t("TSType"),null),n.null),t("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes",[r(t("TSType"),t("TSNamedTupleMember"))]),t("TSNamedTupleMember").bases("TSType").build("label","elementType","optional").field("label",t("Identifier")).field("optional",Boolean,n.false).field("elementType",t("TSType")),t("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation",t("TSType")),t("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation",t("TSType")),t("TSIndexedAccessType").bases("TSType").build("objectType","indexType").field("objectType",t("TSType")).field("indexType",t("TSType")),t("TSTypeOperator").bases("TSType").build("operator").field("operator",String).field("typeAnnotation",t("TSType")),t("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",r(t("TSType"),t("TSTypeAnnotation"))),t("TSIndexSignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",[t("Identifier")]).field("readonly",Boolean,n.false),t("TSPropertySignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("key","typeAnnotation","optional").field("key",t("Expression")).field("computed",Boolean,n.false).field("readonly",Boolean,n.false).field("optional",Boolean,n.false).field("initializer",r(t("Expression"),null),n.null),t("TSMethodSignature").bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("key","parameters","typeAnnotation").field("key",t("Expression")).field("computed",Boolean,n.false).field("optional",Boolean,n.false).field("parameters",l),t("TSTypePredicate").bases("TSTypeAnnotation","TSType").build("parameterName","typeAnnotation","asserts").field("parameterName",r(t("Identifier"),t("TSThisType"))).field("typeAnnotation",r(t("TSTypeAnnotation"),null),n.null).field("asserts",Boolean,n.false),["TSCallSignatureDeclaration","TSConstructSignatureDeclaration"].forEach(u=>{t(u).bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",l)}),t("TSEnumMember").bases("Node").build("id","initializer").field("id",r(t("Identifier"),a)).field("initializer",r(t("Expression"),null),n.null),t("TSTypeQuery").bases("TSType").build("exprName").field("exprName",r(o,t("TSImportType")));var c=r(t("TSCallSignatureDeclaration"),t("TSConstructSignatureDeclaration"),t("TSIndexSignature"),t("TSMethodSignature"),t("TSPropertySignature"));t("TSTypeLiteral").bases("TSType").build("members").field("members",[c]),t("TSTypeParameter").bases("Identifier").build("name","constraint","default").field("name",r(t("Identifier"),String)).field("constraint",r(t("TSType"),void 0),n.undefined).field("default",r(t("TSType"),void 0),n.undefined),t("TSTypeAssertion").bases("Expression","Pattern").build("typeAnnotation","expression").field("typeAnnotation",t("TSType")).field("expression",t("Expression")).field("extra",r({parenthesized:Boolean},null),n.null),t("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params",[t("TSTypeParameter")]),t("TSInstantiationExpression").bases("Expression","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",t("Expression")),t("TSTypeParameterInstantiation").bases("Node").build("params").field("params",[t("TSType")]),t("TSEnumDeclaration").bases("Declaration").build("id","members").field("id",t("Identifier")).field("const",Boolean,n.false).field("declare",Boolean,n.false).field("members",[t("TSEnumMember")]).field("initializer",r(t("Expression"),null),n.null),t("TSTypeAliasDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","typeAnnotation").field("id",t("Identifier")).field("declare",Boolean,n.false).field("typeAnnotation",t("TSType")),t("TSModuleBlock").bases("Node").build("body").field("body",[t("Statement")]),t("TSModuleDeclaration").bases("Declaration").build("id","body").field("id",r(a,o)).field("declare",Boolean,n.false).field("global",Boolean,n.false).field("body",r(t("TSModuleBlock"),t("TSModuleDeclaration"),null),n.null),t("TSImportType").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("argument","qualifier","typeParameters").field("argument",a).field("qualifier",r(o,void 0),n.undefined),t("TSImportEqualsDeclaration").bases("Declaration").build("id","moduleReference").field("id",t("Identifier")).field("isExport",Boolean,n.false).field("moduleReference",r(o,t("TSExternalModuleReference"))),t("TSExternalModuleReference").bases("Declaration").build("expression").field("expression",a),t("TSExportAssignment").bases("Statement").build("expression").field("expression",t("Expression")),t("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id",t("Identifier")),t("TSInterfaceBody").bases("Node").build("body").field("body",[c]),t("TSExpressionWithTypeArguments").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",o),t("TSInterfaceDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","body").field("id",o).field("declare",Boolean,n.false).field("extends",r([t("TSExpressionWithTypeArguments")],null),n.null).field("body",t("TSInterfaceBody")),t("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility",r("public","private","protected",void 0),n.undefined).field("readonly",Boolean,n.false).field("parameter",r(t("Identifier"),t("AssignmentPattern"))),t("ClassProperty").field("access",r("public","private","protected",void 0),n.undefined),t("ClassAccessorProperty").bases("Declaration","TSHasOptionalTypeAnnotation"),t("ClassBody").field("body",[r(t("MethodDefinition"),t("VariableDeclarator"),t("ClassPropertyDefinition"),t("ClassProperty"),t("ClassPrivateProperty"),t("ClassAccessorProperty"),t("ClassMethod"),t("ClassPrivateMethod"),t("StaticBlock"),t("TSDeclareMethod"),c)])}q(()=>module);var Se;Se||(Se={});var{astNodesAreEquivalent:_u,builders:mt,builtInTypes:Ee,defineMethod:ju,eachField:Ru,finalize:Uu,getBuilderName:Vu,getFieldNames:Ml,getFieldValue:_e,getSupertypeNames:$u,namedTypes:Fl,NodePath:Bl,Path:qu,PathVisitor:zu,someField:_l,Type:Wu,use:Ju,visit:Ku}=xl([qt,kl,wn,Ll,Dl,Ol]);Object.assign(Se,Fl);var os=Se,sn=Ps.default.SourceMapConsumer,jl=Ps.default.SourceMapGenerator,Cn=Object.prototype.hasOwnProperty;function Rl(){return`
10
- `}function rn(i,s,e){return i&&Cn.call(i,s)?i[s]:e}function Ul(...i){let s={},e=i.length;for(let t=0;t<e;++t){let r=Object.keys(i[t]),n=r.length;for(let a=0;a<n;++a)s[r[a]]=!0}return s}function U(i,s){return i.line-s.line||i.column-s.column}function $e(i){return{line:i.line,column:i.column}}function Vl(i,s){if(i){if(!s)return i}else return s||null;let e=new sn(i),t=new sn(s),r=new jl({file:s.file,sourceRoot:s.sourceRoot}),n={};return t.eachMapping(function(a){let o=e.originalPositionFor({line:a.originalLine,column:a.originalColumn}),l=o.source;if(l===null)return;r.addMapping({source:l,original:$e(o),generated:{line:a.generatedLine,column:a.generatedColumn},name:a.name});let c=e.sourceContentFor(l);c&&!Cn.call(n,l)&&(n[l]=c,r.setSourceContent(l,c))}),r.toJSON()}function In(i,s){if(!i.loc)return null;let e={start:i.loc.start,end:i.loc.end};function t(r){Nr(e,r.loc)}return i.declaration&&i.declaration.decorators&&Ss(i)&&i.declaration.decorators.forEach(t),U(e.start,e.end)<0&&(e.start=$e(e.start),s.skipSpaces(e.start,!1,!0),U(e.start,e.end)<0&&(e.end=$e(e.end),s.skipSpaces(e.end,!0,!0))),i.comments&&i.comments.forEach(t),e}function Nr(i,s){i&&s&&(U(s.start,i.start)<0&&(i.start=s.start),U(i.end,s.end)<0&&(i.end=s.end))}function Rr(i,s){let e=i.loc;if(e&&(e.start.line<1&&(e.start.line=1),e.end.line<1&&(e.end.line=1)),i.type==="File"&&(e.start=s.firstPos(),e.end=s.lastPos()),$l(i,s),ql(i,s),e&&i.decorators)i.decorators.forEach(function(t){Nr(e,t.loc)});else if(i.declaration&&Ss(i)){i.declaration.loc=null;let t=i.declaration.decorators;t&&t.forEach(function(r){Nr(e,r.loc)})}else if(os.MethodDefinition&&os.MethodDefinition.check(i)||os.Property.check(i)&&(i.method||i.shorthand))i.value.loc=null,os.FunctionExpression.check(i.value)&&(i.value.id=null);else if(i.type==="ObjectTypeProperty"){let t=i.loc,r=t&&t.end;r&&(r=$e(r),s.prevPos(r)&&s.charAt(r)===","&&(r=s.skipSpaces(r,!0,!0))&&(t.end=r))}}function $l(i,s){if(i.type!=="ForStatement")return;function e(t){let r=t&&t.loc,n=r&&r.start,a=r&&$e(r.end);for(;n&&a&&U(n,a)<0&&(s.prevPos(a),s.charAt(a)===";");)r.end.line=a.line,r.end.column=a.column}e(i.init),e(i.test),e(i.update)}function ql(i,s){if(i.type==="TemplateLiteral"&&i.quasis.length!==0){if(i.loc){let e=$e(i.loc.start),t=i.quasis[0];U(t.loc.start,e)<0&&(t.loc.start=e);let r=$e(i.loc.end),n=i.quasis[i.quasis.length-1];U(r,n.loc.end)<0&&(n.loc.end=r)}i.expressions.forEach(function(e,t){let r=s.skipSpaces(e.loc.start,!0,!1);if(s.prevPos(r)&&s.charAt(r)==="{"&&s.prevPos(r)&&s.charAt(r)==="$"){let a=i.quasis[t];U(r,a.loc.end)<0&&(a.loc.end=r)}let n=s.skipSpaces(e.loc.end,!1,!1);if(s.charAt(n)==="}"){let a=i.quasis[t+1];U(a.loc.start,n)<0&&(a.loc.start=n)}})}}function Ss(i){if(i)switch(i.type){case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportDefaultSpecifier":case"DeclareExportDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return!0}return!1}function Nn(i){let s=i.getParentNode();return i.getName()==="declaration"&&Ss(s)?s:null}function jt(i,s){let e=i.trailingComma;return typeof e=="object"?!!e[s]:!!e}var kr={tabWidth:4,useTabs:!1,reuseWhitespace:!0,lineTerminator:Rl(),wrapColumn:74,sourceFileName:null,sourceMapName:null,sourceRoot:null,inputSourceMap:null,range:!1,tolerant:!0,quote:null,trailingComma:!1,arrayBracketSpacing:!1,objectCurlySpacing:!0,arrowParensAlways:!1,flowObjectCommas:!0,tokens:!0},zl=kr.hasOwnProperty;function Es(i){let s=i||kr;function e(t){return zl.call(s,t)?s[t]:kr[t]}return{tabWidth:+e("tabWidth"),useTabs:!!e("useTabs"),reuseWhitespace:!!e("reuseWhitespace"),lineTerminator:e("lineTerminator"),wrapColumn:Math.max(e("wrapColumn"),0),sourceFileName:e("sourceFileName"),sourceMapName:e("sourceMapName"),sourceRoot:e("sourceRoot"),inputSourceMap:e("inputSourceMap"),parser:e("esprima")||e("parser"),range:e("range"),tolerant:e("tolerant"),quote:e("quote"),trailingComma:e("trailingComma"),arrayBracketSpacing:e("arrayBracketSpacing"),objectCurlySpacing:e("objectCurlySpacing"),arrowParensAlways:e("arrowParensAlways"),flowObjectCommas:e("flowObjectCommas"),tokens:!!e("tokens")}}var Lr=class i{constructor(s,e,t=e){this.sourceLines=s,this.sourceLoc=e,this.targetLoc=t}slice(s,e,t=s.lastPos()){let r=this.sourceLines,n=this.sourceLoc,a=this.targetLoc;function o(l){let c=n[l],u=a[l],h=e;return l==="end"&&(h=t),Wl(r,c,s,u,h)}if(U(e,a.start)<=0)if(U(a.end,t)<=0)a={start:Ve(a.start,e.line,e.column),end:Ve(a.end,e.line,e.column)};else{if(U(t,a.start)<=0)return null;n={start:n.start,end:o("end")},a={start:Ve(a.start,e.line,e.column),end:Ve(t,e.line,e.column)}}else{if(U(a.end,e)<=0)return null;U(a.end,t)<=0?(n={start:o("start"),end:n.end},a={start:{line:1,column:0},end:Ve(a.end,e.line,e.column)}):(n={start:o("start"),end:o("end")},a={start:{line:1,column:0},end:Ve(t,e.line,e.column)})}return new i(this.sourceLines,n,a)}add(s,e){return new i(this.sourceLines,this.sourceLoc,{start:nn(this.targetLoc.start,s,e),end:nn(this.targetLoc.end,s,e)})}subtract(s,e){return new i(this.sourceLines,this.sourceLoc,{start:Ve(this.targetLoc.start,s,e),end:Ve(this.targetLoc.end,s,e)})}indent(s,e=!1,t=!1){if(s===0)return this;let r=this.targetLoc,n=r.start.line,a=r.end.line;if(e&&n===1&&a===1)return this;if(r={start:r.start,end:r.end},!e||n>1){let o=r.start.column+s;r.start={line:n,column:t?Math.max(0,o):o}}if(!e||a>1){let o=r.end.column+s;r.end={line:a,column:t?Math.max(0,o):o}}return new i(this.sourceLines,this.sourceLoc,r)}};function nn(i,s,e){return{line:i.line+s-1,column:i.line===1?i.column+e:i.column}}function Ve(i,s,e){return{line:i.line-s+1,column:i.line===s?i.column-e:i.column}}function Wl(i,s,e,t,r){let n=U(t,r);if(n===0)return s;let a,o;if(n<0){a=i.skipSpaces(s)||i.lastPos(),o=e.skipSpaces(t)||e.lastPos();let l=r.line-o.line;for(a.line+=l,o.line+=l,l>0&&(a.column=0,o.column=0);U(o,r)<0&&e.nextPos(o,!0););}else{a=i.skipSpaces(s,!0)||i.firstPos(),o=e.skipSpaces(t,!0)||e.firstPos();let l=r.line-o.line;for(a.line+=l,o.line+=l,l<0&&(a.column=i.getLineLength(a.line),o.column=e.getLineLength(o.line));U(r,o)<0&&e.prevPos(o,!0););}return a}var Jl=Object.defineProperty,Kl=(i,s,e)=>s in i?Jl(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e,Lt=(i,s,e)=>(Kl(i,typeof s!="symbol"?s+"":s,e),e),ft=class i{constructor(s,e=null){this.infos=s,Lt(this,"length"),Lt(this,"name"),Lt(this,"mappings",[]),Lt(this,"cachedSourceMap",null),Lt(this,"cachedTabWidth"),this.length=s.length,this.name=e||null,this.name&&this.mappings.push(new Lr(this,{start:this.firstPos(),end:this.lastPos()}))}toString(s){return this.sliceString(this.firstPos(),this.lastPos(),s)}getSourceMap(s,e){if(!s)return null;let t=this;function r(o){return o=o||{},o.file=s,e&&(o.sourceRoot=e),o}if(t.cachedSourceMap)return r(t.cachedSourceMap.toJSON());let n=new Ps.default.SourceMapGenerator(r()),a={};return t.mappings.forEach(function(o){let l=o.sourceLines.skipSpaces(o.sourceLoc.start)||o.sourceLines.lastPos(),c=t.skipSpaces(o.targetLoc.start)||t.lastPos();for(;U(l,o.sourceLoc.end)<0&&U(c,o.targetLoc.end)<0;){o.sourceLines.charAt(l),t.charAt(c);let u=o.sourceLines.name;if(n.addMapping({source:u,original:{line:l.line,column:l.column},generated:{line:c.line,column:c.column}}),!Dr.call(a,u)){let h=o.sourceLines.toString();n.setSourceContent(u,h),a[u]=h}t.nextPos(c,!0),o.sourceLines.nextPos(l,!0)}}),t.cachedSourceMap=n,n.toJSON()}bootstrapCharAt(s){let e=s.line,t=s.column,r=this.toString().split(Or),n=r[e-1];return typeof n>"u"?"":t===n.length&&e<r.length?`
8
+ `):r=String.fromCharCode(t),++this.state.curLine,this.state.lineStart=this.state.pos,r}jsxReadString(e){let t="",r=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(m.UnterminatedString,this.state.startLoc);let n=this.input.charCodeAt(this.state.pos);if(n===e)break;n===38?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadEntity(),r=this.state.pos):rt(n)?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadNewLine(!1),r=this.state.pos):++this.state.pos}t+=this.input.slice(r,this.state.pos++),this.finishToken(133,t)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let t=10;this.codePointAtPos(this.state.pos)===120&&(t=16,++this.state.pos);let r=this.readInt(t,void 0,!1,"bail");if(r!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(r)}else{let t=0,r=!1;for(;t++<10&&this.state.pos<this.length&&!(r=this.codePointAtPos(this.state.pos)===59);)++this.state.pos;if(r){let n=this.input.slice(e,this.state.pos),a=Ko[n];if(++this.state.pos,a)return a}}return this.state.pos=e,"&"}jsxReadWord(){let e,t=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(st(e)||e===45);this.finishToken(140,this.input.slice(t,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(140)?e.name=this.state.value:Er(this.state.type)?e.name=Ue(this.state.type):this.unexpected(),this.next(),this.finishNode(e,"JSXIdentifier")}jsxParseNamespacedName(){let e=this.state.startLoc,t=this.jsxParseIdentifier();if(!this.eat(14))return t;let r=this.startNodeAt(e);return r.namespace=t,r.name=this.jsxParseIdentifier(),this.finishNode(r,"JSXNamespacedName")}jsxParseElementName(){let e=this.state.startLoc,t=this.jsxParseNamespacedName();if(t.type==="JSXNamespacedName")return t;for(;this.eat(16);){let r=this.startNodeAt(e);r.object=t,r.property=this.jsxParseIdentifier(),t=this.finishNode(r,"JSXMemberExpression")}return t}jsxParseAttributeValue(){let e;switch(this.state.type){case 5:return e=this.startNode(),this.setContext($.brace),this.next(),e=this.jsxParseExpressionContainer(e,$.j_oTag),e.expression.type==="JSXEmptyExpression"&&this.raise(We.AttributeIsEmpty,e),e;case 142:case 133:return this.parseExprAtom();default:throw this.raise(We.UnsupportedJsxValue,this.state.startLoc)}}jsxParseEmptyExpression(){let e=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(e,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(e){return this.next(),e.expression=this.parseExpression(),this.setContext($.j_expr),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXSpreadChild")}jsxParseExpressionContainer(e,t){if(this.match(8))e.expression=this.jsxParseEmptyExpression();else{let r=this.parseExpression();e.expression=r}return this.setContext(t),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXExpressionContainer")}jsxParseAttribute(){let e=this.startNode();return this.match(5)?(this.setContext($.brace),this.next(),this.expect(21),e.argument=this.parseMaybeAssignAllowIn(),this.setContext($.j_oTag),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXSpreadAttribute")):(e.name=this.jsxParseNamespacedName(),e.value=this.eat(29)?this.jsxParseAttributeValue():null,this.finishNode(e,"JSXAttribute"))}jsxParseOpeningElementAt(e){let t=this.startNodeAt(e);return this.eat(143)?this.finishNode(t,"JSXOpeningFragment"):(t.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(t))}jsxParseOpeningElementAfterName(e){let t=[];for(;!this.match(56)&&!this.match(143);)t.push(this.jsxParseAttribute());return e.attributes=t,e.selfClosing=this.eat(56),this.expect(143),this.finishNode(e,"JSXOpeningElement")}jsxParseClosingElementAt(e){let t=this.startNodeAt(e);return this.eat(143)?this.finishNode(t,"JSXClosingFragment"):(t.name=this.jsxParseElementName(),this.expect(143),this.finishNode(t,"JSXClosingElement"))}jsxParseElementAt(e){let t=this.startNodeAt(e),r=[],n=this.jsxParseOpeningElementAt(e),a=null;if(!n.selfClosing){e:for(;;)switch(this.state.type){case 142:if(e=this.state.startLoc,this.next(),this.eat(56)){a=this.jsxParseClosingElementAt(e);break e}r.push(this.jsxParseElementAt(e));break;case 141:r.push(this.parseLiteral(this.state.value,"JSXText"));break;case 5:{let o=this.startNode();this.setContext($.brace),this.next(),this.match(21)?r.push(this.jsxParseSpreadChild(o)):r.push(this.jsxParseExpressionContainer(o,$.j_expr));break}default:this.unexpected()}Re(n)&&!Re(a)&&a!==null?this.raise(We.MissingClosingTagFragment,a):!Re(n)&&Re(a)?this.raise(We.MissingClosingTagElement,a,{openingTagName:tt(n.name)}):!Re(n)&&!Re(a)&&tt(a.name)!==tt(n.name)&&this.raise(We.MissingClosingTagElement,a,{openingTagName:tt(n.name)})}if(Re(n)?(t.openingFragment=n,t.closingFragment=a):(t.openingElement=n,t.closingElement=a),t.children=r,this.match(47))throw this.raise(We.UnwrappedAdjacentJSXElements,this.state.startLoc);return Re(n)?this.finishNode(t,"JSXFragment"):this.finishNode(t,"JSXElement")}jsxParseElement(){let e=this.state.startLoc;return this.next(),this.jsxParseElementAt(e)}setContext(e){let{context:t}=this.state;t[t.length-1]=e}parseExprAtom(e){return this.match(142)?this.jsxParseElement():this.match(47)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(142),this.jsxParseElement()):super.parseExprAtom(e)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(e){let t=this.curContext();if(t===$.j_expr){this.jsxReadToken();return}if(t===$.j_oTag||t===$.j_cTag){if(Me(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(143);return}if((e===34||e===39)&&t===$.j_oTag){this.jsxReadString(e);return}}if(e===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(142);return}super.getTokenFromCode(e)}updateContext(e){let{context:t,type:r}=this.state;if(r===56&&e===142)t.splice(-2,2,$.j_cTag),this.state.canStartJSXElement=!1;else if(r===142)t.push($.j_oTag);else if(r===143){let n=t[t.length-1];n===$.j_oTag&&e===56||n===$.j_cTag?(t.pop(),this.state.canStartJSXElement=t[t.length-1]===$.j_expr):(this.setContext($.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=co(r)}},pr=class extends Ct{constructor(...s){super(...s),this.tsNames=new Map}},fr=class extends It{constructor(...s){super(...s),this.importsStack=[]}createScope(s){return this.importsStack.push(new Set),new pr(s)}enter(s){s===256&&this.importsStack.push(new Set),super.enter(s)}exit(){let s=super.exit();return s===256&&this.importsStack.pop(),s}hasImport(s,e){let t=this.importsStack.length;if(this.importsStack[t-1].has(s))return!0;if(!e&&t>1){for(let r=0;r<t-1;r++)if(this.importsStack[r].has(s))return!0}return!1}declareName(s,e,t){if(e&4096){this.hasImport(s,!0)&&this.parser.raise(m.VarRedeclaration,t,{identifierName:s}),this.importsStack[this.importsStack.length-1].add(s);return}let r=this.currentScope(),n=r.tsNames.get(s)||0;if(e&1024){this.maybeExportDefined(r,s),r.tsNames.set(s,n|16);return}super.declareName(s,e,t),e&2&&(e&1||(this.checkRedeclarationInScope(r,s,e,t),this.maybeExportDefined(r,s)),n=n|1),e&256&&(n=n|2),e&512&&(n=n|4),e&128&&(n=n|8),n&&r.tsNames.set(s,n)}isRedeclaredInScope(s,e,t){let r=s.tsNames.get(e);if((r&2)>0){if(t&256){let n=!!(t&512),a=(r&4)>0;return n!==a}return!0}return t&128&&(r&8)>0?s.names.get(e)&2?!!(t&1):!1:t&2&&(r&1)>0?!0:super.isRedeclaredInScope(s,e,t)}checkLocalExport(s){let{name:e}=s;if(this.hasImport(e))return;let t=this.scopeStack.length;for(let r=t-1;r>=0;r--){let a=this.scopeStack[r].tsNames.get(e);if((a&1)>0||(a&16)>0)return}super.checkLocalExport(s)}},Zi=i=>i.type==="ParenthesizedExpression"?Zi(i.expression):i,dr=class extends hr{toAssignable(s,e=!1){var t,r;let n;switch((s.type==="ParenthesizedExpression"||(t=s.extra)!=null&&t.parenthesized)&&(n=Zi(s),e?n.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(m.InvalidParenthesizedAssignment,s):n.type!=="MemberExpression"&&!this.isOptionalMemberExpression(n)&&this.raise(m.InvalidParenthesizedAssignment,s):this.raise(m.InvalidParenthesizedAssignment,s)),s.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":s.type="ObjectPattern";for(let o=0,l=s.properties.length,c=l-1;o<l;o++){var a;let u=s.properties[o],h=o===c;this.toAssignableObjectExpressionProp(u,h,e),h&&u.type==="RestElement"&&(a=s.extra)!=null&&a.trailingCommaLoc&&this.raise(m.RestTrailingComma,s.extra.trailingCommaLoc)}break;case"ObjectProperty":{let{key:o,value:l}=s;this.isPrivateName(o)&&this.classScope.usePrivateName(this.getPrivateNameSV(o),o.loc.start),this.toAssignable(l,e);break}case"SpreadElement":throw new Error("Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.");case"ArrayExpression":s.type="ArrayPattern",this.toAssignableList(s.elements,(r=s.extra)==null?void 0:r.trailingCommaLoc,e);break;case"AssignmentExpression":s.operator!=="="&&this.raise(m.MissingEqInAssignment,s.left.loc.end),s.type="AssignmentPattern",delete s.operator,this.toAssignable(s.left,e);break;case"ParenthesizedExpression":this.toAssignable(n,e);break}}toAssignableObjectExpressionProp(s,e,t){if(s.type==="ObjectMethod")this.raise(s.kind==="get"||s.kind==="set"?m.PatternHasAccessor:m.PatternHasMethod,s.key);else if(s.type==="SpreadElement"){s.type="RestElement";let r=s.argument;this.checkToRestConversion(r,!1),this.toAssignable(r,t),e||this.raise(m.RestTrailingComma,s)}else this.toAssignable(s,t)}toAssignableList(s,e,t){let r=s.length-1;for(let n=0;n<=r;n++){let a=s[n];if(a){if(a.type==="SpreadElement"){a.type="RestElement";let o=a.argument;this.checkToRestConversion(o,!0),this.toAssignable(o,t)}else this.toAssignable(a,t);a.type==="RestElement"&&(n<r?this.raise(m.RestTrailingComma,a):e&&this.raise(m.RestTrailingComma,e))}}}isAssignable(s,e){switch(s.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let t=s.properties.length-1;return s.properties.every((r,n)=>r.type!=="ObjectMethod"&&(n===t||r.type!=="SpreadElement")&&this.isAssignable(r))}case"ObjectProperty":return this.isAssignable(s.value);case"SpreadElement":return this.isAssignable(s.argument);case"ArrayExpression":return s.elements.every(t=>t===null||this.isAssignable(t));case"AssignmentExpression":return s.operator==="=";case"ParenthesizedExpression":return this.isAssignable(s.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(s,e){return s}toReferencedListDeep(s,e){this.toReferencedList(s,e);for(let t of s)t?.type==="ArrayExpression"&&this.toReferencedListDeep(t.elements)}parseSpread(s){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(s,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){let s=this.startNode();return this.next(),s.argument=this.parseBindingAtom(),this.finishNode(s,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let s=this.startNode();return this.next(),s.elements=this.parseBindingList(3,93,1),this.finishNode(s,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(s,e,t){let r=t&1,n=[],a=!0;for(;!this.eat(s);)if(a?a=!1:this.expect(12),r&&this.match(12))n.push(null);else{if(this.eat(s))break;if(this.match(21)){if(n.push(this.parseAssignableListItemTypes(this.parseRestBinding(),t)),!this.checkCommaAfterRest(e)){this.expect(s);break}}else{let o=[];for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(m.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)o.push(this.parseDecorator());n.push(this.parseAssignableListItem(t,o))}}return n}parseBindingRestProperty(s){return this.next(),s.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(s,"RestElement")}parseBindingProperty(){let{type:s,startLoc:e}=this.state;if(s===21)return this.parseBindingRestProperty(this.startNode());let t=this.startNode();return s===138?(this.expectPlugin("destructuringPrivate",e),this.classScope.usePrivateName(this.state.value,e),t.key=this.parsePrivateName()):this.parsePropertyName(t),t.method=!1,this.parseObjPropValue(t,e,!1,!1,!0,!1)}parseAssignableListItem(s,e){let t=this.parseMaybeDefault();this.parseAssignableListItemTypes(t,s);let r=this.parseMaybeDefault(t.loc.start,t);return e.length&&(t.decorators=e),r}parseAssignableListItemTypes(s,e){return s}parseMaybeDefault(s,e){var t,r;if((t=s)!=null||(s=this.state.startLoc),e=(r=e)!=null?r:this.parseBindingAtom(),!this.eat(29))return e;let n=this.startNodeAt(s);return n.left=e,n.right=this.parseMaybeAssignAllowIn(),this.finishNode(n,"AssignmentPattern")}isValidLVal(s,e,t){switch(s){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(s){return s.type==="OptionalMemberExpression"}checkLVal(s,e,t=64,r=!1,n=!1,a=!1){var o;let l=s.type;if(this.isObjectMethod(s))return;let c=this.isOptionalMemberExpression(s);if(c||l==="MemberExpression"){c&&(this.expectPlugin("optionalChainingAssign",s.loc.start),e.type!=="AssignmentExpression"&&this.raise(m.InvalidLhsOptionalChaining,s,{ancestor:e})),t!==64&&this.raise(m.InvalidPropertyBindingPattern,s);return}if(l==="Identifier"){this.checkIdentifier(s,t,n);let{name:g}=s;r&&(r.has(g)?this.raise(m.ParamDupe,s):r.add(g));return}let u=this.isValidLVal(l,!(a||(o=s.extra)!=null&&o.parenthesized)&&e.type==="AssignmentExpression",t);if(u===!0)return;if(u===!1){let g=t===64?m.InvalidLhs:m.InvalidLhsBinding;this.raise(g,s,{ancestor:e});return}let h,f;typeof u=="string"?(h=u,f=l==="ParenthesizedExpression"):[h,f]=u;let d=l==="ArrayPattern"||l==="ObjectPattern"?{type:l}:e,p=s[h];if(Array.isArray(p))for(let g of p)g&&this.checkLVal(g,d,t,r,n,f);else p&&this.checkLVal(p,d,t,r,n,f)}checkIdentifier(s,e,t=!1){this.state.strict&&(t?Hi(s.name,this.inModule):Ki(s.name))&&(e===64?this.raise(m.StrictEvalArguments,s,{referenceName:s.name}):this.raise(m.StrictEvalArgumentsBinding,s,{bindingName:s.name})),e&8192&&s.name==="let"&&this.raise(m.LetInLexicalBinding,s),e&64||this.declareNameFromIdentifier(s,e)}declareNameFromIdentifier(s,e){this.scope.declareName(s.name,e,s.loc.start)}checkToRestConversion(s,e){switch(s.type){case"ParenthesizedExpression":this.checkToRestConversion(s.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(m.InvalidRestAssignmentPattern,s)}}checkCommaAfterRest(s){return this.match(12)?(this.raise(this.lookaheadCharCode()===s?m.RestTrailingComma:m.ElementAfterRest,this.state.startLoc),!0):!1}};function Xo(i){if(i==null)throw new Error(`Unexpected ${i} value.`);return i}function Bi(i){if(!i)throw new Error("Assert fail")}var I=Fe`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 `<T,>() => ...`.",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 Go(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 _i(i){return i==="private"||i==="public"||i==="protected"}function Qo(i){return i==="in"||i==="out"}var Yo=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:I.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:I.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:I.InvalidModifierOnTypeParameter})}getScopeHandler(){return fr}tsIsIdentifier(){return R(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,t){if(!R(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let r=this.state.value;if(e.includes(r)){if(t&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return r}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:t,stopOnStartOfClassStaticBlock:r,errorTemplate:n=I.InvalidModifierOnTypeMember},a){let o=(c,u,h,f)=>{u===h&&a[f]&&this.raise(I.InvalidModifiersOrder,c,{orderedModifiers:[h,f]})},l=(c,u,h,f)=>{(a[h]&&u===f||a[f]&&u===h)&&this.raise(I.IncompatibleModifiers,c,{modifiers:[h,f]})};for(;;){let{startLoc:c}=this.state,u=this.tsParseModifier(e.concat(t??[]),r);if(!u)break;_i(u)?a.accessibility?this.raise(I.DuplicateAccessibilityModifier,c,{modifier:u}):(o(c,u,u,"override"),o(c,u,u,"static"),o(c,u,u,"readonly"),a.accessibility=u):Qo(u)?(a[u]&&this.raise(I.DuplicateModifier,c,{modifier:u}),a[u]=!0,o(c,u,"in","out")):(hasOwnProperty.call(a,u)?this.raise(I.DuplicateModifier,c,{modifier:u}):(o(c,u,"static","readonly"),o(c,u,"static","override"),o(c,u,"override","readonly"),o(c,u,"abstract","override"),l(c,u,"declare","override"),l(c,u,"static","abstract")),a[u]=!0),t!=null&&t.includes(u)&&this.raise(n,c,{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,t){let r=[];for(;!this.tsIsListTerminator(e);)r.push(t());return r}tsParseDelimitedList(e,t,r){return Xo(this.tsParseDelimitedListWorker(e,t,!0,r))}tsParseDelimitedListWorker(e,t,r,n){let a=[],o=-1;for(;!this.tsIsListTerminator(e);){o=-1;let l=t();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,t,r,n,a){n||(r?this.expect(0):this.expect(47));let o=this.tsParseDelimitedList(e,t,a);return r?this.expect(3):this.expect(48),o}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(133)||this.raise(I.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=super.parseExprAtom(),(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))&&(e.options=null),this.eat(12)&&(this.expectImportAttributesPlugin(),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 t=this.parseIdentifier(e);for(;this.eat(16);){let r=this.startNodeAtNode(t);r.left=t,r.right=this.parseIdentifier(e),t=this.finishNode(r,"TSQualifiedName")}return t}tsParseTypeReference(){let 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();let t=this.startNodeAtNode(e);return t.parameterName=e,t.typeAnnotation=this.tsParseTypeAnnotation(!1),t.asserts=!1,this.finishNode(t,"TSTypePredicate")}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){let 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){let t=this.startNode();return e(t),t.name=this.tsParseTypeParameterName(),t.constraint=this.tsEatThenParseType(81),t.default=this.tsEatThenParseType(29),this.finishNode(t,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let t=this.startNode();this.match(47)||this.match(142)?this.next():this.unexpected();let r={value:-1};return t.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,r),t.params.length===0&&this.raise(I.EmptyTypeParameters,t),r.value!==-1&&this.addExtra(t,"trailingComma",r.value),this.finishNode(t,"TSTypeParameterDeclaration")}tsFillSignature(e,t){let r=e===19,n="parameters",a="typeAnnotation";t.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),t[n]=this.tsParseBindingListForSignature(),r?t[a]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(t[a]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let t of e){let{type:r}=t;(r==="AssignmentPattern"||r==="TSParameterProperty")&&this.raise(I.UnsupportedSignatureParameterKind,t,{type:r})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,t){return this.tsFillSignature(14,t),this.tsParseTypeMemberSemicolon(),this.finishNode(t,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),R(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);let t=this.parseIdentifier();t.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(t),this.expect(3),e.parameters=[t];let r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,t){this.eat(17)&&(e.optional=!0);let r=e;if(this.match(10)||this.match(47)){t&&this.raise(I.ReadonlyForMethodSignature,e);let n=r;n.kind&&this.match(47)&&this.raise(I.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,n),this.tsParseTypeMemberSemicolon();let a="parameters",o="typeAnnotation";if(n.kind==="get")n[a].length>0&&(this.raise(m.BadGetterArity,this.state.curPosition()),this.isThisParam(n[a][0])&&this.raise(I.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(n.kind==="set"){if(n[a].length!==1)this.raise(m.BadSetterArity,this.state.curPosition());else{let l=n[a][0];this.isThisParam(l)&&this.raise(I.AccessorCannotDeclareThisParameter,this.state.curPosition()),l.type==="Identifier"&&l.optional&&this.raise(I.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),l.type==="RestElement"&&this.raise(I.SetAccessorCannotHaveRestParameter,this.state.curPosition())}n[o]&&this.raise(I.SetAccessorCannotHaveReturnType,n[o])}else n.kind="method";return this.finishNode(n,"TSMethodSignature")}else{let n=r;t&&(n.readonly=!0);let a=this.tsTryParseTypeAnnotation();return a&&(n.typeAnnotation=a),this.tsParseTypeMemberSemicolon(),this.finishNode(n,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){let 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);let t=this.tsTryParseIndexSignature(e);return t||(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(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let 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(){let 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);{let t=this.startNode();t.name=this.tsParseTypeParameterName(),t.constraint=this.tsExpectThenParseType(58),e.typeParameter=this.finishNode(t,"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(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let t=!1;return e.elementTypes.forEach(r=>{let{type:n}=r;t&&n!=="TSRestType"&&n!=="TSOptionalType"&&!(n==="TSNamedTupleMember"&&r.optional)&&this.raise(I.OptionalTypeBeforeRequired,r),t||(t=n==="TSNamedTupleMember"&&r.optional||n==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let{startLoc:e}=this.state,t=this.eat(21),r,n,a,o,c=Te(this.state.type)?this.lookaheadCharCode():null;if(c===58)r=!0,a=!1,n=this.parseIdentifier(!0),this.expect(14),o=this.tsParseType();else if(c===63){a=!0;let u=this.state.startLoc,h=this.state.value,f=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(r=!0,n=this.createIdentifier(this.startNodeAt(u),h),this.expect(17),this.expect(14),o=this.tsParseType()):(r=!1,o=f,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(I.TupleOptionalAfterType,this.state.lastTokStartLoc))):(u=this.startNodeAtNode(o),u.optional=a,this.raise(I.InvalidTupleMemberLabel,o),u.label=o,u.elementType=this.tsParseType()),o=this.finishNode(u,"TSNamedTupleMember")}else if(a){let u=this.startNodeAtNode(o);u.typeAnnotation=o,o=this.finishNode(u,"TSOptionalType")}if(t){let u=this.startNodeAt(e);u.typeAnnotation=o,o=this.finishNode(u,"TSRestType")}return o}tsParseParenthesizedType(){let e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,t){let r=this.startNode();return e==="TSConstructorType"&&(r.abstract=!!t,t&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,r)),this.finishNode(r,e)}tsParseLiteralTypeNode(){let 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(){let e=this.startNode();return e.literal=super.parseTemplate(!1),this.finishNode(e,"TSLiteralType")}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let 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==="-"){let e=this.startNode(),t=this.lookahead();return t.type!==134&&t.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:{let{type:e}=this.state;if(R(e)||e===88||e===84){let t=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":Go(this.state.value);if(t!==void 0&&this.lookaheadCharCode()!==46){let r=this.startNode();return this.next(),this.finishNode(r,t)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let e=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let t=this.startNodeAtNode(e);t.elementType=e,this.expect(3),e=this.finishNode(t,"TSArrayType")}else{let t=this.startNodeAtNode(e);t.objectType=e,t.indexType=this.tsParseType(),this.expect(3),e=this.finishNode(t,"TSIndexedAccessType")}return e}tsParseTypeOperator(){let e=this.startNode(),t=this.state.value;return this.next(),e.operator=t,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),t==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(I.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(115);let t=this.startNode();return t.name=this.tsParseTypeParameterName(),t.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(t,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){return yo(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,t,r){let n=this.startNode(),a=this.eat(r),o=[];do o.push(t());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(R(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:e}=this.state,t=e.length;try{return this.parseObjectLike(8,!0),e.length===t}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,t=e.length;try{return super.parseBindingList(3,93,1),e.length===t}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(()=>{let t=this.startNode();this.expect(e);let 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),t.typeAnnotation=l,this.finishNode(t,"TSTypeAnnotation")}let a=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!a)return n?(r.parameterName=this.parseIdentifier(),r.asserts=n,r.typeAnnotation=null,t.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(t,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,t);let o=this.tsParseTypeAnnotation(!1);return r.parameterName=a,r.typeAnnotation=o,r.asserts=n,t.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(t,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;let e=this.state.containsEsc;return this.next(),!R(this.state.type)&&!this.match(78)?!1:(e&&this.raise(m.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,t=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),t.typeAnnotation=this.tsParseType()}),this.finishNode(t,"TSTypeAnnotation")}tsParseType(){Bi(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;let t=this.startNodeAtNode(e);return t.checkType=e,t.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),t.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),t.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(t,"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(I.ReservedTypeAssertion,this.state.startLoc);let 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){let t=this.state.startLoc,r=this.tsParseDelimitedList("HeritageClauseElement",()=>{let n=this.startNode();return n.expression=this.tsParseEntityName(),this.match(47)&&(n.typeParameters=this.tsParseTypeArguments()),this.finishNode(n,"TSExpressionWithTypeArguments")});return r.length||this.raise(I.EmptyHeritageClauseType,t,{token:e}),r}tsParseInterfaceDeclaration(e,t={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),t.declare&&(e.declare=!0),R(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(I.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let 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){let t=this.startNode();return this.next(),this.finishNode(t,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInNoContext(e){let t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}tsInType(e){let t=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=t}}tsInDisallowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}tsInAllowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}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(){let 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,t={}){return t.const&&(e.const=!0),t.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(){let 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,t=!1){if(e.id=this.parseIdentifier(),t||this.checkIdentifier(e.id,1024),this.eat(16)){let 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,t,r){e.isExport=r||!1,e.id=t||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);let n=this.tsParseModuleReference();return e.importKind==="type"&&n.type!=="TSExternalModuleReference"&&this.raise(I.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(){let 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){let t=this.state.clone(),r=e();return this.state=t,r}tsTryParseAndCatch(e){let t=this.tryParse(r=>e()||r());if(!(t.aborted||!t.node))return t.error&&(this.state=t.failState),t.node}tsTryParse(e){let t=this.state.clone(),r=e();if(r!==void 0&&r!==!1)return r;this.state=t}tsTryParseDeclare(e){if(this.isLineTerminator())return;let t=this.state.type,r;return this.isContextual(100)&&(t=74,r="let"),this.tsInAmbientContext(()=>{switch(t){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:{let n=this.tsParseInterfaceDeclaration(e,{declare:!0});if(n)return n}default:if(R(t))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,t,r){switch(t.name){case"declare":{let n=this.tsTryParseDeclare(e);return n&&(n.declare=!0),n}case"global":if(this.match(5)){this.scope.enter(256),this.prodParam.enter(0);let n=e;return n.global=!0,n.id=t,n.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(n,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,t.name,!1,r)}}tsParseDeclaration(e,t,r,n){switch(t){case"abstract":if(this.tsCheckLineTerminator(r)&&(this.match(80)||R(this.state.type)))return this.tsParseAbstractDeclaration(e,n);break;case"module":if(this.tsCheckLineTerminator(r)){if(this.match(133))return this.tsParseAmbientExternalModuleDeclaration(e);if(R(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(r)&&R(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(r)&&R(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;let t=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let r=this.tsTryParseAndCatch(()=>{let 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=t,!!r)return super.parseArrowExpression(r,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){let 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(I.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===$.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return go(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseAssignableListItem(e,t){let r=this.state.startLoc,n={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},n);let a=n.accessibility,o=n.override,l=n.readonly;!(e&4)&&(a||l||o)&&this.raise(I.UnexpectedParameterModifier,r);let c=this.parseMaybeDefault();this.parseAssignableListItemTypes(c,e);let u=this.parseMaybeDefault(c.loc.start,c);if(a||l||o){let h=this.startNodeAt(r);return t.length&&(h.decorators=t),a&&(h.accessibility=a),l&&(h.readonly=l),o&&(h.override=o),u.type!=="Identifier"&&u.type!=="AssignmentPattern"&&this.raise(I.UnsupportedParameterPropertyKind,h),h.parameter=u,this.finishNode(h,"TSParameterProperty")}return t.length&&(c.decorators=t),u}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let t of e.params)t.type!=="Identifier"&&t.optional&&!this.state.isAmbientContext&&this.raise(I.PatternIsOptional,t)}setArrowFunctionParameters(e,t,r){super.setArrowFunctionParameters(e,t,r),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,t,r=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let n=t==="FunctionDeclaration"?"TSDeclareFunction":t==="ClassMethod"||t==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return n&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,n):n==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(I.DeclareFunctionHasImplementation,e),e.declare)?super.parseFunctionBodyAndFinish(e,n,r):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,t,r))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(t=>{t?.type==="TSTypeCastExpression"&&this.raise(I.UnexpectedTypeAnnotation,t.typeAnnotation)})}toReferencedList(e,t){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,t,r,n){let a=super.parseArrayLike(e,t,r,n);return a.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(a.elements),a}parseSubscript(e,t,r,n){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let o=this.startNodeAt(t);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,l=this.tsTryParseAndCatch(()=>{if(!r&&this.atPossibleAsyncArrow(e)){let f=this.tsTryParseGenericAsyncArrowFunction(t);if(f)return f}let c=this.tsParseTypeArgumentsInExpression();if(!c)return;if(a&&!this.match(10)){o=this.state.curPosition();return}if(ns(this.state.type)){let f=super.parseTaggedTemplateExpression(e,t,n);return f.typeParameters=c,f}if(!r&&this.eat(10)){let f=this.startNodeAt(t);return f.callee=e,f.arguments=this.parseCallExpressionArguments(11,!1),this.tsCheckForInvalidTypeCasts(f.arguments),f.typeParameters=c,n.optionalChainMember&&(f.optional=a),this.finishCallExpression(f,n.optionalChainMember)}let u=this.state.type;if(u===48||u===52||u!==10&&Qs(u)&&!this.hasPrecedingLineBreak())return;let h=this.startNodeAt(t);return h.expression=e,h.typeParameters=c,this.finishNode(h,"TSInstantiationExpression")});if(o&&this.unexpected(o,10),l)return l.type==="TSInstantiationExpression"&&(this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(I.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),l}return super.parseSubscript(e,t,r,n)}parseNewCallee(e){var t;super.parseNewCallee(e);let{callee:r}=e;r.type==="TSInstantiationExpression"&&!((t=r.extra)!=null&&t.parenthesized)&&(e.typeParameters=r.typeParameters,e.callee=r.expression)}parseExprOp(e,t,r){let n;if(ss(58)>r&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(n=this.isContextual(120)))){let a=this.startNodeAt(t);return a.expression=e,a.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(n&&this.raise(m.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(a,n?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(a,t,r)}return super.parseExprOp(e,t,r)}checkReservedWord(e,t,r,n){this.state.isAmbientContext||super.checkReservedWord(e,t,r,n)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(I.ImportReflectionHasImportType,e.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){let t=this.lookaheadCharCode();return e?t===123||t===42:t!==61}return!e&&this.isContextual(87)}applyImportPhase(e,t,r,n){super.applyImportPhase(e,t,r,n),t?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 t;if(R(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){let r=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,r);t=super.parseImportSpecifiersAndAfter(e,r)}else t=super.parseImport(e);return t.importKind==="type"&&t.specifiers.length>1&&t.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(I.TypeImportCannotSpecifyDefaultAndNamed,t),t}parseExport(e,t){if(this.match(83)){this.next();let r=e,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)){let r=e;return r.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(r,"TSExportAssignment")}else if(this.eatContextual(93)){let r=e;return this.expectContextual(128),r.id=this.parseIdentifier(),this.semicolon(),this.finishNode(r,"TSNamespaceExportDeclaration")}else return super.parseExport(e,t)}isAbstractClass(){return this.isContextual(124)&&this.lookahead().type===80}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(129)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,t,r=!1){let{isAmbientContext:n}=this.state,a=super.parseVarStatement(e,t,r||n);if(!n)return a;for(let{id:o,init:l}of a.declarations)l&&(t!=="const"||o.typeAnnotation?this.raise(I.InitializerNotAllowedInAmbientContext,l):el(l,this.hasPlugin("estree"))||this.raise(I.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,l));return a}parseStatementContent(e,t){if(this.match(75)&&this.isLookaheadContextual("enum")){let 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)){let r=this.tsParseInterfaceDeclaration(this.startNode());if(r)return r}return super.parseStatementContent(e,t)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,t){return t.some(r=>_i(r)?e.accessibility===r:!!e[r])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(e,t,r){let n=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:n,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:I.InvalidModifierOnTypeParameterPositions},t);let a=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(t,n)&&this.raise(I.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,t)):this.parseClassMemberWithIsStatic(e,t,r,!!t.static)};t.declare?this.tsInAmbientContext(a):a()}parseClassMemberWithIsStatic(e,t,r,n){let a=this.tsTryParseIndexSignature(t);if(a){e.body.push(a),t.abstract&&this.raise(I.IndexSignatureHasAbstract,t),t.accessibility&&this.raise(I.IndexSignatureHasAccessibility,t,{modifier:t.accessibility}),t.declare&&this.raise(I.IndexSignatureHasDeclare,t),t.override&&this.raise(I.IndexSignatureHasOverride,t);return}!this.state.inAbstractClass&&t.abstract&&this.raise(I.NonAbstractClassHasAbstractMethod,t),t.override&&(r.hadSuperClass||this.raise(I.OverrideNotInSubClass,t)),super.parseClassMemberWithIsStatic(e,t,r,n)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(I.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(I.ClassMethodHasDeclare,e)}parseExpressionStatement(e,t,r){return(t.type==="Identifier"?this.tsParseExpressionStatement(e,t,r):void 0)||super.parseExpressionStatement(e,t,r)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,t,r){if(!this.state.maybeInArrowParameters||!this.match(17))return super.parseConditional(e,t,r);let n=this.tryParse(()=>super.parseConditional(e,t));return n.node?(n.error&&(this.state=n.failState),n.node):(n.error&&super.setOptionalParametersError(r,n.error),e)}parseParenItem(e,t){let r=super.parseParenItem(e,t);if(this.eat(17)&&(r.optional=!0,this.resetEndLocation(e)),this.match(14)){let n=this.startNodeAt(t);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));let t=this.state.startLoc,r=this.eatContextual(125);if(r&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(I.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let a=R(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return a?((a.type==="TSInterfaceDeclaration"||a.type==="TSTypeAliasDeclaration"||r)&&(e.exportKind="type"),r&&(this.resetStartLocation(a,t),a.declare=!0),a):null}parseClassId(e,t,r,n){if((!t||r)&&this.isContextual(113))return;super.parseClassId(e,t,r,e.declare?1024:8331);let 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));let t=this.tsTryParseTypeAnnotation();t&&(e.typeAnnotation=t)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(I.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){let{key:t}=e;this.raise(I.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:t.type==="Identifier"&&!e.computed?t.name:`[${this.input.slice(t.start,t.end)}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(I.PrivateElementHasAbstract,e),e.accessibility&&this.raise(I.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(I.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,t,r,n,a,o){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);l&&a&&this.raise(I.ConstructorHasTypeParameters,l);let{declare:c=!1,kind:u}=t;c&&(u==="get"||u==="set")&&this.raise(I.DeclareAccessor,t,{kind:u}),l&&(t.typeParameters=l),super.pushClassMethod(e,t,r,n,a,o)}pushClassPrivateMethod(e,t,r,n){let a=this.tsTryParseTypeParameters(this.tsParseConstModifier);a&&(t.typeParameters=a),super.pushClassPrivateMethod(e,t,r,n)}declareClassPrivateMethodInScope(e,t){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&!hasOwnProperty.call(e.value,"body")||super.declareClassPrivateMethodInScope(e,t))}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,t,r,n,a,o,l){let c=this.tsTryParseTypeParameters(this.tsParseConstModifier);return c&&(e.typeParameters=c),super.parseObjPropValue(e,t,r,n,a,o,l)}parseFunctionParams(e,t){let r=this.tsTryParseTypeParameters(this.tsParseConstModifier);r&&(e.typeParameters=r),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let r=this.tsTryParseTypeAnnotation();r&&(e.id.typeAnnotation=r,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,t)}parseMaybeAssign(e,t){var r,n,a,o,l;let c,u,h;if(this.hasPlugin("jsx")&&(this.match(142)||this.match(47))){if(c=this.state.clone(),u=this.tryParse(()=>super.parseMaybeAssign(e,t),c),!u.error)return u.node;let{context:p}=this.state,g=p[p.length-1];(g===$.j_oTag||g===$.j_expr)&&p.pop()}if(!((r=u)!=null&&r.error)&&!this.match(47))return super.parseMaybeAssign(e,t);(!c||c===this.state)&&(c=this.state.clone());let f,d=this.tryParse(p=>{var g,y;f=this.tsParseTypeParameters(this.tsParseConstModifier);let b=super.parseMaybeAssign(e,t);return(b.type!=="ArrowFunctionExpression"||(g=b.extra)!=null&&g.parenthesized)&&p(),((y=f)==null?void 0:y.params.length)!==0&&this.resetStartLocationFromNode(b,f),b.typeParameters=f,b},c);if(!d.error&&!d.aborted)return f&&this.reportReservedArrowTypeParam(f),d.node;if(!u&&(Bi(!this.hasPlugin("jsx")),h=this.tryParse(()=>super.parseMaybeAssign(e,t),c),!h.error))return h.node;if((n=u)!=null&&n.node)return this.state=u.failState,u.node;if(d.node)return this.state=d.failState,f&&this.reportReservedArrowTypeParam(f),d.node;if((a=h)!=null&&a.node)return this.state=h.failState,h.node;throw((o=u)==null?void 0:o.error)||d.error||((l=h)==null?void 0:l.error)}reportReservedArrowTypeParam(e){var t;e.params.length===1&&!e.params[0].constraint&&!((t=e.extra)!=null&&t.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(I.ReservedArrowTypeParam,e)}parseMaybeUnary(e,t){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,t)}parseArrow(e){if(this.match(14)){let t=this.tryParse(r=>{let n=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&r(),n});if(t.aborted)return;t.thrown||(t.error&&(this.state=t.failState),e.returnType=t.node)}return super.parseArrow(e)}parseAssignableListItemTypes(e,t){if(!(t&2))return e;this.eat(17)&&(e.optional=!0);let r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.resetEndLocation(e),e}isAssignable(e,t){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,t);case"TSParameterProperty":return!0;default:return super.isAssignable(e,t)}}toAssignable(e,t=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,t);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":t?this.expressionScope.recordArrowParameterBindingError(I.UnexpectedTypeCastInParameter,e):this.raise(I.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,t);break;case"AssignmentExpression":!t&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,t)}}toAssignableParenthesizedExpression(e,t){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,t);break;default:super.toAssignable(e,t)}}checkToRestConversion(e,t){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,t)}}isValidLVal(e,t,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||!t)&&["expression",!0];default:return super.isValidLVal(e,t,r)}}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e){if(this.match(47)||this.match(51)){let t=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let r=super.parseMaybeDecoratorArguments(e);return r.typeParameters=t,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,t){let r=super.parseMaybeDefault(e,t);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.start<r.typeAnnotation.start&&this.raise(I.TypeAnnotationAfterAssign,r.typeAnnotation),r}getTokenFromCode(e){if(this.state.inType){if(e===62){this.finishOp(48,1);return}if(e===60){this.finishOp(47,1);return}}super.getTokenFromCode(e)}reScan_lt_gt(){let{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}toAssignableList(e,t,r){for(let n=0;n<e.length;n++){let a=e[n];a?.type==="TSTypeCastExpression"&&(e[n]=this.typeCastToParameter(a))}super.toAssignableList(e,t,r)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}shouldParseArrow(e){return this.match(14)?e.every(t=>this.isAssignable(t,!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)){let t=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());t&&(e.typeParameters=t)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let t=super.getGetterSetterExpectedParamCount(e),n=this.getObjectOrClassMethodParams(e)[0];return n&&this.isThisParam(n)?t+1:t}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:t,strict:r}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=t,this.state.strict=r}}parseClass(e,t,r){let n=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,t,r)}finally{this.state.inAbstractClass=n}}tsParseAbstractDeclaration(e,t){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(t,this.parseClass(e,!0,!1));if(this.isContextual(129)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(I.NonClassMethodPropertyHasAbstractModifer,e),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,t,r,n,a,o,l){let c=super.parseMethod(e,t,r,n,a,o,l);if(c.abstract&&(this.hasPlugin("estree")?!!c.value.body:!!c.body)){let{key:h}=c;this.raise(I.AbstractMethodHasImplementation,c,{methodName:h.type==="Identifier"&&!c.computed?h.name:`[${this.input.slice(h.start,h.end)}]`})}return c}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,t,r,n){return!t&&n?(this.parseTypeOnlyImportExportSpecifier(e,!1,r),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,t,r,n))}parseImportSpecifier(e,t,r,n,a){return!t&&n?(this.parseTypeOnlyImportExportSpecifier(e,!0,r),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,t,r,n,r?4098:4096))}parseTypeOnlyImportExportSpecifier(e,t,r){let n=t?"imported":"local",a=t?"local":"exported",o=e[n],l,c=!1,u=!0,h=o.loc.start;if(this.isContextual(93)){let d=this.parseIdentifier();if(this.isContextual(93)){let p=this.parseIdentifier();Te(this.state.type)?(c=!0,o=d,l=t?this.parseIdentifier():this.parseModuleExportName(),u=!1):(l=p,u=!1)}else Te(this.state.type)?(u=!1,l=t?this.parseIdentifier():this.parseModuleExportName()):(c=!0,o=d)}else Te(this.state.type)&&(c=!0,t?(o=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(o.name,o.loc.start,!0,!0)):o=this.parseModuleExportName());c&&r&&this.raise(t?I.TypeModifierIsUsedInTypeImports:I.TypeModifierIsUsedInTypeExports,h),e[n]=o,e[a]=l;let f=t?"importKind":"exportKind";e[f]=c?"type":"value",u&&this.eatContextual(93)&&(e[a]=t?this.parseIdentifier():this.parseModuleExportName()),e[a]||(e[a]=Be(e[n])),t&&this.checkIdentifier(e[a],c?4098:4096)}};function Zo(i){if(i.type!=="MemberExpression")return!1;let{computed:s,property:e}=i;return s&&e.type!=="StringLiteral"&&(e.type!=="TemplateLiteral"||e.expressions.length>0)?!1:tn(i.object)}function el(i,s){var e;let{type:t}=i;if((e=i.extra)!=null&&e.parenthesized)return!1;if(s){if(t==="Literal"){let{value:r}=i;if(typeof r=="string"||typeof r=="boolean")return!0}}else if(t==="StringLiteral"||t==="BooleanLiteral")return!0;return!!(en(i,s)||tl(i,s)||t==="TemplateLiteral"&&i.expressions.length===0||Zo(i))}function en(i,s){return s?i.type==="Literal"&&(typeof i.value=="number"||"bigint"in i):i.type==="NumericLiteral"||i.type==="BigIntLiteral"}function tl(i,s){if(i.type==="UnaryExpression"){let{operator:e,argument:t}=i;if(e==="-"&&en(t,s))return!0}return!1}function tn(i){return i.type==="Identifier"?!0:i.type!=="MemberExpression"||i.computed?!1:tn(i.object)}var ji=Fe`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),sl=i=>class extends i{parsePlaceholder(e){if(this.match(144)){let t=this.startNode();return this.next(),this.assertNoSpace(),t.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(144),this.finishPlaceholder(t,e)}}finishPlaceholder(e,t){let r=e;return(!r.expectedNode||!r.type)&&(r=this.finishNode(r,"Placeholder")),r.expectedNode=t,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,t,r,n){e!==void 0&&super.checkReservedWord(e,t,r,n)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,t,r){return e==="Placeholder"||super.isValidLVal(e,t,r)}toAssignable(e,t){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,t)}chStartsBindingIdentifier(e,t){return!!(super.chStartsBindingIdentifier(e,t)||this.lookahead().type===144)}verifyBreakContinue(e,t){e.label&&e.label.type==="Placeholder"||super.verifyBreakContinue(e,t)}parseExpressionStatement(e,t){var r;if(t.type!=="Placeholder"||(r=t.extra)!=null&&r.parenthesized)return super.parseExpressionStatement(e,t);if(this.match(14)){let a=e;return a.label=this.finishPlaceholder(t,"Identifier"),this.next(),a.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(a,"LabeledStatement")}this.semicolon();let n=e;return n.name=t.name,this.finishPlaceholder(n,"Statement")}parseBlock(e,t,r){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,t,r)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,t,r){let n=t?"ClassDeclaration":"ClassExpression";this.next();let 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||!t)return e.id=null,e.body=this.finishPlaceholder(o,"ClassBody"),this.finishNode(e,n);throw this.raise(ji.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(e,t,r);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,a),this.finishNode(e,n)}parseExport(e,t){let r=this.parsePlaceholder("Identifier");if(!r)return super.parseExport(e,t);let 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");let a=this.startNode();return a.exported=r,n.specifiers=[this.finishNode(a,"ExportDefaultSpecifier")],super.parseExport(n,t)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(Ue(144),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,t){var r;return(r=e.specifiers)!=null&&r.length?!0:super.maybeParseExportDefaultSpecifier(e,t)}checkExport(e){let{specifiers:t}=e;t!=null&&t.length&&(e.specifiers=t.filter(r=>r.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=t}parseImport(e){let t=this.parsePlaceholder("Identifier");if(!t)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(98)&&!this.match(12))return e.source=this.finishPlaceholder(t,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let r=this.startNodeAtNode(t);return r.local=t,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(ji.UnexpectedSpace,this.state.lastTokEndLoc)}},rl=i=>class extends i{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,t=this.startNode();if(this.next(),R(this.state.type)){let r=this.parseIdentifierName(),n=this.createIdentifier(t,r);if(n.type="V8IntrinsicIdentifier",this.match(10))return n}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},Ri=["minimal","fsharp","hack","smart"],Ui=["^^","@@","^","%","#"];function il(i){if(i.has("decorators")){if(i.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let e=i.get("decorators").decoratorsBeforeExport;if(e!=null&&typeof e!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let t=i.get("decorators").allowCallParenthesized;if(t!=null&&typeof t!="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 s;let e=i.get("pipelineOperator").proposal;if(!Ri.includes(e)){let r=Ri.map(n=>`"${n}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${r}.`)}let t=((s=i.get("recordAndTuple"))==null?void 0:s.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.");let r=i.get("pipelineOperator").topicToken;if(!Ui.includes(r)){let n=Ui.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==="#"&&t)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",i.get("recordAndTuple")])}\`.`)}else if(e==="smart"&&t)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("importAttributes")&&i.has("importAssertions"))throw new Error("Cannot combine importAssertions and importAttributes plugins.");if(i.has("recordAndTuple")){let e=i.get("recordAndTuple").syntaxType;if(e!=null){let t=["hash","bar"];if(!t.includes(e))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+t.map(r=>`'${r}'`).join(", "))}}if(i.has("asyncDoExpressions")&&!i.has("doExpressions")){let 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'.")}var sn={estree:no,jsx:Ho,flow:Jo,typescript:Yo,v8intrinsic:rl,placeholders:sl},nl=Object.keys(sn),Hs={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 al(i){if(i==null)return Object.assign({},Hs);if(i.annexB!=null&&i.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");let s={};for(let t of Object.keys(Hs)){var e;s[t]=(e=i[t])!=null?e:Hs[t]}return s}var mr=class extends dr{checkProto(s,e,t,r){if(s.type==="SpreadElement"||this.isObjectMethod(s)||s.computed||s.shorthand)return;let n=s.key;if((n.type==="Identifier"?n.name:n.value)==="__proto__"){if(e){this.raise(m.RecordNoProto,n);return}t.used&&(r?r.doubleProtoLoc===null&&(r.doubleProtoLoc=n.loc.start):this.raise(m.DuplicateProto,n)),t.used=!0}}shouldExitDescending(s,e){return s.type==="ArrowFunctionExpression"&&s.start===e}getExpression(){this.enterInitialScopes(),this.nextToken();let s=this.parseExpression();return this.match(139)||this.unexpected(),this.finalizeRemainingComments(),s.comments=this.comments,s.errors=this.state.errors,this.options.tokens&&(s.tokens=this.tokens),s}parseExpression(s,e){return s?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(s){let e=this.state.startLoc,t=this.parseMaybeAssign(s);if(this.match(12)){let r=this.startNodeAt(e);for(r.expressions=[t];this.eat(12);)r.expressions.push(this.parseMaybeAssign(s));return this.toReferencedList(r.expressions),this.finishNode(r,"SequenceExpression")}return t}parseMaybeAssignDisallowIn(s,e){return this.disallowInAnd(()=>this.parseMaybeAssign(s,e))}parseMaybeAssignAllowIn(s,e){return this.allowInAnd(()=>this.parseMaybeAssign(s,e))}setOptionalParametersError(s,e){var t;s.optionalParametersLoc=(t=e?.loc)!=null?t:this.state.startLoc}parseMaybeAssign(s,e){let t=this.state.startLoc;if(this.isContextual(108)&&this.prodParam.hasYield){let o=this.parseYield();return e&&(o=e.call(this,o,t)),o}let r;s?r=!1:(s=new it,r=!0);let{type:n}=this.state;(n===10||R(n))&&(this.state.potentialArrowAt=this.state.start);let a=this.parseMaybeConditional(s);if(e&&(a=e.call(this,a,t)),uo(this.state.type)){let o=this.startNodeAt(t),l=this.state.value;if(o.operator=l,this.match(29)){this.toAssignable(a,!0),o.left=a;let c=t.index;s.doubleProtoLoc!=null&&s.doubleProtoLoc.index>=c&&(s.doubleProtoLoc=null),s.shorthandAssignLoc!=null&&s.shorthandAssignLoc.index>=c&&(s.shorthandAssignLoc=null),s.privateKeyLoc!=null&&s.privateKeyLoc.index>=c&&(this.checkDestructuringPrivate(s),s.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(s,!0);return a}parseMaybeConditional(s){let e=this.state.startLoc,t=this.state.potentialArrowAt,r=this.parseExprOps(s);return this.shouldExitDescending(r,t)?r:this.parseConditional(r,e,s)}parseConditional(s,e,t){if(this.eat(17)){let r=this.startNodeAt(e);return r.test=s,r.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),r.alternate=this.parseMaybeAssign(),this.finishNode(r,"ConditionalExpression")}return s}parseMaybeUnaryOrPrivate(s){return this.match(138)?this.parsePrivateName():this.parseMaybeUnary(s)}parseExprOps(s){let e=this.state.startLoc,t=this.state.potentialArrowAt,r=this.parseMaybeUnaryOrPrivate(s);return this.shouldExitDescending(r,t)?r:this.parseExprOp(r,e,-1)}parseExprOp(s,e,t){if(this.isPrivateName(s)){let n=this.getPrivateNameSV(s);(t>=ss(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(m.PrivateInExpectedIn,s,{identifierName:n}),this.classScope.usePrivateName(n,s.loc.start)}let r=this.state.type;if(po(r)&&(this.prodParam.hasIn||!this.match(58))){let n=ss(r);if(n>t){if(r===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return s;this.checkPipelineAtInfixOperator(s,e)}let a=this.startNodeAt(e);a.left=s,a.operator=this.state.value;let o=r===41||r===42,l=r===40;if(l&&(n=ss(42)),this.next(),r===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(m.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);a.right=this.parseExprOpRightExpr(r,n);let c=this.finishNode(a,o||l?"LogicalExpression":"BinaryExpression"),u=this.state.type;if(l&&(u===41||u===42)||o&&u===40)throw this.raise(m.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(c,e,t)}}return s}parseExprOpRightExpr(s,e){let t=this.state.startLoc;switch(s){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(m.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(s,e),t)});case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}default:return this.parseExprOpBaseRightExpr(s,e)}}parseExprOpBaseRightExpr(s,e){let t=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),t,xo(s)?e-1:e)}parseHackPipeBody(){var s;let{startLoc:e}=this.state,t=this.parseMaybeAssign();return eo.has(t.type)&&!((s=t.extra)!=null&&s.parenthesized)&&this.raise(m.PipeUnparenthesizedBody,e,{type:t.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(m.PipeTopicUnused,e),t}checkExponentialAfterUnary(s){this.match(57)&&this.raise(m.UnexpectedTokenUnaryExponentiation,s.argument)}parseMaybeUnary(s,e){let t=this.state.startLoc,r=this.isContextual(96);if(r&&this.recordAwaitIfAllowed()){this.next();let l=this.parseAwait(t);return e||this.checkExponentialAfterUnary(l),l}let n=this.match(34),a=this.startNode();if(mo(this.state.type)){a.operator=this.state.value,a.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let l=this.match(89);if(this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(s,!0),this.state.strict&&l){let c=a.argument;c.type==="Identifier"?this.raise(m.StrictDelete,a):this.hasPropertyAsPrivateName(c)&&this.raise(m.DeletePrivateField,a)}if(!n)return e||this.checkExponentialAfterUnary(a),this.finishNode(a,"UnaryExpression")}let o=this.parseUpdate(a,n,s);if(r){let{type:l}=this.state;if((this.hasPlugin("v8intrinsic")?Qs(l):Qs(l)&&!this.match(54))&&!this.isAmbiguousAwait())return this.raiseOverwrite(m.AwaitNotInAsyncContext,t),this.parseAwait(t)}return o}parseUpdate(s,e,t){if(e){let a=s;return this.checkLVal(a.argument,this.finishNode(a,"UpdateExpression")),s}let r=this.state.startLoc,n=this.parseExprSubscripts(t);if(this.checkExpressionErrors(t,!1))return n;for(;fo(this.state.type)&&!this.canInsertSemicolon();){let 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(s){let e=this.state.startLoc,t=this.state.potentialArrowAt,r=this.parseExprAtom(s);return this.shouldExitDescending(r,t)?r:this.parseSubscripts(r,e)}parseSubscripts(s,e,t){let r={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(s),stop:!1};do s=this.parseSubscript(s,e,t,r),r.maybeAsyncArrow=!1;while(!r.stop);return s}parseSubscript(s,e,t,r){let{type:n}=this.state;if(!t&&n===15)return this.parseBind(s,e,t,r);if(ns(n))return this.parseTaggedTemplateExpression(s,e,r);let a=!1;if(n===18){if(t&&(this.raise(m.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return r.stop=!0,s;r.optionalChainMember=a=!0,this.next()}if(!t&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(s,e,r,a);{let o=this.eat(0);return o||a||this.eat(16)?this.parseMember(s,e,r,o,a):(r.stop=!0,s)}}parseMember(s,e,t,r,n){let a=this.startNodeAt(e);return a.object=s,a.computed=r,r?(a.property=this.parseExpression(),this.expect(3)):this.match(138)?(s.type==="Super"&&this.raise(m.SuperPrivateField,e),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),t.optionalChainMember?(a.optional=n,this.finishNode(a,"OptionalMemberExpression")):this.finishNode(a,"MemberExpression")}parseBind(s,e,t,r){let n=this.startNodeAt(e);return n.object=s,this.next(),n.callee=this.parseNoCallExpr(),r.stop=!0,this.parseSubscripts(this.finishNode(n,"BindExpression"),e,t)}parseCoverCallAndAsyncArrowHead(s,e,t,r){let n=this.state.maybeInArrowParameters,a=null;this.state.maybeInArrowParameters=!0,this.next();let o=this.startNodeAt(e);o.callee=s;let{maybeAsyncArrow:l,optionalChainMember:c}=t;l&&(this.expressionScope.enter(jo()),a=new it),c&&(o.optional=r),r?o.arguments=this.parseCallExpressionArguments(11):o.arguments=this.parseCallExpressionArguments(11,s.type==="Import",s.type!=="Super",o,a);let u=this.finishCallExpression(o,c);return l&&this.shouldParseAsyncArrow()&&!r?(t.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(s,e){this.toReferencedListDeep(s.arguments,e)}parseTaggedTemplateExpression(s,e,t){let r=this.startNodeAt(e);return r.tag=s,r.quasi=this.parseTemplate(!0),t.optionalChainMember&&this.raise(m.OptionalChainingNoTemplate,e),this.finishNode(r,"TaggedTemplateExpression")}atPossibleAsyncArrow(s){return s.type==="Identifier"&&s.name==="async"&&this.state.lastTokEndLoc.index===s.end&&!this.canInsertSemicolon()&&s.end-s.start===5&&s.start===this.state.potentialArrowAt}expectImportAttributesPlugin(){this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes")}finishCallExpression(s,e){if(s.callee.type==="Import")if(s.arguments.length===2&&(this.hasPlugin("moduleAttributes")||this.expectImportAttributesPlugin()),s.arguments.length===0||s.arguments.length>2)this.raise(m.ImportCallArity,s,{maxArgumentCount:this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")||this.hasPlugin("moduleAttributes")?2:1});else for(let t of s.arguments)t.type==="SpreadElement"&&this.raise(m.ImportCallSpreadArgument,t);return this.finishNode(s,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(s,e,t,r,n){let a=[],o=!0,l=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(s);){if(o)o=!1;else if(this.expect(12),this.match(s)){e&&!this.hasPlugin("importAttributes")&&!this.hasPlugin("importAssertions")&&!this.hasPlugin("moduleAttributes")&&this.raise(m.ImportCallArgumentTrailingComma,this.state.lastTokStartLoc),r&&this.addTrailingCommaExtraToNode(r),this.next();break}a.push(this.parseExprListItem(!1,n,t))}return this.state.inFSharpPipelineDirectBody=l,a}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(s,e){var t;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(s,e.arguments,!0,(t=e.extra)==null?void 0:t.trailingCommaLoc),e.innerComments&&Nt(s,e.innerComments),e.callee.trailingComments&&Nt(s,e.callee.trailingComments),s}parseNoCallExpr(){let s=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),s,!0)}parseExprAtom(s){let e,t=null,{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(m.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 136:return this.parseDecimalLiteral(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:{let 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,s);case 6:case 7:return this.parseObjectLike(this.state.type===6?9:8,!1,!0);case 5:return this.parseObjectLike(8,!1,!1,s);case 68:return this.parseFunctionOrFunctionSent();case 26:t=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(t,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;let n=e.callee=this.parseNoCallExpr();if(n.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(m.UnsupportedBind,n)}case 138:return this.raise(m.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:{let n=this.getPluginOption("pipelineOperator","proposal");if(n)return this.parseTopicReference(n);this.unexpected();break}case 47:{let n=this.input.codePointAt(this.nextTokenStart());Me(n)||n===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(R(r)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let n=this.state.potentialArrowAt===this.state.start,a=this.state.containsEsc,o=this.parseIdentifier();if(!a&&o.name==="async"&&!this.canInsertSemicolon()){let{type:l}=this.state;if(l===68)return this.resetPreviousNodeTrailingComments(o),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(o));if(R(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(s,e){let t=this.getPluginOption("pipelineOperator","proposal");if(t)return this.state.type=s,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=ae(this.state.endLoc,-1),this.parseTopicReference(t);this.unexpected()}parseTopicReference(s){let e=this.startNode(),t=this.state.startLoc,r=this.state.type;return this.next(),this.finishTopicReference(e,t,s,r)}finishTopicReference(s,e,t,r){if(this.testTopicReferenceConfiguration(t,e,r)){let n=t==="smart"?"PipelinePrimaryTopicReference":"TopicReference";return this.topicReferenceIsAllowedInCurrentContext()||this.raise(t==="smart"?m.PrimaryTopicNotAllowed:m.PipeTopicUnbound,e),this.registerTopicReference(),this.finishNode(s,n)}else throw this.raise(m.PipeTopicUnconfiguredToken,e,{token:Ue(r)})}testTopicReferenceConfiguration(s,e,t){switch(s){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:Ue(t)}]);case"smart":return t===27;default:throw this.raise(m.PipeTopicRequiresHackPipes,e)}}parseAsyncArrowUnaryFunction(s){this.prodParam.enter(rs(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(m.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(s,e,!0)}parseDo(s,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),s.async=e,this.next();let t=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(2),s.body=this.parseBlock(),this.prodParam.exit()):s.body=this.parseBlock(),this.state.labels=t,this.finishNode(s,"DoExpression")}parseSuper(){let s=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!this.options.allowSuperOutsideMethod?this.raise(m.SuperNotAllowed,s):!this.scope.allowSuper&&!this.options.allowSuperOutsideMethod&&this.raise(m.UnexpectedSuper,s),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(m.UnsupportedSuper,s),this.finishNode(s,"Super")}parsePrivateName(){let s=this.startNode(),e=this.startNodeAt(ae(this.state.startLoc,1)),t=this.state.value;return this.next(),s.id=this.createIdentifier(e,t),this.finishNode(s,"PrivateName")}parseFunctionOrFunctionSent(){let s=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(s),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(s,e,"sent")}return this.parseFunction(s)}parseMetaProperty(s,e,t){s.meta=e;let r=this.state.containsEsc;return s.property=this.parseIdentifier(!0),(s.property.name!==t||r)&&this.raise(m.UnsupportedMetaProperty,s.property,{target:e.name,onlyValidPropertyName:t}),this.finishNode(s,"MetaProperty")}parseImportMetaProperty(s){let e=this.createIdentifier(this.startNodeAtNode(s),"import");if(this.next(),this.isContextual(101))this.inModule||this.raise(m.ImportMetaOutsideModule,e),this.sawUnambiguousESM=!0;else if(this.isContextual(105)||this.isContextual(97)){let t=this.isContextual(105);if(t||this.unexpected(),this.expectPlugin(t?"sourcePhaseImports":"deferredImportEvaluation"),!this.options.createImportExpressions)throw this.raise(m.DynamicImportPhaseRequiresImportExpressions,this.state.startLoc,{phase:this.state.value});return this.next(),s.phase=t?"source":"defer",this.parseImportCall(s)}return this.parseMetaProperty(s,e,"meta")}parseLiteralAtNode(s,e,t){return this.addExtra(t,"rawValue",s),this.addExtra(t,"raw",this.input.slice(t.start,this.state.end)),t.value=s,this.next(),this.finishNode(t,e)}parseLiteral(s,e){let t=this.startNode();return this.parseLiteralAtNode(s,e,t)}parseStringLiteral(s){return this.parseLiteral(s,"StringLiteral")}parseNumericLiteral(s){return this.parseLiteral(s,"NumericLiteral")}parseBigIntLiteral(s){return this.parseLiteral(s,"BigIntLiteral")}parseDecimalLiteral(s){return this.parseLiteral(s,"DecimalLiteral")}parseRegExpLiteral(s){let e=this.startNode();return this.addExtra(e,"raw",this.input.slice(e.start,this.state.end)),e.pattern=s.pattern,e.flags=s.flags,this.next(),this.finishNode(e,"RegExpLiteral")}parseBooleanLiteral(s){let e=this.startNode();return e.value=s,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){let s=this.startNode();return this.next(),this.finishNode(s,"NullLiteral")}parseParenAndDistinguishExpression(s){let e=this.state.startLoc,t;this.next(),this.expressionScope.enter(_o());let r=this.state.maybeInArrowParameters,n=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let a=this.state.startLoc,o=[],l=new it,c=!0,u,h;for(;!this.match(11);){if(c)c=!1;else if(this.expect(12,l.optionalParametersLoc===null?null:l.optionalParametersLoc),this.match(11)){h=this.state.startLoc;break}if(this.match(21)){let 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))}let f=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=r,this.state.inFSharpPipelineDirectBody=n;let d=this.startNodeAt(e);return s&&this.shouldParseArrow(o)&&(d=this.parseArrow(d))?(this.checkDestructuringPrivate(l),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(d,o,!1),d):(this.expressionScope.exit(),o.length||this.unexpected(this.state.lastTokStartLoc),h&&this.unexpected(h),u&&this.unexpected(u),this.checkExpressionErrors(l,!0),this.toReferencedListDeep(o,!0),o.length>1?(t=this.startNodeAt(a),t.expressions=o,this.finishNode(t,"SequenceExpression"),this.resetEndLocation(t,f)):t=o[0],this.wrapParenthesis(e,t))}wrapParenthesis(s,e){if(!this.options.createParenthesizedExpressions)return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",s.index),this.takeSurroundingComments(e,s.index,this.state.lastTokEndLoc.index),e;let t=this.startNodeAt(s);return t.expression=e,this.finishNode(t,"ParenthesizedExpression")}shouldParseArrow(s){return!this.canInsertSemicolon()}parseArrow(s){if(this.eat(19))return s}parseParenItem(s,e){return s}parseNewOrNewTarget(){let s=this.startNode();if(this.next(),this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(s),"new");this.next();let t=this.parseMetaProperty(s,e,"target");return!this.scope.inNonArrowFunction&&!this.scope.inClass&&!this.options.allowNewTargetOutsideFunction&&this.raise(m.UnexpectedNewTarget,t),t}return this.parseNew(s)}parseNew(s){if(this.parseNewCallee(s),this.eat(10)){let e=this.parseExprList(11);this.toReferencedList(e),s.arguments=e}else s.arguments=[];return this.finishNode(s,"NewExpression")}parseNewCallee(s){let e=this.match(83),t=this.parseNoCallExpr();s.callee=t,e&&(t.type==="Import"||t.type==="ImportExpression")&&this.raise(m.ImportCallNotNewExpression,t)}parseTemplateElement(s){let{start:e,startLoc:t,end:r,value:n}=this.state,a=e+1,o=this.startNodeAt(ae(t,1));n===null&&(s||this.raise(m.InvalidEscapeSequenceTemplate,ae(this.state.firstInvalidTemplateEscapePos,1)));let l=this.match(24),c=l?-1:-2,u=r+c;o.value={raw:this.input.slice(a,u).replace(/\r\n?/g,`
9
+ `),cooked:n===null?null:n.slice(1,c)},o.tail=l,this.next();let h=this.finishNode(o,"TemplateElement");return this.resetEndLocation(h,ae(this.state.lastTokEndLoc,c)),h}parseTemplate(s){let e=this.startNode(),t=this.parseTemplateElement(s),r=[t],n=[];for(;!t.tail;)n.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),r.push(t=this.parseTemplateElement(s));return e.expressions=n,e.quasis=r,this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(s,e,t,r){t&&this.expectPlugin("recordAndTuple");let n=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=Object.create(null),o=!0,l=this.startNode();for(l.properties=[],this.next();!this.match(s);){if(o)o=!1;else if(this.expect(12),this.match(s)){this.addTrailingCommaExtraToNode(l);break}let u;e?u=this.parseBindingProperty():(u=this.parsePropertyDefinition(r),this.checkProto(u,t,a,r)),t&&!this.isObjectProperty(u)&&u.type!=="SpreadElement"&&this.raise(m.InvalidRecordProperty,u),u.shorthand&&this.addExtra(u,"shorthand",!0),l.properties.push(u)}this.next(),this.state.inFSharpPipelineDirectBody=n;let c="ObjectExpression";return e?c="ObjectPattern":t&&(c="RecordExpression"),this.finishNode(l,c)}addTrailingCommaExtraToNode(s){this.addExtra(s,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(s,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(s){return!s.computed&&s.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(s){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(m.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)e.push(this.parseDecorator());let t=this.startNode(),r=!1,n=!1,a;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(t.decorators=e,e=[]),t.method=!1,s&&(a=this.state.startLoc);let o=this.eat(55);this.parsePropertyNamePrefixOperator(t);let l=this.state.containsEsc;if(this.parsePropertyName(t,s),!o&&!l&&this.maybeAsyncOrAccessorProp(t)){let{key:c}=t,u=c.name;u==="async"&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(c),o=this.eat(55),this.parsePropertyName(t)),(u==="get"||u==="set")&&(n=!0,this.resetPreviousNodeTrailingComments(c),t.kind=u,this.match(55)&&(o=!0,this.raise(m.AccessorIsGenerator,this.state.curPosition(),{kind:u}),this.next()),this.parsePropertyName(t))}return this.parseObjPropValue(t,a,o,r,!1,n,s)}getGetterSetterExpectedParamCount(s){return s.kind==="get"?0:1}getObjectOrClassMethodParams(s){return s.params}checkGetterSetterParams(s){var e;let t=this.getGetterSetterExpectedParamCount(s),r=this.getObjectOrClassMethodParams(s);r.length!==t&&this.raise(s.kind==="get"?m.BadGetterArity:m.BadSetterArity,s),s.kind==="set"&&((e=r[r.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(m.BadSetterRestParameter,s)}parseObjectMethod(s,e,t,r,n){if(n){let a=this.parseMethod(s,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(a),a}if(t||e||this.match(10))return r&&this.unexpected(),s.kind="method",s.method=!0,this.parseMethod(s,e,t,!1,!1,"ObjectMethod")}parseObjectProperty(s,e,t,r){if(s.shorthand=!1,this.eat(14))return s.value=t?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(r),this.finishNode(s,"ObjectProperty");if(!s.computed&&s.key.type==="Identifier"){if(this.checkReservedWord(s.key.name,s.key.loc.start,!0,!1),t)s.value=this.parseMaybeDefault(e,Be(s.key));else if(this.match(29)){let n=this.state.startLoc;r!=null?r.shorthandAssignLoc===null&&(r.shorthandAssignLoc=n):this.raise(m.InvalidCoverInitializedName,n),s.value=this.parseMaybeDefault(e,Be(s.key))}else s.value=Be(s.key);return s.shorthand=!0,this.finishNode(s,"ObjectProperty")}}parseObjPropValue(s,e,t,r,n,a,o){let l=this.parseObjectMethod(s,t,r,n,a)||this.parseObjectProperty(s,e,n,o);return l||this.unexpected(),l}parsePropertyName(s,e){if(this.eat(0))s.computed=!0,s.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:t,value:r}=this.state,n;if(Te(t))n=this.parseIdentifier(!0);else switch(t){case 134:n=this.parseNumericLiteral(r);break;case 133:n=this.parseStringLiteral(r);break;case 135:n=this.parseBigIntLiteral(r);break;case 136:n=this.parseDecimalLiteral(r);break;case 138:{let a=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=a):this.raise(m.UnexpectedPrivateField,a),n=this.parsePrivateName();break}default:this.unexpected()}s.key=n,t!==138&&(s.computed=!1)}}initFunction(s,e){s.id=null,s.generator=!1,s.async=e}parseMethod(s,e,t,r,n,a,o=!1){this.initFunction(s,t),s.generator=e,this.scope.enter(18|(o?64:0)|(n?32:0)),this.prodParam.enter(rs(t,s.generator)),this.parseFunctionParams(s,r);let l=this.parseFunctionBodyAndFinish(s,a,!0);return this.prodParam.exit(),this.scope.exit(),l}parseArrayLike(s,e,t,r){t&&this.expectPlugin("recordAndTuple");let n=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=this.startNode();return this.next(),a.elements=this.parseExprList(s,!t,r,a),this.state.inFSharpPipelineDirectBody=n,this.finishNode(a,t?"TupleExpression":"ArrayExpression")}parseArrowExpression(s,e,t,r){this.scope.enter(6);let n=rs(t,!1);!this.match(5)&&this.prodParam.hasIn&&(n|=8),this.prodParam.enter(n),this.initFunction(s,t);let a=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(s,e,r)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(s,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=a,this.finishNode(s,"ArrowFunctionExpression")}setArrowFunctionParameters(s,e,t){this.toAssignableList(e,t,!1),s.params=e}parseFunctionBodyAndFinish(s,e,t=!1){return this.parseFunctionBody(s,!1,t),this.finishNode(s,e)}parseFunctionBody(s,e,t=!1){let r=e&&!this.match(5);if(this.expressionScope.enter(Yi()),r)s.body=this.parseMaybeAssign(),this.checkParams(s,!1,e,!1);else{let n=this.state.strict,a=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),s.body=this.parseBlock(!0,!1,o=>{let l=!this.isSimpleParamList(s.params);o&&l&&this.raise(m.IllegalLanguageModeDirective,(s.kind==="method"||s.kind==="constructor")&&s.key?s.key.loc.end:s);let c=!n&&this.state.strict;this.checkParams(s,!this.state.strict&&!e&&!t&&!l,e,c),this.state.strict&&s.id&&this.checkIdentifier(s.id,65,c)}),this.prodParam.exit(),this.state.labels=a}this.expressionScope.exit()}isSimpleParameter(s){return s.type==="Identifier"}isSimpleParamList(s){for(let e=0,t=s.length;e<t;e++)if(!this.isSimpleParameter(s[e]))return!1;return!0}checkParams(s,e,t,r=!0){let n=!e&&new Set,a={type:"FormalParameters"};for(let o of s.params)this.checkLVal(o,a,5,n,r)}parseExprList(s,e,t,r){let n=[],a=!0;for(;!this.eat(s);){if(a)a=!1;else if(this.expect(12),this.match(s)){r&&this.addTrailingCommaExtraToNode(r),this.next();break}n.push(this.parseExprListItem(e,t))}return n}parseExprListItem(s,e,t){let r;if(this.match(12))s||this.raise(m.UnexpectedToken,this.state.curPosition(),{unexpected:","}),r=null;else if(this.match(21)){let n=this.state.startLoc;r=this.parseParenItem(this.parseSpread(e),n)}else if(this.match(17)){this.expectPlugin("partialApplication"),t||this.raise(m.UnexpectedArgumentPlaceholder,this.state.startLoc);let n=this.startNode();this.next(),r=this.finishNode(n,"ArgumentPlaceholder")}else r=this.parseMaybeAssignAllowIn(e,this.parseParenItem);return r}parseIdentifier(s){let e=this.startNode(),t=this.parseIdentifierName(s);return this.createIdentifier(e,t)}createIdentifier(s,e){return s.name=e,s.loc.identifierName=e,this.finishNode(s,"Identifier")}parseIdentifierName(s){let e,{startLoc:t,type:r}=this.state;Te(r)?e=this.state.value:this.unexpected();let n=lo(r);return s?n&&this.replaceToken(132):this.checkReservedWord(e,t,n,!1),this.next(),e}checkReservedWord(s,e,t,r){if(s.length>10||!Io(s))return;if(t&&wo(s)){this.raise(m.UnexpectedKeyword,e,{keyword:s});return}if((this.state.strict?r?Hi:Ji:Wi)(s,this.inModule)){this.raise(m.UnexpectedReservedWord,e,{reservedWord:s});return}else if(s==="yield"){if(this.prodParam.hasYield){this.raise(m.YieldBindingIdentifier,e);return}}else if(s==="await"){if(this.prodParam.hasAwait){this.raise(m.AwaitBindingIdentifier,e);return}if(this.scope.inStaticBlock){this.raise(m.AwaitBindingIdentifierInStaticBlock,e);return}this.expressionScope.recordAsyncArrowParametersError(e)}else if(s==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(m.ArgumentsInClass,e);return}}recordAwaitIfAllowed(){let s=this.prodParam.hasAwait||this.options.allowAwaitOutsideFunction&&!this.scope.inFunction;return s&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),s}parseAwait(s){let e=this.startNodeAt(s);return this.expressionScope.recordParameterInitializerError(m.AwaitExpressionFormalParameter,e),this.eat(55)&&this.raise(m.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;let{type:s}=this.state;return s===53||s===10||s===0||ns(s)||s===102&&!this.state.containsEsc||s===137||s===56||this.hasPlugin("v8intrinsic")&&s===54}parseYield(){let s=this.startNode();this.expressionScope.recordParameterInitializerError(m.YieldInParameter,s),this.next();let e=!1,t=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:t=this.parseMaybeAssign()}return s.delegate=e,s.argument=t,this.finishNode(s,"YieldExpression")}parseImportCall(s){return this.next(),s.source=this.parseMaybeAssignAllowIn(),(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))&&(s.options=null),this.eat(12)&&(this.expectImportAttributesPlugin(),this.match(11)||(s.options=this.parseMaybeAssignAllowIn(),this.eat(12))),this.expect(11),this.finishNode(s,"ImportExpression")}checkPipelineAtInfixOperator(s,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&s.type==="SequenceExpression"&&this.raise(m.PipelineHeadSequenceExpression,e)}parseSmartPipelineBodyInStyle(s,e){if(this.isSimpleReference(s)){let t=this.startNodeAt(e);return t.callee=s,this.finishNode(t,"PipelineBareFunction")}else{let t=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),t.expression=s,this.finishNode(t,"PipelineTopicExpression")}}isSimpleReference(s){switch(s.type){case"MemberExpression":return!s.computed&&this.isSimpleReference(s.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(s){if(this.match(19))throw this.raise(m.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(m.PipelineTopicUnused,s)}withTopicBindingContext(s){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return s()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(s){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return s()}finally{this.state.topicContext=e}}else return s()}withSoloAwaitPermittingContext(s){let e=this.state.soloAwait;this.state.soloAwait=!0;try{return s()}finally{this.state.soloAwait=e}}allowInAnd(s){let e=this.prodParam.currentFlags();if(8&~e){this.prodParam.enter(e|8);try{return s()}finally{this.prodParam.exit()}}return s()}disallowInAnd(s){let e=this.prodParam.currentFlags();if(8&e){this.prodParam.enter(e&-9);try{return s()}finally{this.prodParam.exit()}}return s()}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(s){let e=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let t=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let r=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,s);return this.state.inFSharpPipelineDirectBody=t,r}parseModuleExpression(){this.expectPlugin("moduleBlocks");let s=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let e=this.startNodeAt(this.state.endLoc);this.next();let t=this.initializeScopes(!0);this.enterInitialScopes();try{s.body=this.parseProgram(e,8,"module")}finally{t()}return this.finishNode(s,"ModuleExpression")}parsePropertyNamePrefixOperator(s){}},Xs={kind:1},ol={kind:2},ll=/[\uD800-\uDFFF]/u,Gs=/in(?:stanceof)?/y;function cl(i,s){for(let e=0;e<i.length;e++){let t=i[e],{type:r}=t;if(typeof r=="number"){{if(r===138){let{loc:n,start:a,value:o,end:l}=t,c=a+1,u=ae(n.start,1);i.splice(e,1,new we({type:De(27),value:"#",start:a,end:c,startLoc:n.start,endLoc:u}),new we({type:De(132),value:o,start:c,end:l,startLoc:u,endLoc:n.end})),e++;continue}if(ns(r)){let{loc:n,start:a,value:o,end:l}=t,c=a+1,u=ae(n.start,1),h;s.charCodeAt(a)===96?h=new we({type:De(22),value:"`",start:a,end:c,startLoc:n.start,endLoc:u}):h=new we({type:De(8),value:"}",start:a,end:c,startLoc:n.start,endLoc:u});let f,d,p,g;r===24?(d=l-1,p=ae(n.end,-1),f=o===null?null:o.slice(1,-1),g=new we({type:De(22),value:"`",start:d,end:l,startLoc:p,endLoc:n.end})):(d=l-2,p=ae(n.end,-2),f=o===null?null:o.slice(1,-2),g=new we({type:De(23),value:"${",start:d,end:l,startLoc:p,endLoc:n.end})),i.splice(e,1,h,new we({type:De(20),value:f,start:c,end:d,startLoc:u,endLoc:p}),g),e+=2;continue}}t.type=De(r)}}return i}var yr=class extends mr{parseTopLevel(s,e){return s.program=this.parseProgram(e),s.comments=this.comments,this.options.tokens&&(s.tokens=cl(this.tokens,this.input)),this.finishNode(s,"File")}parseProgram(s,e=139,t=this.options.sourceType){if(s.sourceType=t,s.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(s,!0,!0,e),this.inModule){if(!this.options.allowUndeclaredExports&&this.scope.undefinedExports.size>0)for(let[n,a]of Array.from(this.scope.undefinedExports))this.raise(m.ModuleExportUndefined,a,{localName:n});this.addExtra(s,"topLevelAwait",this.state.hasTopLevelAwait)}let r;return e===139?r=this.finishNode(s,"Program"):r=this.finishNodeAt(s,"Program",ae(this.state.startLoc,-1)),r}stmtToDirective(s){let e=s;e.type="Directive",e.value=e.expression,delete e.expression;let t=e.value,r=t.value,n=this.input.slice(t.start,t.end),a=t.value=n.slice(1,-1);return this.addExtra(t,"raw",n),this.addExtra(t,"rawValue",a),this.addExtra(t,"expressionValue",r),t.type="DirectiveLiteral",e}parseInterpreterDirective(){if(!this.match(28))return null;let s=this.startNode();return s.value=this.state.value,this.next(),this.finishNode(s,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(s,e){if(Me(s)){if(Gs.lastIndex=e,Gs.test(this.input)){let t=this.codePointAtPos(Gs.lastIndex);if(!st(t)&&t!==92)return!1}return!0}else return s===92}chStartsBindingPattern(s){return s===91||s===123}hasFollowingBindingAtom(){let s=this.nextTokenStart(),e=this.codePointAtPos(s);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,s)}hasInLineFollowingBindingIdentifierOrBrace(){let s=this.nextTokenInLineStart(),e=this.codePointAtPos(s);return e===123||this.chStartsBindingIdentifier(e,s)}startsUsingForOf(){let{type:s,containsEsc:e}=this.lookahead();if(s===102&&!e)return!1;if(R(s)&&!this.hasFollowingLineBreak())return this.expectPlugin("explicitResourceManagement"),!0}startsAwaitUsing(){let s=this.nextTokenInLineStart();if(this.isUnparsedContextual(s,"using")){s=this.nextTokenInLineStartSince(s+5);let e=this.codePointAtPos(s);if(this.chStartsBindingIdentifier(e,s))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(s=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,s&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(s){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(s,e)}parseStatementContent(s,e){let t=this.state.type,r=this.startNode(),n=!!(s&2),a=!!(s&4),o=s&1;switch(t){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?m.StrictFunction:this.options.annexB?m.SloppyFunctionAnnexB:m.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(m.UnexpectedLexicalDeclaration,r):this.raise(m.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(m.UnexpectedUsingDeclaration,this.state.startLoc):n||this.raise(m.UnexpectedLexicalDeclaration,this.state.startLoc),this.parseVarStatement(r,"using");case 100:{if(this.state.containsEsc)break;let u=this.nextTokenStart(),h=this.codePointAtPos(u);if(h!==91&&(!n&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(h,u)&&h!==123))break}case 75:n||this.raise(m.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let 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:{let u=this.lookaheadCharCode();if(u===40||u===46)break}case 82:{!this.options.allowImportExportEverywhere&&!o&&this.raise(m.UnexpectedImportExport,this.state.startLoc),this.next();let u;return t===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(m.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(r,!0,!n&&a)}let l=this.state.value,c=this.parseExpression();return R(t)&&c.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(r,l,c,s):this.parseExpressionStatement(r,c,e)}assertModuleNodeAllowed(s){!this.options.allowImportExportEverywhere&&!this.inModule&&this.raise(m.ImportOutsideModule,s)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(s,e,t){return s&&(e.decorators&&e.decorators.length>0?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(m.DecoratorsBeforeAfterExport,e.decorators[0]),e.decorators.unshift(...s)):e.decorators=s,this.resetStartLocationFromNode(e,s[0]),t&&this.resetStartLocationFromNode(t,e)),e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(s){let e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))s||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(m.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(m.UnexpectedLeadingDecorator,this.state.startLoc);return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let s=this.startNode();if(this.next(),this.hasPlugin("decorators")){let e=this.state.startLoc,t;if(this.match(10)){let r=this.state.startLoc;this.next(),t=this.parseExpression(),this.expect(11),t=this.wrapParenthesis(r,t);let n=this.state.startLoc;s.expression=this.parseMaybeDecoratorArguments(t),this.getPluginOption("decorators","allowCallParenthesized")===!1&&s.expression!==t&&this.raise(m.DecoratorArgumentsOutsideParentheses,n)}else{for(t=this.parseIdentifier(!1);this.eat(16);){let r=this.startNodeAt(e);r.object=t,this.match(138)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),r.property=this.parsePrivateName()):r.property=this.parseIdentifier(!0),r.computed=!1,t=this.finishNode(r,"MemberExpression")}s.expression=this.parseMaybeDecoratorArguments(t)}}else s.expression=this.parseExprSubscripts();return this.finishNode(s,"Decorator")}parseMaybeDecoratorArguments(s){if(this.eat(10)){let e=this.startNodeAtNode(s);return e.callee=s,e.arguments=this.parseCallExpressionArguments(11,!1),this.toReferencedList(e.arguments),this.finishNode(e,"CallExpression")}return s}parseBreakContinueStatement(s,e){return this.next(),this.isLineTerminator()?s.label=null:(s.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(s,e),this.finishNode(s,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(s,e){let t;for(t=0;t<this.state.labels.length;++t){let r=this.state.labels[t];if((s.label==null||r.name===s.label.name)&&(r.kind!=null&&(e||r.kind===1)||s.label&&e))break}if(t===this.state.labels.length){let r=e?"BreakStatement":"ContinueStatement";this.raise(m.IllegalBreakContinue,s,{type:r})}}parseDebuggerStatement(s){return this.next(),this.semicolon(),this.finishNode(s,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let s=this.parseExpression();return this.expect(11),s}parseDoWhileStatement(s){return this.next(),this.state.labels.push(Xs),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),s.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(s,"DoWhileStatement")}parseForStatement(s){this.next(),this.state.labels.push(Xs);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(s,null);let t=this.isContextual(100);{let l=this.isContextual(96)&&this.startsAwaitUsing(),c=l||this.isContextual(107)&&this.startsUsingForOf(),u=t&&this.hasFollowingBindingAtom()||c;if(this.match(74)||this.match(75)||u){let h=this.startNode(),f;l?(f="await using",this.recordAwaitIfAllowed()||this.raise(m.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):f=this.state.value,this.next(),this.parseVar(h,!0,f);let d=this.finishNode(h,"VariableDeclaration"),p=this.match(58);return p&&c&&this.raise(m.ForInUsing,d),(p||this.isContextual(102))&&d.declarations.length===1?this.parseForIn(s,d,e):(e!==null&&this.unexpected(e),this.parseFor(s,d))}}let r=this.isContextual(95),n=new it,a=this.parseExpression(!0,n),o=this.isContextual(102);if(o&&(t&&this.raise(m.ForOfLet,a),e===null&&r&&a.type==="Identifier"&&this.raise(m.ForOfAsync,a)),o||this.match(58)){this.checkDestructuringPrivate(n),this.toAssignable(a,!0);let l=o?"ForOfStatement":"ForInStatement";return this.checkLVal(a,{type:l}),this.parseForIn(s,a,e)}else this.checkExpressionErrors(n,!0);return e!==null&&this.unexpected(e),this.parseFor(s,a)}parseFunctionStatement(s,e,t){return this.next(),this.parseFunction(s,1|(t?2:0)|(e?8:0))}parseIfStatement(s){return this.next(),s.test=this.parseHeaderExpression(),s.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),s.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(s,"IfStatement")}parseReturnStatement(s){return!this.prodParam.hasReturn&&!this.options.allowReturnOutsideFunction&&this.raise(m.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?s.argument=null:(s.argument=this.parseExpression(),this.semicolon()),this.finishNode(s,"ReturnStatement")}parseSwitchStatement(s){this.next(),s.discriminant=this.parseHeaderExpression();let e=s.cases=[];this.expect(5),this.state.labels.push(ol),this.scope.enter(0);let t;for(let r;!this.match(8);)if(this.match(61)||this.match(65)){let n=this.match(61);t&&this.finishNode(t,"SwitchCase"),e.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(r&&this.raise(m.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),r=!0,t.test=null),this.expect(14)}else t?t.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(s,"SwitchStatement")}parseThrowStatement(s){return this.next(),this.hasPrecedingLineBreak()&&this.raise(m.NewlineAfterThrow,this.state.lastTokEndLoc),s.argument=this.parseExpression(),this.semicolon(),this.finishNode(s,"ThrowStatement")}parseCatchClauseParam(){let s=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&s.type==="Identifier"?8:0),this.checkLVal(s,{type:"CatchClause"},9),s}parseTryStatement(s){if(this.next(),s.block=this.parseBlock(),s.handler=null,this.match(62)){let 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(),s.handler=this.finishNode(e,"CatchClause")}return s.finalizer=this.eat(67)?this.parseBlock():null,!s.handler&&!s.finalizer&&this.raise(m.NoCatchOrFinally,s),this.finishNode(s,"TryStatement")}parseVarStatement(s,e,t=!1){return this.next(),this.parseVar(s,!1,e,t),this.semicolon(),this.finishNode(s,"VariableDeclaration")}parseWhileStatement(s){return this.next(),s.test=this.parseHeaderExpression(),this.state.labels.push(Xs),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(s,"WhileStatement")}parseWithStatement(s){return this.state.strict&&this.raise(m.StrictWith,this.state.startLoc),this.next(),s.object=this.parseHeaderExpression(),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(s,"WithStatement")}parseEmptyStatement(s){return this.next(),this.finishNode(s,"EmptyStatement")}parseLabeledStatement(s,e,t,r){for(let a of this.state.labels)a.name===e&&this.raise(m.LabelRedeclaration,t,{labelName:e});let n=ho(this.state.type)?1:this.match(71)?2:null;for(let a=this.state.labels.length-1;a>=0;a--){let o=this.state.labels[a];if(o.statementStart===s.start)o.statementStart=this.state.start,o.kind=n;else break}return this.state.labels.push({name:e,kind:n,statementStart:this.state.start}),s.body=r&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),s.label=t,this.finishNode(s,"LabeledStatement")}parseExpressionStatement(s,e,t){return s.expression=e,this.semicolon(),this.finishNode(s,"ExpressionStatement")}parseBlock(s=!1,e=!0,t){let r=this.startNode();return s&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(r,s,!1,8,t),e&&this.scope.exit(),this.finishNode(r,"BlockStatement")}isValidDirective(s){return s.type==="ExpressionStatement"&&s.expression.type==="StringLiteral"&&!s.expression.extra.parenthesized}parseBlockBody(s,e,t,r,n){let a=s.body=[],o=s.directives=[];this.parseBlockOrModuleBlockBody(a,e?o:void 0,t,r,n)}parseBlockOrModuleBlockBody(s,e,t,r,n){let a=this.state.strict,o=!1,l=!1;for(;!this.match(r);){let c=t?this.parseModuleItem():this.parseStatementListItem();if(e&&!l){if(this.isValidDirective(c)){let u=this.stmtToDirective(c);e.push(u),!o&&u.value.value==="use strict"&&(o=!0,this.setStrict(!0));continue}l=!0,this.state.strictErrors.clear()}s.push(c)}n?.call(this,o),a||this.setStrict(!1),this.next()}parseFor(s,e){return s.init=e,this.semicolon(!1),s.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),s.update=this.match(11)?null:this.parseExpression(),this.expect(11),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(s,"ForStatement")}parseForIn(s,e,t){let r=this.match(58);return this.next(),r?t!==null&&this.unexpected(t):s.await=t!==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(m.ForInOfLoopInitializer,e,{type:r?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(m.InvalidLhs,e,{ancestor:{type:"ForStatement"}}),s.left=e,s.right=r?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(s,r?"ForInStatement":"ForOfStatement")}parseVar(s,e,t,r=!1){let n=s.declarations=[];for(s.kind=t;;){let a=this.startNode();if(this.parseVarId(a,t),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(m.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(t==="const"||t==="using"||t==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(m.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:t})),n.push(this.finishNode(a,"VariableDeclarator")),!this.eat(12))break}return s}parseVarId(s,e){let t=this.parseBindingAtom();(e==="using"||e==="await using")&&(t.type==="ArrayPattern"||t.type==="ObjectPattern")&&this.raise(m.UsingDeclarationHasBindingPattern,t.loc.start),this.checkLVal(t,{type:"VariableDeclarator"},e==="var"?5:8201),s.id=t}parseAsyncFunctionExpression(s){return this.parseFunction(s,8)}parseFunction(s,e=0){let t=e&2,r=!!(e&1),n=r&&!(e&4),a=!!(e&8);this.initFunction(s,a),this.match(55)&&(t&&this.raise(m.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),s.generator=!0),r&&(s.id=this.parseFunctionId(n));let o=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(rs(a,s.generator)),r||(s.id=this.parseFunctionId()),this.parseFunctionParams(s,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(s,r?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),r&&!t&&this.registerFunctionStatementId(s),this.state.maybeInArrowParameters=o,s}parseFunctionId(s){return s||R(this.state.type)?this.parseIdentifier():null}parseFunctionParams(s,e){this.expect(10),this.expressionScope.enter(Bo()),s.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(s){s.id&&this.scope.declareName(s.id.name,!this.options.annexB||this.state.strict||s.generator||s.async?this.scope.treatFunctionsAsVar?5:8201:17,s.id.loc.start)}parseClass(s,e,t){this.next();let r=this.state.strict;return this.state.strict=!0,this.parseClassId(s,e,t),this.parseClassSuper(s),s.body=this.parseClassBody(!!s.superClass,r),this.finishNode(s,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(s){return s.type==="Identifier"&&s.name==="constructor"||s.type==="StringLiteral"&&s.value==="constructor"}isNonstaticConstructor(s){return!s.computed&&!s.static&&this.nameIsConstructor(s.key)}parseClassBody(s,e){this.classScope.enter();let t={hadConstructor:!1,hadSuperClass:s},r=[],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(m.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){r.push(this.parseDecorator());continue}let a=this.startNode();r.length&&(a.decorators=r,this.resetStartLocationFromNode(a,r[0]),r=[]),this.parseClassMember(n,a,t),a.kind==="constructor"&&a.decorators&&a.decorators.length>0&&this.raise(m.DecoratorConstructor,a)}}),this.state.strict=e,this.next(),r.length)throw this.raise(m.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(n,"ClassBody")}parseClassMemberFromModifier(s,e){let t=this.parseIdentifier(!0);if(this.isClassMethod()){let r=e;return r.kind="method",r.computed=!1,r.key=t,r.static=!1,this.pushClassMethod(s,r,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let r=e;return r.computed=!1,r.key=t,r.static=!1,s.body.push(this.parseClassProperty(r)),!0}return this.resetPreviousNodeTrailingComments(t),!1}parseClassMember(s,e,t){let r=this.isContextual(106);if(r){if(this.parseClassMemberFromModifier(s,e))return;if(this.eat(5)){this.parseClassStaticBlock(s,e);return}}this.parseClassMemberWithIsStatic(s,e,t,r)}parseClassMemberWithIsStatic(s,e,t,r){let n=e,a=e,o=e,l=e,c=e,u=n,h=n;if(e.static=r,this.parsePropertyNamePrefixOperator(e),this.eat(55)){u.kind="method";let b=this.match(138);if(this.parseClassElementName(u),b){this.pushClassPrivateMethod(s,a,!0,!1);return}this.isNonstaticConstructor(n)&&this.raise(m.ConstructorIsGenerator,n.key),this.pushClassMethod(s,n,!0,!1,!1,!1);return}let f=!this.state.containsEsc&&R(this.state.type),d=this.parseClassElementName(e),p=f?d.name:null,g=this.isPrivateName(d),y=this.state.startLoc;if(this.parsePostMemberNameModifiers(h),this.isClassMethod()){if(u.kind="method",g){this.pushClassPrivateMethod(s,a,!1,!1);return}let b=this.isNonstaticConstructor(n),P=!1;b&&(n.kind="constructor",t.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(m.DuplicateConstructor,d),b&&this.hasPlugin("typescript")&&e.override&&this.raise(m.OverrideOnConstructor,d),t.hadConstructor=!0,P=t.hadSuperClass),this.pushClassMethod(s,n,!1,!1,b,P)}else if(this.isClassProperty())g?this.pushClassPrivateProperty(s,l):this.pushClassProperty(s,o);else if(p==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(d);let b=this.eat(55);h.optional&&this.unexpected(y),u.kind="method";let P=this.match(138);this.parseClassElementName(u),this.parsePostMemberNameModifiers(h),P?this.pushClassPrivateMethod(s,a,b,!0):(this.isNonstaticConstructor(n)&&this.raise(m.ConstructorIsAsync,n.key),this.pushClassMethod(s,n,b,!0,!1,!1))}else if((p==="get"||p==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(d),u.kind=p;let b=this.match(138);this.parseClassElementName(n),b?this.pushClassPrivateMethod(s,a,!1,!1):(this.isNonstaticConstructor(n)&&this.raise(m.ConstructorIsAccessor,n.key),this.pushClassMethod(s,n,!1,!1,!1,!1)),this.checkGetterSetterParams(n)}else if(p==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(d);let b=this.match(138);this.parseClassElementName(o),this.pushClassAccessorProperty(s,c,b)}else this.isLineTerminator()?g?this.pushClassPrivateProperty(s,l):this.pushClassProperty(s,o):this.unexpected()}parseClassElementName(s){let{type:e,value:t}=this.state;if((e===132||e===133)&&s.static&&t==="prototype"&&this.raise(m.StaticPrototype,this.state.startLoc),e===138){t==="constructor"&&this.raise(m.ConstructorClassPrivateField,this.state.startLoc);let r=this.parsePrivateName();return s.key=r,r}return this.parsePropertyName(s),s.key}parseClassStaticBlock(s,e){var t;this.scope.enter(208);let r=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let n=e.body=[];this.parseBlockOrModuleBlockBody(n,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=r,s.body.push(this.finishNode(e,"StaticBlock")),(t=e.decorators)!=null&&t.length&&this.raise(m.DecoratorStaticBlock,e)}pushClassProperty(s,e){!e.computed&&this.nameIsConstructor(e.key)&&this.raise(m.ConstructorClassField,e.key),s.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(s,e){let t=this.parseClassPrivateProperty(e);s.body.push(t),this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),0,t.key.loc.start)}pushClassAccessorProperty(s,e,t){!t&&!e.computed&&this.nameIsConstructor(e.key)&&this.raise(m.ConstructorClassField,e.key);let r=this.parseClassAccessorProperty(e);s.body.push(r),t&&this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.loc.start)}pushClassMethod(s,e,t,r,n,a){s.body.push(this.parseMethod(e,t,r,n,a,"ClassMethod",!0))}pushClassPrivateMethod(s,e,t,r){let n=this.parseMethod(e,t,r,!1,!1,"ClassPrivateMethod",!0);s.body.push(n);let a=n.kind==="get"?n.static?6:2:n.kind==="set"?n.static?5:1:0;this.declareClassPrivateMethodInScope(n,a)}declareClassPrivateMethodInScope(s,e){this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),e,s.key.loc.start)}parsePostMemberNameModifiers(s){}parseClassPrivateProperty(s){return this.parseInitializer(s),this.semicolon(),this.finishNode(s,"ClassPrivateProperty")}parseClassProperty(s){return this.parseInitializer(s),this.semicolon(),this.finishNode(s,"ClassProperty")}parseClassAccessorProperty(s){return this.parseInitializer(s),this.semicolon(),this.finishNode(s,"ClassAccessorProperty")}parseInitializer(s){this.scope.enter(80),this.expressionScope.enter(Yi()),this.prodParam.enter(0),s.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(s,e,t,r=8331){if(R(this.state.type))s.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(s.id,r);else if(t||!e)s.id=null;else throw this.raise(m.MissingClassName,this.state.startLoc)}parseClassSuper(s){s.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(s,e){let t=this.parseMaybeImportPhase(s,!0),r=this.maybeParseExportDefaultSpecifier(s,t),n=!r||this.eat(12),a=n&&this.eatExportStar(s),o=a&&this.maybeParseExportNamespaceSpecifier(s),l=n&&(!o||this.eat(12)),c=r||a;if(a&&!o){if(r&&this.unexpected(),e)throw this.raise(m.UnsupportedDecoratorExport,s);return this.parseExportFrom(s,!0),this.finishNode(s,"ExportAllDeclaration")}let u=this.maybeParseExportNamedSpecifiers(s);r&&n&&!a&&!u&&this.unexpected(null,5),o&&l&&this.unexpected(null,98);let h;if(c||u){if(h=!1,e)throw this.raise(m.UnsupportedDecoratorExport,s);this.parseExportFrom(s,c)}else h=this.maybeParseExportDeclaration(s);if(c||u||h){var f;let d=s;if(this.checkExport(d,!0,!1,!!d.source),((f=d.declaration)==null?void 0:f.type)==="ClassDeclaration")this.maybeTakeDecorators(e,d.declaration,d);else if(e)throw this.raise(m.UnsupportedDecoratorExport,s);return this.finishNode(d,"ExportNamedDeclaration")}if(this.eat(65)){let d=s,p=this.parseExportDefaultExpression();if(d.declaration=p,p.type==="ClassDeclaration")this.maybeTakeDecorators(e,p,d);else if(e)throw this.raise(m.UnsupportedDecoratorExport,s);return this.checkExport(d,!0,!0),this.finishNode(d,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(s){return this.eat(55)}maybeParseExportDefaultSpecifier(s,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e?.loc.start);let t=e||this.parseIdentifier(!0),r=this.startNodeAtNode(t);return r.exported=t,s.specifiers=[this.finishNode(r,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(s){if(this.isContextual(93)){var e,t;(t=(e=s).specifiers)!=null||(e.specifiers=[]);let r=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),r.exported=this.parseModuleExportName(),s.specifiers.push(this.finishNode(r,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(s){if(this.match(5)){let e=s;e.specifiers||(e.specifiers=[]);let t=e.exportKind==="type";return e.specifiers.push(...this.parseExportSpecifiers(t)),e.source=null,e.declaration=null,this.hasPlugin("importAssertions")&&(e.assertions=[]),!0}return!1}maybeParseExportDeclaration(s){return this.shouldParseExportDeclaration()?(s.specifiers=[],s.source=null,this.hasPlugin("importAssertions")&&(s.assertions=[]),s.declaration=this.parseExportDeclaration(s),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let s=this.nextTokenInLineStart();return this.isUnparsedContextual(s,"function")}parseExportDefaultExpression(){let s=this.startNode();if(this.match(68))return this.next(),this.parseFunction(s,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(s,13);if(this.match(80))return this.parseClass(s,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(m.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(m.UnsupportedDefaultExport,this.state.startLoc);let e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(s){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:s}=this.state;if(R(s)){if(s===95&&!this.state.containsEsc||s===100)return!1;if((s===130||s===129)&&!this.state.containsEsc){let{type:r}=this.lookahead();if(R(r)&&r!==98||r===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let e=this.nextTokenStart(),t=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||R(this.state.type)&&t)return!0;if(this.match(65)&&t){let r=this.input.charCodeAt(this.nextTokenStartSince(e+4));return r===34||r===39}return!1}parseExportFrom(s,e){this.eatContextual(98)?(s.source=this.parseImportSource(),this.checkExport(s),this.maybeParseImportAttributes(s),this.checkJSONModuleImport(s)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:s}=this.state;return s===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(m.DecoratorBeforeExport,this.state.startLoc),!0):this.isContextual(107)?(this.raise(m.UsingDeclarationExport,this.state.startLoc),!0):this.isContextual(96)&&this.startsAwaitUsing()?(this.raise(m.UsingDeclarationExport,this.state.startLoc),!0):s===74||s===75||s===68||s===80||this.isLet()||this.isAsyncFunction()}checkExport(s,e,t,r){if(e){var n;if(t){if(this.checkDuplicateExports(s,"default"),this.hasPlugin("exportDefaultFrom")){var a;let o=s.declaration;o.type==="Identifier"&&o.name==="from"&&o.end-o.start===4&&!((a=o.extra)!=null&&a.parenthesized)&&this.raise(m.ExportDefaultFromAsIdentifier,o)}}else if((n=s.specifiers)!=null&&n.length)for(let o of s.specifiers){let{exported:l}=o,c=l.type==="Identifier"?l.name:l.value;if(this.checkDuplicateExports(o,c),!r&&o.local){let{local:u}=o;u.type!=="Identifier"?this.raise(m.ExportBindingIsString,o,{localName:u.value,exportName:c}):(this.checkReservedWord(u.name,u.loc.start,!0,!1),this.scope.checkLocalExport(u))}}else if(s.declaration){let o=s.declaration;if(o.type==="FunctionDeclaration"||o.type==="ClassDeclaration"){let{id:l}=o;if(!l)throw new Error("Assertion failure");this.checkDuplicateExports(s,l.name)}else if(o.type==="VariableDeclaration")for(let l of o.declarations)this.checkDeclaration(l.id)}}}checkDeclaration(s){if(s.type==="Identifier")this.checkDuplicateExports(s,s.name);else if(s.type==="ObjectPattern")for(let e of s.properties)this.checkDeclaration(e);else if(s.type==="ArrayPattern")for(let e of s.elements)e&&this.checkDeclaration(e);else s.type==="ObjectProperty"?this.checkDeclaration(s.value):s.type==="RestElement"?this.checkDeclaration(s.argument):s.type==="AssignmentPattern"&&this.checkDeclaration(s.left)}checkDuplicateExports(s,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(m.DuplicateDefaultExport,s):this.raise(m.DuplicateExport,s,{exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(s){let e=[],t=!0;for(this.expect(5);!this.eat(8);){if(t)t=!1;else if(this.expect(12),this.eat(8))break;let r=this.isContextual(130),n=this.match(133),a=this.startNode();a.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(a,n,s,r))}return e}parseExportSpecifier(s,e,t,r){return this.eatContextual(93)?s.exported=this.parseModuleExportName():e?s.exported=Uo(s.local):s.exported||(s.exported=Be(s.local)),this.finishNode(s,"ExportSpecifier")}parseModuleExportName(){if(this.match(133)){let s=this.parseStringLiteral(this.state.value),e=ll.exec(s.value);return e&&this.raise(m.ModuleExportNameHasLoneSurrogate,s,{surrogateCharCode:e[0].charCodeAt(0)}),s}return this.parseIdentifier(!0)}isJSONModuleImport(s){return s.assertions!=null?s.assertions.some(({key:e,value:t})=>t.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(s){let{specifiers:e}=s,t=e.length===1?e[0].type:null;if(s.phase==="source")t!=="ImportDefaultSpecifier"&&this.raise(m.SourcePhaseImportRequiresDefault,e[0].loc.start);else if(s.phase==="defer")t!=="ImportNamespaceSpecifier"&&this.raise(m.DeferImportRequiresNamespace,e[0].loc.start);else if(s.module){var r;t!=="ImportDefaultSpecifier"&&this.raise(m.ImportReflectionNotBinding,e[0].loc.start),((r=s.assertions)==null?void 0:r.length)>0&&this.raise(m.ImportReflectionHasAssertion,e[0].loc.start)}}checkJSONModuleImport(s){if(this.isJSONModuleImport(s)&&s.type!=="ExportAllDeclaration"){let{specifiers:e}=s;if(e!=null){let t=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"});t!==void 0&&this.raise(m.ImportJSONBindingNotDefault,t.loc.start)}}}isPotentialImportPhase(s){return s?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(s,e,t,r){e||(t==="module"?(this.expectPlugin("importReflection",r),s.module=!0):this.hasPlugin("importReflection")&&(s.module=!1),t==="source"?(this.expectPlugin("sourcePhaseImports",r),s.phase="source"):t==="defer"?(this.expectPlugin("deferredImportEvaluation",r),s.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(s.phase=null))}parseMaybeImportPhase(s,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(s,e,null),null;let t=this.parseIdentifier(!0),{type:r}=this.state;return(Te(r)?r!==98||this.lookaheadCharCode()===102:r!==12)?(this.resetPreviousIdentifierLeadingComments(t),this.applyImportPhase(s,e,t.name,t.loc.start),null):(this.applyImportPhase(s,e,null),t)}isPrecedingIdImportPhase(s){let{type:e}=this.state;return R(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(s){return this.match(133)?this.parseImportSourceAndAttributes(s):this.parseImportSpecifiersAndAfter(s,this.parseMaybeImportPhase(s,!1))}parseImportSpecifiersAndAfter(s,e){s.specifiers=[];let r=!this.maybeParseDefaultImportSpecifier(s,e)||this.eat(12),n=r&&this.maybeParseStarImportSpecifier(s);return r&&!n&&this.parseNamedImportSpecifiers(s),this.expectContextual(98),this.parseImportSourceAndAttributes(s)}parseImportSourceAndAttributes(s){var e;return(e=s.specifiers)!=null||(s.specifiers=[]),s.source=this.parseImportSource(),this.maybeParseImportAttributes(s),this.checkImportReflection(s),this.checkJSONModuleImport(s),this.semicolon(),this.finishNode(s,"ImportDeclaration")}parseImportSource(){return this.match(133)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(s,e,t){e.local=this.parseIdentifier(),s.specifiers.push(this.finishImportSpecifier(e,t))}finishImportSpecifier(s,e,t=8201){return this.checkLVal(s.local,{type:e},t),this.finishNode(s,e)}parseImportAttributes(){this.expect(5);let s=[],e=new Set;do{if(this.match(8))break;let t=this.startNode(),r=this.state.value;if(e.has(r)&&this.raise(m.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:r}),e.add(r),this.match(133)?t.key=this.parseStringLiteral(r):t.key=this.parseIdentifier(!0),this.expect(14),!this.match(133))throw this.raise(m.ModuleAttributeInvalidValue,this.state.startLoc);t.value=this.parseStringLiteral(this.state.value),s.push(this.finishNode(t,"ImportAttribute"))}while(this.eat(12));return this.expect(8),s}parseModuleAttributes(){let s=[],e=new Set;do{let t=this.startNode();if(t.key=this.parseIdentifier(!0),t.key.name!=="type"&&this.raise(m.ModuleAttributeDifferentFromType,t.key),e.has(t.key.name)&&this.raise(m.ModuleAttributesWithDuplicateKeys,t.key,{key:t.key.name}),e.add(t.key.name),this.expect(14),!this.match(133))throw this.raise(m.ModuleAttributeInvalidValue,this.state.startLoc);t.value=this.parseStringLiteral(this.state.value),s.push(this.finishNode(t,"ImportAttribute"))}while(this.eat(12));return s}maybeParseImportAttributes(s){let e,t=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?e=this.parseModuleAttributes():(this.expectImportAttributesPlugin(),e=this.parseImportAttributes()),t=!0}else if(this.isContextual(94)&&!this.hasPrecedingLineBreak())this.hasPlugin("importAttributes")?(this.getPluginOption("importAttributes","deprecatedAssertSyntax")!==!0&&this.raise(m.ImportAttributesUseAssert,this.state.startLoc),this.addExtra(s,"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;!t&&this.hasPlugin("importAssertions")?s.assertions=e:s.attributes=e}maybeParseDefaultImportSpecifier(s,e){if(e){let t=this.startNodeAtNode(e);return t.local=e,s.specifiers.push(this.finishImportSpecifier(t,"ImportDefaultSpecifier")),!0}else if(Te(this.state.type))return this.parseImportSpecifierLocal(s,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(s){if(this.match(55)){let e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(s,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(s){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(m.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let t=this.startNode(),r=this.match(133),n=this.isContextual(130);t.imported=this.parseModuleExportName();let a=this.parseImportSpecifier(t,r,s.importKind==="type"||s.importKind==="typeof",n,void 0);s.specifiers.push(a)}}parseImportSpecifier(s,e,t,r,n){if(this.eatContextual(93))s.local=this.parseIdentifier();else{let{imported:a}=s;if(e)throw this.raise(m.ImportBindingIsString,s,{importName:a.value});this.checkReservedWord(a.name,s.loc.start,!0,!0),s.local||(s.local=Be(a))}return this.finishImportSpecifier(s,"ImportSpecifier",n)}isThisParam(s){return s.type==="Identifier"&&s.name==="this"}},os=class extends yr{constructor(s,e,t){s=al(s),super(s,e),this.options=s,this.initializeScopes(),this.plugins=t,this.filename=s.sourceFilename}getScopeHandler(){return It}parse(){this.enterInitialScopes();let s=this.startNode(),e=this.startNode();return this.nextToken(),s.errors=null,this.parseTopLevel(s,e),s.errors=this.state.errors,s.comments.length=this.state.commentsLen,s}};function ul(i,s){var e;if(((e=s)==null?void 0:e.sourceType)==="unambiguous"){s=Object.assign({},s);try{s.sourceType="module";let t=wt(s,i),r=t.parse();if(t.sawUnambiguousESM)return r;if(t.ambiguousScriptDifferentAst)try{return s.sourceType="script",wt(s,i).parse()}catch{}else r.program.sourceType="script";return r}catch(t){try{return s.sourceType="script",wt(s,i).parse()}catch{}throw t}}else return wt(s,i).parse()}function hl(i,s){let e=wt(s,i);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function pl(i){let s={};for(let e of Object.keys(i))s[e]=De(i[e]);return s}var fl=pl(oo);function wt(i,s){let e=os,t=new Map;if(i!=null&&i.plugins){for(let r of i.plugins){let n,a;typeof r=="string"?n=r:[n,a]=r,t.has(n)||t.set(n,a||{})}il(t),e=dl(t)}return new e(i,s,t)}var Vi=new Map;function dl(i){let s=[];for(let r of nl)i.has(r)&&s.push(r);let e=s.join("|"),t=Vi.get(e);if(!t){t=os;for(let r of s)t=sn[r](t);Vi.set(e,t)}return t}kt.parse=ul;kt.parseExpression=hl;kt.tokTypes=fl});var Kt=class{constructor(s){Jt(this,"connections",new Set);Jt(this,"maxConnections",1e3);Jt(this,"sys");this.sys=s}addConnection(s,e){if(this.connections.size>=this.maxConnections){let t=`Max connections (${this.maxConnections}) reached, rejecting new connection`;return console.error(`[ConnectionTracker] ${t}`),this.sys.Sentry?.captureMessage(t,{level:"error",tags:{component:"ConnectionTracker",maxConnections:this.maxConnections.toString(),currentConnections:this.connections.size.toString(),requestUrl:e?.url||"unknown",requestMethod:e?.method||"unknown",userAgent:e?.headers?.["user-agent"]||"unknown",origin:e?.headers?.origin||"unknown",referer:e?.headers?.referer||"unknown"},extra:{connectionLimit:this.maxConnections,activeConnections:this.connections.size,requestHeaders:e?.headers||{},requestUrl:e?.url}}),!1}return this.connections.add(s),s.on("close",()=>{this.removeConnection(s)}),s.on("error",()=>{this.removeConnection(s)}),!0}removeConnection(s){this.connections.delete(s)}getConnectionCount(){return this.connections.size}cleanup(){for(let s of this.connections)s.writable&&s.write(`HTTP/1.1 503 Service Unavailable\r
10
+ \r
11
+ `),s.destroy();this.connections.clear()}};import{access as Jc,mkdir as Kc,readdir as na,readFile as Hc,stat as Xc,unlink as Gc,writeFile as Qc}from"fs/promises";import{createHash as Yc}from"crypto";import{existsSync as ie,readdirSync as Zc,readFileSync as ra,statSync as eu,unlinkSync as tu}from"fs";import{homedir as su,hostname as ru}from"os";import V from"path";import iu from"typescript";import nu from"launch-editor";async function Hr(i,s){let e=i.resolve("/");for(let t=0;t<20;t++){let r=i.join(s,"package.json"),n=await i.readFile(r);if(n)return JSON.parse(n);if(s===e)break;s=i.dirname(s)}return null}var Qr=Ls(Gr(),1);function Yr(){try{let i=(0,Qr.default)();if(i?.name)return i.name}catch{}return"npm"}async function ei(i){let s=[],e=await Hr(i,i.getRepoRootDir());if(e){let t=await Aa(e,i);s.push(...t)}return s}async function Aa(i,s){let e=[];if(i&&typeof i=="object"){let t=new Set(Object.keys({...i.dependencies,...i.devDependencies}));for(let r of wa)if(t.has(r)&&!e.some(n=>n.name===r)){let n={name:r};Zr.has(r)&&(n.version=await Zr.get(r)(s)),e.push(n)}}return e}function Ds(i){let s=parseInt(i);return Number.isNaN(s)?void 0:s}var Zr=new Map([["next",async i=>{if(!i.spawnSync)return;let s=Yr(),e=s==="npm"?"npx":s,{stdout:t}=i.spawnSync(e,["next","-v"],{encoding:"utf8"});if(!t)return;let r=t.match(/(Next.js v)([\d.]+)/g);if(!r)return;let n=r[0].split("Next.js v")[1],[a,o,l]=n.split(".");return{major:Ds(a),minor:Ds(o),patch:Ds(l)}}]]),wa=["@shopify/remix-oxygen","@shopify/hydrogen","@builder.io/qwik-city","@remix-run/react","@sveltejs/kit","astro","gatsby","next","nuxt","@builder.io/qwik","@angular/core","react","solid-js","svelte","vue"];import{spawnSync as yt}from"child_process";var Jr={};Pa(Jr,{MagicastError:()=>se,builders:()=>zc,detectCodeFormat:()=>Zn,generateCode:()=>Wr,loadFile:()=>$c,parseExpression:()=>ta,parseModule:()=>ea,writeFile:()=>qc});import{promises as kr}from"fs";var As=Ls(vi(),1),bn=Ls(rn(),1);function de(i){var s=i.use(G),e=s.Type,t=s.builtInTypes,r=t.number;function n(c){return e.from(u=>r.check(u)&&u>=c,r+" >= "+c)}let a={null:function(){return null},emptyArray:function(){return[]},false:function(){return!1},true:function(){return!0},undefined:function(){},"use strict":function(){return"use strict"}};var o=e.or(t.string,t.number,t.boolean,t.null,t.undefined);let l=e.from(c=>{if(c===null)return!0;var u=typeof c;return!(u==="object"||u==="function")},o.toString());return{geq:n,defaults:a,isPrimitive:l}}function q(i){try{var s=i(),e=s.exports,t=e.default}catch{return}t&&t!==e&&typeof e=="object"&&(Object.assign(t,e,{default:t}),e.__esModule&&Object.defineProperty(t,"__esModule",{value:!0}),s.exports=t)}var ml=Object.defineProperty,yl=(i,s,e)=>s in i?ml(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e,oe=(i,s,e)=>(yl(i,typeof s!="symbol"?s+"":s,e),e),Tn=Object.prototype,gs=Tn.toString,ge=Tn.hasOwnProperty,Ge=class{assert(s,e){if(!this.check(s,e)){var t=Ur(s);throw new Error(t+" does not match type "+this)}return!0}arrayOf(){let s=this;return new Rt(s)}},Rt=class extends Ge{constructor(s){super(),this.elemType=s,oe(this,"kind","ArrayType")}toString(){return"["+this.elemType+"]"}check(s,e){return Array.isArray(s)&&s.every(t=>this.elemType.check(t,e))}},xs=class extends Ge{constructor(s){super(),this.value=s,oe(this,"kind","IdentityType")}toString(){return String(this.value)}check(s,e){let t=s===this.value;return!t&&typeof e=="function"&&e(this,s),t}},bs=class extends Ge{constructor(s){super(),this.fields=s,oe(this,"kind","ObjectType")}toString(){return"{ "+this.fields.join(", ")+" }"}check(s,e){return gs.call(s)===gs.call({})&&this.fields.every(t=>t.type.check(s[t.name],e))}},Ts=class extends Ge{constructor(s){super(),this.types=s,oe(this,"kind","OrType")}toString(){return this.types.join(" | ")}check(s,e){return this.types.some(t=>t.check(s,!!e))?!0:(typeof e=="function"&&e(this,s),!1)}},Xe=class extends Ge{constructor(s,e){super(),this.name=s,this.predicate=e,oe(this,"kind","PredicateType")}toString(){return this.name}check(s,e){let t=this.predicate(s,e);return!t&&typeof e=="function"&&e(this,s),t}},_t=class i{constructor(s,e){this.type=s,this.typeName=e,oe(this,"baseNames",[]),oe(this,"ownFields",Object.create(null)),oe(this,"allSupertypes",Object.create(null)),oe(this,"supertypeList",[]),oe(this,"allFields",Object.create(null)),oe(this,"fieldNames",[]),oe(this,"finalized",!1),oe(this,"buildable",!1),oe(this,"buildParams",[])}isSupertypeOf(s){if(s instanceof i){if(this.finalized!==!0||s.finalized!==!0)throw new Error("");return ge.call(s.allSupertypes,this.typeName)}else throw new Error(s+" is not a Def")}checkAllFields(s,e){var t=this.allFields;if(this.finalized!==!0)throw new Error(""+this.typeName);function r(n){var a=t[n],o=a.type,l=a.getValue(s);return o.check(l,e)}return s!==null&&typeof s=="object"&&Object.keys(t).every(r)}bases(...s){var e=this.baseNames;if(this.finalized){if(s.length!==e.length)throw new Error("");for(var t=0;t<s.length;t++)if(s[t]!==e[t])throw new Error("");return this}return s.forEach(r=>{e.indexOf(r)<0&&e.push(r)}),this}},Ps=class{constructor(s,e,t,r){this.name=s,this.type=e,this.defaultFn=t,oe(this,"hidden"),this.hidden=!!r}toString(){return JSON.stringify(this.name)+": "+this.type}getValue(s){var e=s[this.name];return typeof e<"u"||typeof this.defaultFn=="function"&&(e=this.defaultFn.call(s)),e}};function Ur(i){return Array.isArray(i)?"["+i.map(Ur).join(", ")+"]":i&&typeof i=="object"?"{ "+Object.keys(i).map(function(s){return s+": "+i[s]}).join(", ")+" }":JSON.stringify(i)}function G(i){let s={or(...w){return new Ts(w.map(v=>s.from(v)))},from(w,v){if(w instanceof Rt||w instanceof xs||w instanceof bs||w instanceof Ts||w instanceof Xe)return w;if(w instanceof _t)return w.type;if(o.check(w)){if(w.length!==1)throw new Error("only one element type is permitted for typed arrays");return new Rt(s.from(w[0]))}if(l.check(w))return new bs(Object.keys(w).map(F=>new Ps(F,s.from(w[F],F))));if(typeof w=="function"){var M=e.indexOf(w);if(M>=0)return t[M];if(typeof v!="string")throw new Error("missing name");return new Xe(v,w)}return new xs(w)},def(w){return ge.call(b,w)?b[w]:b[w]=new k(w)},hasDef(w){return ge.call(b,w)}};var e=[],t=[];function r(w,v){let M=gs.call(v),F=new Xe(w,z=>gs.call(z)===M);return v&&typeof v.constructor=="function"&&(e.push(v.constructor),t.push(F)),F}let n=r("string","truthy"),a=r("function",function(){}),o=r("array",[]),l=r("object",{}),c=r("RegExp",/./),u=r("Date",new Date),h=r("number",3),f=r("boolean",!0),d=r("null",null),p=r("undefined",void 0),g=typeof BigInt=="function"?r("BigInt",BigInt(1234)):new Xe("BigInt",()=>!1),y={string:n,function:a,array:o,object:l,RegExp:c,Date:u,number:h,boolean:f,null:d,undefined:p,BigInt:g};var b=Object.create(null);function P(w){if(w&&typeof w=="object"){var v=w.type;if(typeof v=="string"&&ge.call(b,v)){var M=b[v];if(M.finalized)return M}}return null}class k extends _t{constructor(v){super(new Xe(v,(M,F)=>this.check(M,F)),v)}check(v,M){if(this.finalized!==!0)throw new Error("prematurely checking unfinalized type "+this.typeName);if(v===null||typeof v!="object")return!1;var F=P(v);return F?M&&F===this?this.checkAllFields(v,M):this.isSupertypeOf(F)?M?F.checkAllFields(v,M)&&this.checkAllFields(v,!1):!0:!1:this.typeName==="SourceLocation"||this.typeName==="Position"?this.checkAllFields(v,M):!1}build(...v){if(this.buildParams=v,this.buildable)return this;this.field("type",String,()=>this.typeName),this.buildable=!0;let M=(z,J,X,me)=>{if(!ge.call(z,J)){var Ne=this.allFields;if(!ge.call(Ne,J))throw new Error(""+J);var zt=Ne[J],pa=zt.type,gt;if(me)gt=X;else if(zt.defaultFn)gt=zt.defaultFn.call(z);else{var fa="no value or default function given for field "+JSON.stringify(J)+" of "+this.typeName+"("+this.buildParams.map(function(da){return Ne[da]}).join(", ")+")";throw new Error(fa)}if(!pa.check(gt))throw new Error(Ur(gt)+" does not match field "+zt+" of type "+this.typeName);z[J]=gt}},F=(...z)=>{var J=z.length;if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var X=Object.create(L);if(this.buildParams.forEach(function(me,Ne){Ne<J?M(X,me,z[Ne],!0):M(X,me,null,!1)}),Object.keys(this.allFields).forEach(function(me){M(X,me,null,!1)}),X.type!==this.typeName)throw new Error("");return X};return F.from=z=>{if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var J=Object.create(L);if(Object.keys(this.allFields).forEach(function(X){ge.call(z,X)?M(J,X,z[X],!0):M(J,X,null,!1)}),J.type!==this.typeName)throw new Error("");return J},Object.defineProperty(A,ue(this.typeName),{enumerable:!0,value:F}),this}field(v,M,F,z){return this.finalized?(console.error("Ignoring attempt to redefine field "+JSON.stringify(v)+" of finalized type "+JSON.stringify(this.typeName)),this):(this.ownFields[v]=new Ps(v,s.from(M),F,z),this)}finalize(){if(!this.finalized){var v=this.allFields,M=this.allSupertypes;this.baseNames.forEach(z=>{var J=b[z];if(J instanceof _t)J.finalize(),ks(v,J.allFields),ks(M,J.allSupertypes);else{var X="unknown supertype name "+JSON.stringify(z)+" for subtype "+JSON.stringify(this.typeName);throw new Error(X)}}),ks(v,this.ownFields),M[this.typeName]=this,this.fieldNames.length=0;for(var F in v)ge.call(v,F)&&!v[F].hidden&&this.fieldNames.push(F);Object.defineProperty(Kr,this.typeName,{enumerable:!0,value:this.type}),this.finalized=!0,ua(this.typeName,this.supertypeList),this.buildable&&this.supertypeList.lastIndexOf("Expression")>=0&&ca(this.typeName)}}}function T(w){if(!ge.call(b,w))throw new Error("");var v=b[w];if(v.finalized!==!0)throw new Error("");return v.supertypeList.slice(1)}function E(w){for(var v={},M=Object.keys(b),F=M.length,z=0;z<F;++z){var J=M[z],X=b[J];if(X.finalized!==!0)throw new Error(""+J);for(var me=0;me<X.supertypeList.length;++me){var Ne=X.supertypeList[me];if(ge.call(w,Ne)){v[J]=Ne;break}}}return v}var A=Object.create(null),L={};function W(w,v){var M=L[w];return p.check(v)?delete L[w]:(a.assert(v),Object.defineProperty(L,w,{enumerable:!0,configurable:!0,value:v})),M}function ue(w){return w.replace(/^[A-Z]+/,function(v){var M=v.length;switch(M){case 0:return"";case 1:return v.toLowerCase();default:return v.slice(0,M-1).toLowerCase()+v.charAt(M-1)}})}function Ae(w){return w=ue(w),w.replace(/(Expression)?$/,"Statement")}var Kr={};function Is(w){var v=P(w);if(v)return v.fieldNames.slice(0);if("type"in w)throw new Error("did not recognize object of type "+JSON.stringify(w.type));return Object.keys(w)}function Ns(w,v){var M=P(w);if(M){var F=M.allFields[v];if(F)return F.getValue(w)}return w&&w[v]}function oa(w,v,M){Is(w).forEach(function(F){v.call(this,F,Ns(w,F))},M)}function la(w,v,M){return Is(w).some(function(F){return v.call(this,F,Ns(w,F))},M)}function ca(w){var v=Ae(w);if(A[v])return;var M=A[ue(w)];if(!M)return;let F=function(...z){return A.expressionStatement(M.apply(A,z))};F.from=function(...z){return A.expressionStatement(M.from.apply(A,z))},A[v]=F}function ua(w,v){v.length=0,v.push(w);for(var M=Object.create(null),F=0;F<v.length;++F){w=v[F];var z=b[w];if(z.finalized!==!0)throw new Error("");ge.call(M,w)&&delete v[M[w]],M[w]=F,v.push.apply(v,z.baseNames)}for(var J=0,X=J,me=v.length;X<me;++X)ge.call(v,X)&&(v[J++]=v[X]);v.length=J}function ks(w,v){return Object.keys(v).forEach(function(M){w[M]=v[M]}),w}function ha(){Object.keys(b).forEach(function(w){b[w].finalize()})}return{Type:s,builtInTypes:y,getSupertypeNames:T,computeSupertypeLookupTable:E,builders:A,defineMethod:W,getBuilderName:ue,getStatementBuilderName:Ae,namedTypes:Kr,getFieldNames:Is,getFieldValue:Ns,eachField:oa,someField:la,finalize:ha}}q(()=>module);var gl=Object.prototype,ls=gl.hasOwnProperty;function Pn(i){var s=i.use(G),e=s.builtInTypes.array,t=s.builtInTypes.number;let r=function h(f,d,p){if(!(this instanceof h))throw new Error("Path constructor cannot be invoked without 'new'");if(d){if(!(d instanceof h))throw new Error("")}else d=null,p=null;this.value=f,this.parentPath=d,this.name=p,this.__childCache=null};var n=r.prototype;function a(h){return h.__childCache||(h.__childCache=Object.create(null))}function o(h,f){var d=a(h),p=h.getValueProperty(f),g=d[f];return(!ls.call(d,f)||g.value!==p)&&(g=d[f]=new h.constructor(p,h,f)),g}n.getValueProperty=function(f){return this.value[f]},n.get=function(...f){for(var d=this,p=f.length,g=0;g<p;++g)d=o(d,f[g]);return d},n.each=function(f,d){for(var p=[],g=this.value.length,y=0,y=0;y<g;++y)ls.call(this.value,y)&&(p[y]=this.get(y));for(d=d||this,y=0;y<g;++y)ls.call(p,y)&&f.call(d,p[y])},n.map=function(f,d){var p=[];return this.each(function(g){p.push(f.call(this,g))},d),p},n.filter=function(f,d){var p=[];return this.each(function(g){f.call(this,g)&&p.push(g)},d),p};function l(){}function c(h,f,d,p){if(e.assert(h.value),f===0)return l;var g=h.value.length;if(g<1)return l;var y=arguments.length;y===2?(d=0,p=g):y===3?(d=Math.max(d,0),p=g):(d=Math.max(d,0),p=Math.min(p,g)),t.assert(d),t.assert(p);for(var b=Object.create(null),P=a(h),k=d;k<p;++k)if(ls.call(h.value,k)){var T=h.get(k);if(T.name!==k)throw new Error("");var E=k+f;T.name=E,b[E]=T,delete P[k]}return delete P.length,function(){for(var A in b){var L=b[A];if(L.name!==+A)throw new Error("");P[A]=L,h.value[A]=L.value}}}n.shift=function(){var f=c(this,-1),d=this.value.shift();return f(),d},n.unshift=function(...f){var d=c(this,f.length),p=this.value.unshift.apply(this.value,f);return d(),p},n.push=function(...f){return e.assert(this.value),delete a(this).length,this.value.push.apply(this.value,f)},n.pop=function(){e.assert(this.value);var f=a(this);return delete f[this.value.length-1],delete f.length,this.value.pop()},n.insertAt=function(f){var d=arguments.length,p=c(this,d-1,f);if(p===l&&d<=1)return this;f=Math.max(f,0);for(var g=1;g<d;++g)this.value[f+g-1]=arguments[g];return p(),this},n.insertBefore=function(...f){for(var d=this.parentPath,p=f.length,g=[this.name],y=0;y<p;++y)g.push(f[y]);return d.insertAt.apply(d,g)},n.insertAfter=function(...f){for(var d=this.parentPath,p=f.length,g=[this.name+1],y=0;y<p;++y)g.push(f[y]);return d.insertAt.apply(d,g)};function u(h){if(!(h instanceof r))throw new Error("");var f=h.parentPath;if(!f)return h;var d=f.value,p=a(f);if(d[h.name]===h.value)p[h.name]=h;else if(e.check(d)){var g=d.indexOf(h.value);g>=0&&(p[h.name=g]=h)}else d[h.name]=h.value,p[h.name]=h;if(d[h.name]!==h.value)throw new Error("");if(h.parentPath.get(h.name)!==h)throw new Error("");return h}return n.replace=function(f){var d=[],p=this.parentPath.value,g=a(this.parentPath),y=arguments.length;if(u(this),e.check(p)){for(var b=p.length,P=c(this.parentPath,y-1,this.name+1),k=[this.name,1],T=0;T<y;++T)k.push(arguments[T]);var E=p.splice.apply(p,k);if(E[0]!==this.value)throw new Error("");if(p.length!==b-1+y)throw new Error("");if(P(),y===0)delete this.value,delete g[this.name],this.__childCache=null;else{if(p[this.name]!==f)throw new Error("");for(this.value!==f&&(this.value=f,this.__childCache=null),T=0;T<y;++T)d.push(this.parentPath.get(this.name+T));if(d[0]!==this)throw new Error("")}}else if(y===1)this.value!==f&&(this.__childCache=null),this.value=p[this.name]=f,d.push(this);else if(y===0)delete p[this.name],delete this.value,this.__childCache=null;else throw new Error("Could not replace path");return d},r}q(()=>module);var lt=Object.prototype.hasOwnProperty;function xl(i){var s=i.use(G),e=s.Type,t=s.namedTypes,r=t.Node,n=t.Expression,a=s.builtInTypes.array,o=s.builders;let l=function T(E,A){if(!(this instanceof T))throw new Error("Scope constructor cannot be invoked without 'new'");u.check(E.value)||c.assert(E.value);var L;if(A){if(!(A instanceof T))throw new Error("");L=A.depth+1}else A=null,L=0;Object.defineProperties(this,{path:{value:E},node:{value:E.value},isGlobal:{value:!A,enumerable:!0},depth:{value:L},parent:{value:A},bindings:{value:{}},types:{value:{}}})};var c=e.or(t.Program,t.Function,t.CatchClause),u=e.or(t.Function,t.ClassDeclaration,t.ClassExpression,t.InterfaceDeclaration,t.TSInterfaceDeclaration,t.TypeAlias,t.TSTypeAliasDeclaration),h=e.or(t.TypeParameter,t.TSTypeParameter);l.isEstablishedBy=function(T){return c.check(T)||u.check(T)};var f=l.prototype;f.didScan=!1,f.declares=function(T){return this.scan(),lt.call(this.bindings,T)},f.declaresType=function(T){return this.scan(),lt.call(this.types,T)},f.declareTemporary=function(T){if(T){if(!/^[a-z$_]/i.test(T))throw new Error("")}else T="t$";T+=this.depth.toString(36)+"$",this.scan();for(var E=0;this.declares(T+E);)++E;var A=T+E;return this.bindings[A]=s.builders.identifier(A)},f.injectTemporary=function(T,E){T||(T=this.declareTemporary());var A=this.path.get("body");return t.BlockStatement.check(A.value)&&(A=A.get("body")),A.unshift(o.variableDeclaration("var",[o.variableDeclarator(T,E||null)])),T},f.scan=function(T){if(T||!this.didScan){for(var E in this.bindings)delete this.bindings[E];for(var E in this.types)delete this.types[E];d(this.path,this.bindings,this.types),this.didScan=!0}},f.getBindings=function(){return this.scan(),this.bindings},f.getTypes=function(){return this.scan(),this.types};function d(T,E,A){var L=T.value;if(u.check(L)){let W=T.get("typeParameters","params");a.check(W.value)&&W.each(ue=>{k(ue,A)})}c.check(L)&&(t.CatchClause.check(L)?b(T.get("param"),E):p(T,E,A))}function p(T,E,A){var L=T.value;T.parent&&t.FunctionExpression.check(T.parent.node)&&T.parent.node.id&&b(T.parent.get("id"),E),L&&(a.check(L)?T.each(W=>{y(W,E,A)}):t.Function.check(L)?(T.get("params").each(W=>{b(W,E)}),y(T.get("body"),E,A),p(T.get("typeParameters"),E,A)):t.TypeAlias&&t.TypeAlias.check(L)||t.InterfaceDeclaration&&t.InterfaceDeclaration.check(L)||t.TSTypeAliasDeclaration&&t.TSTypeAliasDeclaration.check(L)||t.TSInterfaceDeclaration&&t.TSInterfaceDeclaration.check(L)?P(T.get("id"),A):t.VariableDeclarator.check(L)?(b(T.get("id"),E),y(T.get("init"),E,A)):L.type==="ImportSpecifier"||L.type==="ImportNamespaceSpecifier"||L.type==="ImportDefaultSpecifier"?b(T.get(L.local?"local":L.name?"name":"id"),E):r.check(L)&&!n.check(L)&&s.eachField(L,function(W,ue){var Ae=T.get(W);if(!g(Ae,ue))throw new Error("");y(Ae,E,A)}))}function g(T,E){return!!(T.value===E||Array.isArray(T.value)&&T.value.length===0&&Array.isArray(E)&&E.length===0)}function y(T,E,A){var L=T.value;if(!(!L||n.check(L)))if(t.FunctionDeclaration.check(L)&&L.id!==null)b(T.get("id"),E);else if(t.ClassDeclaration&&t.ClassDeclaration.check(L)&&L.id!==null)b(T.get("id"),E),p(T.get("typeParameters"),E,A);else if(t.InterfaceDeclaration&&t.InterfaceDeclaration.check(L)||t.TSInterfaceDeclaration&&t.TSInterfaceDeclaration.check(L))P(T.get("id"),A);else if(c.check(L)){if(t.CatchClause.check(L)&&t.Identifier.check(L.param)){var W=L.param.name,ue=lt.call(E,W);p(T.get("body"),E,A),ue||delete E[W]}}else p(T,E,A)}function b(T,E){var A=T.value;t.Pattern.assert(A),t.Identifier.check(A)?lt.call(E,A.name)?E[A.name].push(T):E[A.name]=[T]:t.AssignmentPattern&&t.AssignmentPattern.check(A)?b(T.get("left"),E):t.ObjectPattern&&t.ObjectPattern.check(A)?T.get("properties").each(function(L){var W=L.value;t.Pattern.check(W)?b(L,E):t.Property.check(W)||t.ObjectProperty&&t.ObjectProperty.check(W)?b(L.get("value"),E):t.SpreadProperty&&t.SpreadProperty.check(W)&&b(L.get("argument"),E)}):t.ArrayPattern&&t.ArrayPattern.check(A)?T.get("elements").each(function(L){var W=L.value;t.Pattern.check(W)?b(L,E):t.SpreadElement&&t.SpreadElement.check(W)&&b(L.get("argument"),E)}):t.PropertyPattern&&t.PropertyPattern.check(A)?b(T.get("pattern"),E):(t.SpreadElementPattern&&t.SpreadElementPattern.check(A)||t.RestElement&&t.RestElement.check(A)||t.SpreadPropertyPattern&&t.SpreadPropertyPattern.check(A))&&b(T.get("argument"),E)}function P(T,E){var A=T.value;t.Pattern.assert(A),t.Identifier.check(A)&&(lt.call(E,A.name)?E[A.name].push(T):E[A.name]=[T])}function k(T,E){var A=T.value;h.assert(A),lt.call(E,A.name)?E[A.name].push(T):E[A.name]=[T]}return f.lookup=function(T){for(var E=this;E&&!E.declares(T);E=E.parent);return E},f.lookupType=function(T){for(var E=this;E&&!E.declaresType(T);E=E.parent);return E},f.getGlobalScope=function(){for(var T=this;!T.isGlobal;)T=T.parent;return T},l}q(()=>module);function Sn(i){var s=i.use(G),e=s.namedTypes,t=s.builders,r=s.builtInTypes.number,n=s.builtInTypes.array,a=i.use(Pn),o=i.use(xl);let l=function y(b,P,k){if(!(this instanceof y))throw new Error("NodePath constructor cannot be invoked without 'new'");a.call(this,b,P,k)};var c=l.prototype=Object.create(a.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}});Object.defineProperties(c,{node:{get:function(){return Object.defineProperty(this,"node",{configurable:!0,value:this._computeNode()}),this.node}},parent:{get:function(){return Object.defineProperty(this,"parent",{configurable:!0,value:this._computeParent()}),this.parent}},scope:{get:function(){return Object.defineProperty(this,"scope",{configurable:!0,value:this._computeScope()}),this.scope}}}),c.replace=function(){return delete this.node,delete this.parent,delete this.scope,a.prototype.replace.apply(this,arguments)},c.prune=function(){var y=this.parent;return this.replace(),p(y)},c._computeNode=function(){var y=this.value;if(e.Node.check(y))return y;var b=this.parentPath;return b&&b.node||null},c._computeParent=function(){var y=this.value,b=this.parentPath;if(!e.Node.check(y)){for(;b&&!e.Node.check(b.value);)b=b.parentPath;b&&(b=b.parentPath)}for(;b&&!e.Node.check(b.value);)b=b.parentPath;return b||null},c._computeScope=function(){var y=this.value,b=this.parentPath,P=b&&b.scope;return e.Node.check(y)&&o.isEstablishedBy(y)&&(P=new o(this,P)),P||null},c.getValueProperty=function(y){return s.getFieldValue(this.value,y)},c.needsParens=function(y){var b=this.parentPath;if(!b)return!1;var P=this.value;if(!e.Expression.check(P)||P.type==="Identifier")return!1;for(;!e.Node.check(b.value);)if(b=b.parentPath,!b)return!1;var k=b.value;switch(P.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return k.type==="MemberExpression"&&this.name==="object"&&k.object===P;case"BinaryExpression":case"LogicalExpression":switch(k.type){case"CallExpression":return this.name==="callee"&&k.callee===P;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return this.name==="object"&&k.object===P;case"BinaryExpression":case"LogicalExpression":{let T=P,E=k.operator,A=h[E],L=T.operator,W=h[L];if(A>W)return!0;if(A===W&&this.name==="right"){if(k.right!==T)throw new Error("Nodes must be equal");return!0}}default:return!1}case"SequenceExpression":switch(k.type){case"ForStatement":return!1;case"ExpressionStatement":return this.name!=="expression";default:return!0}case"YieldExpression":switch(k.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"Literal":return k.type==="MemberExpression"&&r.check(P.value)&&this.name==="object"&&k.object===P;case"AssignmentExpression":case"ConditionalExpression":switch(k.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return this.name==="callee"&&k.callee===P;case"ConditionalExpression":return this.name==="test"&&k.test===P;case"MemberExpression":return this.name==="object"&&k.object===P;default:return!1}default:if(k.type==="NewExpression"&&this.name==="callee"&&k.callee===P)return f(P)}return!!(y!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function u(y){return e.BinaryExpression.check(y)||e.LogicalExpression.check(y)}var h={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(y,b){y.forEach(function(P){h[P]=b})});function f(y){return e.CallExpression.check(y)?!0:n.check(y)?y.some(f):e.Node.check(y)?s.someField(y,function(b,P){return f(P)}):!1}c.canBeFirstInStatement=function(){var y=this.node;return!e.FunctionExpression.check(y)&&!e.ObjectExpression.check(y)},c.firstInStatement=function(){return d(this)};function d(y){for(var b,P;y.parent;y=y.parent){if(b=y.node,P=y.parent.node,e.BlockStatement.check(P)&&y.parent.name==="body"&&y.name===0){if(P.body[0]!==b)throw new Error("Nodes must be equal");return!0}if(e.ExpressionStatement.check(P)&&y.name==="expression"){if(P.expression!==b)throw new Error("Nodes must be equal");return!0}if(e.SequenceExpression.check(P)&&y.parent.name==="expressions"&&y.name===0){if(P.expressions[0]!==b)throw new Error("Nodes must be equal");continue}if(e.CallExpression.check(P)&&y.name==="callee"){if(P.callee!==b)throw new Error("Nodes must be equal");continue}if(e.MemberExpression.check(P)&&y.name==="object"){if(P.object!==b)throw new Error("Nodes must be equal");continue}if(e.ConditionalExpression.check(P)&&y.name==="test"){if(P.test!==b)throw new Error("Nodes must be equal");continue}if(u(P)&&y.name==="left"){if(P.left!==b)throw new Error("Nodes must be equal");continue}if(e.UnaryExpression.check(P)&&!P.prefix&&y.name==="argument"){if(P.argument!==b)throw new Error("Nodes must be equal");continue}return!1}return!0}function p(y){if(e.VariableDeclaration.check(y.node)){var b=y.get("declarations").value;if(!b||b.length===0)return y.prune()}else if(e.ExpressionStatement.check(y.node)){if(!y.get("expression").value)return y.prune()}else e.IfStatement.check(y.node)&&g(y);return y}function g(y){var b=y.get("test").value,P=y.get("alternate").value,k=y.get("consequent").value;if(!k&&!P){var T=t.expressionStatement(b);y.replace(T)}else if(!k&&P){var E=t.unaryExpression("!",b,!0);e.UnaryExpression.check(b)&&b.operator==="!"&&(E=b.argument),y.get("test").replace(E),y.get("consequent").replace(P),y.get("alternate").replace()}}return l}q(()=>module);var cs=Object.prototype.hasOwnProperty;function bl(i){var s=i.use(G),e=i.use(Sn),t=s.builtInTypes.array,r=s.builtInTypes.object,n=s.builtInTypes.function,a;let o=function p(){if(!(this instanceof p))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=l(this),this._shouldVisitComments=cs.call(this._methodNameTable,"Block")||cs.call(this._methodNameTable,"Line"),this.Context=f(this),this._visiting=!1,this._changeReported=!1};function l(p){var g=Object.create(null);for(var y in p)/^visit[A-Z]/.test(y)&&(g[y.slice(5)]=!0);for(var b=s.computeSupertypeLookupTable(g),P=Object.create(null),k=Object.keys(b),T=k.length,E=0;E<T;++E){var A=k[E];y="visit"+b[A],n.check(p[y])&&(P[A]=y)}return P}o.fromMethodsObject=function(g){if(g instanceof o)return g;if(!r.check(g))return new o;let y=function P(){if(!(this instanceof P))throw new Error("Visitor constructor cannot be invoked without 'new'");o.call(this)};var b=y.prototype=Object.create(u);return b.constructor=y,c(b,g),c(y,o),n.assert(y.fromMethodsObject),n.assert(y.visit),new y};function c(p,g){for(var y in g)cs.call(g,y)&&(p[y]=g[y]);return p}o.visit=function(g,y){return o.fromMethodsObject(y).visit(g)};var u=o.prototype;u.visit=function(){if(this._visiting)throw new Error("Recursively calling visitor.visit(path) resets visitor state. Try this.visit(path) or this.traverse(path) instead.");this._visiting=!0,this._changeReported=!1,this._abortRequested=!1;for(var p=arguments.length,g=new Array(p),y=0;y<p;++y)g[y]=arguments[y];g[0]instanceof e||(g[0]=new e({root:g[0]}).get("root")),this.reset.apply(this,g);var b;try{var P=this.visitWithoutReset(g[0]);b=!0}finally{if(this._visiting=!1,!b&&this._abortRequested)return g[0].value}return P},u.AbortRequest=function(){},u.abort=function(){var p=this;p._abortRequested=!0;var g=new p.AbortRequest;throw g.cancel=function(){p._abortRequested=!1},g},u.reset=function(p){},u.visitWithoutReset=function(p){if(this instanceof this.Context)return this.visitor.visitWithoutReset(p);if(!(p instanceof e))throw new Error("");var g=p.value,y=g&&typeof g=="object"&&typeof g.type=="string"&&this._methodNameTable[g.type];if(y){var b=this.acquireContext(p);try{return b.invokeVisitorMethod(y)}finally{this.releaseContext(b)}}else return h(p,this)};function h(p,g){if(!(p instanceof e))throw new Error("");if(!(g instanceof o))throw new Error("");var y=p.value;if(t.check(y))p.each(g.visitWithoutReset,g);else if(r.check(y)){var b=s.getFieldNames(y);g._shouldVisitComments&&y.comments&&b.indexOf("comments")<0&&b.push("comments");for(var P=b.length,k=[],T=0;T<P;++T){var E=b[T];cs.call(y,E)||(y[E]=s.getFieldValue(y,E)),k.push(p.get(E))}for(var T=0;T<P;++T)g.visitWithoutReset(k[T])}return p.value}u.acquireContext=function(p){return this._reusableContextStack.length===0?new this.Context(p):this._reusableContextStack.pop().reset(p)},u.releaseContext=function(p){if(!(p instanceof this.Context))throw new Error("");this._reusableContextStack.push(p),p.currentPath=null},u.reportChanged=function(){this._changeReported=!0},u.wasChangeReported=function(){return this._changeReported};function f(p){function g(b){if(!(this instanceof g))throw new Error("");if(!(this instanceof o))throw new Error("");if(!(b instanceof e))throw new Error("");Object.defineProperty(this,"visitor",{value:p,writable:!1,enumerable:!0,configurable:!1}),this.currentPath=b,this.needToCallTraverse=!0,Object.seal(this)}if(!(p instanceof o))throw new Error("");var y=g.prototype=Object.create(p);return y.constructor=g,c(y,d),g}var d=Object.create(null);return d.reset=function(g){if(!(this instanceof this.Context))throw new Error("");if(!(g instanceof e))throw new Error("");return this.currentPath=g,this.needToCallTraverse=!0,this},d.invokeVisitorMethod=function(g){if(!(this instanceof this.Context))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");var y=this.visitor[g].call(this,this.currentPath);if(y===!1?this.needToCallTraverse=!1:y!==a&&(this.currentPath=this.currentPath.replace(y)[0],this.needToCallTraverse&&this.traverse(this.currentPath)),this.needToCallTraverse!==!1)throw new Error("Must either call this.traverse or return false in "+g);var b=this.currentPath;return b&&b.value},d.traverse=function(g,y){if(!(this instanceof this.Context))throw new Error("");if(!(g instanceof e))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");return this.needToCallTraverse=!1,h(g,o.fromMethodsObject(y||this.visitor))},d.visit=function(g,y){if(!(this instanceof this.Context))throw new Error("");if(!(g instanceof e))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");return this.needToCallTraverse=!1,o.fromMethodsObject(y||this.visitor).visitWithoutReset(g)},d.reportChanged=function(){this.visitor.reportChanged()},d.abort=function(){this.needToCallTraverse=!1,this.visitor.abort()},o}q(()=>module);function Tl(i){var s=i.use(G),e=s.getFieldNames,t=s.getFieldValue,r=s.builtInTypes.array,n=s.builtInTypes.object,a=s.builtInTypes.Date,o=s.builtInTypes.RegExp,l=Object.prototype.hasOwnProperty;function c(p,g,y){return r.check(y)?y.length=0:y=null,h(p,g,y)}c.assert=function(p,g){var y=[];if(!c(p,g,y))if(y.length===0){if(p!==g)throw new Error("Nodes must be equal")}else throw new Error("Nodes differ in the following path: "+y.map(u).join(""))};function u(p){return/[_$a-z][_$a-z0-9]*/i.test(p)?"."+p:"["+JSON.stringify(p)+"]"}function h(p,g,y){return p===g?!0:r.check(p)?f(p,g,y):n.check(p)?d(p,g,y):a.check(p)?a.check(g)&&+p==+g:o.check(p)?o.check(g)&&p.source===g.source&&p.global===g.global&&p.multiline===g.multiline&&p.ignoreCase===g.ignoreCase:p==g}function f(p,g,y){r.assert(p);var b=p.length;if(!r.check(g)||g.length!==b)return y&&y.push("length"),!1;for(var P=0;P<b;++P){if(y&&y.push(P),P in p!=P in g||!h(p[P],g[P],y))return!1;if(y){var k=y.pop();if(k!==P)throw new Error(""+k)}}return!0}function d(p,g,y){if(n.assert(p),!n.check(g))return!1;if(p.type!==g.type)return y&&y.push("type"),!1;var b=e(p),P=b.length,k=e(g),T=k.length;if(P===T){for(var E=0;E<P;++E){var A=b[E],L=t(p,A),W=t(g,A);if(y&&y.push(A),!h(L,W,y))return!1;if(y){var ue=y.pop();if(ue!==A)throw new Error(""+ue)}}return!0}if(!y)return!1;var Ae=Object.create(null);for(E=0;E<P;++E)Ae[b[E]]=!0;for(E=0;E<T;++E){if(A=k[E],!l.call(Ae,A))return y.push(A),!1;delete Ae[A]}for(A in Ae){y.push(A);break}return!1}return c}q(()=>module);function Pl(i){let s=Sl(),e=s.use(G);i.forEach(s.use),e.finalize();let t=s.use(bl);return{Type:e.Type,builtInTypes:e.builtInTypes,namedTypes:e.namedTypes,builders:e.builders,defineMethod:e.defineMethod,getFieldNames:e.getFieldNames,getFieldValue:e.getFieldValue,eachField:e.eachField,someField:e.someField,getSupertypeNames:e.getSupertypeNames,getBuilderName:e.getBuilderName,astNodesAreEquivalent:s.use(Tl),finalize:e.finalize,Path:s.use(Pn),NodePath:s.use(Sn),PathVisitor:t,use:s.use,visit:t.visit}}function Sl(){let i=[],s=[];function e(r){var n=i.indexOf(r);return n===-1&&(n=i.length,i.push(r),s[n]=r(t)),s[n]}var t={use:e};return t}q(()=>module);function En(){return{BinaryOperators:["==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof"],AssignmentOperators:["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&="],LogicalOperators:["||","&&"]}}q(()=>module);function An(i){let s=i.use(En);return s.BinaryOperators.indexOf("**")<0&&s.BinaryOperators.push("**"),s.AssignmentOperators.indexOf("**=")<0&&s.AssignmentOperators.push("**="),s}q(()=>module);function wn(i){let s=i.use(An);return s.LogicalOperators.indexOf("??")<0&&s.LogicalOperators.push("??"),s}q(()=>module);function El(i){let s=i.use(wn);return s.LogicalOperators.forEach(e=>{let t=e+"=";s.AssignmentOperators.indexOf(t)<0&&s.AssignmentOperators.push(t)}),s}q(()=>module);function Al(i){var s=i.use(G),e=s.Type,t=e.def,r=e.or,n=i.use(de),a=n.defaults,o=n.geq;let{BinaryOperators:l,AssignmentOperators:c,LogicalOperators:u}=i.use(En);t("Printable").field("loc",r(t("SourceLocation"),null),a.null,!0),t("Node").bases("Printable").field("type",String).field("comments",r([t("Comment")],null),a.null,!0),t("SourceLocation").field("start",t("Position")).field("end",t("Position")).field("source",r(String,null),a.null),t("Position").field("line",o(1)).field("column",o(0)),t("File").bases("Node").build("program","name").field("program",t("Program")).field("name",r(String,null),a.null),t("Program").bases("Node").build("body").field("body",[t("Statement")]),t("Function").bases("Node").field("id",r(t("Identifier"),null),a.null).field("params",[t("Pattern")]).field("body",t("BlockStatement")).field("generator",Boolean,a.false).field("async",Boolean,a.false),t("Statement").bases("Node"),t("EmptyStatement").bases("Statement").build(),t("BlockStatement").bases("Statement").build("body").field("body",[t("Statement")]),t("ExpressionStatement").bases("Statement").build("expression").field("expression",t("Expression")),t("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",t("Expression")).field("consequent",t("Statement")).field("alternate",r(t("Statement"),null),a.null),t("LabeledStatement").bases("Statement").build("label","body").field("label",t("Identifier")).field("body",t("Statement")),t("BreakStatement").bases("Statement").build("label").field("label",r(t("Identifier"),null),a.null),t("ContinueStatement").bases("Statement").build("label").field("label",r(t("Identifier"),null),a.null),t("WithStatement").bases("Statement").build("object","body").field("object",t("Expression")).field("body",t("Statement")),t("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",t("Expression")).field("cases",[t("SwitchCase")]).field("lexical",Boolean,a.false),t("ReturnStatement").bases("Statement").build("argument").field("argument",r(t("Expression"),null)),t("ThrowStatement").bases("Statement").build("argument").field("argument",t("Expression")),t("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",t("BlockStatement")).field("handler",r(t("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[t("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[t("CatchClause")],a.emptyArray).field("finalizer",r(t("BlockStatement"),null),a.null),t("CatchClause").bases("Node").build("param","guard","body").field("param",t("Pattern")).field("guard",r(t("Expression"),null),a.null).field("body",t("BlockStatement")),t("WhileStatement").bases("Statement").build("test","body").field("test",t("Expression")).field("body",t("Statement")),t("DoWhileStatement").bases("Statement").build("body","test").field("body",t("Statement")).field("test",t("Expression")),t("ForStatement").bases("Statement").build("init","test","update","body").field("init",r(t("VariableDeclaration"),t("Expression"),null)).field("test",r(t("Expression"),null)).field("update",r(t("Expression"),null)).field("body",t("Statement")),t("ForInStatement").bases("Statement").build("left","right","body").field("left",r(t("VariableDeclaration"),t("Expression"))).field("right",t("Expression")).field("body",t("Statement")),t("DebuggerStatement").bases("Statement").build(),t("Declaration").bases("Statement"),t("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",t("Identifier")),t("FunctionExpression").bases("Function","Expression").build("id","params","body"),t("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",r("var","let","const")).field("declarations",[t("VariableDeclarator")]),t("VariableDeclarator").bases("Node").build("id","init").field("id",t("Pattern")).field("init",r(t("Expression"),null),a.null),t("Expression").bases("Node"),t("ThisExpression").bases("Expression").build(),t("ArrayExpression").bases("Expression").build("elements").field("elements",[r(t("Expression"),null)]),t("ObjectExpression").bases("Expression").build("properties").field("properties",[t("Property")]),t("Property").bases("Node").build("kind","key","value").field("kind",r("init","get","set")).field("key",r(t("Literal"),t("Identifier"))).field("value",t("Expression")),t("SequenceExpression").bases("Expression").build("expressions").field("expressions",[t("Expression")]);var h=r("-","+","!","~","typeof","void","delete");t("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",h).field("argument",t("Expression")).field("prefix",Boolean,a.true);let f=r(...l);t("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",f).field("left",t("Expression")).field("right",t("Expression"));let d=r(...c);t("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",d).field("left",r(t("Pattern"),t("MemberExpression"))).field("right",t("Expression"));var p=r("++","--");t("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",p).field("argument",t("Expression")).field("prefix",Boolean);var g=r(...u);t("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",g).field("left",t("Expression")).field("right",t("Expression")),t("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",t("Expression")).field("consequent",t("Expression")).field("alternate",t("Expression")),t("NewExpression").bases("Expression").build("callee","arguments").field("callee",t("Expression")).field("arguments",[t("Expression")]),t("CallExpression").bases("Expression").build("callee","arguments").field("callee",t("Expression")).field("arguments",[t("Expression")]),t("MemberExpression").bases("Expression").build("object","property","computed").field("object",t("Expression")).field("property",r(t("Identifier"),t("Expression"))).field("computed",Boolean,function(){var y=this.property.type;return y==="Literal"||y==="MemberExpression"||y==="BinaryExpression"}),t("Pattern").bases("Node"),t("SwitchCase").bases("Node").build("test","consequent").field("test",r(t("Expression"),null)).field("consequent",[t("Statement")]),t("Identifier").bases("Expression","Pattern").build("name").field("name",String).field("optional",Boolean,a.false),t("Literal").bases("Expression").build("value").field("value",r(String,Boolean,null,Number,RegExp,BigInt)),t("Comment").bases("Printable").field("value",String).field("leading",Boolean,a.true).field("trailing",Boolean,a.false)}q(()=>module);function wl(i){i.use(Al);let s=i.use(G),e=s.Type.def,t=s.Type.or,r=i.use(de).defaults;e("Function").field("generator",Boolean,r.false).field("expression",Boolean,r.false).field("defaults",[t(e("Expression"),null)],r.emptyArray).field("rest",t(e("Identifier"),null),r.null),e("RestElement").bases("Pattern").build("argument").field("argument",e("Pattern")).field("typeAnnotation",t(e("TypeAnnotation"),e("TSTypeAnnotation"),null),r.null),e("SpreadElementPattern").bases("Pattern").build("argument").field("argument",e("Pattern")),e("FunctionDeclaration").build("id","params","body","generator","expression").field("id",t(e("Identifier"),null)),e("FunctionExpression").build("id","params","body","generator","expression"),e("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,r.null).field("body",t(e("BlockStatement"),e("Expression"))).field("generator",!1,r.false),e("ForOfStatement").bases("Statement").build("left","right","body").field("left",t(e("VariableDeclaration"),e("Pattern"))).field("right",e("Expression")).field("body",e("Statement")),e("YieldExpression").bases("Expression").build("argument","delegate").field("argument",t(e("Expression"),null)).field("delegate",Boolean,r.false),e("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",e("Expression")).field("blocks",[e("ComprehensionBlock")]).field("filter",t(e("Expression"),null)),e("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",e("Expression")).field("blocks",[e("ComprehensionBlock")]).field("filter",t(e("Expression"),null)),e("ComprehensionBlock").bases("Node").build("left","right","each").field("left",e("Pattern")).field("right",e("Expression")).field("each",Boolean),e("Property").field("key",t(e("Literal"),e("Identifier"),e("Expression"))).field("value",t(e("Expression"),e("Pattern"))).field("method",Boolean,r.false).field("shorthand",Boolean,r.false).field("computed",Boolean,r.false),e("ObjectProperty").field("shorthand",Boolean,r.false),e("PropertyPattern").bases("Pattern").build("key","pattern").field("key",t(e("Literal"),e("Identifier"),e("Expression"))).field("pattern",e("Pattern")).field("computed",Boolean,r.false),e("ObjectPattern").bases("Pattern").build("properties").field("properties",[t(e("PropertyPattern"),e("Property"))]),e("ArrayPattern").bases("Pattern").build("elements").field("elements",[t(e("Pattern"),null)]),e("SpreadElement").bases("Node").build("argument").field("argument",e("Expression")),e("ArrayExpression").field("elements",[t(e("Expression"),e("SpreadElement"),e("RestElement"),null)]),e("NewExpression").field("arguments",[t(e("Expression"),e("SpreadElement"))]),e("CallExpression").field("arguments",[t(e("Expression"),e("SpreadElement"))]),e("AssignmentPattern").bases("Pattern").build("left","right").field("left",e("Pattern")).field("right",e("Expression")),e("MethodDefinition").bases("Declaration").build("kind","key","value","static").field("kind",t("constructor","method","get","set")).field("key",e("Expression")).field("value",e("Function")).field("computed",Boolean,r.false).field("static",Boolean,r.false);let n=t(e("MethodDefinition"),e("VariableDeclarator"),e("ClassPropertyDefinition"),e("ClassProperty"),e("StaticBlock"));e("ClassProperty").bases("Declaration").build("key").field("key",t(e("Literal"),e("Identifier"),e("Expression"))).field("computed",Boolean,r.false),e("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",n),e("ClassBody").bases("Declaration").build("body").field("body",[n]),e("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",t(e("Identifier"),null)).field("body",e("ClassBody")).field("superClass",t(e("Expression"),null),r.null),e("ClassExpression").bases("Expression").build("id","body","superClass").field("id",t(e("Identifier"),null),r.null).field("body",e("ClassBody")).field("superClass",t(e("Expression"),null),r.null),e("Super").bases("Expression").build(),e("Specifier").bases("Node"),e("ModuleSpecifier").bases("Specifier").field("local",t(e("Identifier"),null),r.null).field("id",t(e("Identifier"),null),r.null).field("name",t(e("Identifier"),null),r.null),e("ImportSpecifier").bases("ModuleSpecifier").build("imported","local").field("imported",e("Identifier")),e("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local"),e("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local"),e("ImportDeclaration").bases("Declaration").build("specifiers","source","importKind").field("specifiers",[t(e("ImportSpecifier"),e("ImportNamespaceSpecifier"),e("ImportDefaultSpecifier"))],r.emptyArray).field("source",e("Literal")).field("importKind",t("value","type"),function(){return"value"}),e("ExportNamedDeclaration").bases("Declaration").build("declaration","specifiers","source").field("declaration",t(e("Declaration"),null)).field("specifiers",[e("ExportSpecifier")],r.emptyArray).field("source",t(e("Literal"),null),r.null),e("ExportSpecifier").bases("ModuleSpecifier").build("local","exported").field("exported",e("Identifier")),e("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",t(e("Declaration"),e("Expression"))),e("ExportAllDeclaration").bases("Declaration").build("source").field("source",e("Literal")),e("TaggedTemplateExpression").bases("Expression").build("tag","quasi").field("tag",e("Expression")).field("quasi",e("TemplateLiteral")),e("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[e("TemplateElement")]).field("expressions",[e("Expression")]),e("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:String,raw:String}).field("tail",Boolean),e("MetaProperty").bases("Expression").build("meta","property").field("meta",e("Identifier")).field("property",e("Identifier"))}q(()=>module);function vl(i){i.use(An),i.use(wl)}q(()=>module);function Cl(i){i.use(vl);let e=i.use(G).Type.def,t=i.use(de).defaults;e("Function").field("async",Boolean,t.false),e("AwaitExpression").bases("Expression").build("argument").field("argument",e("Expression"))}q(()=>module);function Il(i){i.use(Cl);let s=i.use(G),e=s.Type.def,t=s.Type.or,r=i.use(de).defaults;e("ForOfStatement").field("await",Boolean,r.false),e("SpreadProperty").bases("Node").build("argument").field("argument",e("Expression")),e("ObjectExpression").field("properties",[t(e("Property"),e("SpreadProperty"),e("SpreadElement"))]),e("TemplateElement").field("value",{cooked:t(String,null),raw:String}),e("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",e("Pattern")),e("ObjectPattern").field("properties",[t(e("PropertyPattern"),e("Property"),e("RestElement"),e("SpreadPropertyPattern"))])}q(()=>module);function Nl(i){i.use(Il);let s=i.use(G),e=s.Type.def,t=s.Type.or,r=i.use(de).defaults;e("CatchClause").field("param",t(e("Pattern"),null),r.null)}q(()=>module);function kl(i){i.use(wn),i.use(Nl);let s=i.use(G),e=s.Type.def,t=s.Type.or,n=i.use(de).defaults;e("ImportExpression").bases("Expression").build("source").field("source",e("Expression")),e("ExportAllDeclaration").bases("Declaration").build("source","exported").field("source",e("Literal")).field("exported",t(e("Identifier"),null,void 0),n.null),e("ChainElement").bases("Node").field("optional",Boolean,n.false),e("CallExpression").bases("Expression","ChainElement"),e("MemberExpression").bases("Expression","ChainElement"),e("ChainExpression").bases("Expression").build("expression").field("expression",e("ChainElement")),e("OptionalCallExpression").bases("CallExpression").build("callee","arguments","optional").field("optional",Boolean,n.true),e("OptionalMemberExpression").bases("MemberExpression").build("object","property","computed","optional").field("optional",Boolean,n.true)}q(()=>module);function Ll(i){i.use(El),i.use(kl)}q(()=>module);function Dl(i){i.use(Ll);let e=i.use(G).Type.def;e("StaticBlock").bases("Declaration").build("body").field("body",[e("Statement")])}q(()=>module);function qt(i){i.use(Dl);let s=i.use(G),e=s.Type,t=s.Type.def,r=e.or,a=i.use(de).defaults;t("AwaitExpression").build("argument","all").field("argument",r(t("Expression"),null)).field("all",Boolean,a.false),t("Decorator").bases("Node").build("expression").field("expression",t("Expression")),t("Property").field("decorators",r([t("Decorator")],null),a.null),t("MethodDefinition").field("decorators",r([t("Decorator")],null),a.null),t("PrivateName").bases("Expression","Pattern").build("id").field("id",t("Identifier")),t("ClassPrivateProperty").bases("ClassProperty").build("key","value").field("key",t("PrivateName")).field("value",r(t("Expression"),null),a.null),t("ImportAttribute").bases("Node").build("key","value").field("key",r(t("Identifier"),t("Literal"))).field("value",t("Expression")),["ImportDeclaration","ExportAllDeclaration","ExportNamedDeclaration"].forEach(o=>{t(o).field("assertions",[t("ImportAttribute")],a.emptyArray)}),t("RecordExpression").bases("Expression").build("properties").field("properties",[r(t("ObjectProperty"),t("ObjectMethod"),t("SpreadElement"))]),t("TupleExpression").bases("Expression").build("elements").field("elements",[r(t("Expression"),t("SpreadElement"),null)]),t("ModuleExpression").bases("Node").build("body").field("body",t("Program"))}q(()=>module);function Ol(i){i.use(qt);let s=i.use(G),e=s.Type.def,t=s.Type.or,r=i.use(de).defaults;e("JSXAttribute").bases("Node").build("name","value").field("name",t(e("JSXIdentifier"),e("JSXNamespacedName"))).field("value",t(e("Literal"),e("JSXExpressionContainer"),e("JSXElement"),e("JSXFragment"),null),r.null),e("JSXIdentifier").bases("Identifier").build("name").field("name",String),e("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",e("JSXIdentifier")).field("name",e("JSXIdentifier")),e("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",t(e("JSXIdentifier"),e("JSXMemberExpression"))).field("property",e("JSXIdentifier")).field("computed",Boolean,r.false);let n=t(e("JSXIdentifier"),e("JSXNamespacedName"),e("JSXMemberExpression"));e("JSXSpreadAttribute").bases("Node").build("argument").field("argument",e("Expression"));let a=[t(e("JSXAttribute"),e("JSXSpreadAttribute"))];e("JSXExpressionContainer").bases("Expression").build("expression").field("expression",t(e("Expression"),e("JSXEmptyExpression")));let o=[t(e("JSXText"),e("JSXExpressionContainer"),e("JSXSpreadChild"),e("JSXElement"),e("JSXFragment"),e("Literal"))];e("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",e("JSXOpeningElement")).field("closingElement",t(e("JSXClosingElement"),null),r.null).field("children",o,r.emptyArray).field("name",n,function(){return this.openingElement.name},!0).field("selfClosing",Boolean,function(){return this.openingElement.selfClosing},!0).field("attributes",a,function(){return this.openingElement.attributes},!0),e("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",n).field("attributes",a,r.emptyArray).field("selfClosing",Boolean,r.false),e("JSXClosingElement").bases("Node").build("name").field("name",n),e("JSXFragment").bases("Expression").build("openingFragment","closingFragment","children").field("openingFragment",e("JSXOpeningFragment")).field("closingFragment",e("JSXClosingFragment")).field("children",o,r.emptyArray),e("JSXOpeningFragment").bases("Node").build(),e("JSXClosingFragment").bases("Node").build(),e("JSXText").bases("Literal").build("value","raw").field("value",String).field("raw",String,function(){return this.value}),e("JSXEmptyExpression").bases("Node").build(),e("JSXSpreadChild").bases("Node").build("expression").field("expression",e("Expression"))}q(()=>module);function vn(i){var s=i.use(G),e=s.Type.def,t=s.Type.or,r=i.use(de).defaults,n=t(e("TypeAnnotation"),e("TSTypeAnnotation"),null),a=t(e("TypeParameterDeclaration"),e("TSTypeParameterDeclaration"),null);e("Identifier").field("typeAnnotation",n,r.null),e("ObjectPattern").field("typeAnnotation",n,r.null),e("Function").field("returnType",n,r.null).field("typeParameters",a,r.null),e("ClassProperty").build("key","value","typeAnnotation","static").field("value",t(e("Expression"),null)).field("static",Boolean,r.false).field("typeAnnotation",n,r.null),["ClassDeclaration","ClassExpression"].forEach(o=>{e(o).field("typeParameters",a,r.null).field("superTypeParameters",t(e("TypeParameterInstantiation"),e("TSTypeParameterInstantiation"),null),r.null).field("implements",t([e("ClassImplements")],[e("TSExpressionWithTypeArguments")]),r.emptyArray)})}q(()=>module);function Cn(i){i.use(qt),i.use(vn);let s=i.use(G),e=s.Type.def,t=s.Type.or,r=i.use(de).defaults;e("Flow").bases("Node"),e("FlowType").bases("Flow"),e("AnyTypeAnnotation").bases("FlowType").build(),e("EmptyTypeAnnotation").bases("FlowType").build(),e("MixedTypeAnnotation").bases("FlowType").build(),e("VoidTypeAnnotation").bases("FlowType").build(),e("SymbolTypeAnnotation").bases("FlowType").build(),e("NumberTypeAnnotation").bases("FlowType").build(),e("BigIntTypeAnnotation").bases("FlowType").build(),e("NumberLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),e("NumericLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),e("BigIntLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",null).field("raw",String),e("StringTypeAnnotation").bases("FlowType").build(),e("StringLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",String).field("raw",String),e("BooleanTypeAnnotation").bases("FlowType").build(),e("BooleanLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Boolean).field("raw",String),e("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",e("FlowType")),e("NullableTypeAnnotation").bases("FlowType").build("typeAnnotation").field("typeAnnotation",e("FlowType")),e("NullLiteralTypeAnnotation").bases("FlowType").build(),e("NullTypeAnnotation").bases("FlowType").build(),e("ThisTypeAnnotation").bases("FlowType").build(),e("ExistsTypeAnnotation").bases("FlowType").build(),e("ExistentialTypeParam").bases("FlowType").build(),e("FunctionTypeAnnotation").bases("FlowType").build("params","returnType","rest","typeParameters").field("params",[e("FunctionTypeParam")]).field("returnType",e("FlowType")).field("rest",t(e("FunctionTypeParam"),null)).field("typeParameters",t(e("TypeParameterDeclaration"),null)),e("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",t(e("Identifier"),null)).field("typeAnnotation",e("FlowType")).field("optional",Boolean),e("ArrayTypeAnnotation").bases("FlowType").build("elementType").field("elementType",e("FlowType")),e("ObjectTypeAnnotation").bases("FlowType").build("properties","indexers","callProperties").field("properties",[t(e("ObjectTypeProperty"),e("ObjectTypeSpreadProperty"))]).field("indexers",[e("ObjectTypeIndexer")],r.emptyArray).field("callProperties",[e("ObjectTypeCallProperty")],r.emptyArray).field("inexact",t(Boolean,void 0),r.undefined).field("exact",Boolean,r.false).field("internalSlots",[e("ObjectTypeInternalSlot")],r.emptyArray),e("Variance").bases("Node").build("kind").field("kind",t("plus","minus"));let n=t(e("Variance"),"plus","minus",null);e("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",t(e("Literal"),e("Identifier"))).field("value",e("FlowType")).field("optional",Boolean).field("variance",n,r.null),e("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",e("Identifier")).field("key",e("FlowType")).field("value",e("FlowType")).field("variance",n,r.null).field("static",Boolean,r.false),e("ObjectTypeCallProperty").bases("Node").build("value").field("value",e("FunctionTypeAnnotation")).field("static",Boolean,r.false),e("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",t(e("Identifier"),e("QualifiedTypeIdentifier"))).field("id",e("Identifier")),e("GenericTypeAnnotation").bases("FlowType").build("id","typeParameters").field("id",t(e("Identifier"),e("QualifiedTypeIdentifier"))).field("typeParameters",t(e("TypeParameterInstantiation"),null)),e("MemberTypeAnnotation").bases("FlowType").build("object","property").field("object",e("Identifier")).field("property",t(e("MemberTypeAnnotation"),e("GenericTypeAnnotation"))),e("IndexedAccessType").bases("FlowType").build("objectType","indexType").field("objectType",e("FlowType")).field("indexType",e("FlowType")),e("OptionalIndexedAccessType").bases("FlowType").build("objectType","indexType","optional").field("objectType",e("FlowType")).field("indexType",e("FlowType")).field("optional",Boolean),e("UnionTypeAnnotation").bases("FlowType").build("types").field("types",[e("FlowType")]),e("IntersectionTypeAnnotation").bases("FlowType").build("types").field("types",[e("FlowType")]),e("TypeofTypeAnnotation").bases("FlowType").build("argument").field("argument",e("FlowType")),e("ObjectTypeSpreadProperty").bases("Node").build("argument").field("argument",e("FlowType")),e("ObjectTypeInternalSlot").bases("Node").build("id","value","optional","static","method").field("id",e("Identifier")).field("value",e("FlowType")).field("optional",Boolean).field("static",Boolean).field("method",Boolean),e("TypeParameterDeclaration").bases("Node").build("params").field("params",[e("TypeParameter")]),e("TypeParameterInstantiation").bases("Node").build("params").field("params",[e("FlowType")]),e("TypeParameter").bases("FlowType").build("name","variance","bound","default").field("name",String).field("variance",n,r.null).field("bound",t(e("TypeAnnotation"),null),r.null).field("default",t(e("FlowType"),null),r.null),e("ClassProperty").field("variance",n,r.null),e("ClassImplements").bases("Node").build("id").field("id",e("Identifier")).field("superClass",t(e("Expression"),null),r.null).field("typeParameters",t(e("TypeParameterInstantiation"),null),r.null),e("InterfaceTypeAnnotation").bases("FlowType").build("body","extends").field("body",e("ObjectTypeAnnotation")).field("extends",t([e("InterfaceExtends")],null),r.null),e("InterfaceDeclaration").bases("Declaration").build("id","body","extends").field("id",e("Identifier")).field("typeParameters",t(e("TypeParameterDeclaration"),null),r.null).field("body",e("ObjectTypeAnnotation")).field("extends",[e("InterfaceExtends")]),e("DeclareInterface").bases("InterfaceDeclaration").build("id","body","extends"),e("InterfaceExtends").bases("Node").build("id").field("id",e("Identifier")).field("typeParameters",t(e("TypeParameterInstantiation"),null),r.null),e("TypeAlias").bases("Declaration").build("id","typeParameters","right").field("id",e("Identifier")).field("typeParameters",t(e("TypeParameterDeclaration"),null)).field("right",e("FlowType")),e("DeclareTypeAlias").bases("TypeAlias").build("id","typeParameters","right"),e("OpaqueType").bases("Declaration").build("id","typeParameters","impltype","supertype").field("id",e("Identifier")).field("typeParameters",t(e("TypeParameterDeclaration"),null)).field("impltype",e("FlowType")).field("supertype",t(e("FlowType"),null)),e("DeclareOpaqueType").bases("OpaqueType").build("id","typeParameters","supertype").field("impltype",t(e("FlowType"),null)),e("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",e("Expression")).field("typeAnnotation",e("TypeAnnotation")),e("TupleTypeAnnotation").bases("FlowType").build("types").field("types",[e("FlowType")]),e("DeclareVariable").bases("Statement").build("id").field("id",e("Identifier")),e("DeclareFunction").bases("Statement").build("id").field("id",e("Identifier")).field("predicate",t(e("FlowPredicate"),null),r.null),e("DeclareClass").bases("InterfaceDeclaration").build("id"),e("DeclareModule").bases("Statement").build("id","body").field("id",t(e("Identifier"),e("Literal"))).field("body",e("BlockStatement")),e("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation",e("TypeAnnotation")),e("DeclareExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",t(e("DeclareVariable"),e("DeclareFunction"),e("DeclareClass"),e("FlowType"),e("TypeAlias"),e("DeclareOpaqueType"),e("InterfaceDeclaration"),null)).field("specifiers",[t(e("ExportSpecifier"),e("ExportBatchSpecifier"))],r.emptyArray).field("source",t(e("Literal"),null),r.null),e("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source",t(e("Literal"),null),r.null),e("ImportDeclaration").field("importKind",t("value","type","typeof"),()=>"value"),e("FlowPredicate").bases("Flow"),e("InferredPredicate").bases("FlowPredicate").build(),e("DeclaredPredicate").bases("FlowPredicate").build("value").field("value",e("Expression")),e("Function").field("predicate",t(e("FlowPredicate"),null),r.null),e("CallExpression").field("typeArguments",t(null,e("TypeParameterInstantiation")),r.null),e("NewExpression").field("typeArguments",t(null,e("TypeParameterInstantiation")),r.null),e("EnumDeclaration").bases("Declaration").build("id","body").field("id",e("Identifier")).field("body",t(e("EnumBooleanBody"),e("EnumNumberBody"),e("EnumStringBody"),e("EnumSymbolBody"))),e("EnumBooleanBody").build("members","explicitType").field("members",[e("EnumBooleanMember")]).field("explicitType",Boolean),e("EnumNumberBody").build("members","explicitType").field("members",[e("EnumNumberMember")]).field("explicitType",Boolean),e("EnumStringBody").build("members","explicitType").field("members",t([e("EnumStringMember")],[e("EnumDefaultedMember")])).field("explicitType",Boolean),e("EnumSymbolBody").build("members").field("members",[e("EnumDefaultedMember")]),e("EnumBooleanMember").build("id","init").field("id",e("Identifier")).field("init",t(e("Literal"),Boolean)),e("EnumNumberMember").build("id","init").field("id",e("Identifier")).field("init",e("Literal")),e("EnumStringMember").build("id","init").field("id",e("Identifier")).field("init",e("Literal")),e("EnumDefaultedMember").build("id").field("id",e("Identifier"))}q(()=>module);function Ml(i){i.use(qt);var s=i.use(G),e=i.use(de).defaults,t=s.Type.def,r=s.Type.or;t("VariableDeclaration").field("declarations",[r(t("VariableDeclarator"),t("Identifier"))]),t("Property").field("value",r(t("Expression"),t("Pattern"))),t("ArrayPattern").field("elements",[r(t("Pattern"),t("SpreadElement"),null)]),t("ObjectPattern").field("properties",[r(t("Property"),t("PropertyPattern"),t("SpreadPropertyPattern"),t("SpreadProperty"))]),t("ExportSpecifier").bases("ModuleSpecifier").build("id","name"),t("ExportBatchSpecifier").bases("Specifier").build(),t("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",r(t("Declaration"),t("Expression"),null)).field("specifiers",[r(t("ExportSpecifier"),t("ExportBatchSpecifier"))],e.emptyArray).field("source",r(t("Literal"),null),e.null),t("Block").bases("Comment").build("value","leading","trailing"),t("Line").bases("Comment").build("value","leading","trailing")}q(()=>module);function In(i){i.use(qt);let s=i.use(G),e=i.use(de).defaults,t=s.Type.def,r=s.Type.or,{undefined:n}=s.builtInTypes;t("Noop").bases("Statement").build(),t("DoExpression").bases("Expression").build("body").field("body",[t("Statement")]),t("BindExpression").bases("Expression").build("object","callee").field("object",r(t("Expression"),null)).field("callee",t("Expression")),t("ParenthesizedExpression").bases("Expression").build("expression").field("expression",t("Expression")),t("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported",t("Identifier")),t("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported",t("Identifier")),t("CommentBlock").bases("Comment").build("value","leading","trailing"),t("CommentLine").bases("Comment").build("value","leading","trailing"),t("Directive").bases("Node").build("value").field("value",t("DirectiveLiteral")),t("DirectiveLiteral").bases("Node","Expression").build("value").field("value",String,e["use strict"]),t("InterpreterDirective").bases("Node").build("value").field("value",String),t("BlockStatement").bases("Statement").build("body").field("body",[t("Statement")]).field("directives",[t("Directive")],e.emptyArray),t("Program").bases("Node").build("body").field("body",[t("Statement")]).field("directives",[t("Directive")],e.emptyArray).field("interpreter",r(t("InterpreterDirective"),null),e.null);function a(u=String,h){return["extra",{rawValue:u,raw:String},function(){let d=s.getFieldValue(this,"value");return{rawValue:d,raw:h?h(d):String(d)}}]}t("StringLiteral").bases("Literal").build("value").field("value",String).field(...a(String,u=>JSON.stringify(u))),t("NumericLiteral").bases("Literal").build("value").field("value",Number).field("raw",r(String,null),e.null).field(...a(Number)),t("BigIntLiteral").bases("Literal").build("value").field("value",r(String,Number)).field(...a(String,u=>u+"n")),t("DecimalLiteral").bases("Literal").build("value").field("value",String).field(...a(String,u=>u+"m")),t("NullLiteral").bases("Literal").build().field("value",null,e.null),t("BooleanLiteral").bases("Literal").build("value").field("value",Boolean),t("RegExpLiteral").bases("Literal").build("pattern","flags").field("pattern",String).field("flags",String).field("value",RegExp,function(){return new RegExp(this.pattern,this.flags)}).field(...a(r(RegExp,n),u=>`/${u.pattern}/${u.flags||""}`)).field("regex",{pattern:String,flags:String},function(){return{pattern:this.pattern,flags:this.flags}});var o=r(t("Property"),t("ObjectMethod"),t("ObjectProperty"),t("SpreadProperty"),t("SpreadElement"));t("ObjectExpression").bases("Expression").build("properties").field("properties",[o]),t("ObjectMethod").bases("Node","Function").build("kind","key","params","body","computed").field("kind",r("method","get","set")).field("key",r(t("Literal"),t("Identifier"),t("Expression"))).field("params",[t("Pattern")]).field("body",t("BlockStatement")).field("computed",Boolean,e.false).field("generator",Boolean,e.false).field("async",Boolean,e.false).field("accessibility",r(t("Literal"),null),e.null).field("decorators",r([t("Decorator")],null),e.null),t("ObjectProperty").bases("Node").build("key","value").field("key",r(t("Literal"),t("Identifier"),t("Expression"))).field("value",r(t("Expression"),t("Pattern"))).field("accessibility",r(t("Literal"),null),e.null).field("computed",Boolean,e.false);var l=r(t("MethodDefinition"),t("VariableDeclarator"),t("ClassPropertyDefinition"),t("ClassProperty"),t("ClassPrivateProperty"),t("ClassMethod"),t("ClassPrivateMethod"),t("ClassAccessorProperty"),t("StaticBlock"));t("ClassBody").bases("Declaration").build("body").field("body",[l]),t("ClassMethod").bases("Declaration","Function").build("kind","key","params","body","computed","static").field("key",r(t("Literal"),t("Identifier"),t("Expression"))),t("ClassPrivateMethod").bases("Declaration","Function").build("key","params","body","kind","computed","static").field("key",t("PrivateName")),t("ClassAccessorProperty").bases("Declaration").build("key","value","decorators","computed","static").field("key",r(t("Literal"),t("Identifier"),t("PrivateName"),t("Expression"))).field("value",r(t("Expression"),null),e.null),["ClassMethod","ClassPrivateMethod"].forEach(u=>{t(u).field("kind",r("get","set","method","constructor"),()=>"method").field("body",t("BlockStatement")).field("access",r("public","private","protected",null),e.null)}),["ClassMethod","ClassPrivateMethod","ClassAccessorProperty"].forEach(u=>{t(u).field("computed",Boolean,e.false).field("static",Boolean,e.false).field("abstract",Boolean,e.false).field("accessibility",r("public","private","protected",null),e.null).field("decorators",r([t("Decorator")],null),e.null).field("definite",Boolean,e.false).field("optional",Boolean,e.false).field("override",Boolean,e.false).field("readonly",Boolean,e.false)});var c=r(t("Property"),t("PropertyPattern"),t("SpreadPropertyPattern"),t("SpreadProperty"),t("ObjectProperty"),t("RestProperty"),t("RestElement"));t("ObjectPattern").bases("Pattern").build("properties").field("properties",[c]).field("decorators",r([t("Decorator")],null),e.null),t("SpreadProperty").bases("Node").build("argument").field("argument",t("Expression")),t("RestProperty").bases("Node").build("argument").field("argument",t("Expression")),t("ForAwaitStatement").bases("Statement").build("left","right","body").field("left",r(t("VariableDeclaration"),t("Expression"))).field("right",t("Expression")).field("body",t("Statement")),t("Import").bases("Expression").build()}q(()=>module);function Fl(i){let e=i.use(G).Type.def;i.use(In),i.use(Cn),e("V8IntrinsicIdentifier").bases("Expression").build("name").field("name",String),e("TopicReference").bases("Expression").build()}q(()=>module);function Bl(i){i.use(In),i.use(vn);var s=i.use(G),e=s.namedTypes,t=s.Type.def,r=s.Type.or,n=i.use(de).defaults,a=s.Type.from(function(u,h){return!!(e.StringLiteral&&e.StringLiteral.check(u,h)||e.Literal&&e.Literal.check(u,h)&&typeof u.value=="string")},"StringLiteral");t("TSType").bases("Node");var o=r(t("Identifier"),t("TSQualifiedName"));t("TSTypeReference").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("typeName","typeParameters").field("typeName",o),t("TSHasOptionalTypeParameterInstantiation").field("typeParameters",r(t("TSTypeParameterInstantiation"),null),n.null),t("TSHasOptionalTypeParameters").field("typeParameters",r(t("TSTypeParameterDeclaration"),null,void 0),n.null),t("TSHasOptionalTypeAnnotation").field("typeAnnotation",r(t("TSTypeAnnotation"),null),n.null),t("TSQualifiedName").bases("Node").build("left","right").field("left",o).field("right",o),t("TSAsExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",t("Expression")).field("typeAnnotation",t("TSType")).field("extra",r({parenthesized:Boolean},null),n.null),t("TSTypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",t("Expression")).field("typeAnnotation",t("TSType")),t("TSSatisfiesExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",t("Expression")).field("typeAnnotation",t("TSType")),t("TSNonNullExpression").bases("Expression","Pattern").build("expression").field("expression",t("Expression")),["TSAnyKeyword","TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword","TSIntrinsicKeyword","TSThisType"].forEach(u=>{t(u).bases("TSType").build()}),t("TSArrayType").bases("TSType").build("elementType").field("elementType",t("TSType")),t("TSLiteralType").bases("TSType").build("literal").field("literal",r(t("NumericLiteral"),t("StringLiteral"),t("BooleanLiteral"),t("TemplateLiteral"),t("UnaryExpression"),t("BigIntLiteral"))),t("TemplateLiteral").field("expressions",r([t("Expression")],[t("TSType")])),["TSUnionType","TSIntersectionType"].forEach(u=>{t(u).bases("TSType").build("types").field("types",[t("TSType")])}),t("TSConditionalType").bases("TSType").build("checkType","extendsType","trueType","falseType").field("checkType",t("TSType")).field("extendsType",t("TSType")).field("trueType",t("TSType")).field("falseType",t("TSType")),t("TSInferType").bases("TSType").build("typeParameter").field("typeParameter",t("TSTypeParameter")),t("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation",t("TSType"));var l=[r(t("Identifier"),t("RestElement"),t("ArrayPattern"),t("ObjectPattern"))];["TSFunctionType","TSConstructorType"].forEach(u=>{t(u).bases("TSType","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters").field("parameters",l)}),t("TSDeclareFunction").bases("Declaration","TSHasOptionalTypeParameters").build("id","params","returnType").field("declare",Boolean,n.false).field("async",Boolean,n.false).field("generator",Boolean,n.false).field("id",r(t("Identifier"),null),n.null).field("params",[t("Pattern")]).field("returnType",r(t("TSTypeAnnotation"),t("Noop"),null),n.null),t("TSDeclareMethod").bases("Declaration","TSHasOptionalTypeParameters").build("key","params","returnType").field("async",Boolean,n.false).field("generator",Boolean,n.false).field("params",[t("Pattern")]).field("abstract",Boolean,n.false).field("accessibility",r("public","private","protected",void 0),n.undefined).field("static",Boolean,n.false).field("computed",Boolean,n.false).field("optional",Boolean,n.false).field("key",r(t("Identifier"),t("StringLiteral"),t("NumericLiteral"),t("Expression"))).field("kind",r("get","set","method","constructor"),function(){return"method"}).field("access",r("public","private","protected",void 0),n.undefined).field("decorators",r([t("Decorator")],null),n.null).field("returnType",r(t("TSTypeAnnotation"),t("Noop"),null),n.null),t("TSMappedType").bases("TSType").build("typeParameter","typeAnnotation").field("readonly",r(Boolean,"+","-"),n.false).field("typeParameter",t("TSTypeParameter")).field("optional",r(Boolean,"+","-"),n.false).field("typeAnnotation",r(t("TSType"),null),n.null),t("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes",[r(t("TSType"),t("TSNamedTupleMember"))]),t("TSNamedTupleMember").bases("TSType").build("label","elementType","optional").field("label",t("Identifier")).field("optional",Boolean,n.false).field("elementType",t("TSType")),t("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation",t("TSType")),t("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation",t("TSType")),t("TSIndexedAccessType").bases("TSType").build("objectType","indexType").field("objectType",t("TSType")).field("indexType",t("TSType")),t("TSTypeOperator").bases("TSType").build("operator").field("operator",String).field("typeAnnotation",t("TSType")),t("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",r(t("TSType"),t("TSTypeAnnotation"))),t("TSIndexSignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",[t("Identifier")]).field("readonly",Boolean,n.false),t("TSPropertySignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("key","typeAnnotation","optional").field("key",t("Expression")).field("computed",Boolean,n.false).field("readonly",Boolean,n.false).field("optional",Boolean,n.false).field("initializer",r(t("Expression"),null),n.null),t("TSMethodSignature").bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("key","parameters","typeAnnotation").field("key",t("Expression")).field("computed",Boolean,n.false).field("optional",Boolean,n.false).field("parameters",l),t("TSTypePredicate").bases("TSTypeAnnotation","TSType").build("parameterName","typeAnnotation","asserts").field("parameterName",r(t("Identifier"),t("TSThisType"))).field("typeAnnotation",r(t("TSTypeAnnotation"),null),n.null).field("asserts",Boolean,n.false),["TSCallSignatureDeclaration","TSConstructSignatureDeclaration"].forEach(u=>{t(u).bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",l)}),t("TSEnumMember").bases("Node").build("id","initializer").field("id",r(t("Identifier"),a)).field("initializer",r(t("Expression"),null),n.null),t("TSTypeQuery").bases("TSType").build("exprName").field("exprName",r(o,t("TSImportType")));var c=r(t("TSCallSignatureDeclaration"),t("TSConstructSignatureDeclaration"),t("TSIndexSignature"),t("TSMethodSignature"),t("TSPropertySignature"));t("TSTypeLiteral").bases("TSType").build("members").field("members",[c]),t("TSTypeParameter").bases("Identifier").build("name","constraint","default").field("name",r(t("Identifier"),String)).field("constraint",r(t("TSType"),void 0),n.undefined).field("default",r(t("TSType"),void 0),n.undefined),t("TSTypeAssertion").bases("Expression","Pattern").build("typeAnnotation","expression").field("typeAnnotation",t("TSType")).field("expression",t("Expression")).field("extra",r({parenthesized:Boolean},null),n.null),t("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params",[t("TSTypeParameter")]),t("TSInstantiationExpression").bases("Expression","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",t("Expression")),t("TSTypeParameterInstantiation").bases("Node").build("params").field("params",[t("TSType")]),t("TSEnumDeclaration").bases("Declaration").build("id","members").field("id",t("Identifier")).field("const",Boolean,n.false).field("declare",Boolean,n.false).field("members",[t("TSEnumMember")]).field("initializer",r(t("Expression"),null),n.null),t("TSTypeAliasDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","typeAnnotation").field("id",t("Identifier")).field("declare",Boolean,n.false).field("typeAnnotation",t("TSType")),t("TSModuleBlock").bases("Node").build("body").field("body",[t("Statement")]),t("TSModuleDeclaration").bases("Declaration").build("id","body").field("id",r(a,o)).field("declare",Boolean,n.false).field("global",Boolean,n.false).field("body",r(t("TSModuleBlock"),t("TSModuleDeclaration"),null),n.null),t("TSImportType").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("argument","qualifier","typeParameters").field("argument",a).field("qualifier",r(o,void 0),n.undefined),t("TSImportEqualsDeclaration").bases("Declaration").build("id","moduleReference").field("id",t("Identifier")).field("isExport",Boolean,n.false).field("moduleReference",r(o,t("TSExternalModuleReference"))),t("TSExternalModuleReference").bases("Declaration").build("expression").field("expression",a),t("TSExportAssignment").bases("Statement").build("expression").field("expression",t("Expression")),t("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id",t("Identifier")),t("TSInterfaceBody").bases("Node").build("body").field("body",[c]),t("TSExpressionWithTypeArguments").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",o),t("TSInterfaceDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","body").field("id",o).field("declare",Boolean,n.false).field("extends",r([t("TSExpressionWithTypeArguments")],null),n.null).field("body",t("TSInterfaceBody")),t("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility",r("public","private","protected",void 0),n.undefined).field("readonly",Boolean,n.false).field("parameter",r(t("Identifier"),t("AssignmentPattern"))),t("ClassProperty").field("access",r("public","private","protected",void 0),n.undefined),t("ClassAccessorProperty").bases("Declaration","TSHasOptionalTypeAnnotation"),t("ClassBody").field("body",[r(t("MethodDefinition"),t("VariableDeclarator"),t("ClassPropertyDefinition"),t("ClassProperty"),t("ClassPrivateProperty"),t("ClassAccessorProperty"),t("ClassMethod"),t("ClassPrivateMethod"),t("StaticBlock"),t("TSDeclareMethod"),c)])}q(()=>module);var Se;Se||(Se={});var{astNodesAreEquivalent:$u,builders:mt,builtInTypes:Ee,defineMethod:qu,eachField:zu,finalize:Wu,getBuilderName:Ju,getFieldNames:_l,getFieldValue:_e,getSupertypeNames:Ku,namedTypes:jl,NodePath:Rl,Path:Hu,PathVisitor:Xu,someField:Ul,Type:Gu,use:Qu,visit:Yu}=Pl([qt,Ol,Cn,Ml,Fl,Bl]);Object.assign(Se,jl);var us=Se,nn=As.default.SourceMapConsumer,Vl=As.default.SourceMapGenerator,Nn=Object.prototype.hasOwnProperty;function $l(){return`
12
+ `}function an(i,s,e){return i&&Nn.call(i,s)?i[s]:e}function ql(...i){let s={},e=i.length;for(let t=0;t<e;++t){let r=Object.keys(i[t]),n=r.length;for(let a=0;a<n;++a)s[r[a]]=!0}return s}function U(i,s){return i.line-s.line||i.column-s.column}function $e(i){return{line:i.line,column:i.column}}function zl(i,s){if(i){if(!s)return i}else return s||null;let e=new nn(i),t=new nn(s),r=new Vl({file:s.file,sourceRoot:s.sourceRoot}),n={};return t.eachMapping(function(a){let o=e.originalPositionFor({line:a.originalLine,column:a.originalColumn}),l=o.source;if(l===null)return;r.addMapping({source:l,original:$e(o),generated:{line:a.generatedLine,column:a.generatedColumn},name:a.name});let c=e.sourceContentFor(l);c&&!Nn.call(n,l)&&(n[l]=c,r.setSourceContent(l,c))}),r.toJSON()}function kn(i,s){if(!i.loc)return null;let e={start:i.loc.start,end:i.loc.end};function t(r){Lr(e,r.loc)}return i.declaration&&i.declaration.decorators&&ws(i)&&i.declaration.decorators.forEach(t),U(e.start,e.end)<0&&(e.start=$e(e.start),s.skipSpaces(e.start,!1,!0),U(e.start,e.end)<0&&(e.end=$e(e.end),s.skipSpaces(e.end,!0,!0))),i.comments&&i.comments.forEach(t),e}function Lr(i,s){i&&s&&(U(s.start,i.start)<0&&(i.start=s.start),U(i.end,s.end)<0&&(i.end=s.end))}function Vr(i,s){let e=i.loc;if(e&&(e.start.line<1&&(e.start.line=1),e.end.line<1&&(e.end.line=1)),i.type==="File"&&(e.start=s.firstPos(),e.end=s.lastPos()),Wl(i,s),Jl(i,s),e&&i.decorators)i.decorators.forEach(function(t){Lr(e,t.loc)});else if(i.declaration&&ws(i)){i.declaration.loc=null;let t=i.declaration.decorators;t&&t.forEach(function(r){Lr(e,r.loc)})}else if(us.MethodDefinition&&us.MethodDefinition.check(i)||us.Property.check(i)&&(i.method||i.shorthand))i.value.loc=null,us.FunctionExpression.check(i.value)&&(i.value.id=null);else if(i.type==="ObjectTypeProperty"){let t=i.loc,r=t&&t.end;r&&(r=$e(r),s.prevPos(r)&&s.charAt(r)===","&&(r=s.skipSpaces(r,!0,!0))&&(t.end=r))}}function Wl(i,s){if(i.type!=="ForStatement")return;function e(t){let r=t&&t.loc,n=r&&r.start,a=r&&$e(r.end);for(;n&&a&&U(n,a)<0&&(s.prevPos(a),s.charAt(a)===";");)r.end.line=a.line,r.end.column=a.column}e(i.init),e(i.test),e(i.update)}function Jl(i,s){if(i.type==="TemplateLiteral"&&i.quasis.length!==0){if(i.loc){let e=$e(i.loc.start),t=i.quasis[0];U(t.loc.start,e)<0&&(t.loc.start=e);let r=$e(i.loc.end),n=i.quasis[i.quasis.length-1];U(r,n.loc.end)<0&&(n.loc.end=r)}i.expressions.forEach(function(e,t){let r=s.skipSpaces(e.loc.start,!0,!1);if(s.prevPos(r)&&s.charAt(r)==="{"&&s.prevPos(r)&&s.charAt(r)==="$"){let a=i.quasis[t];U(r,a.loc.end)<0&&(a.loc.end=r)}let n=s.skipSpaces(e.loc.end,!1,!1);if(s.charAt(n)==="}"){let a=i.quasis[t+1];U(a.loc.start,n)<0&&(a.loc.start=n)}})}}function ws(i){if(i)switch(i.type){case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportDefaultSpecifier":case"DeclareExportDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return!0}return!1}function Ln(i){let s=i.getParentNode();return i.getName()==="declaration"&&ws(s)?s:null}function jt(i,s){let e=i.trailingComma;return typeof e=="object"?!!e[s]:!!e}var Dr={tabWidth:4,useTabs:!1,reuseWhitespace:!0,lineTerminator:$l(),wrapColumn:74,sourceFileName:null,sourceMapName:null,sourceRoot:null,inputSourceMap:null,range:!1,tolerant:!0,quote:null,trailingComma:!1,arrayBracketSpacing:!1,objectCurlySpacing:!0,arrowParensAlways:!1,flowObjectCommas:!0,tokens:!0},Kl=Dr.hasOwnProperty;function vs(i){let s=i||Dr;function e(t){return Kl.call(s,t)?s[t]:Dr[t]}return{tabWidth:+e("tabWidth"),useTabs:!!e("useTabs"),reuseWhitespace:!!e("reuseWhitespace"),lineTerminator:e("lineTerminator"),wrapColumn:Math.max(e("wrapColumn"),0),sourceFileName:e("sourceFileName"),sourceMapName:e("sourceMapName"),sourceRoot:e("sourceRoot"),inputSourceMap:e("inputSourceMap"),parser:e("esprima")||e("parser"),range:e("range"),tolerant:e("tolerant"),quote:e("quote"),trailingComma:e("trailingComma"),arrayBracketSpacing:e("arrayBracketSpacing"),objectCurlySpacing:e("objectCurlySpacing"),arrowParensAlways:e("arrowParensAlways"),flowObjectCommas:e("flowObjectCommas"),tokens:!!e("tokens")}}var Or=class i{constructor(s,e,t=e){this.sourceLines=s,this.sourceLoc=e,this.targetLoc=t}slice(s,e,t=s.lastPos()){let r=this.sourceLines,n=this.sourceLoc,a=this.targetLoc;function o(l){let c=n[l],u=a[l],h=e;return l==="end"&&(h=t),Hl(r,c,s,u,h)}if(U(e,a.start)<=0)if(U(a.end,t)<=0)a={start:Ve(a.start,e.line,e.column),end:Ve(a.end,e.line,e.column)};else{if(U(t,a.start)<=0)return null;n={start:n.start,end:o("end")},a={start:Ve(a.start,e.line,e.column),end:Ve(t,e.line,e.column)}}else{if(U(a.end,e)<=0)return null;U(a.end,t)<=0?(n={start:o("start"),end:n.end},a={start:{line:1,column:0},end:Ve(a.end,e.line,e.column)}):(n={start:o("start"),end:o("end")},a={start:{line:1,column:0},end:Ve(t,e.line,e.column)})}return new i(this.sourceLines,n,a)}add(s,e){return new i(this.sourceLines,this.sourceLoc,{start:on(this.targetLoc.start,s,e),end:on(this.targetLoc.end,s,e)})}subtract(s,e){return new i(this.sourceLines,this.sourceLoc,{start:Ve(this.targetLoc.start,s,e),end:Ve(this.targetLoc.end,s,e)})}indent(s,e=!1,t=!1){if(s===0)return this;let r=this.targetLoc,n=r.start.line,a=r.end.line;if(e&&n===1&&a===1)return this;if(r={start:r.start,end:r.end},!e||n>1){let o=r.start.column+s;r.start={line:n,column:t?Math.max(0,o):o}}if(!e||a>1){let o=r.end.column+s;r.end={line:a,column:t?Math.max(0,o):o}}return new i(this.sourceLines,this.sourceLoc,r)}};function on(i,s,e){return{line:i.line+s-1,column:i.line===1?i.column+e:i.column}}function Ve(i,s,e){return{line:i.line-s+1,column:i.line===s?i.column-e:i.column}}function Hl(i,s,e,t,r){let n=U(t,r);if(n===0)return s;let a,o;if(n<0){a=i.skipSpaces(s)||i.lastPos(),o=e.skipSpaces(t)||e.lastPos();let l=r.line-o.line;for(a.line+=l,o.line+=l,l>0&&(a.column=0,o.column=0);U(o,r)<0&&e.nextPos(o,!0););}else{a=i.skipSpaces(s,!0)||i.firstPos(),o=e.skipSpaces(t,!0)||e.firstPos();let l=r.line-o.line;for(a.line+=l,o.line+=l,l<0&&(a.column=i.getLineLength(a.line),o.column=e.getLineLength(o.line));U(r,o)<0&&e.prevPos(o,!0););}return a}var Xl=Object.defineProperty,Gl=(i,s,e)=>s in i?Xl(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e,Lt=(i,s,e)=>(Gl(i,typeof s!="symbol"?s+"":s,e),e),ft=class i{constructor(s,e=null){this.infos=s,Lt(this,"length"),Lt(this,"name"),Lt(this,"mappings",[]),Lt(this,"cachedSourceMap",null),Lt(this,"cachedTabWidth"),this.length=s.length,this.name=e||null,this.name&&this.mappings.push(new Or(this,{start:this.firstPos(),end:this.lastPos()}))}toString(s){return this.sliceString(this.firstPos(),this.lastPos(),s)}getSourceMap(s,e){if(!s)return null;let t=this;function r(o){return o=o||{},o.file=s,e&&(o.sourceRoot=e),o}if(t.cachedSourceMap)return r(t.cachedSourceMap.toJSON());let n=new As.default.SourceMapGenerator(r()),a={};return t.mappings.forEach(function(o){let l=o.sourceLines.skipSpaces(o.sourceLoc.start)||o.sourceLines.lastPos(),c=t.skipSpaces(o.targetLoc.start)||t.lastPos();for(;U(l,o.sourceLoc.end)<0&&U(c,o.targetLoc.end)<0;){o.sourceLines.charAt(l),t.charAt(c);let u=o.sourceLines.name;if(n.addMapping({source:u,original:{line:l.line,column:l.column},generated:{line:c.line,column:c.column}}),!Mr.call(a,u)){let h=o.sourceLines.toString();n.setSourceContent(u,h),a[u]=h}t.nextPos(c,!0),o.sourceLines.nextPos(l,!0)}}),t.cachedSourceMap=n,n.toJSON()}bootstrapCharAt(s){let e=s.line,t=s.column,r=this.toString().split(Fr),n=r[e-1];return typeof n>"u"?"":t===n.length&&e<r.length?`
11
13
  `:t>=n.length?"":n.charAt(t)}charAt(s){let e=s.line,t=s.column,r=this,n=r.infos,a=n[e-1],o=t;if(typeof a>"u"||o<0)return"";let l=this.getIndentAt(e);return o<l?" ":(o+=a.sliceStart-l,o===a.sliceEnd&&e<this.length?`
12
- `:o>=a.sliceEnd?"":a.line.charAt(o))}stripMargin(s,e){if(s===0)return this;if(e&&this.length===1)return this;let t=new i(this.infos.map(function(r,n){return r.line&&(n>0||!e)&&(r={...r,indent:Math.max(0,r.indent-s)}),r}));if(this.mappings.length>0){let r=t.mappings;this.mappings.forEach(function(n){r.push(n.indent(s,e,!0))})}return t}indent(s){if(s===0)return this;let e=new i(this.infos.map(function(t){return t.line&&!t.locked&&(t={...t,indent:t.indent+s}),t}));if(this.mappings.length>0){let t=e.mappings;this.mappings.forEach(function(r){t.push(r.indent(s))})}return e}indentTail(s){if(s===0)return this;if(this.length<2)return this;let e=new i(this.infos.map(function(t,r){return r>0&&t.line&&!t.locked&&(t={...t,indent:t.indent+s}),t}));if(this.mappings.length>0){let t=e.mappings;this.mappings.forEach(function(r){t.push(r.indent(s,!0))})}return e}lockIndentTail(){return this.length<2?this:new i(this.infos.map((s,e)=>({...s,locked:e>0})))}getIndentAt(s){return Math.max(this.infos[s-1].indent,0)}guessTabWidth(){if(typeof this.cachedTabWidth=="number")return this.cachedTabWidth;let s=[],e=0;for(let n=1,a=this.length;n<=a;++n){let o=this.infos[n-1],l=o.line.slice(o.sliceStart,o.sliceEnd);if(ct(l))continue;let c=Math.abs(o.indent-e);s[c]=~~s[c]+1,e=o.indent}let t=-1,r=2;for(let n=1;n<s.length;n+=1)Dr.call(s,n)&&s[n]>t&&(t=s[n],r=n);return this.cachedTabWidth=r}startsWithComment(){if(this.infos.length===0)return!1;let s=this.infos[0],e=s.sliceStart,t=s.sliceEnd,r=s.line.slice(e,t).trim();return r.length===0||r.slice(0,2)==="//"||r.slice(0,2)==="/*"}isOnlyWhitespace(){return ct(this.toString())}isPrecededOnlyByWhitespace(s){let e=this.infos[s.line-1],t=Math.max(e.indent,0),r=s.column-t;if(r<=0)return!0;let n=e.sliceStart,a=Math.min(n+r,e.sliceEnd),o=e.line.slice(n,a);return ct(o)}getLineLength(s){let e=this.infos[s-1];return this.getIndentAt(s)+e.sliceEnd-e.sliceStart}nextPos(s,e=!1){let t=Math.max(s.line,0);return Math.max(s.column,0)<this.getLineLength(t)?(s.column+=1,e?!!this.skipSpaces(s,!1,!0):!0):t<this.length?(s.line+=1,s.column=0,e?!!this.skipSpaces(s,!1,!0):!0):!1}prevPos(s,e=!1){let t=s.line,r=s.column;if(r<1){if(t-=1,t<1)return!1;r=this.getLineLength(t)}else r=Math.min(r-1,this.getLineLength(t));return s.line=t,s.column=r,e?!!this.skipSpaces(s,!0,!0):!0}firstPos(){return{line:1,column:0}}lastPos(){return{line:this.length,column:this.getLineLength(this.length)}}skipSpaces(s,e=!1,t=!1){if(s?s=t?s:{line:s.line,column:s.column}:e?s=this.lastPos():s=this.firstPos(),e){for(;this.prevPos(s);)if(!ct(this.charAt(s))&&this.nextPos(s))return s;return null}else{for(;ct(this.charAt(s));)if(!this.nextPos(s))return null;return s}}trimLeft(){let s=this.skipSpaces(this.firstPos(),!1,!0);return s?this.slice(s):He}trimRight(){let s=this.skipSpaces(this.lastPos(),!0,!0);return s?this.slice(this.firstPos(),s):He}trim(){let s=this.skipSpaces(this.firstPos(),!1,!0);if(s===null)return He;let e=this.skipSpaces(this.lastPos(),!0,!0);return e===null?He:this.slice(s,e)}eachPos(s,e=this.firstPos(),t=!1){let r=this.firstPos();if(e&&(r.line=e.line,r.column=e.column),!(t&&!this.skipSpaces(r,!1,!0)))do s.call(this,r);while(this.nextPos(r,t))}bootstrapSlice(s,e){let t=this.toString().split(Or).slice(s.line-1,e.line);return t.length>0&&(t.push(t.pop().slice(0,e.column)),t[0]=t[0].slice(s.column)),S(t.join(`
13
- `))}slice(s,e){if(!e){if(!s)return this;e=this.lastPos()}if(!s)throw new Error("cannot slice with end but not start");let t=this.infos.slice(s.line-1,e.line);s.line===e.line?t[0]=ut(t[0],s.column,e.column):(t[0]=ut(t[0],s.column),t.push(ut(t.pop(),0,e.column)));let r=new i(t);if(this.mappings.length>0){let n=r.mappings;this.mappings.forEach(function(a){let o=a.slice(this,s,e);o&&n.push(o)},this)}return r}bootstrapSliceString(s,e,t){return this.slice(s,e).toString(t)}sliceString(s=this.firstPos(),e=this.lastPos(),t){let{tabWidth:r,useTabs:n,reuseWhitespace:a,lineTerminator:o}=Es(t),l=[];for(let c=s.line;c<=e.line;++c){let u=this.infos[c-1];c===s.line?c===e.line?u=ut(u,s.column,e.column):u=ut(u,s.column):c===e.line&&(u=ut(u,0,e.column));let h=Math.max(u.indent,0),f=u.line.slice(0,u.sliceStart);if(a&&ct(f)&&kn(f,r)===h){l.push(u.line.slice(0,u.sliceEnd));continue}let d=0,p=h;n&&(d=Math.floor(h/r),p-=d*r);let g="";d>0&&(g+=new Array(d+1).join(" ")),p>0&&(g+=new Array(p+1).join(" ")),g+=u.line.slice(u.sliceStart,u.sliceEnd),l.push(g)}return l.join(o)}isEmpty(){return this.length<2&&this.getLineLength(1)<1}join(s){let e=this,t=[],r=[],n;function a(c){if(c!==null){if(n){let u=c.infos[0],h=new Array(u.indent+1).join(" "),f=t.length,d=Math.max(n.indent,0)+n.sliceEnd-n.sliceStart;n.line=n.line.slice(0,n.sliceEnd)+h+u.line.slice(u.sliceStart,u.sliceEnd),n.locked=n.locked||u.locked,n.sliceEnd=n.line.length,c.mappings.length>0&&c.mappings.forEach(function(p){r.push(p.add(f,d))})}else c.mappings.length>0&&r.push.apply(r,c.mappings);c.infos.forEach(function(u,h){(!n||h>0)&&(n={...u},t.push(n))})}}function o(c,u){u>0&&a(e),a(c)}if(s.map(function(c){let u=S(c);return u.isEmpty()?null:u}).forEach((c,u)=>{e.isEmpty()?a(c):o(c,u)}),t.length<1)return He;let l=new i(t);return l.mappings=r,l}concat(...s){let e=[this];return e.push.apply(e,s),He.join(e)}},ps={},Dr=ps.hasOwnProperty,Hl=10;function kn(i,s){let e=0,t=i.length;for(let r=0;r<t;++r)switch(i.charCodeAt(r)){case 9:{let n=Math.ceil(e/s)*s;n===e?e+=s:e=n;break}case 11:case 12:case 13:case 65279:break;case 32:default:e+=1;break}return e}var Xl=/^\s*/,Or=/\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/;function S(i,s){if(i instanceof ft)return i;i+="";let e=s&&s.tabWidth,t=i.indexOf(" ")<0,r=!s&&t&&i.length<=Hl;if(r&&Dr.call(ps,i))return ps[i];let n=new ft(i.split(Or).map(function(a){let o=Xl.exec(a)[0];return{line:a,indent:kn(o,e),locked:!1,sliceStart:o.length,sliceEnd:a.length}}),Es(s).sourceFileName);return r&&(ps[i]=n),n}function ct(i){return!/\S/.test(i)}function ut(i,s,e){let t=i.sliceStart,r=i.sliceEnd,n=Math.max(i.indent,0),a=n+r-t;return typeof e>"u"&&(e=a),s=Math.max(s,0),e=Math.min(e,a),e=Math.max(e,s),e<n?(n=e,r=t):r-=a-e,a=e,a-=s,s<n?n-=s:(s-=n,n=0,t+=s),i.indent===n&&i.sliceStart===t&&i.sliceEnd===r?i:{line:i.line,indent:n,locked:!1,sliceStart:t,sliceEnd:r}}function x(i){return He.join(i)}var He=S(""),dt=Se,Ln=Ee.array,Gl=Ee.object,an=new WeakMap;function Dn(i,s,e){if(!i)return e;if(Rr(i,s),e){if(dt.Node.check(i)&&dt.SourceLocation.check(i.loc)){let r=e.length-1;for(;r>=0;--r){let n=e[r];if(n&&n.loc&&U(n.loc.end,i.loc.start)<=0)break}return e.splice(r+1,0,i),e}}else{let r=an.get(i);if(r)return r}let t;if(Ln.check(i))t=Object.keys(i);else if(Gl.check(i))t=Ml(i);else return e;e||an.set(i,e=[]);for(let r=0,n=t.length;r<n;++r)Dn(i[t[r]],s,e);return e}function On(i,s,e){let t=Dn(i,e),r=0,n=t&&t.length,a,o;for(;typeof n=="number"&&r<n;){let l=r+n>>1,c=t[l];if(U(c.loc.start,s.loc.start)<=0&&U(s.loc.end,c.loc.end)<=0){On(s.enclosingNode=c,s,e);return}if(U(c.loc.end,s.loc.start)<=0){a=c,r=l+1;continue}if(U(s.loc.end,c.loc.start)<=0){o=c,n=l;continue}throw new Error("Comment location overlaps with node location")}a&&(s.precedingNode=a),o&&(s.followingNode=o)}function Ql(i,s,e){if(!Ln.check(i))return;let t=[];i.forEach(function(r){r.loc.lines=e,On(s,r,e);let n=r.precedingNode,a=r.enclosingNode,o=r.followingNode;if(n&&o){let l=t.length;l>0&&t[l-1].followingNode!==r.followingNode&&Dt(t,e),t.push(r)}else if(n)Dt(t,e),Fn(n,r);else if(o)Dt(t,e),Mn(o,r);else if(a)Dt(t,e),Yl(a,r);else throw new Error("AST contains no nodes at all?")}),Dt(t,e),i.forEach(function(r){delete r.precedingNode,delete r.enclosingNode,delete r.followingNode})}function Dt(i,s){let e=i.length;if(e===0)return;let t=i[0].precedingNode,r=i[0].followingNode,n=r.loc.start,a=e,o;for(;a>0;--a){o=i[a-1];let l=s.sliceString(o.loc.end,n);if(/\S/.test(l))break;n=o.loc.start}for(;a<=e&&(o=i[a])&&(o.type==="Line"||o.type==="CommentLine")&&o.loc.start.column>r.loc.start.column;)++a;if(a){let{enclosingNode:l}=i[a-1];l?.type==="CallExpression"&&--a}i.forEach(function(l,c){c<a?Fn(t,l):Mn(r,l)}),i.length=0}function Ur(i,s){(i.comments||(i.comments=[])).push(s)}function Mn(i,s){s.leading=!0,s.trailing=!1,Ur(i,s)}function Yl(i,s){s.leading=!1,s.trailing=!1,Ur(i,s)}function Fn(i,s){s.leading=!1,s.trailing=!0,Ur(i,s)}function Zl(i,s){let e=i.getValue();dt.Comment.assert(e);let t=e.loc,r=t&&t.lines,n=[s(i)];if(e.trailing)n.push(`
14
+ `:o>=a.sliceEnd?"":a.line.charAt(o))}stripMargin(s,e){if(s===0)return this;if(e&&this.length===1)return this;let t=new i(this.infos.map(function(r,n){return r.line&&(n>0||!e)&&(r={...r,indent:Math.max(0,r.indent-s)}),r}));if(this.mappings.length>0){let r=t.mappings;this.mappings.forEach(function(n){r.push(n.indent(s,e,!0))})}return t}indent(s){if(s===0)return this;let e=new i(this.infos.map(function(t){return t.line&&!t.locked&&(t={...t,indent:t.indent+s}),t}));if(this.mappings.length>0){let t=e.mappings;this.mappings.forEach(function(r){t.push(r.indent(s))})}return e}indentTail(s){if(s===0)return this;if(this.length<2)return this;let e=new i(this.infos.map(function(t,r){return r>0&&t.line&&!t.locked&&(t={...t,indent:t.indent+s}),t}));if(this.mappings.length>0){let t=e.mappings;this.mappings.forEach(function(r){t.push(r.indent(s,!0))})}return e}lockIndentTail(){return this.length<2?this:new i(this.infos.map((s,e)=>({...s,locked:e>0})))}getIndentAt(s){return Math.max(this.infos[s-1].indent,0)}guessTabWidth(){if(typeof this.cachedTabWidth=="number")return this.cachedTabWidth;let s=[],e=0;for(let n=1,a=this.length;n<=a;++n){let o=this.infos[n-1],l=o.line.slice(o.sliceStart,o.sliceEnd);if(ct(l))continue;let c=Math.abs(o.indent-e);s[c]=~~s[c]+1,e=o.indent}let t=-1,r=2;for(let n=1;n<s.length;n+=1)Mr.call(s,n)&&s[n]>t&&(t=s[n],r=n);return this.cachedTabWidth=r}startsWithComment(){if(this.infos.length===0)return!1;let s=this.infos[0],e=s.sliceStart,t=s.sliceEnd,r=s.line.slice(e,t).trim();return r.length===0||r.slice(0,2)==="//"||r.slice(0,2)==="/*"}isOnlyWhitespace(){return ct(this.toString())}isPrecededOnlyByWhitespace(s){let e=this.infos[s.line-1],t=Math.max(e.indent,0),r=s.column-t;if(r<=0)return!0;let n=e.sliceStart,a=Math.min(n+r,e.sliceEnd),o=e.line.slice(n,a);return ct(o)}getLineLength(s){let e=this.infos[s-1];return this.getIndentAt(s)+e.sliceEnd-e.sliceStart}nextPos(s,e=!1){let t=Math.max(s.line,0);return Math.max(s.column,0)<this.getLineLength(t)?(s.column+=1,e?!!this.skipSpaces(s,!1,!0):!0):t<this.length?(s.line+=1,s.column=0,e?!!this.skipSpaces(s,!1,!0):!0):!1}prevPos(s,e=!1){let t=s.line,r=s.column;if(r<1){if(t-=1,t<1)return!1;r=this.getLineLength(t)}else r=Math.min(r-1,this.getLineLength(t));return s.line=t,s.column=r,e?!!this.skipSpaces(s,!0,!0):!0}firstPos(){return{line:1,column:0}}lastPos(){return{line:this.length,column:this.getLineLength(this.length)}}skipSpaces(s,e=!1,t=!1){if(s?s=t?s:{line:s.line,column:s.column}:e?s=this.lastPos():s=this.firstPos(),e){for(;this.prevPos(s);)if(!ct(this.charAt(s))&&this.nextPos(s))return s;return null}else{for(;ct(this.charAt(s));)if(!this.nextPos(s))return null;return s}}trimLeft(){let s=this.skipSpaces(this.firstPos(),!1,!0);return s?this.slice(s):He}trimRight(){let s=this.skipSpaces(this.lastPos(),!0,!0);return s?this.slice(this.firstPos(),s):He}trim(){let s=this.skipSpaces(this.firstPos(),!1,!0);if(s===null)return He;let e=this.skipSpaces(this.lastPos(),!0,!0);return e===null?He:this.slice(s,e)}eachPos(s,e=this.firstPos(),t=!1){let r=this.firstPos();if(e&&(r.line=e.line,r.column=e.column),!(t&&!this.skipSpaces(r,!1,!0)))do s.call(this,r);while(this.nextPos(r,t))}bootstrapSlice(s,e){let t=this.toString().split(Fr).slice(s.line-1,e.line);return t.length>0&&(t.push(t.pop().slice(0,e.column)),t[0]=t[0].slice(s.column)),S(t.join(`
15
+ `))}slice(s,e){if(!e){if(!s)return this;e=this.lastPos()}if(!s)throw new Error("cannot slice with end but not start");let t=this.infos.slice(s.line-1,e.line);s.line===e.line?t[0]=ut(t[0],s.column,e.column):(t[0]=ut(t[0],s.column),t.push(ut(t.pop(),0,e.column)));let r=new i(t);if(this.mappings.length>0){let n=r.mappings;this.mappings.forEach(function(a){let o=a.slice(this,s,e);o&&n.push(o)},this)}return r}bootstrapSliceString(s,e,t){return this.slice(s,e).toString(t)}sliceString(s=this.firstPos(),e=this.lastPos(),t){let{tabWidth:r,useTabs:n,reuseWhitespace:a,lineTerminator:o}=vs(t),l=[];for(let c=s.line;c<=e.line;++c){let u=this.infos[c-1];c===s.line?c===e.line?u=ut(u,s.column,e.column):u=ut(u,s.column):c===e.line&&(u=ut(u,0,e.column));let h=Math.max(u.indent,0),f=u.line.slice(0,u.sliceStart);if(a&&ct(f)&&Dn(f,r)===h){l.push(u.line.slice(0,u.sliceEnd));continue}let d=0,p=h;n&&(d=Math.floor(h/r),p-=d*r);let g="";d>0&&(g+=new Array(d+1).join(" ")),p>0&&(g+=new Array(p+1).join(" ")),g+=u.line.slice(u.sliceStart,u.sliceEnd),l.push(g)}return l.join(o)}isEmpty(){return this.length<2&&this.getLineLength(1)<1}join(s){let e=this,t=[],r=[],n;function a(c){if(c!==null){if(n){let u=c.infos[0],h=new Array(u.indent+1).join(" "),f=t.length,d=Math.max(n.indent,0)+n.sliceEnd-n.sliceStart;n.line=n.line.slice(0,n.sliceEnd)+h+u.line.slice(u.sliceStart,u.sliceEnd),n.locked=n.locked||u.locked,n.sliceEnd=n.line.length,c.mappings.length>0&&c.mappings.forEach(function(p){r.push(p.add(f,d))})}else c.mappings.length>0&&r.push.apply(r,c.mappings);c.infos.forEach(function(u,h){(!n||h>0)&&(n={...u},t.push(n))})}}function o(c,u){u>0&&a(e),a(c)}if(s.map(function(c){let u=S(c);return u.isEmpty()?null:u}).forEach((c,u)=>{e.isEmpty()?a(c):o(c,u)}),t.length<1)return He;let l=new i(t);return l.mappings=r,l}concat(...s){let e=[this];return e.push.apply(e,s),He.join(e)}},ms={},Mr=ms.hasOwnProperty,Ql=10;function Dn(i,s){let e=0,t=i.length;for(let r=0;r<t;++r)switch(i.charCodeAt(r)){case 9:{let n=Math.ceil(e/s)*s;n===e?e+=s:e=n;break}case 11:case 12:case 13:case 65279:break;case 32:default:e+=1;break}return e}var Yl=/^\s*/,Fr=/\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/;function S(i,s){if(i instanceof ft)return i;i+="";let e=s&&s.tabWidth,t=i.indexOf(" ")<0,r=!s&&t&&i.length<=Ql;if(r&&Mr.call(ms,i))return ms[i];let n=new ft(i.split(Fr).map(function(a){let o=Yl.exec(a)[0];return{line:a,indent:Dn(o,e),locked:!1,sliceStart:o.length,sliceEnd:a.length}}),vs(s).sourceFileName);return r&&(ms[i]=n),n}function ct(i){return!/\S/.test(i)}function ut(i,s,e){let t=i.sliceStart,r=i.sliceEnd,n=Math.max(i.indent,0),a=n+r-t;return typeof e>"u"&&(e=a),s=Math.max(s,0),e=Math.min(e,a),e=Math.max(e,s),e<n?(n=e,r=t):r-=a-e,a=e,a-=s,s<n?n-=s:(s-=n,n=0,t+=s),i.indent===n&&i.sliceStart===t&&i.sliceEnd===r?i:{line:i.line,indent:n,locked:!1,sliceStart:t,sliceEnd:r}}function x(i){return He.join(i)}var He=S(""),dt=Se,On=Ee.array,Zl=Ee.object,ln=new WeakMap;function Mn(i,s,e){if(!i)return e;if(Vr(i,s),e){if(dt.Node.check(i)&&dt.SourceLocation.check(i.loc)){let r=e.length-1;for(;r>=0;--r){let n=e[r];if(n&&n.loc&&U(n.loc.end,i.loc.start)<=0)break}return e.splice(r+1,0,i),e}}else{let r=ln.get(i);if(r)return r}let t;if(On.check(i))t=Object.keys(i);else if(Zl.check(i))t=_l(i);else return e;e||ln.set(i,e=[]);for(let r=0,n=t.length;r<n;++r)Mn(i[t[r]],s,e);return e}function Fn(i,s,e){let t=Mn(i,e),r=0,n=t&&t.length,a,o;for(;typeof n=="number"&&r<n;){let l=r+n>>1,c=t[l];if(U(c.loc.start,s.loc.start)<=0&&U(s.loc.end,c.loc.end)<=0){Fn(s.enclosingNode=c,s,e);return}if(U(c.loc.end,s.loc.start)<=0){a=c,r=l+1;continue}if(U(s.loc.end,c.loc.start)<=0){o=c,n=l;continue}throw new Error("Comment location overlaps with node location")}a&&(s.precedingNode=a),o&&(s.followingNode=o)}function ec(i,s,e){if(!On.check(i))return;let t=[];i.forEach(function(r){r.loc.lines=e,Fn(s,r,e);let n=r.precedingNode,a=r.enclosingNode,o=r.followingNode;if(n&&o){let l=t.length;l>0&&t[l-1].followingNode!==r.followingNode&&Dt(t,e),t.push(r)}else if(n)Dt(t,e),_n(n,r);else if(o)Dt(t,e),Bn(o,r);else if(a)Dt(t,e),tc(a,r);else throw new Error("AST contains no nodes at all?")}),Dt(t,e),i.forEach(function(r){delete r.precedingNode,delete r.enclosingNode,delete r.followingNode})}function Dt(i,s){let e=i.length;if(e===0)return;let t=i[0].precedingNode,r=i[0].followingNode,n=r.loc.start,a=e,o;for(;a>0;--a){o=i[a-1];let l=s.sliceString(o.loc.end,n);if(/\S/.test(l))break;n=o.loc.start}for(;a<=e&&(o=i[a])&&(o.type==="Line"||o.type==="CommentLine")&&o.loc.start.column>r.loc.start.column;)++a;if(a){let{enclosingNode:l}=i[a-1];l?.type==="CallExpression"&&--a}i.forEach(function(l,c){c<a?_n(t,l):Bn(r,l)}),i.length=0}function $r(i,s){(i.comments||(i.comments=[])).push(s)}function Bn(i,s){s.leading=!0,s.trailing=!1,$r(i,s)}function tc(i,s){s.leading=!1,s.trailing=!1,$r(i,s)}function _n(i,s){s.leading=!1,s.trailing=!0,$r(i,s)}function sc(i,s){let e=i.getValue();dt.Comment.assert(e);let t=e.loc,r=t&&t.lines,n=[s(i)];if(e.trailing)n.push(`
14
16
  `);else if(r instanceof ft){let a=r.slice(t.end,r.skipSpaces(t.end)||r.lastPos());a.length===1?n.push(a):n.push(new Array(a.length).join(`
15
17
  `))}else n.push(`
16
- `);return x(n)}function ec(i,s){let e=i.getValue(i);dt.Comment.assert(e);let t=e.loc,r=t&&t.lines,n=[];if(r instanceof ft){let a=r.skipSpaces(t.start,!0)||r.firstPos(),o=r.slice(a,t.start);o.length===1?n.push(o):n.push(new Array(o.length).join(`
17
- `))}return n.push(s(i)),x(n)}function on(i,s){let e=i.getValue(),t=s(i),r=dt.Node.check(e)&&_e(e,"comments");if(!r||r.length===0)return t;let n=[],a=[t];return i.each(function(o){let l=o.getValue(),c=_e(l,"leading"),u=_e(l,"trailing");c||u&&!(dt.Statement.check(e)||l.type==="Block"||l.type==="CommentBlock")?n.push(Zl(o,s)):u&&a.push(ec(o,s))},"comments"),n.push.apply(n,a),x(n)}var tc=mt,sc=Ee.object,rc=Ee.array;function Bn(i,s){s=Es(s);let e=S(i,s),t=e.toString({tabWidth:s.tabWidth,reuseWhitespace:!1,useTabs:!1}),r=[],n=s.parser.parse(t,{jsx:!0,loc:!0,locations:!0,range:s.range,comment:!0,onComment:r,tolerant:rn(s,"tolerant",!0),ecmaVersion:6,sourceType:rn(s,"sourceType","module")}),a=Array.isArray(n.tokens)?n.tokens:!1;delete n.tokens,a.forEach(function(u){typeof u.value!="string"&&(u.value=e.sliceString(u.loc.start,u.loc.end))}),Array.isArray(n.comments)&&(r=n.comments,delete n.comments),n.loc?Rr(n,e):n.loc={start:e.firstPos(),end:e.lastPos()},n.loc.lines=e,n.loc.indent=0;let o,l;n.type==="Program"?(l=n,o=tc.file(n,s.sourceFileName||null),o.loc={start:e.firstPos(),end:e.lastPos(),lines:e,indent:0}):n.type==="File"&&(o=n,l=o.program),s.tokens&&(o.tokens=a);let c=In({type:l.type,loc:l.loc,body:[],comments:r},e);return l.loc.start=c.start,l.loc.end=c.end,Ql(r,l.body.length?o.program:o,e),new _n(e,a).copy(o)}var _n=function(s,e){this.lines=s,this.tokens=e,this.startTokenIndex=0,this.endTokenIndex=e.length,this.indent=0,this.seen=new Map},jn=_n.prototype;jn.copy=function(i){if(this.seen.has(i))return this.seen.get(i);if(rc.check(i)){let c=new Array(i.length);return this.seen.set(i,c),i.forEach(function(u,h){c[h]=this.copy(u)},this),c}if(!sc.check(i))return i;Rr(i,this.lines);let s=Object.create(Object.getPrototypeOf(i),{original:{value:i,configurable:!1,enumerable:!1,writable:!0}});this.seen.set(i,s);let e=i.loc,t=this.indent,r=t,n=this.startTokenIndex,a=this.endTokenIndex;e&&((i.type==="Block"||i.type==="Line"||i.type==="CommentBlock"||i.type==="CommentLine"||this.lines.isPrecededOnlyByWhitespace(e.start))&&(r=this.indent=e.start.column),e.lines=this.lines,e.tokens=this.tokens,e.indent=r,this.findTokenRange(e));let o=Object.keys(i),l=o.length;for(let c=0;c<l;++c){let u=o[c];u==="loc"||u==="tokens"&&i.type==="File"?s[u]=i[u]:s[u]=this.copy(i[u])}return this.indent=t,this.startTokenIndex=n,this.endTokenIndex=a,s};jn.findTokenRange=function(i){for(;this.startTokenIndex>0;){let s=i.tokens[this.startTokenIndex];if(U(i.start,s.loc.start)<0)--this.startTokenIndex;else break}for(;this.endTokenIndex<i.tokens.length;){let s=i.tokens[this.endTokenIndex];if(U(s.loc.end,i.end)<0)++this.endTokenIndex;else break}for(;this.startTokenIndex<this.endTokenIndex;){let s=i.tokens[this.startTokenIndex];if(U(s.loc.start,i.start)<0)++this.startTokenIndex;else break}for(i.start.token=this.startTokenIndex;this.endTokenIndex>this.startTokenIndex;){let s=i.tokens[this.endTokenIndex-1];if(U(i.end,s.loc.end)<0)--this.endTokenIndex;else break}i.end.token=this.endTokenIndex};var H=Se,ic=Ee.array,nc=Ee.number,Mr={};[["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].forEach(function(i,s){i.forEach(function(e){Mr[e]=s})});var Pe=function(s){this.stack=[s]},re=Pe.prototype;Pe.from=function(i){if(i instanceof Pe)return i.copy();if(i instanceof Bl){let s=Object.create(Pe.prototype),e=[i.value];for(let t;t=i.parentPath;i=t)e.push(i.name,t.value);return s.stack=e.reverse(),s}return new Pe(i)};re.copy=function(){let s=Object.create(Pe.prototype);return s.stack=this.stack.slice(0),s};re.getName=function(){let s=this.stack,e=s.length;return e>1?s[e-2]:null};re.getValue=function(){let s=this.stack;return s[s.length-1]};re.valueIsDuplicate=function(){let i=this.stack,s=i.length-1;return i.lastIndexOf(i[s],s-1)>=0};function Rn(i,s){let e=i.stack;for(let t=e.length-1;t>=0;t-=2){let r=e[t];if(H.Node.check(r)&&--s<0)return r}return null}re.getNode=function(s=0){return Rn(this,~~s)};re.getParentNode=function(s=0){return Rn(this,~~s+1)};re.getRootValue=function(){let s=this.stack;return s.length%2===0?s[1]:s[0]};re.call=function(s){let e=this.stack,t=e.length,r=e[t-1],n=arguments.length;for(let o=1;o<n;++o){let l=arguments[o];r=r[l],e.push(l,r)}let a=s(this);return e.length=t,a};re.each=function(s){let e=this.stack,t=e.length,r=e[t-1],n=arguments.length;for(let a=1;a<n;++a){let o=arguments[a];r=r[o],e.push(o,r)}for(let a=0;a<r.length;++a)a in r&&(e.push(a,r[a]),s(this),e.length-=2);e.length=t};re.map=function(s){let e=this.stack,t=e.length,r=e[t-1],n=arguments.length;for(let o=1;o<n;++o){let l=arguments[o];r=r[l],e.push(l,r)}let a=new Array(r.length);for(let o=0;o<r.length;++o)o in r&&(e.push(o,r[o]),a[o]=s(this,o),e.length-=2);return e.length=t,a};re.hasParens=function(){let i=this.getNode(),s=this.getPrevToken(i);if(!s)return!1;let e=this.getNextToken(i);return e?!!(s.value==="("&&(e.value===")"||!this.canBeFirstInStatement()&&this.firstInStatement()&&!this.needsParens(!0))):!1};re.getPrevToken=function(i){i=i||this.getNode();let s=i&&i.loc,e=s&&s.tokens;if(e&&s.start.token>0){let t=e[s.start.token-1];if(t){let r=this.getRootValue().loc;if(U(r.start,t.loc.start)<=0)return t}}return null};re.getNextToken=function(i){i=i||this.getNode();let s=i&&i.loc,e=s&&s.tokens;if(e&&s.end.token<e.length){let t=e[s.end.token];if(t){let r=this.getRootValue().loc;if(U(t.loc.end,r.end)<=0)return t}}return null};re.needsParens=function(i){let s=this.getNode();if(s.type==="AssignmentExpression"&&s.left.type==="ObjectPattern")return!0;let e=this.getParentNode(),t=this.getName();if(this.getValue()!==s||H.Statement.check(s)||s.type==="Identifier"||e&&e.type==="ParenthesizedExpression")return!1;if(s.extra&&s.extra.parenthesized)return!0;if(!e)return!1;if(s.type==="UnaryExpression"&&e.type==="BinaryExpression"&&t==="left"&&e.left===s&&e.operator==="**")return!0;switch(s.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return e.type==="MemberExpression"&&t==="object"&&e.object===s;case"BinaryExpression":case"LogicalExpression":switch(e.type){case"CallExpression":return t==="callee"&&e.callee===s;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return t==="object"&&e.object===s;case"BinaryExpression":case"LogicalExpression":{let r=e.operator,n=Mr[r],a=s.operator,o=Mr[a];if(n>o||n===o&&t==="right")return!0;break}default:return!1}break;case"SequenceExpression":switch(e.type){case"ReturnStatement":return!1;case"ForStatement":return!1;case"ExpressionStatement":return t!=="expression";default:return!0}case"OptionalIndexedAccessType":return s.optional&&e.type==="IndexedAccessType";case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return e.type==="NullableTypeAnnotation";case"Literal":return e.type==="MemberExpression"&&nc.check(s.value)&&t==="object"&&e.object===s;case"NumericLiteral":return e.type==="MemberExpression"&&t==="object"&&e.object===s;case"YieldExpression":case"AwaitExpression":case"AssignmentExpression":case"ConditionalExpression":switch(e.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":case"NewExpression":return t==="callee"&&e.callee===s;case"ConditionalExpression":return t==="test"&&e.test===s;case"MemberExpression":return t==="object"&&e.object===s;default:return!1}case"ArrowFunctionExpression":return H.CallExpression.check(e)&&t==="callee"&&e.callee===s||H.MemberExpression.check(e)&&t==="object"&&e.object===s||H.TSAsExpression&&H.TSAsExpression.check(e)&&t==="expression"&&e.expression===s?!0:Un(e);case"ObjectExpression":if(e.type==="ArrowFunctionExpression"&&t==="body"&&e.body===s)return!0;break;case"TSAsExpression":if(e.type==="ArrowFunctionExpression"&&t==="body"&&e.body===s&&s.expression.type==="ObjectExpression")return!0;break;case"CallExpression":if(t==="declaration"&&H.ExportDefaultDeclaration.check(e)&&H.FunctionExpression.check(s.callee))return!0}return e.type==="NewExpression"&&t==="callee"&&e.callee===s?Fr(s):!!(i!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function Un(i){return H.BinaryExpression.check(i)||H.LogicalExpression.check(i)}function Fr(i){return H.CallExpression.check(i)?!0:ic.check(i)?i.some(Fr):H.Node.check(i)?_l(i,(s,e)=>Fr(e)):!1}re.canBeFirstInStatement=function(){let i=this.getNode();return!(H.FunctionExpression.check(i)||H.ObjectExpression.check(i)||H.ClassExpression.check(i))};re.firstInStatement=function(){let i=this.stack,s,e,t,r;for(let n=i.length-1;n>=0;n-=2)if(H.Node.check(i[n])&&(t=s,r=e,s=i[n-1],e=i[n]),!(!e||!r)){if(H.BlockStatement.check(e)&&s==="body"&&t===0||H.ExpressionStatement.check(e)&&t==="expression"||H.AssignmentExpression.check(e)&&t==="left"||H.ArrowFunctionExpression.check(e)&&t==="body")return!0;if(!(H.SequenceExpression.check(e)&&i[n+1]==="expressions"&&t===0)&&!(H.CallExpression.check(e)&&t==="callee")&&!(H.MemberExpression.check(e)&&t==="object")&&!(H.ConditionalExpression.check(e)&&t==="test")&&!(Un(e)&&t==="left")&&!(H.UnaryExpression.check(e)&&!e.prefix&&t==="argument"))return!1}return!0};var Ut=Se.Printable,ln=Se.Expression,ac=Se.ReturnStatement,oc=Se.SourceLocation,Vt=Ee.object,Br=Ee.array,lc=Ee.string,bs=/[0-9a-z_$]/i,Vn=function(s){let e=this,t=[];e.replace=function(r,n){lc.check(n)&&(n=S(n)),t.push({lines:n,start:r.start,end:r.end})},e.get=function(r){r=r||{start:{line:1,column:0},end:{line:s.length,column:s.getLineLength(s.length)}};let n=r.start,a=[];function o(l,c){a.push(s.slice(l,c))}return t.sort((l,c)=>U(l.start,c.start)).forEach(function(l){U(n,l.start)>0||(o(n,l.start),a.push(l.lines),n=l.end)}),o(n,r.end),x(a)}},$n=Vn.prototype;$n.tryToReprintComments=function(i,s,e){let t=this;if(!i.comments&&!s.comments)return!0;let r=Pe.from(i),n=Pe.from(s);r.stack.push("comments",cn(i)),n.stack.push("comments",cn(s));let a=[],o=zn(r,n,a);return o&&a.length>0&&a.forEach(function(l){let c=l.oldPath.getValue();t.replace(c.loc,e(l.newPath).indentTail(c.loc.indent))}),o};function cn(i){let s=[];return i.comments&&i.comments.length>0&&i.comments.forEach(function(e){(e.leading||e.trailing)&&s.push(e)}),s}$n.deleteComments=function(i){if(!i.comments)return;let s=this;i.comments.forEach(function(e){e.leading?s.replace({start:e.loc.start,end:i.loc.lines.skipSpaces(e.loc.end,!1,!1)},""):e.trailing&&s.replace({start:i.loc.lines.skipSpaces(e.loc.start,!0,!1),end:e.loc.end},"")})};function cc(i){let s=i.getValue();if(!Ut.check(s))return;let e=s.original,t=e&&e.loc,r=t&&t.lines,n=[];if(!(!r||!pc(i,n)))return function(a){let o=new Vn(r);n.forEach(function(c){let u=c.newPath.getValue(),h=c.oldPath.getValue();oc.assert(h.loc,!0);let f=!o.tryToReprintComments(u,h,a);f&&o.deleteComments(h);let d=a(c.newPath,{includeComments:f,avoidRootParens:h.type===u.type&&c.oldPath.hasParens()}).indentTail(h.loc.indent),p=uc(r,h.loc,d),g=hc(r,h.loc,d);if(p||g){let y=[];p&&y.push(" "),y.push(d),g&&y.push(" "),d=x(y)}o.replace(h.loc,d)});let l=o.get(t).indentTail(-e.loc.indent);return i.needsParens()?x(["(",l,")"]):l}}function uc(i,s,e){let t=$e(s.start),r=i.prevPos(t)&&i.charAt(t),n=e.charAt(e.firstPos());return r&&bs.test(r)&&n&&bs.test(n)}function hc(i,s,e){let t=i.charAt(s.end),r=e.lastPos(),n=e.prevPos(r)&&e.charAt(r);return n&&bs.test(n)&&t&&bs.test(t)}function pc(i,s){let e=i.getValue();Ut.assert(e);let t=e.original;if(Ut.assert(t),e.type!==t.type)return!1;let r=new Pe(t),n=_r(i,r,s);return n||(s.length=0),n}function qn(i,s,e){let t=i.getValue(),r=s.getValue();return t===r?!0:Br.check(t)?zn(i,s,e):Vt.check(t)?fc(i,s,e):!1}function zn(i,s,e){let t=i.getValue(),r=s.getValue();if(t===r||i.valueIsDuplicate()||s.valueIsDuplicate())return!0;Br.assert(t);let n=t.length;if(!(Br.check(r)&&r.length===n))return!1;for(let a=0;a<n;++a){i.stack.push(a,t[a]),s.stack.push(a,r[a]);let o=qn(i,s,e);if(i.stack.length-=2,s.stack.length-=2,!o)return!1}return!0}function fc(i,s,e){let t=i.getValue();if(Vt.assert(t),t.original===null)return!1;let r=s.getValue();if(!Vt.check(r))return!1;if(t===r||i.valueIsDuplicate()||s.valueIsDuplicate())return!0;if(Ut.check(t)){if(!Ut.check(r))return!1;let n=i.getParentNode(),a=s.getParentNode();if(a!==null&&a.type==="FunctionTypeAnnotation"&&n!==null&&n.type==="FunctionTypeAnnotation"){let o=a.params.length!==1||!!a.params[0].name,l=n.params.length!==1||!!n.params[0].name;if(!o&&l)return!1}if(t.type===r.type){let o=[];if(_r(i,s,o))e.push.apply(e,o);else if(r.loc)e.push({oldPath:s.copy(),newPath:i.copy()});else return!1;return!0}return ln.check(t)&&ln.check(r)&&r.loc?(e.push({oldPath:s.copy(),newPath:i.copy()}),!0):!1}return _r(i,s,e)}function _r(i,s,e){let t=i.getValue(),r=s.getValue();if(Vt.assert(t),Vt.assert(r),t.original===null||i.needsParens()&&!s.hasParens())return!1;let n=Ul(r,t);(r.type==="File"||t.type==="File")&&delete n.tokens,delete n.loc;let a=e.length;for(let o in n){if(o.charAt(0)==="_")continue;i.stack.push(o,_e(t,o)),s.stack.push(o,_e(r,o));let l=qn(i,s,e);if(i.stack.length-=2,s.stack.length-=2,!l)return!1}return!(ac.check(i.getNode())&&e.length>a)}var Y=Se,Vr=Ee.string,dc=Ee.object,Ts=function(s,e){Vr.assert(s),this.code=s,e&&(dc.assert(e),this.map=e)},mc=Ts.prototype,un=!1;mc.toString=function(){return un||(console.warn("Deprecation warning: recast.print now returns an object with a .code property. You appear to be treating the object as a string, which might still work but is strongly discouraged."),un=!0),this.code};var hn=new Ts(""),yc=function(s){let e=s&&s.tabWidth;s=Es(s),s.sourceFileName=null;function t(n,a){return n=Object.assign({},n,a),o=>r(o,n)}function r(n,a){if(a=a||{},a.includeComments)return on(n,t(a,{includeComments:!1}));let o=s.tabWidth;if(!e){let u=n.getNode().loc;u&&u.lines&&u.lines.guessTabWidth&&(s.tabWidth=u.lines.guessTabWidth())}let l=cc(n),c=l?l(r):pn(n,s,a,t(a,{includeComments:!0,avoidRootParens:!1}));return s.tabWidth=o,c}this.print=function(n){if(!n)return hn;let a=r(Pe.from(n),{includeComments:!0,avoidRootParens:!1});return new Ts(a.toString(s),Vl(s.inputSourceMap,a.getSourceMap(s.sourceMapName,s.sourceRoot)))},this.printGenerically=function(n){if(!n)return hn;function a(u){return on(u,h=>pn(h,s,{includeComments:!0,avoidRootParens:!1},a))}let o=Pe.from(n),l=s.reuseWhitespace;s.reuseWhitespace=!1;let c=new Ts(a(o).toString(s));return s.reuseWhitespace=l,c}};function pn(i,s,e,t){let r=i.getValue(),n=[],a=gc(i,s,t);if(!r||a.isEmpty())return a;let o=!1,l=xc(i,t);return l.isEmpty()?e.avoidRootParens||(o=i.needsParens()):n.push(l),o&&n.unshift("("),n.push(a),o&&n.push(")"),x(n)}function gc(i,s,e){let t=i.getValue();if(!t)return S("");if(typeof t=="string")return S(t,s);Y.Printable.assert(t);let r=[];switch(t.type){case"File":return i.call(e,"program");case"Program":return t.directives&&i.each(function(n){r.push(e(n),`;
18
- `)},"directives"),t.interpreter&&r.push(i.call(e,"interpreter")),r.push(i.call(n=>ht(n,s,e),"body")),x(r);case"Noop":case"EmptyStatement":return S("");case"ExpressionStatement":return x([i.call(e,"expression"),";"]);case"ParenthesizedExpression":return x(["(",i.call(e,"expression"),")"]);case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":return S(" ").join([i.call(e,"left"),t.operator,i.call(e,"right")]);case"AssignmentPattern":return x([i.call(e,"left")," = ",i.call(e,"right")]);case"MemberExpression":case"OptionalMemberExpression":{r.push(i.call(e,"object"));let n=i.call(e,"property"),a=_e(t,"optional");return t.computed?r.push(a?"?.[":"[",n,"]"):r.push(a?"?.":".",n),x(r)}case"ChainExpression":return i.call(e,"expression");case"MetaProperty":return x([i.call(e,"meta"),".",i.call(e,"property")]);case"BindExpression":return t.object&&r.push(i.call(e,"object")),r.push("::",i.call(e,"callee")),x(r);case"Path":return S(".").join(t.body);case"Identifier":return x([S(t.name,s),t.optional?"?":"",i.call(e,"typeAnnotation")]);case"SpreadElement":case"SpreadElementPattern":case"RestProperty":case"SpreadProperty":case"SpreadPropertyPattern":case"ObjectTypeSpreadProperty":case"RestElement":return x(["...",i.call(e,"argument"),i.call(e,"typeAnnotation")]);case"FunctionDeclaration":case"FunctionExpression":case"TSDeclareFunction":return t.declare&&r.push("declare "),t.async&&r.push("async "),r.push("function"),t.generator&&r.push("*"),t.id?r.push(" ",i.call(e,"id"),i.call(e,"typeParameters")):t.typeParameters&&r.push(i.call(e,"typeParameters")),r.push("(",Ce(i,s,e),")",i.call(e,"returnType")),t.body&&r.push(" ",i.call(e,"body")),x(r);case"ArrowFunctionExpression":return t.async&&r.push("async "),t.typeParameters&&r.push(i.call(e,"typeParameters")),!s.arrowParensAlways&&t.params.length===1&&!t.rest&&t.params[0].type==="Identifier"&&!t.params[0].typeAnnotation&&!t.returnType?r.push(i.call(e,"params",0)):r.push("(",Ce(i,s,e),")",i.call(e,"returnType")),r.push(" => ",i.call(e,"body")),x(r);case"MethodDefinition":return wr(i,s,e);case"YieldExpression":return r.push("yield"),t.delegate&&r.push("*"),t.argument&&r.push(" ",i.call(e,"argument")),x(r);case"AwaitExpression":return r.push("await"),t.all&&r.push("*"),t.argument&&r.push(" ",i.call(e,"argument")),x(r);case"ModuleExpression":return x([`module {
18
+ `);return x(n)}function rc(i,s){let e=i.getValue(i);dt.Comment.assert(e);let t=e.loc,r=t&&t.lines,n=[];if(r instanceof ft){let a=r.skipSpaces(t.start,!0)||r.firstPos(),o=r.slice(a,t.start);o.length===1?n.push(o):n.push(new Array(o.length).join(`
19
+ `))}return n.push(s(i)),x(n)}function cn(i,s){let e=i.getValue(),t=s(i),r=dt.Node.check(e)&&_e(e,"comments");if(!r||r.length===0)return t;let n=[],a=[t];return i.each(function(o){let l=o.getValue(),c=_e(l,"leading"),u=_e(l,"trailing");c||u&&!(dt.Statement.check(e)||l.type==="Block"||l.type==="CommentBlock")?n.push(sc(o,s)):u&&a.push(rc(o,s))},"comments"),n.push.apply(n,a),x(n)}var ic=mt,nc=Ee.object,ac=Ee.array;function jn(i,s){s=vs(s);let e=S(i,s),t=e.toString({tabWidth:s.tabWidth,reuseWhitespace:!1,useTabs:!1}),r=[],n=s.parser.parse(t,{jsx:!0,loc:!0,locations:!0,range:s.range,comment:!0,onComment:r,tolerant:an(s,"tolerant",!0),ecmaVersion:6,sourceType:an(s,"sourceType","module")}),a=Array.isArray(n.tokens)?n.tokens:!1;delete n.tokens,a.forEach(function(u){typeof u.value!="string"&&(u.value=e.sliceString(u.loc.start,u.loc.end))}),Array.isArray(n.comments)&&(r=n.comments,delete n.comments),n.loc?Vr(n,e):n.loc={start:e.firstPos(),end:e.lastPos()},n.loc.lines=e,n.loc.indent=0;let o,l;n.type==="Program"?(l=n,o=ic.file(n,s.sourceFileName||null),o.loc={start:e.firstPos(),end:e.lastPos(),lines:e,indent:0}):n.type==="File"&&(o=n,l=o.program),s.tokens&&(o.tokens=a);let c=kn({type:l.type,loc:l.loc,body:[],comments:r},e);return l.loc.start=c.start,l.loc.end=c.end,ec(r,l.body.length?o.program:o,e),new Rn(e,a).copy(o)}var Rn=function(s,e){this.lines=s,this.tokens=e,this.startTokenIndex=0,this.endTokenIndex=e.length,this.indent=0,this.seen=new Map},Un=Rn.prototype;Un.copy=function(i){if(this.seen.has(i))return this.seen.get(i);if(ac.check(i)){let c=new Array(i.length);return this.seen.set(i,c),i.forEach(function(u,h){c[h]=this.copy(u)},this),c}if(!nc.check(i))return i;Vr(i,this.lines);let s=Object.create(Object.getPrototypeOf(i),{original:{value:i,configurable:!1,enumerable:!1,writable:!0}});this.seen.set(i,s);let e=i.loc,t=this.indent,r=t,n=this.startTokenIndex,a=this.endTokenIndex;e&&((i.type==="Block"||i.type==="Line"||i.type==="CommentBlock"||i.type==="CommentLine"||this.lines.isPrecededOnlyByWhitespace(e.start))&&(r=this.indent=e.start.column),e.lines=this.lines,e.tokens=this.tokens,e.indent=r,this.findTokenRange(e));let o=Object.keys(i),l=o.length;for(let c=0;c<l;++c){let u=o[c];u==="loc"||u==="tokens"&&i.type==="File"?s[u]=i[u]:s[u]=this.copy(i[u])}return this.indent=t,this.startTokenIndex=n,this.endTokenIndex=a,s};Un.findTokenRange=function(i){for(;this.startTokenIndex>0;){let s=i.tokens[this.startTokenIndex];if(U(i.start,s.loc.start)<0)--this.startTokenIndex;else break}for(;this.endTokenIndex<i.tokens.length;){let s=i.tokens[this.endTokenIndex];if(U(s.loc.end,i.end)<0)++this.endTokenIndex;else break}for(;this.startTokenIndex<this.endTokenIndex;){let s=i.tokens[this.startTokenIndex];if(U(s.loc.start,i.start)<0)++this.startTokenIndex;else break}for(i.start.token=this.startTokenIndex;this.endTokenIndex>this.startTokenIndex;){let s=i.tokens[this.endTokenIndex-1];if(U(i.end,s.loc.end)<0)--this.endTokenIndex;else break}i.end.token=this.endTokenIndex};var H=Se,oc=Ee.array,lc=Ee.number,Br={};[["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].forEach(function(i,s){i.forEach(function(e){Br[e]=s})});var Pe=function(s){this.stack=[s]},re=Pe.prototype;Pe.from=function(i){if(i instanceof Pe)return i.copy();if(i instanceof Rl){let s=Object.create(Pe.prototype),e=[i.value];for(let t;t=i.parentPath;i=t)e.push(i.name,t.value);return s.stack=e.reverse(),s}return new Pe(i)};re.copy=function(){let s=Object.create(Pe.prototype);return s.stack=this.stack.slice(0),s};re.getName=function(){let s=this.stack,e=s.length;return e>1?s[e-2]:null};re.getValue=function(){let s=this.stack;return s[s.length-1]};re.valueIsDuplicate=function(){let i=this.stack,s=i.length-1;return i.lastIndexOf(i[s],s-1)>=0};function Vn(i,s){let e=i.stack;for(let t=e.length-1;t>=0;t-=2){let r=e[t];if(H.Node.check(r)&&--s<0)return r}return null}re.getNode=function(s=0){return Vn(this,~~s)};re.getParentNode=function(s=0){return Vn(this,~~s+1)};re.getRootValue=function(){let s=this.stack;return s.length%2===0?s[1]:s[0]};re.call=function(s){let e=this.stack,t=e.length,r=e[t-1],n=arguments.length;for(let o=1;o<n;++o){let l=arguments[o];r=r[l],e.push(l,r)}let a=s(this);return e.length=t,a};re.each=function(s){let e=this.stack,t=e.length,r=e[t-1],n=arguments.length;for(let a=1;a<n;++a){let o=arguments[a];r=r[o],e.push(o,r)}for(let a=0;a<r.length;++a)a in r&&(e.push(a,r[a]),s(this),e.length-=2);e.length=t};re.map=function(s){let e=this.stack,t=e.length,r=e[t-1],n=arguments.length;for(let o=1;o<n;++o){let l=arguments[o];r=r[l],e.push(l,r)}let a=new Array(r.length);for(let o=0;o<r.length;++o)o in r&&(e.push(o,r[o]),a[o]=s(this,o),e.length-=2);return e.length=t,a};re.hasParens=function(){let i=this.getNode(),s=this.getPrevToken(i);if(!s)return!1;let e=this.getNextToken(i);return e?!!(s.value==="("&&(e.value===")"||!this.canBeFirstInStatement()&&this.firstInStatement()&&!this.needsParens(!0))):!1};re.getPrevToken=function(i){i=i||this.getNode();let s=i&&i.loc,e=s&&s.tokens;if(e&&s.start.token>0){let t=e[s.start.token-1];if(t){let r=this.getRootValue().loc;if(U(r.start,t.loc.start)<=0)return t}}return null};re.getNextToken=function(i){i=i||this.getNode();let s=i&&i.loc,e=s&&s.tokens;if(e&&s.end.token<e.length){let t=e[s.end.token];if(t){let r=this.getRootValue().loc;if(U(t.loc.end,r.end)<=0)return t}}return null};re.needsParens=function(i){let s=this.getNode();if(s.type==="AssignmentExpression"&&s.left.type==="ObjectPattern")return!0;let e=this.getParentNode(),t=this.getName();if(this.getValue()!==s||H.Statement.check(s)||s.type==="Identifier"||e&&e.type==="ParenthesizedExpression")return!1;if(s.extra&&s.extra.parenthesized)return!0;if(!e)return!1;if(s.type==="UnaryExpression"&&e.type==="BinaryExpression"&&t==="left"&&e.left===s&&e.operator==="**")return!0;switch(s.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return e.type==="MemberExpression"&&t==="object"&&e.object===s;case"BinaryExpression":case"LogicalExpression":switch(e.type){case"CallExpression":return t==="callee"&&e.callee===s;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return t==="object"&&e.object===s;case"BinaryExpression":case"LogicalExpression":{let r=e.operator,n=Br[r],a=s.operator,o=Br[a];if(n>o||n===o&&t==="right")return!0;break}default:return!1}break;case"SequenceExpression":switch(e.type){case"ReturnStatement":return!1;case"ForStatement":return!1;case"ExpressionStatement":return t!=="expression";default:return!0}case"OptionalIndexedAccessType":return s.optional&&e.type==="IndexedAccessType";case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return e.type==="NullableTypeAnnotation";case"Literal":return e.type==="MemberExpression"&&lc.check(s.value)&&t==="object"&&e.object===s;case"NumericLiteral":return e.type==="MemberExpression"&&t==="object"&&e.object===s;case"YieldExpression":case"AwaitExpression":case"AssignmentExpression":case"ConditionalExpression":switch(e.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":case"NewExpression":return t==="callee"&&e.callee===s;case"ConditionalExpression":return t==="test"&&e.test===s;case"MemberExpression":return t==="object"&&e.object===s;default:return!1}case"ArrowFunctionExpression":return H.CallExpression.check(e)&&t==="callee"&&e.callee===s||H.MemberExpression.check(e)&&t==="object"&&e.object===s||H.TSAsExpression&&H.TSAsExpression.check(e)&&t==="expression"&&e.expression===s?!0:$n(e);case"ObjectExpression":if(e.type==="ArrowFunctionExpression"&&t==="body"&&e.body===s)return!0;break;case"TSAsExpression":if(e.type==="ArrowFunctionExpression"&&t==="body"&&e.body===s&&s.expression.type==="ObjectExpression")return!0;break;case"CallExpression":if(t==="declaration"&&H.ExportDefaultDeclaration.check(e)&&H.FunctionExpression.check(s.callee))return!0}return e.type==="NewExpression"&&t==="callee"&&e.callee===s?_r(s):!!(i!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function $n(i){return H.BinaryExpression.check(i)||H.LogicalExpression.check(i)}function _r(i){return H.CallExpression.check(i)?!0:oc.check(i)?i.some(_r):H.Node.check(i)?Ul(i,(s,e)=>_r(e)):!1}re.canBeFirstInStatement=function(){let i=this.getNode();return!(H.FunctionExpression.check(i)||H.ObjectExpression.check(i)||H.ClassExpression.check(i))};re.firstInStatement=function(){let i=this.stack,s,e,t,r;for(let n=i.length-1;n>=0;n-=2)if(H.Node.check(i[n])&&(t=s,r=e,s=i[n-1],e=i[n]),!(!e||!r)){if(H.BlockStatement.check(e)&&s==="body"&&t===0||H.ExpressionStatement.check(e)&&t==="expression"||H.AssignmentExpression.check(e)&&t==="left"||H.ArrowFunctionExpression.check(e)&&t==="body")return!0;if(!(H.SequenceExpression.check(e)&&i[n+1]==="expressions"&&t===0)&&!(H.CallExpression.check(e)&&t==="callee")&&!(H.MemberExpression.check(e)&&t==="object")&&!(H.ConditionalExpression.check(e)&&t==="test")&&!($n(e)&&t==="left")&&!(H.UnaryExpression.check(e)&&!e.prefix&&t==="argument"))return!1}return!0};var Ut=Se.Printable,un=Se.Expression,cc=Se.ReturnStatement,uc=Se.SourceLocation,Vt=Ee.object,jr=Ee.array,hc=Ee.string,Ss=/[0-9a-z_$]/i,qn=function(s){let e=this,t=[];e.replace=function(r,n){hc.check(n)&&(n=S(n)),t.push({lines:n,start:r.start,end:r.end})},e.get=function(r){r=r||{start:{line:1,column:0},end:{line:s.length,column:s.getLineLength(s.length)}};let n=r.start,a=[];function o(l,c){a.push(s.slice(l,c))}return t.sort((l,c)=>U(l.start,c.start)).forEach(function(l){U(n,l.start)>0||(o(n,l.start),a.push(l.lines),n=l.end)}),o(n,r.end),x(a)}},zn=qn.prototype;zn.tryToReprintComments=function(i,s,e){let t=this;if(!i.comments&&!s.comments)return!0;let r=Pe.from(i),n=Pe.from(s);r.stack.push("comments",hn(i)),n.stack.push("comments",hn(s));let a=[],o=Jn(r,n,a);return o&&a.length>0&&a.forEach(function(l){let c=l.oldPath.getValue();t.replace(c.loc,e(l.newPath).indentTail(c.loc.indent))}),o};function hn(i){let s=[];return i.comments&&i.comments.length>0&&i.comments.forEach(function(e){(e.leading||e.trailing)&&s.push(e)}),s}zn.deleteComments=function(i){if(!i.comments)return;let s=this;i.comments.forEach(function(e){e.leading?s.replace({start:e.loc.start,end:i.loc.lines.skipSpaces(e.loc.end,!1,!1)},""):e.trailing&&s.replace({start:i.loc.lines.skipSpaces(e.loc.start,!0,!1),end:e.loc.end},"")})};function pc(i){let s=i.getValue();if(!Ut.check(s))return;let e=s.original,t=e&&e.loc,r=t&&t.lines,n=[];if(!(!r||!mc(i,n)))return function(a){let o=new qn(r);n.forEach(function(c){let u=c.newPath.getValue(),h=c.oldPath.getValue();uc.assert(h.loc,!0);let f=!o.tryToReprintComments(u,h,a);f&&o.deleteComments(h);let d=a(c.newPath,{includeComments:f,avoidRootParens:h.type===u.type&&c.oldPath.hasParens()}).indentTail(h.loc.indent),p=fc(r,h.loc,d),g=dc(r,h.loc,d);if(p||g){let y=[];p&&y.push(" "),y.push(d),g&&y.push(" "),d=x(y)}o.replace(h.loc,d)});let l=o.get(t).indentTail(-e.loc.indent);return i.needsParens()?x(["(",l,")"]):l}}function fc(i,s,e){let t=$e(s.start),r=i.prevPos(t)&&i.charAt(t),n=e.charAt(e.firstPos());return r&&Ss.test(r)&&n&&Ss.test(n)}function dc(i,s,e){let t=i.charAt(s.end),r=e.lastPos(),n=e.prevPos(r)&&e.charAt(r);return n&&Ss.test(n)&&t&&Ss.test(t)}function mc(i,s){let e=i.getValue();Ut.assert(e);let t=e.original;if(Ut.assert(t),e.type!==t.type)return!1;let r=new Pe(t),n=Rr(i,r,s);return n||(s.length=0),n}function Wn(i,s,e){let t=i.getValue(),r=s.getValue();return t===r?!0:jr.check(t)?Jn(i,s,e):Vt.check(t)?yc(i,s,e):!1}function Jn(i,s,e){let t=i.getValue(),r=s.getValue();if(t===r||i.valueIsDuplicate()||s.valueIsDuplicate())return!0;jr.assert(t);let n=t.length;if(!(jr.check(r)&&r.length===n))return!1;for(let a=0;a<n;++a){i.stack.push(a,t[a]),s.stack.push(a,r[a]);let o=Wn(i,s,e);if(i.stack.length-=2,s.stack.length-=2,!o)return!1}return!0}function yc(i,s,e){let t=i.getValue();if(Vt.assert(t),t.original===null)return!1;let r=s.getValue();if(!Vt.check(r))return!1;if(t===r||i.valueIsDuplicate()||s.valueIsDuplicate())return!0;if(Ut.check(t)){if(!Ut.check(r))return!1;let n=i.getParentNode(),a=s.getParentNode();if(a!==null&&a.type==="FunctionTypeAnnotation"&&n!==null&&n.type==="FunctionTypeAnnotation"){let o=a.params.length!==1||!!a.params[0].name,l=n.params.length!==1||!!n.params[0].name;if(!o&&l)return!1}if(t.type===r.type){let o=[];if(Rr(i,s,o))e.push.apply(e,o);else if(r.loc)e.push({oldPath:s.copy(),newPath:i.copy()});else return!1;return!0}return un.check(t)&&un.check(r)&&r.loc?(e.push({oldPath:s.copy(),newPath:i.copy()}),!0):!1}return Rr(i,s,e)}function Rr(i,s,e){let t=i.getValue(),r=s.getValue();if(Vt.assert(t),Vt.assert(r),t.original===null||i.needsParens()&&!s.hasParens())return!1;let n=ql(r,t);(r.type==="File"||t.type==="File")&&delete n.tokens,delete n.loc;let a=e.length;for(let o in n){if(o.charAt(0)==="_")continue;i.stack.push(o,_e(t,o)),s.stack.push(o,_e(r,o));let l=Wn(i,s,e);if(i.stack.length-=2,s.stack.length-=2,!l)return!1}return!(cc.check(i.getNode())&&e.length>a)}var Y=Se,qr=Ee.string,gc=Ee.object,Es=function(s,e){qr.assert(s),this.code=s,e&&(gc.assert(e),this.map=e)},xc=Es.prototype,pn=!1;xc.toString=function(){return pn||(console.warn("Deprecation warning: recast.print now returns an object with a .code property. You appear to be treating the object as a string, which might still work but is strongly discouraged."),pn=!0),this.code};var fn=new Es(""),bc=function(s){let e=s&&s.tabWidth;s=vs(s),s.sourceFileName=null;function t(n,a){return n=Object.assign({},n,a),o=>r(o,n)}function r(n,a){if(a=a||{},a.includeComments)return cn(n,t(a,{includeComments:!1}));let o=s.tabWidth;if(!e){let u=n.getNode().loc;u&&u.lines&&u.lines.guessTabWidth&&(s.tabWidth=u.lines.guessTabWidth())}let l=pc(n),c=l?l(r):dn(n,s,a,t(a,{includeComments:!0,avoidRootParens:!1}));return s.tabWidth=o,c}this.print=function(n){if(!n)return fn;let a=r(Pe.from(n),{includeComments:!0,avoidRootParens:!1});return new Es(a.toString(s),zl(s.inputSourceMap,a.getSourceMap(s.sourceMapName,s.sourceRoot)))},this.printGenerically=function(n){if(!n)return fn;function a(u){return cn(u,h=>dn(h,s,{includeComments:!0,avoidRootParens:!1},a))}let o=Pe.from(n),l=s.reuseWhitespace;s.reuseWhitespace=!1;let c=new Es(a(o).toString(s));return s.reuseWhitespace=l,c}};function dn(i,s,e,t){let r=i.getValue(),n=[],a=Tc(i,s,t);if(!r||a.isEmpty())return a;let o=!1,l=Pc(i,t);return l.isEmpty()?e.avoidRootParens||(o=i.needsParens()):n.push(l),o&&n.unshift("("),n.push(a),o&&n.push(")"),x(n)}function Tc(i,s,e){let t=i.getValue();if(!t)return S("");if(typeof t=="string")return S(t,s);Y.Printable.assert(t);let r=[];switch(t.type){case"File":return i.call(e,"program");case"Program":return t.directives&&i.each(function(n){r.push(e(n),`;
20
+ `)},"directives"),t.interpreter&&r.push(i.call(e,"interpreter")),r.push(i.call(n=>ht(n,s,e),"body")),x(r);case"Noop":case"EmptyStatement":return S("");case"ExpressionStatement":return x([i.call(e,"expression"),";"]);case"ParenthesizedExpression":return x(["(",i.call(e,"expression"),")"]);case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":return S(" ").join([i.call(e,"left"),t.operator,i.call(e,"right")]);case"AssignmentPattern":return x([i.call(e,"left")," = ",i.call(e,"right")]);case"MemberExpression":case"OptionalMemberExpression":{r.push(i.call(e,"object"));let n=i.call(e,"property"),a=_e(t,"optional");return t.computed?r.push(a?"?.[":"[",n,"]"):r.push(a?"?.":".",n),x(r)}case"ChainExpression":return i.call(e,"expression");case"MetaProperty":return x([i.call(e,"meta"),".",i.call(e,"property")]);case"BindExpression":return t.object&&r.push(i.call(e,"object")),r.push("::",i.call(e,"callee")),x(r);case"Path":return S(".").join(t.body);case"Identifier":return x([S(t.name,s),t.optional?"?":"",i.call(e,"typeAnnotation")]);case"SpreadElement":case"SpreadElementPattern":case"RestProperty":case"SpreadProperty":case"SpreadPropertyPattern":case"ObjectTypeSpreadProperty":case"RestElement":return x(["...",i.call(e,"argument"),i.call(e,"typeAnnotation")]);case"FunctionDeclaration":case"FunctionExpression":case"TSDeclareFunction":return t.declare&&r.push("declare "),t.async&&r.push("async "),r.push("function"),t.generator&&r.push("*"),t.id?r.push(" ",i.call(e,"id"),i.call(e,"typeParameters")):t.typeParameters&&r.push(i.call(e,"typeParameters")),r.push("(",Ce(i,s,e),")",i.call(e,"returnType")),t.body&&r.push(" ",i.call(e,"body")),x(r);case"ArrowFunctionExpression":return t.async&&r.push("async "),t.typeParameters&&r.push(i.call(e,"typeParameters")),!s.arrowParensAlways&&t.params.length===1&&!t.rest&&t.params[0].type==="Identifier"&&!t.params[0].typeAnnotation&&!t.returnType?r.push(i.call(e,"params",0)):r.push("(",Ce(i,s,e),")",i.call(e,"returnType")),r.push(" => ",i.call(e,"body")),x(r);case"MethodDefinition":return Cr(i,s,e);case"YieldExpression":return r.push("yield"),t.delegate&&r.push("*"),t.argument&&r.push(" ",i.call(e,"argument")),x(r);case"AwaitExpression":return r.push("await"),t.all&&r.push("*"),t.argument&&r.push(" ",i.call(e,"argument")),x(r);case"ModuleExpression":return x([`module {
19
21
  `,i.call(e,"body").indent(s.tabWidth),`
20
- }`]);case"ModuleDeclaration":return r.push("module",i.call(e,"id")),t.source?r.push("from",i.call(e,"source")):r.push(i.call(e,"body")),S(" ").join(r);case"ImportSpecifier":return t.importKind&&t.importKind!=="value"&&r.push(t.importKind+" "),t.imported?(r.push(i.call(e,"imported")),t.local&&t.local.name!==t.imported.name&&r.push(" as ",i.call(e,"local"))):t.id&&(r.push(i.call(e,"id")),t.name&&r.push(" as ",i.call(e,"name"))),x(r);case"ExportSpecifier":return t.exportKind&&t.exportKind!=="value"&&r.push(t.exportKind+" "),t.local?(r.push(i.call(e,"local")),t.exported&&t.exported.name!==t.local.name&&r.push(" as ",i.call(e,"exported"))):t.id&&(r.push(i.call(e,"id")),t.name&&r.push(" as ",i.call(e,"name"))),x(r);case"ExportBatchSpecifier":return S("*");case"ImportNamespaceSpecifier":return r.push("* as "),t.local?r.push(i.call(e,"local")):t.id&&r.push(i.call(e,"id")),x(r);case"ImportDefaultSpecifier":return t.local?i.call(e,"local"):i.call(e,"id");case"TSExportAssignment":return x(["export = ",i.call(e,"expression")]);case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":return dn(i,s,e);case"ExportAllDeclaration":return r.push("export *"),t.exported&&r.push(" as ",i.call(e,"exported")),r.push(" from ",i.call(e,"source"),";"),x(r);case"TSNamespaceExportDeclaration":return r.push("export as namespace ",i.call(e,"id")),fs(x(r));case"ExportNamespaceSpecifier":return x(["* as ",i.call(e,"exported")]);case"ExportDefaultSpecifier":return i.call(e,"exported");case"Import":return S("import",s);case"ImportExpression":return x(["import(",i.call(e,"source"),")"]);case"ImportDeclaration":{if(r.push("import "),t.importKind&&t.importKind!=="value"&&r.push(t.importKind+" "),t.specifiers&&t.specifiers.length>0){let n=[],a=[];if(i.each(function(o){let l=o.getValue();l.type==="ImportSpecifier"?a.push(e(o)):(l.type==="ImportDefaultSpecifier"||l.type==="ImportNamespaceSpecifier")&&n.push(e(o))},"specifiers"),n.forEach((o,l)=>{l>0&&r.push(", "),r.push(o)}),a.length>0){let o=S(", ").join(a);o.getLineLength(1)>s.wrapColumn&&(o=x([S(`,
22
+ }`]);case"ModuleDeclaration":return r.push("module",i.call(e,"id")),t.source?r.push("from",i.call(e,"source")):r.push(i.call(e,"body")),S(" ").join(r);case"ImportSpecifier":return t.importKind&&t.importKind!=="value"&&r.push(t.importKind+" "),t.imported?(r.push(i.call(e,"imported")),t.local&&t.local.name!==t.imported.name&&r.push(" as ",i.call(e,"local"))):t.id&&(r.push(i.call(e,"id")),t.name&&r.push(" as ",i.call(e,"name"))),x(r);case"ExportSpecifier":return t.exportKind&&t.exportKind!=="value"&&r.push(t.exportKind+" "),t.local?(r.push(i.call(e,"local")),t.exported&&t.exported.name!==t.local.name&&r.push(" as ",i.call(e,"exported"))):t.id&&(r.push(i.call(e,"id")),t.name&&r.push(" as ",i.call(e,"name"))),x(r);case"ExportBatchSpecifier":return S("*");case"ImportNamespaceSpecifier":return r.push("* as "),t.local?r.push(i.call(e,"local")):t.id&&r.push(i.call(e,"id")),x(r);case"ImportDefaultSpecifier":return t.local?i.call(e,"local"):i.call(e,"id");case"TSExportAssignment":return x(["export = ",i.call(e,"expression")]);case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":return yn(i,s,e);case"ExportAllDeclaration":return r.push("export *"),t.exported&&r.push(" as ",i.call(e,"exported")),r.push(" from ",i.call(e,"source"),";"),x(r);case"TSNamespaceExportDeclaration":return r.push("export as namespace ",i.call(e,"id")),ys(x(r));case"ExportNamespaceSpecifier":return x(["* as ",i.call(e,"exported")]);case"ExportDefaultSpecifier":return i.call(e,"exported");case"Import":return S("import",s);case"ImportExpression":return x(["import(",i.call(e,"source"),")"]);case"ImportDeclaration":{if(r.push("import "),t.importKind&&t.importKind!=="value"&&r.push(t.importKind+" "),t.specifiers&&t.specifiers.length>0){let n=[],a=[];if(i.each(function(o){let l=o.getValue();l.type==="ImportSpecifier"?a.push(e(o)):(l.type==="ImportDefaultSpecifier"||l.type==="ImportNamespaceSpecifier")&&n.push(e(o))},"specifiers"),n.forEach((o,l)=>{l>0&&r.push(", "),r.push(o)}),a.length>0){let o=S(", ").join(a);o.getLineLength(1)>s.wrapColumn&&(o=x([S(`,
21
23
  `).join(a).indent(s.tabWidth),","])),n.length>0&&r.push(", "),o.length>1?r.push(`{
22
24
  `,o,`
23
- }`):s.objectCurlySpacing?r.push("{ ",o," }"):r.push("{",o,"}")}r.push(" from ")}return r.push(i.call(e,"source"),Jn(i,s,e),";"),x(r)}case"ImportAttribute":return x([i.call(e,"key"),": ",i.call(e,"value")]);case"StaticBlock":r.push("static ");case"BlockStatement":{let n=i.call(a=>ht(a,s,e),"body");return n.isEmpty()&&(!t.directives||t.directives.length===0)?(r.push("{}"),x(r)):(r.push(`{
24
- `),t.directives&&i.each(function(a){r.push(fs(e(a).indent(s.tabWidth)),t.directives.length>1||!n.isEmpty()?`
25
+ }`):s.objectCurlySpacing?r.push("{ ",o," }"):r.push("{",o,"}")}r.push(" from ")}return r.push(i.call(e,"source"),Hn(i,s,e),";"),x(r)}case"ImportAttribute":return x([i.call(e,"key"),": ",i.call(e,"value")]);case"StaticBlock":r.push("static ");case"BlockStatement":{let n=i.call(a=>ht(a,s,e),"body");return n.isEmpty()&&(!t.directives||t.directives.length===0)?(r.push("{}"),x(r)):(r.push(`{
26
+ `),t.directives&&i.each(function(a){r.push(ys(e(a).indent(s.tabWidth)),t.directives.length>1||!n.isEmpty()?`
25
27
  `:"")},"directives"),r.push(n.indent(s.tabWidth)),r.push(`
26
28
  }`),x(r))}case"ReturnStatement":{if(r.push("return"),t.argument){let n=i.call(e,"argument");n.startsWithComment()||n.length>1&&Y.JSXElement&&Y.JSXElement.check(t.argument)?r.push(` (
27
29
  `,n.indent(s.tabWidth),`
28
- )`):r.push(" ",n)}return r.push(";"),x(r)}case"CallExpression":case"OptionalCallExpression":return r.push(i.call(e,"callee")),t.typeParameters&&r.push(i.call(e,"typeParameters")),t.typeArguments&&r.push(i.call(e,"typeArguments")),_e(t,"optional")&&r.push("?."),r.push(fn(i,s,e)),x(r);case"RecordExpression":r.push("#");case"ObjectExpression":case"ObjectPattern":case"ObjectTypeAnnotation":{let n=t.type==="ObjectTypeAnnotation",a=s.flowObjectCommas?",":n?";":",",o=[],l=!1;n&&(o.push("indexers","callProperties"),t.internalSlots!=null&&o.push("internalSlots")),o.push("properties");let c=0;o.forEach(function(g){c+=t[g].length});let u=n&&c===1||c===0,h=t.exact?"{|":"{",f=t.exact?"|}":"}";r.push(u?h:h+`
30
+ )`):r.push(" ",n)}return r.push(";"),x(r)}case"CallExpression":case"OptionalCallExpression":return r.push(i.call(e,"callee")),t.typeParameters&&r.push(i.call(e,"typeParameters")),t.typeArguments&&r.push(i.call(e,"typeArguments")),_e(t,"optional")&&r.push("?."),r.push(mn(i,s,e)),x(r);case"RecordExpression":r.push("#");case"ObjectExpression":case"ObjectPattern":case"ObjectTypeAnnotation":{let n=t.type==="ObjectTypeAnnotation",a=s.flowObjectCommas?",":n?";":",",o=[],l=!1;n&&(o.push("indexers","callProperties"),t.internalSlots!=null&&o.push("internalSlots")),o.push("properties");let c=0;o.forEach(function(g){c+=t[g].length});let u=n&&c===1||c===0,h=t.exact?"{|":"{",f=t.exact?"|}":"}";r.push(u?h:h+`
29
31
  `);let d=r.length-1,p=0;if(o.forEach(function(g){i.each(function(y){let b=e(y);u||(b=b.indent(s.tabWidth));let P=!n&&b.length>1;P&&l&&r.push(`
30
32
  `),r.push(b),p<c-1?(r.push(a+(P?`
31
33
 
32
34
  `:`
33
35
  `)),l=!P):(c!==1&&n||!u&&jt(s,"objects")&&y.getValue().type!=="RestElement")&&r.push(a),p++},g)}),t.inexact){let g=S("...",s);u?(c>0&&r.push(a," "),r.push(g)):r.push(`
34
36
  `,g.indent(s.tabWidth))}return r.push(u?f:`
35
- `+f),p!==0&&u&&s.objectCurlySpacing&&(r[d]=h+" ",r[r.length-1]=" "+f),t.typeAnnotation&&r.push(i.call(e,"typeAnnotation")),x(r)}case"PropertyPattern":return x([i.call(e,"key"),": ",i.call(e,"pattern")]);case"ObjectProperty":case"Property":{if(t.method||t.kind==="get"||t.kind==="set")return wr(i,s,e);if(t.shorthand&&t.value.type==="AssignmentPattern")return i.call(e,"value");let n=i.call(e,"key");return t.computed?r.push("[",n,"]"):r.push(n),(!t.shorthand||t.key.name!==t.value.name)&&r.push(": ",i.call(e,"value")),x(r)}case"ClassMethod":case"ObjectMethod":case"ClassPrivateMethod":case"TSDeclareMethod":return wr(i,s,e);case"PrivateName":return x(["#",i.call(e,"id")]);case"Decorator":return x(["@",i.call(e,"expression")]);case"TupleExpression":r.push("#");case"ArrayExpression":case"ArrayPattern":{let a=t.elements.length,o=i.map(e,"elements"),c=S(", ").join(o).getLineLength(1)<=s.wrapColumn;return c?s.arrayBracketSpacing?r.push("[ "):r.push("["):r.push(`[
37
+ `+f),p!==0&&u&&s.objectCurlySpacing&&(r[d]=h+" ",r[r.length-1]=" "+f),t.typeAnnotation&&r.push(i.call(e,"typeAnnotation")),x(r)}case"PropertyPattern":return x([i.call(e,"key"),": ",i.call(e,"pattern")]);case"ObjectProperty":case"Property":{if(t.method||t.kind==="get"||t.kind==="set")return Cr(i,s,e);if(t.shorthand&&t.value.type==="AssignmentPattern")return i.call(e,"value");let n=i.call(e,"key");return t.computed?r.push("[",n,"]"):r.push(n),(!t.shorthand||t.key.name!==t.value.name)&&r.push(": ",i.call(e,"value")),x(r)}case"ClassMethod":case"ObjectMethod":case"ClassPrivateMethod":case"TSDeclareMethod":return Cr(i,s,e);case"PrivateName":return x(["#",i.call(e,"id")]);case"Decorator":return x(["@",i.call(e,"expression")]);case"TupleExpression":r.push("#");case"ArrayExpression":case"ArrayPattern":{let a=t.elements.length,o=i.map(e,"elements"),c=S(", ").join(o).getLineLength(1)<=s.wrapColumn;return c?s.arrayBracketSpacing?r.push("[ "):r.push("["):r.push(`[
36
38
  `),i.each(function(u){let h=u.getName();if(!u.getValue())r.push(",");else{let d=o[h];c?h>0&&r.push(" "):d=d.indent(s.tabWidth),r.push(d),(h<a-1||!c&&jt(s,"arrays"))&&r.push(","),c||r.push(`
37
39
  `)}},"elements"),c&&s.arrayBracketSpacing?r.push(" ]"):r.push("]"),t.typeAnnotation&&r.push(i.call(e,"typeAnnotation")),x(r)}case"SequenceExpression":return S(", ").join(i.map(e,"expressions"));case"ThisExpression":return S("this");case"Super":return S("super");case"NullLiteral":return S("null");case"RegExpLiteral":return S(pt(t)||`/${t.pattern}/${t.flags||""}`,s);case"BigIntLiteral":return S(pt(t)||t.value+"n",s);case"NumericLiteral":return S(pt(t)||t.value,s);case"DecimalLiteral":return S(pt(t)||t.value+"m",s);case"StringLiteral":return S(Ft(t.value,s));case"BooleanLiteral":case"Literal":return S(pt(t)||(typeof t.value=="string"?Ft(t.value,s):t.value),s);case"Directive":return i.call(e,"value");case"DirectiveLiteral":return S(pt(t)||Ft(t.value,s),s);case"InterpreterDirective":return S(`#!${t.value}
38
- `,s);case"ModuleSpecifier":if(t.local)throw new Error("The ESTree ModuleSpecifier type should be abstract");return S(Ft(t.value,s),s);case"UnaryExpression":return r.push(t.operator),/[a-z]$/.test(t.operator)&&r.push(" "),r.push(i.call(e,"argument")),x(r);case"UpdateExpression":return r.push(i.call(e,"argument"),t.operator),t.prefix&&r.reverse(),x(r);case"ConditionalExpression":return x([i.call(e,"test")," ? ",i.call(e,"consequent")," : ",i.call(e,"alternate")]);case"NewExpression":return r.push("new ",i.call(e,"callee")),t.typeParameters&&r.push(i.call(e,"typeParameters")),t.typeArguments&&r.push(i.call(e,"typeArguments")),t.arguments&&r.push(fn(i,s,e)),x(r);case"VariableDeclaration":{t.declare&&r.push("declare "),r.push(t.kind," ");let n=0,a=i.map(function(l){let c=e(l);return n=Math.max(c.length,n),c},"declarations");n===1?r.push(S(", ").join(a)):a.length>1?r.push(S(`,
39
- `).join(a).indentTail(t.kind.length+1)):r.push(a[0]);let o=i.getParentNode();return!Y.ForStatement.check(o)&&!Y.ForInStatement.check(o)&&!(Y.ForOfStatement&&Y.ForOfStatement.check(o))&&!(Y.ForAwaitStatement&&Y.ForAwaitStatement.check(o))&&r.push(";"),x(r)}case"VariableDeclarator":return t.init?S(" = ").join([i.call(e,"id"),i.call(e,"init")]):i.call(e,"id");case"WithStatement":return x(["with (",i.call(e,"object"),") ",i.call(e,"body")]);case"IfStatement":{let n=Ke(i.call(e,"consequent"),s);return r.push("if (",i.call(e,"test"),")",n),t.alternate&&r.push(mn(n)?" else":`
40
+ `,s);case"ModuleSpecifier":if(t.local)throw new Error("The ESTree ModuleSpecifier type should be abstract");return S(Ft(t.value,s),s);case"UnaryExpression":return r.push(t.operator),/[a-z]$/.test(t.operator)&&r.push(" "),r.push(i.call(e,"argument")),x(r);case"UpdateExpression":return r.push(i.call(e,"argument"),t.operator),t.prefix&&r.reverse(),x(r);case"ConditionalExpression":return x([i.call(e,"test")," ? ",i.call(e,"consequent")," : ",i.call(e,"alternate")]);case"NewExpression":return r.push("new ",i.call(e,"callee")),t.typeParameters&&r.push(i.call(e,"typeParameters")),t.typeArguments&&r.push(i.call(e,"typeArguments")),t.arguments&&r.push(mn(i,s,e)),x(r);case"VariableDeclaration":{t.declare&&r.push("declare "),r.push(t.kind," ");let n=0,a=i.map(function(l){let c=e(l);return n=Math.max(c.length,n),c},"declarations");n===1?r.push(S(", ").join(a)):a.length>1?r.push(S(`,
41
+ `).join(a).indentTail(t.kind.length+1)):r.push(a[0]);let o=i.getParentNode();return!Y.ForStatement.check(o)&&!Y.ForInStatement.check(o)&&!(Y.ForOfStatement&&Y.ForOfStatement.check(o))&&!(Y.ForAwaitStatement&&Y.ForAwaitStatement.check(o))&&r.push(";"),x(r)}case"VariableDeclarator":return t.init?S(" = ").join([i.call(e,"id"),i.call(e,"init")]):i.call(e,"id");case"WithStatement":return x(["with (",i.call(e,"object"),") ",i.call(e,"body")]);case"IfStatement":{let n=Ke(i.call(e,"consequent"),s);return r.push("if (",i.call(e,"test"),")",n),t.alternate&&r.push(gn(n)?" else":`
40
42
  else`,Ke(i.call(e,"alternate"),s)),x(r)}case"ForStatement":{let n=i.call(e,"init"),a=n.length>1?`;
41
43
  `:"; ",o="for (",l=S(a).join([n,i.call(e,"test"),i.call(e,"update")]).indentTail(o.length),c=x([o,l,")"]),u=Ke(i.call(e,"body"),s);return r.push(c),c.length>1&&(r.push(`
42
- `),u=u.trimLeft()),r.push(u),x(r)}case"WhileStatement":return x(["while (",i.call(e,"test"),")",Ke(i.call(e,"body"),s)]);case"ForInStatement":return x([t.each?"for each (":"for (",i.call(e,"left")," in ",i.call(e,"right"),")",Ke(i.call(e,"body"),s)]);case"ForOfStatement":case"ForAwaitStatement":return r.push("for "),(t.await||t.type==="ForAwaitStatement")&&r.push("await "),r.push("(",i.call(e,"left")," of ",i.call(e,"right"),")",Ke(i.call(e,"body"),s)),x(r);case"DoWhileStatement":{let n=x(["do",Ke(i.call(e,"body"),s)]);return r.push(n),mn(n)?r.push(" while"):r.push(`
44
+ `),u=u.trimLeft()),r.push(u),x(r)}case"WhileStatement":return x(["while (",i.call(e,"test"),")",Ke(i.call(e,"body"),s)]);case"ForInStatement":return x([t.each?"for each (":"for (",i.call(e,"left")," in ",i.call(e,"right"),")",Ke(i.call(e,"body"),s)]);case"ForOfStatement":case"ForAwaitStatement":return r.push("for "),(t.await||t.type==="ForAwaitStatement")&&r.push("await "),r.push("(",i.call(e,"left")," of ",i.call(e,"right"),")",Ke(i.call(e,"body"),s)),x(r);case"DoWhileStatement":{let n=x(["do",Ke(i.call(e,"body"),s)]);return r.push(n),gn(n)?r.push(" while"):r.push(`
43
45
  while`),r.push(" (",i.call(e,"test"),");"),x(r)}case"DoExpression":{let n=i.call(a=>ht(a,s,e),"body");return x([`do {
44
46
  `,n.indent(s.tabWidth),`
45
47
  }`])}case"BreakStatement":return r.push("break"),t.label&&r.push(" ",i.call(e,"label")),r.push(";"),x(r);case"ContinueStatement":return r.push("continue"),t.label&&r.push(" ",i.call(e,"label")),r.push(";"),x(r);case"LabeledStatement":return x([i.call(e,"label"),`:
@@ -51,9 +53,9 @@ while`),r.push(" (",i.call(e,"test"),");"),x(r)}case"DoExpression":{let n=i.call
51
53
  `}return e(u)},"children")).indentTail(s.tabWidth),c=i.call(e,a);return x([o,l,c])}case"JSXOpeningElement":{r.push("<",i.call(e,"name"));let n=[];i.each(function(l){n.push(" ",e(l))},"attributes");let a=x(n);return(a.length>1||a.getLineLength(1)>s.wrapColumn)&&(n.forEach(function(l,c){l===" "&&(n[c]=`
52
54
  `)}),a=x(n).indentTail(s.tabWidth)),r.push(a,t.selfClosing?" />":">"),x(r)}case"JSXClosingElement":return x(["</",i.call(e,"name"),">"]);case"JSXOpeningFragment":return S("<>");case"JSXClosingFragment":return S("</>");case"JSXText":return S(t.value,s);case"JSXEmptyExpression":return S("");case"TypeAnnotatedIdentifier":return x([i.call(e,"annotation")," ",i.call(e,"identifier")]);case"ClassBody":return t.body.length===0?S("{}"):x([`{
53
55
  `,i.call(n=>ht(n,s,e),"body").indent(s.tabWidth),`
54
- }`]);case"ClassPropertyDefinition":return r.push("static ",i.call(e,"definition")),Y.MethodDefinition.check(t.definition)||r.push(";"),x(r);case"ClassProperty":{t.declare&&r.push("declare ");let n=t.accessibility||t.access;typeof n=="string"&&r.push(n," "),t.static&&r.push("static "),t.abstract&&r.push("abstract "),t.readonly&&r.push("readonly ");let a=i.call(e,"key");return t.computed&&(a=x(["[",a,"]"])),t.variance&&(a=x([Mt(i,e),a])),r.push(a),t.optional&&r.push("?"),t.definite&&r.push("!"),t.typeAnnotation&&r.push(i.call(e,"typeAnnotation")),t.value&&r.push(" = ",i.call(e,"value")),r.push(";"),x(r)}case"ClassPrivateProperty":return t.static&&r.push("static "),r.push(i.call(e,"key")),t.typeAnnotation&&r.push(i.call(e,"typeAnnotation")),t.value&&r.push(" = ",i.call(e,"value")),r.push(";"),x(r);case"ClassAccessorProperty":return r.push(...Wn(t),"accessor "),t.computed?r.push("[",i.call(e,"key"),"]"):r.push(i.call(e,"key")),t.optional&&r.push("?"),t.definite&&r.push("!"),t.typeAnnotation&&r.push(i.call(e,"typeAnnotation")),t.value&&r.push(" = ",i.call(e,"value")),r.push(";"),x(r);case"ClassDeclaration":case"ClassExpression":case"DeclareClass":return t.declare&&r.push("declare "),t.abstract&&r.push("abstract "),r.push("class"),t.id&&r.push(" ",i.call(e,"id")),t.typeParameters&&r.push(i.call(e,"typeParameters")),t.superClass&&r.push(" extends ",i.call(e,"superClass"),i.call(e,"superTypeParameters")),t.extends&&t.extends.length>0&&r.push(" extends ",S(", ").join(i.map(e,"extends"))),t.implements&&t.implements.length>0&&r.push(" implements ",S(", ").join(i.map(e,"implements"))),r.push(" ",i.call(e,"body")),t.type==="DeclareClass"?Ot(i,r):x(r);case"TemplateElement":return S(t.value.raw,s).lockIndentTail();case"TemplateLiteral":{let n=i.map(e,"expressions");return r.push("`"),i.each(function(a){let o=a.getName();r.push(e(a)),o<n.length&&r.push("${",n[o],"}")},"quasis"),r.push("`"),x(r).lockIndentTail()}case"TaggedTemplateExpression":return x([i.call(e,"tag"),i.call(e,"quasi")]);case"Node":case"Printable":case"SourceLocation":case"Position":case"Statement":case"Function":case"Pattern":case"Expression":case"Declaration":case"Specifier":case"NamedSpecifier":case"Comment":case"Flow":case"FlowType":case"FlowPredicate":case"MemberTypeAnnotation":case"Type":case"TSHasOptionalTypeParameterInstantiation":case"TSHasOptionalTypeParameters":case"TSHasOptionalTypeAnnotation":case"ChainElement":throw new Error("unprintable type: "+JSON.stringify(t.type));case"CommentBlock":case"Block":return x(["/*",S(t.value,s),"*/"]);case"CommentLine":case"Line":return x(["//",S(t.value,s)]);case"TypeAnnotation":return t.typeAnnotation?(t.typeAnnotation.type!=="FunctionTypeAnnotation"&&r.push(": "),r.push(i.call(e,"typeAnnotation")),x(r)):S("");case"ExistentialTypeParam":case"ExistsTypeAnnotation":return S("*",s);case"EmptyTypeAnnotation":return S("empty",s);case"AnyTypeAnnotation":return S("any",s);case"MixedTypeAnnotation":return S("mixed",s);case"ArrayTypeAnnotation":return x([i.call(e,"elementType"),"[]"]);case"TupleTypeAnnotation":{let n=i.map(e,"types"),o=S(", ").join(n).getLineLength(1)<=s.wrapColumn;return o?s.arrayBracketSpacing?r.push("[ "):r.push("["):r.push(`[
56
+ }`]);case"ClassPropertyDefinition":return r.push("static ",i.call(e,"definition")),Y.MethodDefinition.check(t.definition)||r.push(";"),x(r);case"ClassProperty":{t.declare&&r.push("declare ");let n=t.accessibility||t.access;typeof n=="string"&&r.push(n," "),t.static&&r.push("static "),t.abstract&&r.push("abstract "),t.readonly&&r.push("readonly ");let a=i.call(e,"key");return t.computed&&(a=x(["[",a,"]"])),t.variance&&(a=x([Mt(i,e),a])),r.push(a),t.optional&&r.push("?"),t.definite&&r.push("!"),t.typeAnnotation&&r.push(i.call(e,"typeAnnotation")),t.value&&r.push(" = ",i.call(e,"value")),r.push(";"),x(r)}case"ClassPrivateProperty":return t.static&&r.push("static "),r.push(i.call(e,"key")),t.typeAnnotation&&r.push(i.call(e,"typeAnnotation")),t.value&&r.push(" = ",i.call(e,"value")),r.push(";"),x(r);case"ClassAccessorProperty":return r.push(...Kn(t),"accessor "),t.computed?r.push("[",i.call(e,"key"),"]"):r.push(i.call(e,"key")),t.optional&&r.push("?"),t.definite&&r.push("!"),t.typeAnnotation&&r.push(i.call(e,"typeAnnotation")),t.value&&r.push(" = ",i.call(e,"value")),r.push(";"),x(r);case"ClassDeclaration":case"ClassExpression":case"DeclareClass":return t.declare&&r.push("declare "),t.abstract&&r.push("abstract "),r.push("class"),t.id&&r.push(" ",i.call(e,"id")),t.typeParameters&&r.push(i.call(e,"typeParameters")),t.superClass&&r.push(" extends ",i.call(e,"superClass"),i.call(e,"superTypeParameters")),t.extends&&t.extends.length>0&&r.push(" extends ",S(", ").join(i.map(e,"extends"))),t.implements&&t.implements.length>0&&r.push(" implements ",S(", ").join(i.map(e,"implements"))),r.push(" ",i.call(e,"body")),t.type==="DeclareClass"?Ot(i,r):x(r);case"TemplateElement":return S(t.value.raw,s).lockIndentTail();case"TemplateLiteral":{let n=i.map(e,"expressions");return r.push("`"),i.each(function(a){let o=a.getName();r.push(e(a)),o<n.length&&r.push("${",n[o],"}")},"quasis"),r.push("`"),x(r).lockIndentTail()}case"TaggedTemplateExpression":return x([i.call(e,"tag"),i.call(e,"quasi")]);case"Node":case"Printable":case"SourceLocation":case"Position":case"Statement":case"Function":case"Pattern":case"Expression":case"Declaration":case"Specifier":case"NamedSpecifier":case"Comment":case"Flow":case"FlowType":case"FlowPredicate":case"MemberTypeAnnotation":case"Type":case"TSHasOptionalTypeParameterInstantiation":case"TSHasOptionalTypeParameters":case"TSHasOptionalTypeAnnotation":case"ChainElement":throw new Error("unprintable type: "+JSON.stringify(t.type));case"CommentBlock":case"Block":return x(["/*",S(t.value,s),"*/"]);case"CommentLine":case"Line":return x(["//",S(t.value,s)]);case"TypeAnnotation":return t.typeAnnotation?(t.typeAnnotation.type!=="FunctionTypeAnnotation"&&r.push(": "),r.push(i.call(e,"typeAnnotation")),x(r)):S("");case"ExistentialTypeParam":case"ExistsTypeAnnotation":return S("*",s);case"EmptyTypeAnnotation":return S("empty",s);case"AnyTypeAnnotation":return S("any",s);case"MixedTypeAnnotation":return S("mixed",s);case"ArrayTypeAnnotation":return x([i.call(e,"elementType"),"[]"]);case"TupleTypeAnnotation":{let n=i.map(e,"types"),o=S(", ").join(n).getLineLength(1)<=s.wrapColumn;return o?s.arrayBracketSpacing?r.push("[ "):r.push("["):r.push(`[
55
57
  `),i.each(function(l){let c=l.getName();if(!l.getValue())r.push(",");else{let h=n[c];o?c>0&&r.push(" "):h=h.indent(s.tabWidth),r.push(h),(c<t.types.length-1||!o&&jt(s,"arrays"))&&r.push(","),o||r.push(`
56
- `)}},"types"),o&&s.arrayBracketSpacing?r.push(" ]"):r.push("]"),x(r)}case"BooleanTypeAnnotation":return S("boolean",s);case"BooleanLiteralTypeAnnotation":return S(""+t.value,s);case"InterfaceTypeAnnotation":return r.push("interface"),t.extends&&t.extends.length>0&&r.push(" extends ",S(", ").join(i.map(e,"extends"))),r.push(" ",i.call(e,"body")),x(r);case"DeclareFunction":return Ot(i,["function ",i.call(e,"id"),";"]);case"DeclareModule":return Ot(i,["module ",i.call(e,"id")," ",i.call(e,"body")]);case"DeclareModuleExports":return Ot(i,["module.exports",i.call(e,"typeAnnotation")]);case"DeclareVariable":return Ot(i,["var ",i.call(e,"id"),";"]);case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":return x(["declare ",dn(i,s,e)]);case"EnumDeclaration":return x(["enum ",i.call(e,"id"),i.call(e,"body")]);case"EnumBooleanBody":case"EnumNumberBody":case"EnumStringBody":case"EnumSymbolBody":return(t.type==="EnumSymbolBody"||t.explicitType)&&r.push(" of ",t.type.slice(4,-4).toLowerCase()),r.push(` {
58
+ `)}},"types"),o&&s.arrayBracketSpacing?r.push(" ]"):r.push("]"),x(r)}case"BooleanTypeAnnotation":return S("boolean",s);case"BooleanLiteralTypeAnnotation":return S(""+t.value,s);case"InterfaceTypeAnnotation":return r.push("interface"),t.extends&&t.extends.length>0&&r.push(" extends ",S(", ").join(i.map(e,"extends"))),r.push(" ",i.call(e,"body")),x(r);case"DeclareFunction":return Ot(i,["function ",i.call(e,"id"),";"]);case"DeclareModule":return Ot(i,["module ",i.call(e,"id")," ",i.call(e,"body")]);case"DeclareModuleExports":return Ot(i,["module.exports",i.call(e,"typeAnnotation")]);case"DeclareVariable":return Ot(i,["var ",i.call(e,"id"),";"]);case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":return x(["declare ",yn(i,s,e)]);case"EnumDeclaration":return x(["enum ",i.call(e,"id"),i.call(e,"body")]);case"EnumBooleanBody":case"EnumNumberBody":case"EnumStringBody":case"EnumSymbolBody":return(t.type==="EnumSymbolBody"||t.explicitType)&&r.push(" of ",t.type.slice(4,-4).toLowerCase()),r.push(` {
57
59
  `,S(`
58
60
  `).join(i.map(e,"members")).indent(s.tabWidth),`
59
61
  }`),x(r);case"EnumDefaultedMember":return x([i.call(e,"id"),","]);case"EnumBooleanMember":case"EnumNumberMember":case"EnumStringMember":return x([i.call(e,"id")," = ",i.call(e,"init"),","]);case"InferredPredicate":return S("%checks",s);case"DeclaredPredicate":return x(["%checks(",i.call(e,"value"),")"]);case"FunctionTypeAnnotation":{let n=i.getParentNode(0),a=!(Y.ObjectTypeCallProperty.check(n)||Y.ObjectTypeInternalSlot.check(n)&&n.method||Y.DeclareFunction.check(i.getParentNode(2)));a&&!Y.FunctionTypeParam.check(n)&&!Y.TypeAlias.check(n)&&r.push(": ");let l=!!t.typeParameters,c=l||t.params.length!==1||t.params[0].name;return r.push(l?i.call(e,"typeParameters"):"",c?"(":"",Ce(i,s,e),c?")":""),t.returnType&&r.push(a?" => ":": ",i.call(e,"returnType")),x(r)}case"FunctionTypeParam":{let n=i.call(e,"name");return r.push(n),t.optional&&r.push("?"),n.infos[0].line&&r.push(": "),r.push(i.call(e,"typeAnnotation")),x(r)}case"GenericTypeAnnotation":return x([i.call(e,"id"),i.call(e,"typeParameters")]);case"DeclareInterface":r.push("declare ");case"InterfaceDeclaration":case"TSInterfaceDeclaration":return t.declare&&r.push("declare "),r.push("interface ",i.call(e,"id"),i.call(e,"typeParameters")," "),t.extends&&t.extends.length>0&&r.push("extends ",S(", ").join(i.map(e,"extends"))," "),t.body&&r.push(i.call(e,"body")),x(r);case"ClassImplements":case"InterfaceExtends":return x([i.call(e,"id"),i.call(e,"typeParameters")]);case"IntersectionTypeAnnotation":return S(" & ").join(i.map(e,"types"));case"NullableTypeAnnotation":return x(["?",i.call(e,"typeAnnotation")]);case"NullLiteralTypeAnnotation":return S("null",s);case"ThisTypeAnnotation":return S("this",s);case"NumberTypeAnnotation":return S("number",s);case"ObjectTypeCallProperty":return i.call(e,"value");case"ObjectTypeIndexer":return t.static&&r.push("static "),r.push(Mt(i,e),"["),t.id&&r.push(i.call(e,"id"),": "),r.push(i.call(e,"key"),"]: ",i.call(e,"value")),x(r);case"ObjectTypeProperty":return x([Mt(i,e),i.call(e,"key"),t.optional?"?":"",": ",i.call(e,"value")]);case"ObjectTypeInternalSlot":return x([t.static?"static ":"","[[",i.call(e,"id"),"]]",t.optional?"?":"",t.value.type!=="FunctionTypeAnnotation"?": ":"",i.call(e,"value")]);case"QualifiedTypeIdentifier":return x([i.call(e,"qualification"),".",i.call(e,"id")]);case"StringLiteralTypeAnnotation":return S(Ft(t.value,s),s);case"NumberLiteralTypeAnnotation":case"NumericLiteralTypeAnnotation":return S(JSON.stringify(t.value),s);case"BigIntLiteralTypeAnnotation":return S(t.raw,s);case"StringTypeAnnotation":return S("string",s);case"DeclareTypeAlias":r.push("declare ");case"TypeAlias":return x(["type ",i.call(e,"id"),i.call(e,"typeParameters")," = ",i.call(e,"right"),";"]);case"DeclareOpaqueType":r.push("declare ");case"OpaqueType":return r.push("opaque type ",i.call(e,"id"),i.call(e,"typeParameters")),t.supertype&&r.push(": ",i.call(e,"supertype")),t.impltype&&r.push(" = ",i.call(e,"impltype")),r.push(";"),x(r);case"TypeCastExpression":return x(["(",i.call(e,"expression"),i.call(e,"typeAnnotation"),")"]);case"TypeParameterDeclaration":case"TypeParameterInstantiation":return x(["<",S(", ").join(i.map(e,"params")),">"]);case"Variance":return t.kind==="plus"?S("+"):t.kind==="minus"?S("-"):S("");case"TypeParameter":return t.variance&&r.push(Mt(i,e)),r.push(i.call(e,"name")),t.bound&&r.push(i.call(e,"bound")),t.default&&r.push("=",i.call(e,"default")),x(r);case"TypeofTypeAnnotation":return x([S("typeof ",s),i.call(e,"argument")]);case"IndexedAccessType":case"OptionalIndexedAccessType":return x([i.call(e,"objectType"),t.optional?"?.":"","[",i.call(e,"indexType"),"]"]);case"UnionTypeAnnotation":return S(" | ").join(i.map(e,"types"));case"VoidTypeAnnotation":return S("void",s);case"NullTypeAnnotation":return S("null",s);case"SymbolTypeAnnotation":return S("symbol",s);case"BigIntTypeAnnotation":return S("bigint",s);case"TSType":throw new Error("unprintable type: "+JSON.stringify(t.type));case"TSNumberKeyword":return S("number",s);case"TSBigIntKeyword":return S("bigint",s);case"TSObjectKeyword":return S("object",s);case"TSBooleanKeyword":return S("boolean",s);case"TSStringKeyword":return S("string",s);case"TSSymbolKeyword":return S("symbol",s);case"TSAnyKeyword":return S("any",s);case"TSVoidKeyword":return S("void",s);case"TSIntrinsicKeyword":return S("intrinsic",s);case"TSThisType":return S("this",s);case"TSNullKeyword":return S("null",s);case"TSUndefinedKeyword":return S("undefined",s);case"TSUnknownKeyword":return S("unknown",s);case"TSNeverKeyword":return S("never",s);case"TSArrayType":return x([i.call(e,"elementType"),"[]"]);case"TSLiteralType":return i.call(e,"literal");case"TSUnionType":return S(" | ").join(i.map(e,"types"));case"TSIntersectionType":return S(" & ").join(i.map(e,"types"));case"TSConditionalType":return r.push(i.call(e,"checkType")," extends ",i.call(e,"extendsType")," ? ",i.call(e,"trueType")," : ",i.call(e,"falseType")),x(r);case"TSInferType":return r.push("infer ",i.call(e,"typeParameter")),x(r);case"TSParenthesizedType":return x(["(",i.call(e,"typeAnnotation"),")"]);case"TSFunctionType":return x([i.call(e,"typeParameters"),"(",Ce(i,s,e),") => ",i.call(e,"typeAnnotation","typeAnnotation")]);case"TSConstructorType":return x(["new ",i.call(e,"typeParameters"),"(",Ce(i,s,e),") => ",i.call(e,"typeAnnotation","typeAnnotation")]);case"TSMappedType":return r.push(t.readonly?"readonly ":"","[",i.call(e,"typeParameter"),"]",t.optional?"?":""),t.typeAnnotation&&r.push(": ",i.call(e,"typeAnnotation"),";"),x([`{
@@ -67,11 +69,11 @@ while`),r.push(" (",i.call(e,"test"),");"),x(r)}case"DoExpression":{let n=i.call
67
69
  }`),x(r)}case"TSExpressionWithTypeArguments":return x([i.call(e,"expression"),i.call(e,"typeParameters")]);case"TSInterfaceBody":{let n=S(`
68
70
  `).join(i.map(e,"body").map(a=>$t(a)!==";"?a.concat(";"):a));return n.isEmpty()?S("{}",s):x([`{
69
71
  `,n.indent(s.tabWidth),`
70
- }`])}case"TSImportType":return r.push("import(",i.call(e,"argument"),")"),t.qualifier&&r.push(".",i.call(e,"qualifier")),t.typeParameters&&r.push(i.call(e,"typeParameters")),x(r);case"TSImportEqualsDeclaration":return t.isExport&&r.push("export "),r.push("import ",i.call(e,"id")," = ",i.call(e,"moduleReference")),fs(x(r));case"TSExternalModuleReference":return x(["require(",i.call(e,"expression"),")"]);case"TSModuleDeclaration":return i.getParentNode().type==="TSModuleDeclaration"?r.push("."):(t.declare&&r.push("declare "),t.global||(t.id.type==="StringLiteral"||t.id.type==="Literal"&&typeof t.id.value=="string"||t.loc&&t.loc.lines&&t.id.loc&&t.loc.lines.sliceString(t.loc.start,t.id.loc.start).indexOf("module")>=0?r.push("module "):r.push("namespace "))),r.push(i.call(e,"id")),t.body&&(r.push(" "),r.push(i.call(e,"body"))),x(r);case"TSModuleBlock":{let n=i.call(a=>ht(a,s,e),"body");return n.isEmpty()?r.push("{}"):r.push(`{
72
+ }`])}case"TSImportType":return r.push("import(",i.call(e,"argument"),")"),t.qualifier&&r.push(".",i.call(e,"qualifier")),t.typeParameters&&r.push(i.call(e,"typeParameters")),x(r);case"TSImportEqualsDeclaration":return t.isExport&&r.push("export "),r.push("import ",i.call(e,"id")," = ",i.call(e,"moduleReference")),ys(x(r));case"TSExternalModuleReference":return x(["require(",i.call(e,"expression"),")"]);case"TSModuleDeclaration":return i.getParentNode().type==="TSModuleDeclaration"?r.push("."):(t.declare&&r.push("declare "),t.global||(t.id.type==="StringLiteral"||t.id.type==="Literal"&&typeof t.id.value=="string"||t.loc&&t.loc.lines&&t.id.loc&&t.loc.lines.sliceString(t.loc.start,t.id.loc.start).indexOf("module")>=0?r.push("module "):r.push("namespace "))),r.push(i.call(e,"id")),t.body&&(r.push(" "),r.push(i.call(e,"body"))),x(r);case"TSModuleBlock":{let n=i.call(a=>ht(a,s,e),"body");return n.isEmpty()?r.push("{}"):r.push(`{
71
73
  `,n.indent(s.tabWidth),`
72
- }`),x(r)}case"TSInstantiationExpression":return r.push(i.call(e,"expression"),i.call(e,"typeParameters")),x(r);case"V8IntrinsicIdentifier":return x(["%",i.call(e,"name")]);case"TopicReference":return S("#");case"ClassHeritage":case"ComprehensionBlock":case"ComprehensionExpression":case"Glob":case"GeneratorExpression":case"LetStatement":case"LetExpression":case"GraphExpression":case"GraphIndexExpression":case"XMLDefaultDeclaration":case"XMLAnyName":case"XMLQualifiedIdentifier":case"XMLFunctionQualifiedIdentifier":case"XMLAttributeSelector":case"XMLFilterExpression":case"XML":case"XMLElement":case"XMLList":case"XMLEscape":case"XMLText":case"XMLStartTag":case"XMLEndTag":case"XMLPointTag":case"XMLName":case"XMLAttribute":case"XMLCdata":case"XMLComment":case"XMLProcessingInstruction":default:debugger;throw new Error("unknown type: "+JSON.stringify(t.type))}}function xc(i,s){let e=[],t=i.getValue();return t.decorators&&t.decorators.length>0&&!Nn(i)?i.each(function(r){e.push(s(r),`
73
- `)},"decorators"):Ss(t)&&t.declaration&&t.declaration.decorators&&i.each(function(r){e.push(s(r),`
74
- `)},"declaration","decorators"),x(e)}function ht(i,s,e){let t=[];i.each(function(o){let l=o.getValue();l&&(l.type==="EmptyStatement"&&!(l.comments&&l.comments.length>0)||(Y.Comment.check(l)||Y.Statement.check(l)||Vr.assert(l),t.push({node:l,printed:e(o)})))});let r=null,n=t.length,a=[];return t.forEach(function(o,l){let c=o.printed,u=o.node,h=c.length>1,f=l>0,d=l<n-1,p,g,y=u&&u.loc&&u.loc.lines,b=y&&s.reuseWhitespace&&In(u,y);if(f)if(b){let P=y.skipSpaces(b.start,!0),k=P?P.line:1,T=b.start.line-k;p=Array(T+1).join(`
74
+ }`),x(r)}case"TSInstantiationExpression":return r.push(i.call(e,"expression"),i.call(e,"typeParameters")),x(r);case"V8IntrinsicIdentifier":return x(["%",i.call(e,"name")]);case"TopicReference":return S("#");case"ClassHeritage":case"ComprehensionBlock":case"ComprehensionExpression":case"Glob":case"GeneratorExpression":case"LetStatement":case"LetExpression":case"GraphExpression":case"GraphIndexExpression":case"XMLDefaultDeclaration":case"XMLAnyName":case"XMLQualifiedIdentifier":case"XMLFunctionQualifiedIdentifier":case"XMLAttributeSelector":case"XMLFilterExpression":case"XML":case"XMLElement":case"XMLList":case"XMLEscape":case"XMLText":case"XMLStartTag":case"XMLEndTag":case"XMLPointTag":case"XMLName":case"XMLAttribute":case"XMLCdata":case"XMLComment":case"XMLProcessingInstruction":default:debugger;throw new Error("unknown type: "+JSON.stringify(t.type))}}function Pc(i,s){let e=[],t=i.getValue();return t.decorators&&t.decorators.length>0&&!Ln(i)?i.each(function(r){e.push(s(r),`
75
+ `)},"decorators"):ws(t)&&t.declaration&&t.declaration.decorators&&i.each(function(r){e.push(s(r),`
76
+ `)},"declaration","decorators"),x(e)}function ht(i,s,e){let t=[];i.each(function(o){let l=o.getValue();l&&(l.type==="EmptyStatement"&&!(l.comments&&l.comments.length>0)||(Y.Comment.check(l)||Y.Statement.check(l)||qr.assert(l),t.push({node:l,printed:e(o)})))});let r=null,n=t.length,a=[];return t.forEach(function(o,l){let c=o.printed,u=o.node,h=c.length>1,f=l>0,d=l<n-1,p,g,y=u&&u.loc&&u.loc.lines,b=y&&s.reuseWhitespace&&kn(u,y);if(f)if(b){let P=y.skipSpaces(b.start,!0),k=P?P.line:1,T=b.start.line-k;p=Array(T+1).join(`
75
77
  `)}else p=h?`
76
78
 
77
79
  `:`
@@ -79,7 +81,7 @@ while`),r.push(" (",i.call(e,"test"),");"),x(r)}case"DoExpression":{let n=i.call
79
81
  `)}else g=h?`
80
82
 
81
83
  `:`
82
- `;else g="";a.push(bc(r,p),c),d?r=g:g&&a.push(g)}),x(a)}function bc(i,s){if(!i&&!s)return S("");if(!i)return S(s);if(!s)return S(i);let e=S(i),t=S(s);return t.length>e.length?t:e}function Wn(i){let s=[];i.declare&&s.push("declare ");let e=i.accessibility||i.access;return typeof e=="string"&&s.push(e," "),i.static&&s.push("static "),i.override&&s.push("override "),i.abstract&&s.push("abstract "),i.readonly&&s.push("readonly "),s}function wr(i,s,e){let t=i.getNode(),r=t.kind,n=[],a=t.value;Y.FunctionExpression.check(a)||(a=t),n.push(...Wn(t)),a.async&&n.push("async "),a.generator&&n.push("*"),(r==="get"||r==="set")&&n.push(r," ");let o=i.call(e,"key");return t.computed&&(o=x(["[",o,"]"])),n.push(o),t.optional&&n.push("?"),t===a?(n.push(i.call(e,"typeParameters"),"(",Ce(i,s,e),")",i.call(e,"returnType")),t.body?n.push(" ",i.call(e,"body")):n.push(";")):(n.push(i.call(e,"value","typeParameters"),"(",i.call(l=>Ce(l,s,e),"value"),")",i.call(e,"value","returnType")),a.body?n.push(" ",i.call(e,"value","body")):n.push(";")),x(n)}function fn(i,s,e){let t=i.map(e,"arguments"),r=jt(s,"parameters"),n=S(", ").join(t);return n.getLineLength(1)>s.wrapColumn?(n=S(`,
84
+ `;else g="";a.push(Sc(r,p),c),d?r=g:g&&a.push(g)}),x(a)}function Sc(i,s){if(!i&&!s)return S("");if(!i)return S(s);if(!s)return S(i);let e=S(i),t=S(s);return t.length>e.length?t:e}function Kn(i){let s=[];i.declare&&s.push("declare ");let e=i.accessibility||i.access;return typeof e=="string"&&s.push(e," "),i.static&&s.push("static "),i.override&&s.push("override "),i.abstract&&s.push("abstract "),i.readonly&&s.push("readonly "),s}function Cr(i,s,e){let t=i.getNode(),r=t.kind,n=[],a=t.value;Y.FunctionExpression.check(a)||(a=t),n.push(...Kn(t)),a.async&&n.push("async "),a.generator&&n.push("*"),(r==="get"||r==="set")&&n.push(r," ");let o=i.call(e,"key");return t.computed&&(o=x(["[",o,"]"])),n.push(o),t.optional&&n.push("?"),t===a?(n.push(i.call(e,"typeParameters"),"(",Ce(i,s,e),")",i.call(e,"returnType")),t.body?n.push(" ",i.call(e,"body")):n.push(";")):(n.push(i.call(e,"value","typeParameters"),"(",i.call(l=>Ce(l,s,e),"value"),")",i.call(e,"value","returnType")),a.body?n.push(" ",i.call(e,"value","body")):n.push(";")),x(n)}function mn(i,s,e){let t=i.map(e,"arguments"),r=jt(s,"parameters"),n=S(", ").join(t);return n.getLineLength(1)>s.wrapColumn?(n=S(`,
83
85
  `).join(t),x([`(
84
86
  `,n.indent(s.tabWidth),r?`,
85
87
  )`:`
@@ -87,20 +89,20 @@ while`),r.push(" (",i.call(e,"test"),");"),x(r)}case"DoExpression":{let n=i.call
87
89
  `).join(n),jt(s,"parameters")&&!t.rest&&r[r.length-1].type!=="RestElement"?a=x([a,`,
88
90
  `]):a=x([a,`
89
91
  `]),x([`
90
- `,a.indent(s.tabWidth)])):a}function Jn(i,s,e){let t=i.getValue();if(t.assertions&&t.assertions.length>0){let r=[" assert {"],n=i.map(e,"assertions"),a=S(", ").join(n);return a.length>1||a.getLineLength(1)>s.wrapColumn?r.push(`
92
+ `,a.indent(s.tabWidth)])):a}function Hn(i,s,e){let t=i.getValue();if(t.assertions&&t.assertions.length>0){let r=[" assert {"],n=i.map(e,"assertions"),a=S(", ").join(n);return a.length>1||a.getLineLength(1)>s.wrapColumn?r.push(`
91
93
  `,S(`,
92
94
  `).join(n).indent(s.tabWidth),`
93
- }`):r.push(" ",a," }"),x(r)}return S("")}function dn(i,s,e){let t=i.getValue(),r=["export "];t.exportKind&&t.exportKind==="type"&&(t.declaration||r.push("type "));let n=s.objectCurlySpacing;if(Y.Declaration.assert(t),(t.default||t.type==="ExportDefaultDeclaration")&&r.push("default "),t.declaration)r.push(i.call(e,"declaration"));else if(t.specifiers){if(t.specifiers.length===1&&t.specifiers[0].type==="ExportBatchSpecifier")r.push("*");else if(t.specifiers.length===0)r.push("{}");else if(t.specifiers[0].type==="ExportDefaultSpecifier"){let o=[],l=[];if(i.each(function(c){c.getValue().type==="ExportDefaultSpecifier"?o.push(e(c)):l.push(e(c))},"specifiers"),o.forEach((c,u)=>{u>0&&r.push(", "),r.push(c)}),l.length>0){let c=S(", ").join(l);c.getLineLength(1)>s.wrapColumn&&(c=x([S(`,
95
+ }`):r.push(" ",a," }"),x(r)}return S("")}function yn(i,s,e){let t=i.getValue(),r=["export "];t.exportKind&&t.exportKind==="type"&&(t.declaration||r.push("type "));let n=s.objectCurlySpacing;if(Y.Declaration.assert(t),(t.default||t.type==="ExportDefaultDeclaration")&&r.push("default "),t.declaration)r.push(i.call(e,"declaration"));else if(t.specifiers){if(t.specifiers.length===1&&t.specifiers[0].type==="ExportBatchSpecifier")r.push("*");else if(t.specifiers.length===0)r.push("{}");else if(t.specifiers[0].type==="ExportDefaultSpecifier"){let o=[],l=[];if(i.each(function(c){c.getValue().type==="ExportDefaultSpecifier"?o.push(e(c)):l.push(e(c))},"specifiers"),o.forEach((c,u)=>{u>0&&r.push(", "),r.push(c)}),l.length>0){let c=S(", ").join(l);c.getLineLength(1)>s.wrapColumn&&(c=x([S(`,
94
96
  `).join(l).indent(s.tabWidth),","])),o.length>0&&r.push(", "),c.length>1?r.push(`{
95
97
  `,c,`
96
- }`):s.objectCurlySpacing?r.push("{ ",c," }"):r.push("{",c,"}")}}else r.push(n?"{ ":"{",S(", ").join(i.map(e,"specifiers")),n?" }":"}");t.source&&r.push(" from ",i.call(e,"source"),Jn(i,s,e))}let a=x(r);return $t(a)!==";"&&!(t.declaration&&(t.declaration.type==="FunctionDeclaration"||t.declaration.type==="ClassDeclaration"||t.declaration.type==="TSModuleDeclaration"||t.declaration.type==="TSInterfaceDeclaration"||t.declaration.type==="TSEnumDeclaration"))&&(a=x([a,";"])),a}function Ot(i,s){return Nn(i)||s.unshift("declare "),x(s)}function Mt(i,s){return i.call(function(e){let t=e.getValue();return t?t==="plus"?S("+"):t==="minus"?S("-"):s(e):S("")},"variance")}function Ke(i,s){return i.length>1?x([" ",i]):x([`
97
- `,fs(i).indent(s.tabWidth)])}function $t(i){let s=i.lastPos();do{let e=i.charAt(s);if(/\S/.test(e))return e}while(i.prevPos(s))}function mn(i){return $t(i)==="}"}function ls(i){return i.replace(/['"]/g,s=>s==='"'?"'":'"')}function pt(i){let s=_e(i,"value"),e=_e(i,"extra");if(e&&typeof e.raw=="string"&&s==e.rawValue)return e.raw;if(i.type==="Literal"){let t=i.raw;if(typeof t=="string"&&s==t)return t}}function cs(i){return JSON.stringify(i).replace(/[\u2028\u2029]/g,function(s){return"\\u"+s.charCodeAt(0).toString(16)})}function Ft(i,s){switch(Vr.assert(i),s.quote){case"auto":{let e=cs(i),t=ls(cs(ls(i)));return e.length>t.length?t:e}case"single":return ls(cs(ls(i)));case"double":default:return cs(i)}}function fs(i){let s=$t(i);return!s||`
98
- };`.indexOf(s)<0?x([i,";"]):i}function Tc(i,s){return new yc(s).print(i)}var us;function Kn(){if(us)return us;let i=Pc();return us={parse(s,e){return gn.parse(s,{...i,...e})}},us}function Pc(){return{sourceType:"module",strictMode:!1,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,startLine:1,tokens:!0,plugins:["asyncGenerators","bigInt","classPrivateMethods","classPrivateProperties","classProperties","classStaticBlock","decimal","decorators-legacy","doExpressions","dynamicImport","exportDefaultFrom","exportExtensions","exportNamespaceFrom","functionBind","functionSent","importAssertions","importMeta","nullishCoalescingOperator","numericSeparator","objectRestSpread","optionalCatchBinding","optionalChaining",["pipelineOperator",{proposal:"minimal"}],["recordAndTuple",{syntaxType:"hash"}],"throwExpressions","topLevelAwait","v8intrinsic","jsx","typescript"]}}var Sc=Object.defineProperty,Ec=(i,s,e)=>s in i?Sc(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e,yn=(i,s,e)=>(Ec(i,typeof s!="symbol"?s+"":s,e),e),se=class extends Error{constructor(s,e){if(super(""),yn(this,"rawMessage"),yn(this,"options"),this.name="MagicastError",this.rawMessage=s,this.options=e,e?.ast&&e?.code&&e.ast.loc){let{line:t,column:r}=e.ast.loc.start,n=e.code.split(`
98
+ }`):s.objectCurlySpacing?r.push("{ ",c," }"):r.push("{",c,"}")}}else r.push(n?"{ ":"{",S(", ").join(i.map(e,"specifiers")),n?" }":"}");t.source&&r.push(" from ",i.call(e,"source"),Hn(i,s,e))}let a=x(r);return $t(a)!==";"&&!(t.declaration&&(t.declaration.type==="FunctionDeclaration"||t.declaration.type==="ClassDeclaration"||t.declaration.type==="TSModuleDeclaration"||t.declaration.type==="TSInterfaceDeclaration"||t.declaration.type==="TSEnumDeclaration"))&&(a=x([a,";"])),a}function Ot(i,s){return Ln(i)||s.unshift("declare "),x(s)}function Mt(i,s){return i.call(function(e){let t=e.getValue();return t?t==="plus"?S("+"):t==="minus"?S("-"):s(e):S("")},"variance")}function Ke(i,s){return i.length>1?x([" ",i]):x([`
99
+ `,ys(i).indent(s.tabWidth)])}function $t(i){let s=i.lastPos();do{let e=i.charAt(s);if(/\S/.test(e))return e}while(i.prevPos(s))}function gn(i){return $t(i)==="}"}function hs(i){return i.replace(/['"]/g,s=>s==='"'?"'":'"')}function pt(i){let s=_e(i,"value"),e=_e(i,"extra");if(e&&typeof e.raw=="string"&&s==e.rawValue)return e.raw;if(i.type==="Literal"){let t=i.raw;if(typeof t=="string"&&s==t)return t}}function ps(i){return JSON.stringify(i).replace(/[\u2028\u2029]/g,function(s){return"\\u"+s.charCodeAt(0).toString(16)})}function Ft(i,s){switch(qr.assert(i),s.quote){case"auto":{let e=ps(i),t=hs(ps(hs(i)));return e.length>t.length?t:e}case"single":return hs(ps(hs(i)));case"double":default:return ps(i)}}function ys(i){let s=$t(i);return!s||`
100
+ };`.indexOf(s)<0?x([i,";"]):i}function Ec(i,s){return new bc(s).print(i)}var fs;function Xn(){if(fs)return fs;let i=Ac();return fs={parse(s,e){return bn.parse(s,{...i,...e})}},fs}function Ac(){return{sourceType:"module",strictMode:!1,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,startLine:1,tokens:!0,plugins:["asyncGenerators","bigInt","classPrivateMethods","classPrivateProperties","classProperties","classStaticBlock","decimal","decorators-legacy","doExpressions","dynamicImport","exportDefaultFrom","exportExtensions","exportNamespaceFrom","functionBind","functionSent","importAssertions","importMeta","nullishCoalescingOperator","numericSeparator","objectRestSpread","optionalCatchBinding","optionalChaining",["pipelineOperator",{proposal:"minimal"}],["recordAndTuple",{syntaxType:"hash"}],"throwExpressions","topLevelAwait","v8intrinsic","jsx","typescript"]}}var wc=Object.defineProperty,vc=(i,s,e)=>s in i?wc(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e,xn=(i,s,e)=>(vc(i,typeof s!="symbol"?s+"":s,e),e),se=class extends Error{constructor(s,e){if(super(""),xn(this,"rawMessage"),xn(this,"options"),this.name="MagicastError",this.rawMessage=s,this.options=e,e?.ast&&e?.code&&e.ast.loc){let{line:t,column:r}=e.ast.loc.start,n=e.code.split(`
99
101
  `),a=Math.max(0,t-3),o=Math.min(n.length,t+3),l=n.slice(a,o).map((c,u)=>(c=`${(a+u+1).toString().padStart(3," ")} | ${c}`,a+u===t-1&&(c+=`
100
102
  ${" ".repeat(6+r)}^`),c));s+=`
101
103
 
102
104
  ${l.join(`
103
105
  `)}
104
- `}this.message=s}},Ac=new Set(["Literal","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","RegExpLiteral","BigIntLiteral"]),Hn=new Set(["string","number","boolean","bigint","symbol","undefined"]),Z=mt;function wc(i){return/^[$A-Z_a-z][\w$]*$/.test(i)}var $r="__magicast_proxy";function ce(i,s=new Set){if(i===void 0)return Z.identifier("undefined");if(i===null)return Z.literal(null);if(Hn.has(typeof i))return Z.literal(i);if(s.has(i))throw new se("Can not serialize circular reference");if(s.add(i),i[$r])return i.$ast;if(i instanceof RegExp){let e=Z.regExpLiteral(i.source,i.flags);return delete e.extra.raw,e}return i instanceof Set?Z.newExpression(Z.identifier("Set"),[Z.arrayExpression([...i].map(e=>ce(e,s)))]):i instanceof Date?Z.newExpression(Z.identifier("Date"),[Z.literal(i.toISOString())]):i instanceof Map?Z.newExpression(Z.identifier("Map"),[Z.arrayExpression([...i].map(([e,t])=>Z.arrayExpression([ce(e,s),ce(t,s)])))]):Array.isArray(i)?Z.arrayExpression(i.map(e=>ce(e,s))):typeof i=="object"?Z.objectExpression(Object.entries(i).map(([e,t])=>Z.property("init",/^[$A-Z_a-z][\w$]*$/g.test(e)?Z.identifier(e):Z.literal(e),ce(t,s)))):Z.literal(i)}function vc(i,s={}){let e=s;return e[$r]=!0,e.$ast=i,e.$type||(e.$type="object"),e}var Cc={enumerable:!0,configurable:!0};function xe(i,s,e){let t=vc(i,s);return new Proxy({},{ownKeys(){return Object.keys(t).filter(r=>r!==$r&&!r.startsWith("$"))},getOwnPropertyDescriptor(){return Cc},has(r,n){return n in t},...e,get(r,n,a){if(n in t)return t[n];if(e.get)return e.get(r,n,a)},set(r,n,a,o){return n in t?(t[n]=a,!0):e.set?e.set(r,n,a,o):!1}})}var fe=mt,vr=new WeakMap;function Ic(i,s,e){if(vr.has(s))return vr.get(s);let t=xe(s,{get $declaration(){return i},get imported(){return s.type==="ImportDefaultSpecifier"?"default":s.type==="ImportNamespaceSpecifier"?"*":s.imported.type==="Identifier"?s.imported.name:s.imported.value},set imported(r){if(s.type!=="ImportSpecifier")throw new se("Changing import name is not yet implemented");s.imported.type==="Identifier"?s.imported.name=r:s.imported.value=r},get local(){return s.local.name},set local(r){s.local.name=r},get from(){return i.source.value},set from(r){if(r===i.source.value)return;i.specifiers=i.specifiers.filter(a=>a!==s),i.specifiers.length===0&&(e.body=e.body.filter(a=>a!==i));let n=e.body.find(a=>a.type==="ImportDeclaration"&&a.source.value===r);n?n.specifiers.push(s):e.body.unshift(fe.importDeclaration([s],fe.stringLiteral(r)))},toJSON(){return{imported:this.imported,local:this.local,from:this.from}}},{ownKeys(){return["imported","local","from","toJSON"]}});return vr.set(s,t),t}function Nc(i,s){let e=()=>{let a=[];for(let o of i.body)if(o.type==="ImportDeclaration")for(let l of o.specifiers)a.push(Ic(o,l,i));return a},t=(a,o,l)=>{let c=e(),u=c.find(p=>p.local===a),h=o.local||a;if(u)return u.imported=o.imported,u.local=h,u.from=o.from,!0;let f=o.imported==="default"?fe.importDefaultSpecifier(fe.identifier(h)):o.imported==="*"?fe.importNamespaceSpecifier(fe.identifier(h)):fe.importSpecifier(fe.identifier(o.imported),fe.identifier(h)),d=c.find(p=>p.from===o.from)?.$declaration;if(d)d.specifiers.push(f);else if(l==="prepend"||c.length===0)i.body.unshift(fe.importDeclaration([f],fe.stringLiteral(o.from)));else{let p=c.at(-1).$declaration,g=i.body.indexOf(p);i.body.splice(g+1,0,fe.importDeclaration([f],fe.stringLiteral(o.from)))}return!0},r=a=>{let o=e().find(u=>u.local===a);if(!o)return!1;let l=o.$declaration,c=o.$ast;return l.specifiers=l.specifiers.filter(u=>u!==c),l.specifiers.length===0&&(i.body=i.body.filter(u=>u!==l)),!0};return xe(i,{$type:"imports",$add(a){t(a.local||a.imported,a,"prepend")},$prepend(a){t(a.local||a.imported,a,"prepend")},$append(a){t(a.local||a.imported,a,"append")},get $items(){return e()},toJSON(){return e().reduce((a,o)=>(a[o.local]=o,a),{})}},{get(a,o){return e().find(l=>l.local===o)},set(a,o,l){return t(o,l,"prepend")},deleteProperty(a,o){return r(o)},ownKeys(){return e().map(a=>a.local)},has(a,o){return e().some(l=>l.local===o)}})}function As(i,s,e){let t=n=>s[n],r=(n,a)=>{s[n]=a};return xe(i,{$type:"array",push(n){s.push(ce(n))},pop(){return le(s.pop(),e)},unshift(n){s.unshift(ce(n))},shift(){return le(s.shift(),e)},splice(n,a,...o){return s.splice(n,a,...o.map(c=>ce(c))).map(c=>le(c,e))},find(n){return s.map(a=>le(a,e)).find(n)},findIndex(n){return s.map(a=>le(a,e)).findIndex(n)},includes(n){return s.map(a=>le(a,e)).includes(n)},toJSON(){return s.map(n=>le(n,e))}},{get(n,a){if(a==="length")return s.length;if(a===Symbol.iterator)return function*(){for(let c of s)yield le(c,e)};if(typeof a=="symbol")return;let o=+a;if(Number.isNaN(o))return;let l=t(o);if(l)return le(l,e)},set(n,a,o){if(typeof a=="symbol")return!1;let l=+a;return Number.isNaN(l)?!1:(r(l,ce(o)),!0)},deleteProperty(n,a){if(typeof a=="symbol")return!1;let o=+a;return Number.isNaN(o)?!1:(s[o]=ce(void 0),!0)},ownKeys(){return["length",...s.map((n,a)=>a.toString())]}})}function kc(i,s){if("elements"in i)return As(i,i.elements,s)}function Xn(i,s){if(i.type!=="CallExpression")throw new se("Not a function call");function e(r){if(r.type==="Identifier")return r.name;if(r.type==="MemberExpression")return`${e(r.object)}.${e(r.property)}`;throw new se("Not implemented")}let t=As(i,i.arguments,s);return xe(i,{$type:"function-call",$callee:e(i.callee),$args:t},{})}function Lc(i,s){if(i.type!=="ArrowFunctionExpression")throw new se("Not an arrow function expression");let e=As(i,i.params,s);return xe(i,{$type:"arrow-function-expression",$params:e,$body:le(i.body,s)},{})}var Dc=mt;function Oc(i,s){if(!("properties"in i))return;let e=n=>{for(let a of i.properties){if("key"in a&&"name"in a.key&&a.key.name===n)return a.value;if(a.type==="ObjectProperty"&&(a.key.type==="StringLiteral"||a.key.type==="NumericLiteral"||a.key.type==="BooleanLiteral")&&a.key.value.toString()===n)return a.value.value??a.value}},t=(n,a=!1)=>{if("key"in n&&"name"in n.key)return n.key.name;if(n.type==="ObjectProperty"&&(n.key.type==="StringLiteral"||n.key.type==="NumericLiteral"||n.key.type==="BooleanLiteral"))return n.key.value.toString();if(a)throw new se(`Casting "${n.type}" is not supported`,{ast:n,code:s?.$code})},r=(n,a)=>{let o=i.properties.find(l=>t(l)===n);o?o.value=a:wc(n)?i.properties.push({type:"Property",key:{type:"Identifier",name:n},value:a}):i.properties.push({type:"ObjectProperty",key:Dc.stringLiteral(n),value:a})};return xe(i,{$type:"object",toJSON(){return i.properties.reduce((n,a)=>("key"in a&&"name"in a.key&&(n[a.key.name]=le(a.value,s)),n),{})}},{get(n,a){let o=e(a);if(o)return le(o,s)},set(n,a,o){return typeof a!="string"&&(a=String(a)),r(a,ce(o)),!0},deleteProperty(n,a){typeof a!="string"&&(a=String(a));let o=i.properties.findIndex(l=>"key"in l&&"name"in l.key&&l.key.name===a);return o!==-1&&i.properties.splice(o,1),!0},ownKeys(){return i.properties.map(n=>t(n,!0)).filter(Boolean)}})}function Gn(i,s){if(i.type!=="NewExpression")throw new se("Not a new expression");function e(r){if(r.type==="Identifier")return r.name;if(r.type==="MemberExpression")return`${e(r.object)}.${e(r.property)}`;throw new se("Not implemented")}let t=As(i,i.arguments,s);return xe(i,{$type:"new-expression",$callee:e(i.callee),$args:t},{})}function Mc(i){if(i.type!=="Identifier")throw new se("Not an identifier");return xe(i,{$type:"identifier",$name:i.name},{})}function Fc(i){if(i.type!=="LogicalExpression")throw new se("Not a logical expression");return xe(i,{$type:"logicalExpression"},{})}function Bc(i){if(i.type!=="MemberExpression")throw new se("Not a member expression");return xe(i,{$type:"memberExpression"},{})}var Cr=new WeakMap;function le(i,s){if(Hn.has(typeof i))return i;if(Ac.has(i.type))return i.value;if(Cr.has(i))return Cr.get(i);let e;switch(i.type){case"ObjectExpression":{e=Oc(i,s);break}case"ArrayExpression":{e=kc(i,s);break}case"CallExpression":{e=Xn(i,s);break}case"ArrowFunctionExpression":{e=Lc(i,s);break}case"NewExpression":{e=Gn(i,s);break}case"Identifier":{e=Mc(i);break}case"LogicalExpression":{e=Fc(i);break}case"MemberExpression":{e=Bc(i);break}case"TSAsExpression":case"TSSatisfiesExpression":{e=le(i.expression,s);break}default:throw new se(`Casting "${i.type}" is not supported`,{ast:i,code:s?.$code})}return Cr.set(i,e),e}var Bt=mt;function _c(i,s){let e=r=>{let n=r==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(let a of i.body)if(a.type===n){if(r==="default")return a.declaration;if(a.declaration&&"declarations"in a.declaration){let o=a.declaration.declarations[0];if("name"in o.id&&o.id.name===r)return o.init}}},t=(r,n)=>{let a=r==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration",o=ce(n);for(let l of i.body)if(l.type===a){if(r==="default"){l.declaration=o;return}if(l.declaration&&"declarations"in l.declaration){let c=l.declaration.declarations[0];if("name"in c.id&&c.id.name===r){c.init=o;return}}}i.body.push(r==="default"?Bt.exportDefaultDeclaration(o):Bt.exportNamedDeclaration(Bt.variableDeclaration("const",[Bt.variableDeclarator(Bt.identifier(r),o)])))};return xe(i,{$type:"exports"},{get(r,n){let a=e(n);if(a)return le(a,s)},set(r,n,a){return t(n,a),!0},ownKeys(){return i.body.flatMap(r=>r.type==="ExportDefaultDeclaration"?["default"]:r.type==="ExportNamedDeclaration"&&r.declaration&&"declarations"in r.declaration?r.declaration.declarations.map(n=>"name"in n.id?n.id.name:""):[]).filter(Boolean)},deleteProperty(r,n){let a=n==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(let o=0;o<i.body.length;o++){let l=i.body[o];if(l.type===a){if(n==="default")return i.body.splice(o,1),!0;if(l.declaration&&"declarations"in l.declaration){let c=l.declaration.declarations[0];if("name"in c.id&&c.id.name===n)return i.body.splice(o,1),!0}}}return!1}})}function jc(i,s){let e=i.program;if(e.type!=="Program")throw new se(`Cannot proxify ${i.type} as module`);let t={$code:s,$type:"module"},r=xe(e,t,{ownKeys(){return["imports","exports","generate"]}});return t.exports=_c(e,r),t.imports=Nc(e),t.generate=n=>qr(r,n),r}function Qn(i,s={}){let e={wrapColumn:s.wrapColumn===void 0,indent:s.tabWidth===void 0||s.useTabs===void 0,quote:s.quote===void 0,arrowParens:s.arrowParensAlways===void 0,trailingComma:s.trailingComma===void 0},t=2,r=0,n=0,a=0,o=0,l=/(?<doubleQuote>"[^"]+")|(?<singleQuote>'[^']+')|(?<singleParam>\([^),]+\)\s*=>)|(?<trailingComma>,\s*[\]}])/g,c={doubleQuote:0,singleQuote:0,singleParam:0,trailingComma:0},u=(i||"").split(`
105
- `),h=!1;for(let f of u){let d=f.trim();if(d.length!==0){if(e.wrapColumn&&f.length>a&&(a=f.length),e.indent){let p=f.match(/^\s+/)?.[0]||"";p.length>0&&(p.length>0&&p.length<t&&(t=p.length),p[0]===" "?r++:p.length>0&&r--)}if(d.at(-1)===";"?n++:d.length>0&&n--,e.quote||e.arrowParens){let p=d.matchAll(l);for(let g of p)if(g.groups)for(let y in c)g.groups[y]&&c[y]++}e.trailingComma&&((f.startsWith("}")||f.startsWith("]"))&&(h?o++:o--),h=d.endsWith(","))}}return{wrapColumn:a,useTabs:r>0,tabWidth:t,quote:c.singleQuote>c.doubleQuote?"single":"double",arrowParensAlways:c.singleParam>0,trailingComma:o>0||c.trailingComma>0,useSemi:n>0,arrayBracketSpacing:void 0,objectCurlySpacing:void 0,...s}}function Yn(i,s){let e=Bn(i,{parser:s?.parser||Kn(),...s});return jc(e,i)}function Zn(i,s){let e=Bn("("+i+")",{parser:s?.parser||Kn(),...s}),t=e.program.body[0];t.type==="ExpressionStatement"&&(t=t.expression),t.extra?.parenthesized&&(t.extra.parenthesized=!1);let r={$ast:e,$code:" "+i+" ",$type:"module"};return le(t,r)}function qr(i,s={}){let e=i.$ast||i,t=s.format===!1||!("$code"in i)?{}:Qn(i.$code,s.format),{code:r,map:n}=Tc(e,{...s,...t});return{code:r,map:n}}async function Rc(i,s={}){let e=await Ir.readFile(i,"utf8");return s.sourceFileName=s.sourceFileName??i,Yn(e,s)}async function Uc(i,s,e){let t="$ast"in i?i.$ast:i,{code:r,map:n}=qr(t,e);await Ir.writeFile(s,r),n&&await Ir.writeFile(s+".map",n)}var hs=mt,Vc={functionCall(i,...s){let e=hs.callExpression(hs.identifier(i),s.map(t=>ce(t)));return Xn(e)},newExpression(i,...s){let e=hs.newExpression(hs.identifier(i),s.map(t=>ce(t)));return Gn(e)},literal(i){return ce(i)},raw(i){return Zn(i)}};import*as Ie from"@sentry/node";var $c="1.11.43",ea=process.env.OVERRIDE_VERSION??$c;import sa from"prettier";async function ia(i,s){let e=await ra(i,{withFileTypes:!0}),t=[];for(let r of e){let n=V.join(i,r.name);if(r.isDirectory()){if(!s.has(r.name))try{let a=await ia(n,s);t.push(...a)}catch(a){Ie.captureException(a,{tags:{errorType:"filesystem_permission",component:"readdirRecursive"},extra:{directory:n,errorCode:a.code}})}}else t.push(n)}return t}async function ru(i){let s=new Set,e=(...c)=>{if(process.env.DEBUG){let u=new Date,h=`${String(u.getMinutes()).padStart(2,"0")}:${String(u.getSeconds()).padStart(2,"0")}.${String(u.getMilliseconds()).padStart(3,"0")}`;console.debug(h,"[builder-dev-tools]",...c)}},t=async c=>{let u=Xc("md5");return u.update(c),u.digest("hex")},r=V.normalize(V.resolve(process.cwd(),i.cwd)),n=cu(V.normalize(i.cwd))??r,a=uu(V.normalize(i.cwd))??n,o={...V,getCwdDir:()=>r,getRepoRootDir:()=>n,getAppRootDir:()=>a,cwd:()=>process.cwd(),exists:async c=>{try{return await qc(c),!0}catch{return!1}},magicast:zr,existsSync:c=>ie(c),readdir:async(c,u)=>{let h=await ra(c);return u?h.map(f=>V.join(c,f)):h},readdirRecursive:async(c,u)=>ia(c,new Set(u)),readdirSync:c=>Gc(c),readFile:async c=>{try{return await Wc(c,"utf-8")}catch(u){if(u.code==="ENOENT")return null;throw e(u,c),u}},readFileSync(c){try{return ta(c,"utf-8")}catch(u){if(u.code==="ENOENT")return null;throw e(u,c),u}},readFileSyncBuffer(c){try{return new Uint8Array(ta(c,{encoding:null}))}catch(u){if(u.code==="ENOENT")return null;throw e(u,c),u}},spawnSync:yt,stat:async c=>await Jc(c),statSync:c=>Qc(c),unlinkSync:c=>{Yc(c)},unlink:async c=>{await Kc(c)},writeFile:async(c,u)=>{c=V.normalize(c);let h={path:c,basename:V.basename(c),dirname:V.dirname(c),extname:V.extname(c)};await zc(V.dirname(c),{recursive:!0}),await Hc(c,u);for(let f of s)await f(h)},hash:t,getDeviceId:()=>t(`${eu()}:${Zc()}`),formatCode:async(c,u)=>{let h=null;try{h=await sa.resolveConfig(c)}catch{}try{return sa.format(u,{...h,filepath:c})}catch{}return u},on:(c,u)=>{c==="change"&&s.add(u)},off:(c,u)=>{c==="change"&&s.delete(u)},debug:e,launchEditor:async c=>{try{let u=c.filePath;typeof c.line=="number"&&(u+=`:${c.line}`,typeof c.column=="number"&&(u+=`:${c.column}`)),su(u,"code",(h,f)=>{Ie.captureException(new Error(`Failed to launch editor for ${f}`),{extra:{pathFile:h}})})}catch(u){Ie.captureException(new Error("Failed to launch editor",{cause:u}))}},platform:()=>({runtime:"node",os:process.platform}),getRepoInfo:async c=>{let u=V.normalize(c??i.cwd);return{hasGit:au(u),remoteUrl:iu(u),defaultBranch:nu(u),commit:ou(u),currentBranch:lu(u)}},getFrameworks:()=>[],ts:tu,Sentry:Ie,version:ea,sdkVersion:null,ignoreMissingConfig:i.ignoreMissingConfig,kind:null},l=await Yr(o);return o.getFrameworks=()=>l,o}function iu(i){try{return(yt("git",["config","--get","remote.origin.url"],{cwd:i}).stdout||"").toString().trim()}catch(s){return Ie.captureException(new Error("Error getting git remote URL:",{cause:s})),""}}function nu(i){let s="master";try{let e=yt("git",["branch","-r"],{cwd:i});return e.stdout&&e.stdout.toString().trim().split(`
106
- `).map(r=>r.trim()).includes("origin/main")?"main":s}catch(e){return Ie.captureException(new Error("Error getting git default branch name:",{cause:e})),s}}function au(i){try{return(yt("git",["rev-parse","--is-inside-work-tree"],{cwd:i}).stdout||"").toString().trim()==="true"}catch(s){return Ie.captureException(new Error("Error getting git commit:",{cause:s})),!1}}function ou(i){try{return(yt("git",["rev-parse","HEAD"],{cwd:i}).stdout||"").toString().trim()}catch(s){return Ie.captureException(new Error("Error getting git commit:",{cause:s})),""}}function lu(i){try{return(yt("git",["branch","--show-current"],{cwd:i}).stdout||"").toString().trim()}catch(s){return Ie.captureException(new Error("Error getting current branch name:",{cause:s})),""}}function cu(i){let s=V.resolve("/");for(let e=0;e<20;e++){let t=V.join(i,"package.json");if(ie(t))return i;if(i===s)break;i=V.dirname(i)}return null}function uu(i){let s=V.resolve("/");for(let e=0;e<20;e++){if(ie(V.join(i,"builder.config.json"))||ie(V.join(i,"fusion.config.json"))||ie(V.join(i,"package.json"))||ie(V.join(i,"remix.config.js"))||ie(V.join(i,"remix.config.mjs"))||ie(V.join(i,"remix.config.ts"))||ie(V.join(i,"vite.config.js"))||ie(V.join(i,"vite.config.ts"))||ie(V.join(i,"vite.config.mjs"))||ie(V.join(i,"next.config.js"))||ie(V.join(i,"next.config.ts"))||ie(V.join(i,"angular.json"))||ie(V.join(i,"project.json"))||ie(V.join(i,"tsconfig.json")))return i;if(i===s)break;i=V.dirname(i)}return null}export{ru as createDevToolsNodeSys};
106
+ `}this.message=s}},Cc=new Set(["Literal","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","RegExpLiteral","BigIntLiteral"]),Gn=new Set(["string","number","boolean","bigint","symbol","undefined"]),Z=mt;function Ic(i){return/^[$A-Z_a-z][\w$]*$/.test(i)}var zr="__magicast_proxy";function ce(i,s=new Set){if(i===void 0)return Z.identifier("undefined");if(i===null)return Z.literal(null);if(Gn.has(typeof i))return Z.literal(i);if(s.has(i))throw new se("Can not serialize circular reference");if(s.add(i),i[zr])return i.$ast;if(i instanceof RegExp){let e=Z.regExpLiteral(i.source,i.flags);return delete e.extra.raw,e}return i instanceof Set?Z.newExpression(Z.identifier("Set"),[Z.arrayExpression([...i].map(e=>ce(e,s)))]):i instanceof Date?Z.newExpression(Z.identifier("Date"),[Z.literal(i.toISOString())]):i instanceof Map?Z.newExpression(Z.identifier("Map"),[Z.arrayExpression([...i].map(([e,t])=>Z.arrayExpression([ce(e,s),ce(t,s)])))]):Array.isArray(i)?Z.arrayExpression(i.map(e=>ce(e,s))):typeof i=="object"?Z.objectExpression(Object.entries(i).map(([e,t])=>Z.property("init",/^[$A-Z_a-z][\w$]*$/g.test(e)?Z.identifier(e):Z.literal(e),ce(t,s)))):Z.literal(i)}function Nc(i,s={}){let e=s;return e[zr]=!0,e.$ast=i,e.$type||(e.$type="object"),e}var kc={enumerable:!0,configurable:!0};function xe(i,s,e){let t=Nc(i,s);return new Proxy({},{ownKeys(){return Object.keys(t).filter(r=>r!==zr&&!r.startsWith("$"))},getOwnPropertyDescriptor(){return kc},has(r,n){return n in t},...e,get(r,n,a){if(n in t)return t[n];if(e.get)return e.get(r,n,a)},set(r,n,a,o){return n in t?(t[n]=a,!0):e.set?e.set(r,n,a,o):!1}})}var fe=mt,Ir=new WeakMap;function Lc(i,s,e){if(Ir.has(s))return Ir.get(s);let t=xe(s,{get $declaration(){return i},get imported(){return s.type==="ImportDefaultSpecifier"?"default":s.type==="ImportNamespaceSpecifier"?"*":s.imported.type==="Identifier"?s.imported.name:s.imported.value},set imported(r){if(s.type!=="ImportSpecifier")throw new se("Changing import name is not yet implemented");s.imported.type==="Identifier"?s.imported.name=r:s.imported.value=r},get local(){return s.local.name},set local(r){s.local.name=r},get from(){return i.source.value},set from(r){if(r===i.source.value)return;i.specifiers=i.specifiers.filter(a=>a!==s),i.specifiers.length===0&&(e.body=e.body.filter(a=>a!==i));let n=e.body.find(a=>a.type==="ImportDeclaration"&&a.source.value===r);n?n.specifiers.push(s):e.body.unshift(fe.importDeclaration([s],fe.stringLiteral(r)))},toJSON(){return{imported:this.imported,local:this.local,from:this.from}}},{ownKeys(){return["imported","local","from","toJSON"]}});return Ir.set(s,t),t}function Dc(i,s){let e=()=>{let a=[];for(let o of i.body)if(o.type==="ImportDeclaration")for(let l of o.specifiers)a.push(Lc(o,l,i));return a},t=(a,o,l)=>{let c=e(),u=c.find(p=>p.local===a),h=o.local||a;if(u)return u.imported=o.imported,u.local=h,u.from=o.from,!0;let f=o.imported==="default"?fe.importDefaultSpecifier(fe.identifier(h)):o.imported==="*"?fe.importNamespaceSpecifier(fe.identifier(h)):fe.importSpecifier(fe.identifier(o.imported),fe.identifier(h)),d=c.find(p=>p.from===o.from)?.$declaration;if(d)d.specifiers.push(f);else if(l==="prepend"||c.length===0)i.body.unshift(fe.importDeclaration([f],fe.stringLiteral(o.from)));else{let p=c.at(-1).$declaration,g=i.body.indexOf(p);i.body.splice(g+1,0,fe.importDeclaration([f],fe.stringLiteral(o.from)))}return!0},r=a=>{let o=e().find(u=>u.local===a);if(!o)return!1;let l=o.$declaration,c=o.$ast;return l.specifiers=l.specifiers.filter(u=>u!==c),l.specifiers.length===0&&(i.body=i.body.filter(u=>u!==l)),!0};return xe(i,{$type:"imports",$add(a){t(a.local||a.imported,a,"prepend")},$prepend(a){t(a.local||a.imported,a,"prepend")},$append(a){t(a.local||a.imported,a,"append")},get $items(){return e()},toJSON(){return e().reduce((a,o)=>(a[o.local]=o,a),{})}},{get(a,o){return e().find(l=>l.local===o)},set(a,o,l){return t(o,l,"prepend")},deleteProperty(a,o){return r(o)},ownKeys(){return e().map(a=>a.local)},has(a,o){return e().some(l=>l.local===o)}})}function Cs(i,s,e){let t=n=>s[n],r=(n,a)=>{s[n]=a};return xe(i,{$type:"array",push(n){s.push(ce(n))},pop(){return le(s.pop(),e)},unshift(n){s.unshift(ce(n))},shift(){return le(s.shift(),e)},splice(n,a,...o){return s.splice(n,a,...o.map(c=>ce(c))).map(c=>le(c,e))},find(n){return s.map(a=>le(a,e)).find(n)},findIndex(n){return s.map(a=>le(a,e)).findIndex(n)},includes(n){return s.map(a=>le(a,e)).includes(n)},toJSON(){return s.map(n=>le(n,e))}},{get(n,a){if(a==="length")return s.length;if(a===Symbol.iterator)return function*(){for(let c of s)yield le(c,e)};if(typeof a=="symbol")return;let o=+a;if(Number.isNaN(o))return;let l=t(o);if(l)return le(l,e)},set(n,a,o){if(typeof a=="symbol")return!1;let l=+a;return Number.isNaN(l)?!1:(r(l,ce(o)),!0)},deleteProperty(n,a){if(typeof a=="symbol")return!1;let o=+a;return Number.isNaN(o)?!1:(s[o]=ce(void 0),!0)},ownKeys(){return["length",...s.map((n,a)=>a.toString())]}})}function Oc(i,s){if("elements"in i)return Cs(i,i.elements,s)}function Qn(i,s){if(i.type!=="CallExpression")throw new se("Not a function call");function e(r){if(r.type==="Identifier")return r.name;if(r.type==="MemberExpression")return`${e(r.object)}.${e(r.property)}`;throw new se("Not implemented")}let t=Cs(i,i.arguments,s);return xe(i,{$type:"function-call",$callee:e(i.callee),$args:t},{})}function Mc(i,s){if(i.type!=="ArrowFunctionExpression")throw new se("Not an arrow function expression");let e=Cs(i,i.params,s);return xe(i,{$type:"arrow-function-expression",$params:e,$body:le(i.body,s)},{})}var Fc=mt;function Bc(i,s){if(!("properties"in i))return;let e=n=>{for(let a of i.properties){if("key"in a&&"name"in a.key&&a.key.name===n)return a.value;if(a.type==="ObjectProperty"&&(a.key.type==="StringLiteral"||a.key.type==="NumericLiteral"||a.key.type==="BooleanLiteral")&&a.key.value.toString()===n)return a.value.value??a.value}},t=(n,a=!1)=>{if("key"in n&&"name"in n.key)return n.key.name;if(n.type==="ObjectProperty"&&(n.key.type==="StringLiteral"||n.key.type==="NumericLiteral"||n.key.type==="BooleanLiteral"))return n.key.value.toString();if(a)throw new se(`Casting "${n.type}" is not supported`,{ast:n,code:s?.$code})},r=(n,a)=>{let o=i.properties.find(l=>t(l)===n);o?o.value=a:Ic(n)?i.properties.push({type:"Property",key:{type:"Identifier",name:n},value:a}):i.properties.push({type:"ObjectProperty",key:Fc.stringLiteral(n),value:a})};return xe(i,{$type:"object",toJSON(){return i.properties.reduce((n,a)=>("key"in a&&"name"in a.key&&(n[a.key.name]=le(a.value,s)),n),{})}},{get(n,a){let o=e(a);if(o)return le(o,s)},set(n,a,o){return typeof a!="string"&&(a=String(a)),r(a,ce(o)),!0},deleteProperty(n,a){typeof a!="string"&&(a=String(a));let o=i.properties.findIndex(l=>"key"in l&&"name"in l.key&&l.key.name===a);return o!==-1&&i.properties.splice(o,1),!0},ownKeys(){return i.properties.map(n=>t(n,!0)).filter(Boolean)}})}function Yn(i,s){if(i.type!=="NewExpression")throw new se("Not a new expression");function e(r){if(r.type==="Identifier")return r.name;if(r.type==="MemberExpression")return`${e(r.object)}.${e(r.property)}`;throw new se("Not implemented")}let t=Cs(i,i.arguments,s);return xe(i,{$type:"new-expression",$callee:e(i.callee),$args:t},{})}function _c(i){if(i.type!=="Identifier")throw new se("Not an identifier");return xe(i,{$type:"identifier",$name:i.name},{})}function jc(i){if(i.type!=="LogicalExpression")throw new se("Not a logical expression");return xe(i,{$type:"logicalExpression"},{})}function Rc(i){if(i.type!=="MemberExpression")throw new se("Not a member expression");return xe(i,{$type:"memberExpression"},{})}var Nr=new WeakMap;function le(i,s){if(Gn.has(typeof i))return i;if(Cc.has(i.type))return i.value;if(Nr.has(i))return Nr.get(i);let e;switch(i.type){case"ObjectExpression":{e=Bc(i,s);break}case"ArrayExpression":{e=Oc(i,s);break}case"CallExpression":{e=Qn(i,s);break}case"ArrowFunctionExpression":{e=Mc(i,s);break}case"NewExpression":{e=Yn(i,s);break}case"Identifier":{e=_c(i);break}case"LogicalExpression":{e=jc(i);break}case"MemberExpression":{e=Rc(i);break}case"TSAsExpression":case"TSSatisfiesExpression":{e=le(i.expression,s);break}default:throw new se(`Casting "${i.type}" is not supported`,{ast:i,code:s?.$code})}return Nr.set(i,e),e}var Bt=mt;function Uc(i,s){let e=r=>{let n=r==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(let a of i.body)if(a.type===n){if(r==="default")return a.declaration;if(a.declaration&&"declarations"in a.declaration){let o=a.declaration.declarations[0];if("name"in o.id&&o.id.name===r)return o.init}}},t=(r,n)=>{let a=r==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration",o=ce(n);for(let l of i.body)if(l.type===a){if(r==="default"){l.declaration=o;return}if(l.declaration&&"declarations"in l.declaration){let c=l.declaration.declarations[0];if("name"in c.id&&c.id.name===r){c.init=o;return}}}i.body.push(r==="default"?Bt.exportDefaultDeclaration(o):Bt.exportNamedDeclaration(Bt.variableDeclaration("const",[Bt.variableDeclarator(Bt.identifier(r),o)])))};return xe(i,{$type:"exports"},{get(r,n){let a=e(n);if(a)return le(a,s)},set(r,n,a){return t(n,a),!0},ownKeys(){return i.body.flatMap(r=>r.type==="ExportDefaultDeclaration"?["default"]:r.type==="ExportNamedDeclaration"&&r.declaration&&"declarations"in r.declaration?r.declaration.declarations.map(n=>"name"in n.id?n.id.name:""):[]).filter(Boolean)},deleteProperty(r,n){let a=n==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(let o=0;o<i.body.length;o++){let l=i.body[o];if(l.type===a){if(n==="default")return i.body.splice(o,1),!0;if(l.declaration&&"declarations"in l.declaration){let c=l.declaration.declarations[0];if("name"in c.id&&c.id.name===n)return i.body.splice(o,1),!0}}}return!1}})}function Vc(i,s){let e=i.program;if(e.type!=="Program")throw new se(`Cannot proxify ${i.type} as module`);let t={$code:s,$type:"module"},r=xe(e,t,{ownKeys(){return["imports","exports","generate"]}});return t.exports=Uc(e,r),t.imports=Dc(e),t.generate=n=>Wr(r,n),r}function Zn(i,s={}){let e={wrapColumn:s.wrapColumn===void 0,indent:s.tabWidth===void 0||s.useTabs===void 0,quote:s.quote===void 0,arrowParens:s.arrowParensAlways===void 0,trailingComma:s.trailingComma===void 0},t=2,r=0,n=0,a=0,o=0,l=/(?<doubleQuote>"[^"]+")|(?<singleQuote>'[^']+')|(?<singleParam>\([^),]+\)\s*=>)|(?<trailingComma>,\s*[\]}])/g,c={doubleQuote:0,singleQuote:0,singleParam:0,trailingComma:0},u=(i||"").split(`
107
+ `),h=!1;for(let f of u){let d=f.trim();if(d.length!==0){if(e.wrapColumn&&f.length>a&&(a=f.length),e.indent){let p=f.match(/^\s+/)?.[0]||"";p.length>0&&(p.length>0&&p.length<t&&(t=p.length),p[0]===" "?r++:p.length>0&&r--)}if(d.at(-1)===";"?n++:d.length>0&&n--,e.quote||e.arrowParens){let p=d.matchAll(l);for(let g of p)if(g.groups)for(let y in c)g.groups[y]&&c[y]++}e.trailingComma&&((f.startsWith("}")||f.startsWith("]"))&&(h?o++:o--),h=d.endsWith(","))}}return{wrapColumn:a,useTabs:r>0,tabWidth:t,quote:c.singleQuote>c.doubleQuote?"single":"double",arrowParensAlways:c.singleParam>0,trailingComma:o>0||c.trailingComma>0,useSemi:n>0,arrayBracketSpacing:void 0,objectCurlySpacing:void 0,...s}}function ea(i,s){let e=jn(i,{parser:s?.parser||Xn(),...s});return Vc(e,i)}function ta(i,s){let e=jn("("+i+")",{parser:s?.parser||Xn(),...s}),t=e.program.body[0];t.type==="ExpressionStatement"&&(t=t.expression),t.extra?.parenthesized&&(t.extra.parenthesized=!1);let r={$ast:e,$code:" "+i+" ",$type:"module"};return le(t,r)}function Wr(i,s={}){let e=i.$ast||i,t=s.format===!1||!("$code"in i)?{}:Zn(i.$code,s.format),{code:r,map:n}=Ec(e,{...s,...t});return{code:r,map:n}}async function $c(i,s={}){let e=await kr.readFile(i,"utf8");return s.sourceFileName=s.sourceFileName??i,ea(e,s)}async function qc(i,s,e){let t="$ast"in i?i.$ast:i,{code:r,map:n}=Wr(t,e);await kr.writeFile(s,r),n&&await kr.writeFile(s+".map",n)}var ds=mt,zc={functionCall(i,...s){let e=ds.callExpression(ds.identifier(i),s.map(t=>ce(t)));return Qn(e)},newExpression(i,...s){let e=ds.newExpression(ds.identifier(i),s.map(t=>ce(t)));return Yn(e)},literal(i){return ce(i)},raw(i){return ta(i)}};import*as Ie from"@sentry/node";var Wc="1.11.45",sa=process.env.OVERRIDE_VERSION??Wc;import ia from"prettier";async function aa(i,s){let e=await na(i,{withFileTypes:!0}),t=[];for(let r of e){let n=V.join(i,r.name);if(r.isDirectory()){if(!s.has(r.name))try{let a=await aa(n,s);t.push(...a)}catch(a){Ie.captureException(a,{tags:{errorType:"filesystem_permission",component:"readdirRecursive"},extra:{directory:n,errorCode:a.code}})}}else t.push(n)}return t}async function au(i){let s=new Set,e=(...c)=>{if(process.env.DEBUG){let u=new Date,h=`${String(u.getMinutes()).padStart(2,"0")}:${String(u.getSeconds()).padStart(2,"0")}.${String(u.getMilliseconds()).padStart(3,"0")}`;console.debug(h,"[builder-dev-tools]",...c)}},t=async c=>{let u=Yc("md5");return u.update(c),u.digest("hex")},r=V.normalize(V.resolve(process.cwd(),i.cwd)),n=pu(V.normalize(i.cwd))??r,a=fu(V.normalize(i.cwd))??n,o={...V,getCwdDir:()=>r,getRepoRootDir:()=>n,getAppRootDir:()=>a,cwd:()=>process.cwd(),exists:async c=>{try{return await Jc(c),!0}catch{return!1}},magicast:Jr,existsSync:c=>ie(c),readdir:async(c,u)=>{let h=await na(c);return u?h.map(f=>V.join(c,f)):h},readdirRecursive:async(c,u)=>aa(c,new Set(u)),readdirSync:c=>Zc(c),readFile:async c=>{try{return await Hc(c,"utf-8")}catch(u){if(u.code==="ENOENT")return null;throw e(u,c),u}},readFileSync(c){try{return ra(c,"utf-8")}catch(u){if(u.code==="ENOENT")return null;throw e(u,c),u}},readFileSyncBuffer(c){try{return new Uint8Array(ra(c,{encoding:null}))}catch(u){if(u.code==="ENOENT")return null;throw e(u,c),u}},spawnSync:yt,stat:async c=>await Xc(c),statSync:c=>eu(c),unlinkSync:c=>{tu(c)},unlink:async c=>{await Gc(c)},writeFile:async(c,u)=>{c=V.normalize(c);let h={path:c,basename:V.basename(c),dirname:V.dirname(c),extname:V.extname(c)};await Kc(V.dirname(c),{recursive:!0}),await Qc(c,u);for(let f of s)await f(h)},hash:t,getDeviceId:()=>t(`${ru()}:${su()}`),formatCode:async(c,u)=>{let h=null;try{h=await ia.resolveConfig(c)}catch{}try{return ia.format(u,{...h,filepath:c})}catch{}return u},on:(c,u)=>{c==="change"&&s.add(u)},off:(c,u)=>{c==="change"&&s.delete(u)},debug:e,launchEditor:async c=>{try{let u=c.filePath;typeof c.line=="number"&&(u+=`:${c.line}`,typeof c.column=="number"&&(u+=`:${c.column}`)),nu(u,"code",(h,f)=>{Ie.captureException(new Error(`Failed to launch editor for ${f}`),{extra:{pathFile:h}})})}catch(u){Ie.captureException(new Error("Failed to launch editor",{cause:u}))}},platform:()=>({runtime:"node",os:process.platform}),getRepoInfo:async c=>{let u=V.normalize(c??i.cwd);return{hasGit:cu(u),remoteUrl:ou(u),defaultBranch:lu(u),commit:uu(u),currentBranch:hu(u)}},getFrameworks:()=>[],ts:iu,Sentry:Ie,connectionTracker:null,version:sa,sdkVersion:null,ignoreMissingConfig:i.ignoreMissingConfig,kind:null};o.connectionTracker=new Kt(o);let l=await ei(o);return o.getFrameworks=()=>l,o}function ou(i){try{return(yt("git",["config","--get","remote.origin.url"],{cwd:i}).stdout||"").toString().trim()}catch(s){return Ie.captureException(new Error("Error getting git remote URL:",{cause:s})),""}}function lu(i){let s="master";try{let e=yt("git",["branch","-r"],{cwd:i});return e.stdout&&e.stdout.toString().trim().split(`
108
+ `).map(r=>r.trim()).includes("origin/main")?"main":s}catch(e){return Ie.captureException(new Error("Error getting git default branch name:",{cause:e})),s}}function cu(i){try{return(yt("git",["rev-parse","--is-inside-work-tree"],{cwd:i}).stdout||"").toString().trim()==="true"}catch(s){return Ie.captureException(new Error("Error getting git commit:",{cause:s})),!1}}function uu(i){try{return(yt("git",["rev-parse","HEAD"],{cwd:i}).stdout||"").toString().trim()}catch(s){return Ie.captureException(new Error("Error getting git commit:",{cause:s})),""}}function hu(i){try{return(yt("git",["branch","--show-current"],{cwd:i}).stdout||"").toString().trim()}catch(s){return Ie.captureException(new Error("Error getting current branch name:",{cause:s})),""}}function pu(i){let s=V.resolve("/");for(let e=0;e<20;e++){let t=V.join(i,"package.json");if(ie(t))return i;if(i===s)break;i=V.dirname(i)}return null}function fu(i){let s=V.resolve("/");for(let e=0;e<20;e++){if(ie(V.join(i,"builder.config.json"))||ie(V.join(i,"fusion.config.json"))||ie(V.join(i,"package.json"))||ie(V.join(i,"remix.config.js"))||ie(V.join(i,"remix.config.mjs"))||ie(V.join(i,"remix.config.ts"))||ie(V.join(i,"vite.config.js"))||ie(V.join(i,"vite.config.ts"))||ie(V.join(i,"vite.config.mjs"))||ie(V.join(i,"next.config.js"))||ie(V.join(i,"next.config.ts"))||ie(V.join(i,"angular.json"))||ie(V.join(i,"project.json"))||ie(V.join(i,"tsconfig.json")))return i;if(i===s)break;i=V.dirname(i)}return null}export{au as createDevToolsNodeSys};