ui-thing 0.2.0 → 0.2.2

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/dist/index.js CHANGED
@@ -1,113 +1,10 @@
1
1
  #!/usr/bin/env node
2
- var uo=Object.create;var wi=Object.defineProperty;var ho=Object.getOwnPropertyDescriptor;var po=Object.getOwnPropertyNames;var fo=Object.getPrototypeOf,mo=Object.prototype.hasOwnProperty;var ge=(i,s)=>()=>(s||i((s={exports:{}}).exports,s),s.exports);var yo=(i,s,e,t)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of po(s))!mo.call(i,r)&&r!==e&&wi(i,r,{get:()=>s[r],enumerable:!(t=ho(s,r))||t.enumerable});return i};var as=(i,s,e)=>(e=i!=null?uo(fo(i)):{},yo(s||!i||!i.__esModule?wi(e,"default",{value:i,enumerable:!0}):e,i));var Ai=ge(Zs=>{"use strict";var vi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Zs.encode=function(i){if(0<=i&&i<vi.length)return vi[i];throw new TypeError("Must be between 0 and 63: "+i)};Zs.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 sr=ge(tr=>{"use strict";var Ci=Ai(),er=5,Ii=1<<er,Ni=Ii-1,Li=Ii;function bo(i){return i<0?(-i<<1)+1:(i<<1)+0}function xo(i){var s=(i&1)===1,e=i>>1;return s?-e:e}tr.encode=function(s){var e="",t,r=bo(s);do t=r&Ni,r>>>=er,r>0&&(t|=Li),e+=Ci.encode(t);while(r>0);return e};tr.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=Ci.decode(s.charCodeAt(e++)),l===-1)throw new Error("Invalid base64 digit: "+s.charAt(e-1));o=!!(l&Li),l&=Ni,n=n+(l<<a),a+=er}while(o);t.value=xo(n),t.rest=e}});var it=ge(Z=>{"use strict";function To(i,s,e){if(s in i)return i[s];if(arguments.length===3)return e;throw new Error('"'+s+'" is a required argument.')}Z.getArg=To;var Oi=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Po=/^data:.+\,.+$/;function Et(i){var s=i.match(Oi);return s?{scheme:s[1],auth:s[2],host:s[3],port:s[4],path:s[5]}:null}Z.urlParse=Et;function rt(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}Z.urlGenerate=rt;var So=32;function ko(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>So&&s.pop(),n}}var rr=ko(function(s){var e=s,t=Et(s);if(t){if(!t.path)return s;e=t.path}for(var r=Z.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,rt(t)):e});Z.normalize=rr;function Di(i,s){i===""&&(i="."),s===""&&(s=".");var e=Et(s),t=Et(i);if(t&&(i=t.path||"/"),e&&!e.scheme)return t&&(e.scheme=t.scheme),rt(e);if(e||s.match(Po))return s;if(t&&!t.host&&!t.path)return t.host=s,rt(t);var r=s.charAt(0)==="/"?s:rr(i.replace(/\/+$/,"")+"/"+s);return t?(t.path=r,rt(t)):r}Z.join=Di;Z.isAbsolute=function(i){return i.charAt(0)==="/"||Oi.test(i)};function wo(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)}Z.relative=wo;var Mi=(function(){var i=Object.create(null);return!("__proto__"in i)})();function Fi(i){return i}function Eo(i){return _i(i)?"$"+i:i}Z.toSetString=Mi?Fi:Eo;function vo(i){return _i(i)?i.slice(1):i}Z.fromSetString=Mi?Fi:vo;function _i(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 Ao(i,s,e){var t=Ne(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:Ne(i.name,s.name)}Z.compareByOriginalPositions=Ao;function Co(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:Ne(i.name,s.name)}Z.compareByOriginalPositionsNoSource=Co;function Io(i,s,e){var t=i.generatedLine-s.generatedLine;return t!==0||(t=i.generatedColumn-s.generatedColumn,t!==0||e)||(t=Ne(i.source,s.source),t!==0)||(t=i.originalLine-s.originalLine,t!==0)||(t=i.originalColumn-s.originalColumn,t!==0)?t:Ne(i.name,s.name)}Z.compareByGeneratedPositionsDeflated=Io;function No(i,s,e){var t=i.generatedColumn-s.generatedColumn;return t!==0||e||(t=Ne(i.source,s.source),t!==0)||(t=i.originalLine-s.originalLine,t!==0)||(t=i.originalColumn-s.originalColumn,t!==0)?t:Ne(i.name,s.name)}Z.compareByGeneratedPositionsDeflatedNoLine=No;function Ne(i,s){return i===s?0:i===null?1:s===null?-1:i>s?1:-1}function Lo(i,s){var e=i.generatedLine-s.generatedLine;return e!==0||(e=i.generatedColumn-s.generatedColumn,e!==0)||(e=Ne(i.source,s.source),e!==0)||(e=i.originalLine-s.originalLine,e!==0)||(e=i.originalColumn-s.originalColumn,e!==0)?e:Ne(i.name,s.name)}Z.compareByGeneratedPositionsInflated=Lo;function Oo(i){return JSON.parse(i.replace(/^\)]}'[^\n]*\n/,""))}Z.parseSourceMapInput=Oo;function Do(i,s,e){if(s=s||"",i&&(i[i.length-1]!=="/"&&s[0]!=="/"&&(i+="/"),s=i+s),e){var t=Et(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=Di(rt(t),s)}return rr(s)}Z.computeSourceURL=Do});var ar=ge(Bi=>{"use strict";var ir=it(),nr=Object.prototype.hasOwnProperty,We=typeof Map<"u";function Le(){this._array=[],this._set=We?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 We?this._set.size:Object.getOwnPropertyNames(this._set).length};Le.prototype.add=function(s,e){var t=We?s:ir.toSetString(s),r=We?this.has(s):nr.call(this._set,t),n=this._array.length;(!r||e)&&this._array.push(s),r||(We?this._set.set(s,n):this._set[t]=n)};Le.prototype.has=function(s){if(We)return this._set.has(s);var e=ir.toSetString(s);return nr.call(this._set,e)};Le.prototype.indexOf=function(s){if(We){var e=this._set.get(s);if(e>=0)return e}else{var t=ir.toSetString(s);if(nr.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()};Bi.ArraySet=Le});var Ui=ge(Ri=>{"use strict";var ji=it();function Mo(i,s){var e=i.generatedLine,t=s.generatedLine,r=i.generatedColumn,n=s.generatedColumn;return t>e||t==e&&n>=r||ji.compareByGeneratedPositionsInflated(i,s)<=0}function os(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}os.prototype.unsortedForEach=function(s,e){this._array.forEach(s,e)};os.prototype.add=function(s){Mo(this._last,s)?(this._last=s,this._array.push(s)):(this._sorted=!1,this._array.push(s))};os.prototype.toArray=function(){return this._sorted||(this._array.sort(ji.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};Ri.MappingList=os});var or=ge($i=>{"use strict";var vt=sr(),G=it(),ls=ar().ArraySet,Fo=Ui().MappingList;function be(i){i||(i={}),this._file=G.getArg(i,"file",null),this._sourceRoot=G.getArg(i,"sourceRoot",null),this._skipValidation=G.getArg(i,"skipValidation",!1),this._ignoreInvalidMapping=G.getArg(i,"ignoreInvalidMapping",!1),this._sources=new ls,this._names=new ls,this._mappings=new Fo,this._sourcesContents=null}be.prototype._version=3;be.fromSourceMap=function(s,e){var t=s.sourceRoot,r=new be(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=G.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=G.relative(t,n)),r._sources.has(a)||r._sources.add(a);var o=s.sourceContentFor(n);o!=null&&r.setSourceContent(n,o)}),r};be.prototype.addMapping=function(s){var e=G.getArg(s,"generated"),t=G.getArg(s,"original",null),r=G.getArg(s,"source",null),n=G.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}))};be.prototype.setSourceContent=function(s,e){var t=s;this._sourceRoot!=null&&(t=G.relative(this._sourceRoot,t)),e!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[G.toSetString(t)]=e):this._sourcesContents&&(delete this._sourcesContents[G.toSetString(t)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};be.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=G.relative(n,r));var a=new ls,o=new ls;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=G.join(t,l.source)),n!=null&&(l.source=G.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=G.join(t,l)),n!=null&&(l=G.relative(n,l)),this.setSourceContent(l,c))},this)};be.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)}};be.prototype._serializeMappings=function(){for(var s=0,e=1,t=0,r=0,n=0,a=0,o="",l,c,u,h,d=this._mappings.toArray(),f=0,p=d.length;f<p;f++){if(c=d[f],l="",c.generatedLine!==e)for(s=0;c.generatedLine!==e;)l+=";",e++;else if(f>0){if(!G.compareByGeneratedPositionsInflated(c,d[f-1]))continue;l+=","}l+=vt.encode(c.generatedColumn-s),s=c.generatedColumn,c.source!=null&&(h=this._sources.indexOf(c.source),l+=vt.encode(h-a),a=h,l+=vt.encode(c.originalLine-1-r),r=c.originalLine-1,l+=vt.encode(c.originalColumn-t),t=c.originalColumn,c.name!=null&&(u=this._names.indexOf(c.name),l+=vt.encode(u-n),n=u)),o+=l}return o};be.prototype._generateSourcesContent=function(s,e){return s.map(function(t){if(!this._sourcesContents)return null;e!=null&&(t=G.relative(e,t));var r=G.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)};be.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};be.prototype.toString=function(){return JSON.stringify(this.toJSON())};$i.SourceMapGenerator=be});var Vi=ge(He=>{"use strict";He.GREATEST_LOWER_BOUND=1;He.LEAST_UPPER_BOUND=2;function lr(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?lr(a,s,e,t,r,n):n==He.LEAST_UPPER_BOUND?s<t.length?s:-1:a:a-i>1?lr(i,a,e,t,r,n):n==He.LEAST_UPPER_BOUND?a:i<0?-1:i}He.search=function(s,e,t,r){if(e.length===0)return-1;var n=lr(-1,e.length,s,e,t,r||He.GREATEST_LOWER_BOUND);if(n<0)return-1;for(;n-1>=0&&t(e[n],e[n-1],!0)===0;)--n;return n}});var zi=ge(Ki=>{"use strict";function _o(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 d=c+1;t(r,n,a,d-1),t(r,n,d+1,o)}}return t}function Bo(i){let s=_o.toString();return new Function(`return ${s}`)()(i)}var qi=new WeakMap;Ki.quickSort=function(i,s,e=0){let t=qi.get(s);t===void 0&&(t=Bo(s),qi.set(s,t)),t(i,s,e,i.length-1)}});var Ji=ge(cs=>{"use strict";var L=it(),ur=Vi(),nt=ar().ArraySet,jo=sr(),At=zi().quickSort;function H(i,s){var e=i;return typeof i=="string"&&(e=L.parseSourceMapInput(i)),e.sections!=null?new Pe(e,s):new ee(e,s)}H.fromSourceMap=function(i,s){return ee.fromSourceMap(i,s)};H.prototype._version=3;H.prototype.__generatedMappings=null;Object.defineProperty(H.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});H.prototype.__originalMappings=null;Object.defineProperty(H.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});H.prototype._charIsMappingSeparator=function(s,e){var t=s.charAt(e);return t===";"||t===","};H.prototype._parseMappings=function(s,e){throw new Error("Subclasses must implement _parseMappings")};H.GENERATED_ORDER=1;H.ORIGINAL_ORDER=2;H.GREATEST_LOWER_BOUND=1;H.LEAST_UPPER_BOUND=2;H.prototype.eachMapping=function(s,e,t){var r=e||null,n=t||H.GENERATED_ORDER,a;switch(n){case H.GENERATED_ORDER:a=this._generatedMappings;break;case H.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,d=0,f=a.length;d<f;d++){var p=a[d],g=p.source===null?null:u.at(p.source);g!==null&&(g=L.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)})}};H.prototype.allGeneratedPositionsFor=function(s){var e=L.getArg(s,"line"),t={source:L.getArg(s,"source"),originalLine:e,originalColumn:L.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",L.compareByOriginalPositions,ur.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:L.getArg(a,"generatedLine",null),column:L.getArg(a,"generatedColumn",null),lastColumn:L.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++n];else for(var l=a.originalColumn;a&&a.originalLine===e&&a.originalColumn==l;)r.push({line:L.getArg(a,"generatedLine",null),column:L.getArg(a,"generatedColumn",null),lastColumn:L.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++n]}return r};cs.SourceMapConsumer=H;function ee(i,s){var e=i;typeof i=="string"&&(e=L.parseSourceMapInput(i));var t=L.getArg(e,"version"),r=L.getArg(e,"sources"),n=L.getArg(e,"names",[]),a=L.getArg(e,"sourceRoot",null),o=L.getArg(e,"sourcesContent",null),l=L.getArg(e,"mappings"),c=L.getArg(e,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);a&&(a=L.normalize(a)),r=r.map(String).map(L.normalize).map(function(u){return a&&L.isAbsolute(a)&&L.isAbsolute(u)?L.relative(a,u):u}),this._names=nt.fromArray(n.map(String),!0),this._sources=nt.fromArray(r,!0),this._absoluteSources=this._sources.toArray().map(function(u){return L.computeSourceURL(a,u,s)}),this.sourceRoot=a,this.sourcesContent=o,this._mappings=l,this._sourceMapURL=s,this.file=c}ee.prototype=Object.create(H.prototype);ee.prototype.consumer=H;ee.prototype._findSourceIndex=function(i){var s=i;if(this.sourceRoot!=null&&(s=L.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};ee.fromSourceMap=function(s,e){var t=Object.create(ee.prototype),r=t._names=nt.fromArray(s._names.toArray(),!0),n=t._sources=nt.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(f){return L.computeSourceURL(t.sourceRoot,f,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],d=new Hi;d.generatedLine=h.generatedLine,d.generatedColumn=h.generatedColumn,h.source&&(d.source=n.indexOf(h.source),d.originalLine=h.originalLine,d.originalColumn=h.originalColumn,h.name&&(d.name=r.indexOf(h.name)),l.push(d)),o.push(d)}return At(t.__originalMappings,L.compareByOriginalPositions),t};ee.prototype._version=3;Object.defineProperty(ee.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function Hi(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var cr=L.compareByGeneratedPositionsDeflatedNoLine;function Wi(i,s){let e=i.length,t=i.length-s;if(!(t<=1))if(t==2){let r=i[s],n=i[s+1];cr(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(cr(a,o)<=0)break;i[n-1]=o,i[n]=a}else At(i,cr,s)}ee.prototype._parseMappings=function(s,e){var t=1,r=0,n=0,a=0,o=0,l=0,c=s.length,u=0,h={},d={},f=[],p=[],g,y,b,P,I;let T=0;for(;u<c;)if(s.charAt(u)===";")t++,u++,r=0,Wi(p,T),T=p.length;else if(s.charAt(u)===",")u++;else{for(g=new Hi,g.generatedLine=t,P=u;P<c&&!this._charIsMappingSeparator(s,P);P++);for(y=s.slice(u,P),b=[];u<P;)jo.decode(s,u,d),I=d.value,u=d.rest,b.push(I);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 w=g.source;for(;f.length<=w;)f.push(null);f[w]===null&&(f[w]=[]),f[w].push(g)}}Wi(p,T),this.__generatedMappings=p;for(var k=0;k<f.length;k++)f[k]!=null&&At(f[k],L.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...f)};ee.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 ur.search(s,e,n,a)};ee.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}};ee.prototype.originalPositionFor=function(s){var e={generatedLine:L.getArg(s,"line"),generatedColumn:L.getArg(s,"column")},t=this._findMapping(e,this._generatedMappings,"generatedLine","generatedColumn",L.compareByGeneratedPositionsDeflated,L.getArg(s,"bias",H.GREATEST_LOWER_BOUND));if(t>=0){var r=this._generatedMappings[t];if(r.generatedLine===e.generatedLine){var n=L.getArg(r,"source",null);n!==null&&(n=this._sources.at(n),n=L.computeSourceURL(this.sourceRoot,n,this._sourceMapURL));var a=L.getArg(r,"name",null);return a!==null&&(a=this._names.at(a)),{source:n,line:L.getArg(r,"originalLine",null),column:L.getArg(r,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}};ee.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(s){return s==null}):!1};ee.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=L.relative(this.sourceRoot,r));var n;if(this.sourceRoot!=null&&(n=L.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.')};ee.prototype.generatedPositionFor=function(s){var e=L.getArg(s,"source");if(e=this._findSourceIndex(e),e<0)return{line:null,column:null,lastColumn:null};var t={source:e,originalLine:L.getArg(s,"line"),originalColumn:L.getArg(s,"column")},r=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",L.compareByOriginalPositions,L.getArg(s,"bias",H.GREATEST_LOWER_BOUND));if(r>=0){var n=this._originalMappings[r];if(n.source===t.source)return{line:L.getArg(n,"generatedLine",null),column:L.getArg(n,"generatedColumn",null),lastColumn:L.getArg(n,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};cs.BasicSourceMapConsumer=ee;function Pe(i,s){var e=i;typeof i=="string"&&(e=L.parseSourceMapInput(i));var t=L.getArg(e,"version"),r=L.getArg(e,"sections");if(t!=this._version)throw new Error("Unsupported version: "+t);this._sources=new nt,this._names=new nt;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=L.getArg(a,"offset"),l=L.getArg(o,"line"),c=L.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 H(L.getArg(a,"map"),s)}})}Pe.prototype=Object.create(H.prototype);Pe.prototype.constructor=H;Pe.prototype._version=3;Object.defineProperty(Pe.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}});Pe.prototype.originalPositionFor=function(s){var e={generatedLine:L.getArg(s,"line"),generatedColumn:L.getArg(s,"column")},t=ur.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}};Pe.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(s){return s.consumer.hasContentsOfAllSources()})};Pe.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.')};Pe.prototype.generatedPositionFor=function(s){for(var e=0;e<this._sections.length;e++){var t=this._sections[e];if(t.consumer._findSourceIndex(L.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}};Pe.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=L.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)}At(this.__generatedMappings,L.compareByGeneratedPositionsDeflated),At(this.__originalMappings,L.compareByOriginalPositions)};cs.IndexedSourceMapConsumer=Pe});var Gi=ge(Xi=>{"use strict";var Ro=or().SourceMapGenerator,us=it(),Uo=/(\r?\n)/,$o=10,at="$$$isSourceNode$$$";function he(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[at]=!0,t!=null&&this.add(t)}he.fromStringWithSourceMap=function(s,e,t){var r=new he,n=s.split(Uo),a=0,o=function(){var d=p(),f=p()||"";return d+f;function p(){return a<n.length?n[a++]:void 0}},l=1,c=0,u=null;return e.eachMapping(function(d){if(u!==null)if(l<d.generatedLine)h(u,o()),l++,c=0;else{var f=n[a]||"",p=f.substr(0,d.generatedColumn-c);n[a]=f.substr(d.generatedColumn-c),c=d.generatedColumn,h(u,p),u=d;return}for(;l<d.generatedLine;)r.add(o()),l++;if(c<d.generatedColumn){var f=n[a]||"";r.add(f.substr(0,d.generatedColumn)),n[a]=f.substr(d.generatedColumn),c=d.generatedColumn}u=d},this),a<n.length&&(u&&h(u,o()),r.add(n.splice(a).join(""))),e.sources.forEach(function(d){var f=e.sourceContentFor(d);f!=null&&(t!=null&&(d=us.join(t,d)),r.setSourceContent(d,f))}),r;function h(d,f){if(d===null||d.source===void 0)r.add(f);else{var p=t?us.join(t,d.source):d.source;r.add(new he(d.originalLine,d.originalColumn,p,f,d.name))}}};he.prototype.add=function(s){if(Array.isArray(s))s.forEach(function(e){this.add(e)},this);else if(s[at]||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};he.prototype.prepend=function(s){if(Array.isArray(s))for(var e=s.length-1;e>=0;e--)this.prepend(s[e]);else if(s[at]||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};he.prototype.walk=function(s){for(var e,t=0,r=this.children.length;t<r;t++)e=this.children[t],e[at]?e.walk(s):e!==""&&s(e,{source:this.source,line:this.line,column:this.column,name:this.name})};he.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};he.prototype.replaceRight=function(s,e){var t=this.children[this.children.length-1];return t[at]?t.replaceRight(s,e):typeof t=="string"?this.children[this.children.length-1]=t.replace(s,e):this.children.push("".replace(s,e)),this};he.prototype.setSourceContent=function(s,e){this.sourceContents[us.toSetString(s)]=e};he.prototype.walkSourceContents=function(s){for(var e=0,t=this.children.length;e<t;e++)this.children[e][at]&&this.children[e].walkSourceContents(s);for(var r=Object.keys(this.sourceContents),e=0,t=r.length;e<t;e++)s(us.fromSetString(r[e]),this.sourceContents[r[e]])};he.prototype.toString=function(){var s="";return this.walk(function(e){s+=e}),s};he.prototype.toStringWithSourceMap=function(s){var e={code:"",line:1,column:0},t=new Ro(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,d=c.length;h<d;h++)c.charCodeAt(h)===$o?(e.line++,e.column=0,h+1===d?(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}};Xi.SourceNode=he});var hr=ge(hs=>{"use strict";hs.SourceMapGenerator=or().SourceMapGenerator;hs.SourceMapConsumer=Ji().SourceMapConsumer;hs.SourceNode=Gi().SourceNode});var Wr=ge(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});function Vo(i,s){if(i==null)return{};var e={};for(var t in i)if({}.hasOwnProperty.call(i,t)){if(s.indexOf(t)!==-1)continue;e[t]=i[t]}return e}var Ce=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}},ht=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 ne(i,s){let{line:e,column:t,index:r}=i;return new Ce(e,t+s,r+s)}var Yi="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",qo={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Yi},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Yi}},Qi={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"},fs=i=>i.type==="UpdateExpression"?Qi.UpdateExpression[`${i.prefix}`]:Qi[i.type],Ko={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.",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.",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
- - 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 `deprecatedImportAssert` parser 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 }\`?`,ImportCallArity:"`import()` requires exactly 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.",InvalidCoverDiscardElement:"'void' must be followed by an expression when not used in a binding position.",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 ${fs(i)}.`,InvalidLhsBinding:({ancestor:i})=>`Binding invalid left-hand side in ${fs(i)}.`,InvalidLhsOptionalChaining:({ancestor:i})=>`Invalid optional chaining in the left-hand side of ${fs(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` or in the bare case statement.",UnexpectedVoidPattern:"Unexpected void binding.",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.`,VoidPatternCatchClauseParam:"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",VoidPatternInitializer:"A void binding may not have an initializer.",YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},zo={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."},Wo={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:i})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(i)}\`.`},Ho=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),Jo=Object.assign({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 ${fs({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.'}),Xo=["message"];function Zi(i,s,e){Object.defineProperty(i,s,{enumerable:!1,configurable:!0,value:e})}function Go({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),Zi(l,"clone",function(u={}){var h;let{line:d,column:f,index:p}=(h=u.loc)!=null?h:a;return n(new Ce(d,f,p),Object.assign({},o,u.details))}),Zi(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 Ae(i,s){if(Array.isArray(i))return t=>Ae(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=Vo(n,Xo),l=typeof a=="string"?()=>a:a;e[t]=Go(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:t,toMessage:l},s?{syntaxPlugin:s}:{},o))}return e}var m=Object.assign({},Ae(qo),Ae(Ko),Ae(zo),Ae(Wo),Ae`pipelineOperator`(Jo));function Yo(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function Qo(i){let s=Yo();if(i==null)return s;if(i.annexB!=null&&i.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");for(let e of Object.keys(s))i[e]!=null&&(s[e]=i[e]);if(s.startLine===1)i.startIndex==null&&s.startColumn>0?s.startIndex=s.startColumn:i.startColumn==null&&s.startIndex>0&&(s.startColumn=s.startIndex);else if((i.startColumn==null||i.startIndex==null)&&i.startIndex!=null)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");if(s.sourceType==="commonjs"){if(i.allowAwaitOutsideFunction!=null)throw new Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.");if(i.allowReturnOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.");if(i.allowNewTargetOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.")}return s}var{defineProperty:Zo}=Object,en=(i,s)=>{i&&Zo(i,s,{enumerable:!1,value:i[s]})};function Ct(i){return en(i.loc.start,"index"),en(i.loc.end,"index"),i}var el=i=>class extends i{parse(){let e=Ct(super.parse());return this.optionFlags&256&&(e.tokens=e.tokens.map(Ct)),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)}estreeParseChainExpression(e,t){let r=this.startNodeAtNode(e);return r.expression=e,this.finishNodeAt(r,"ChainExpression",t)}directiveToStmt(e){let t=e.value;delete e.value,this.castNodeTo(t,"Literal"),t.raw=t.extra.raw,t.value=t.extra.expressionValue;let r=this.castNodeTo(e,"ExpressionStatement");return r.expression=t,r.directive=t.extra.rawValue,delete t.extra,r}fillOptionalPropertiesForTSESLint(e){}cloneEstreeStringLiteral(e){let{start:t,end:r,loc:n,range:a,raw:o,value:l}=e,c=Object.create(e.constructor.prototype);return c.type="Literal",c.start=t,c.end=r,c.loc=n,c.range=a,c.raw=o,c.value=l,c}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}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,this.castNodeTo(e,"PrivateIdentifier")}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();c.kind=e.kind,c=super.parseMethod(c,t,r,n,a,o,l),delete c.kind;let{typeParameters:u}=e;u&&(delete e.typeParameters,c.typeParameters=u,this.resetStartLocationFromNode(c,u));let h=this.castNodeTo(c,"FunctionExpression");return e.value=h,o==="ClassPrivateMethod"&&(e.computed=!1),o==="ObjectMethod"?(e.kind==="method"&&(e.kind="init"),e.shorthand=!1,this.finishNode(e,"Property")):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")&&this.castNodeTo(t,"PropertyDefinition"),t}parseClassPrivateProperty(...e){let t=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(this.castNodeTo(t,"PropertyDefinition"),t.computed=!1),t}parseClassAccessorProperty(e){let t=super.parseClassAccessorProperty(e);return this.getPluginOption("estree","classFeatures")&&(t.abstract&&this.hasPlugin("typescript")?(delete t.abstract,this.castNodeTo(t,"TSAbstractAccessorProperty")):this.castNodeTo(t,"AccessorProperty")),t}parseObjectProperty(e,t,r,n){let a=super.parseObjectProperty(e,t,r,n);return a&&(a.kind="init",this.castNodeTo(a,"Property")),a}finishObjectProperty(e){return e.kind="init",this.finishNode(e,"Property")}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"){var n,a;this.castNodeTo(r,"ImportExpression"),r.source=r.arguments[0],r.options=(n=r.arguments[1])!=null?n:null,r.attributes=(a=r.arguments[1])!=null?a:null,delete r.arguments,delete r.callee}else r.type==="OptionalCallExpression"?this.castNodeTo(r,"CallExpression"):r.optional=!1;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"&&(this.castNodeTo(n,"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}stopParseSubscript(e,t){let r=super.stopParseSubscript(e,t);return t.optionalChainMember?this.estreeParseChainExpression(r,e.loc.end):r}parseMember(e,t,r,n,a){let o=super.parseMember(e,t,r,n,a);return o.type==="OptionalMemberExpression"?this.castNodeTo(o,"MemberExpression"):o.optional=!1,o}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")}castNodeTo(e,t){let r=super.castNodeTo(e,t);return this.fillOptionalPropertiesForTSESLint(r),r}cloneIdentifier(e){let t=super.cloneIdentifier(e);return this.fillOptionalPropertiesForTSESLint(t),t}cloneStringLiteral(e){return e.type==="Literal"?this.cloneEstreeStringLiteral(e):super.cloneStringLiteral(e)}finishNodeAt(e,t,r){return Ct(super.finishNodeAt(e,t,r))}finishNode(e,t){let r=super.finishNode(e,t);return this.fillOptionalPropertiesForTSESLint(r),r}resetStartLocation(e,t){super.resetStartLocation(e,t),Ct(e)}resetEndLocation(e,t=this.state.lastTokEndLoc){super.resetEndLocation(e,t),Ct(e)}},Xe=class{constructor(s,e){this.token=void 0,this.preserveSpace=void 0,this.token=s,this.preserveSpace=!!e}},R={brace:new Xe("{"),j_oTag:new Xe("<tag"),j_cTag:new Xe("</tag"),j_expr:new Xe("<tag>...</tag>",!0)};R.template=new Xe("`",!0);var _=!0,A=!0,pr=!0,It=!0,Re=!0,tl=!0,gs=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}},Br=new Map;function j(i,s={}){s.keyword=i;let e=O(i,s);return Br.set(i,e),e}function ie(i,s){return O(i,{beforeExpr:_,binop:s})}var Dt=-1,De=[],jr=[],Rr=[],Ur=[],$r=[],Vr=[];function O(i,s={}){var e,t,r,n;return++Dt,jr.push(i),Rr.push((e=s.binop)!=null?e:-1),Ur.push((t=s.beforeExpr)!=null?t:!1),$r.push((r=s.startsExpr)!=null?r:!1),Vr.push((n=s.prefix)!=null?n:!1),De.push(new gs(i,s)),Dt}function B(i,s={}){var e,t,r,n;return++Dt,Br.set(i,Dt),jr.push(i),Rr.push((e=s.binop)!=null?e:-1),Ur.push((t=s.beforeExpr)!=null?t:!1),$r.push((r=s.startsExpr)!=null?r:!1),Vr.push((n=s.prefix)!=null?n:!1),De.push(new gs("name",s)),Dt}var sl={bracketL:O("[",{beforeExpr:_,startsExpr:A}),bracketHashL:O("#[",{beforeExpr:_,startsExpr:A}),bracketBarL:O("[|",{beforeExpr:_,startsExpr:A}),bracketR:O("]"),bracketBarR:O("|]"),braceL:O("{",{beforeExpr:_,startsExpr:A}),braceBarL:O("{|",{beforeExpr:_,startsExpr:A}),braceHashL:O("#{",{beforeExpr:_,startsExpr:A}),braceR:O("}"),braceBarR:O("|}"),parenL:O("(",{beforeExpr:_,startsExpr:A}),parenR:O(")"),comma:O(",",{beforeExpr:_}),semi:O(";",{beforeExpr:_}),colon:O(":",{beforeExpr:_}),doubleColon:O("::",{beforeExpr:_}),dot:O("."),question:O("?",{beforeExpr:_}),questionDot:O("?."),arrow:O("=>",{beforeExpr:_}),template:O("template"),ellipsis:O("...",{beforeExpr:_}),backQuote:O("`",{startsExpr:A}),dollarBraceL:O("${",{beforeExpr:_,startsExpr:A}),templateTail:O("...`",{startsExpr:A}),templateNonTail:O("...${",{beforeExpr:_,startsExpr:A}),at:O("@"),hash:O("#",{startsExpr:A}),interpreterDirective:O("#!..."),eq:O("=",{beforeExpr:_,isAssign:It}),assign:O("_=",{beforeExpr:_,isAssign:It}),slashAssign:O("_=",{beforeExpr:_,isAssign:It}),xorAssign:O("_=",{beforeExpr:_,isAssign:It}),moduloAssign:O("_=",{beforeExpr:_,isAssign:It}),incDec:O("++/--",{prefix:Re,postfix:tl,startsExpr:A}),bang:O("!",{beforeExpr:_,prefix:Re,startsExpr:A}),tilde:O("~",{beforeExpr:_,prefix:Re,startsExpr:A}),doubleCaret:O("^^",{startsExpr:A}),doubleAt:O("@@",{startsExpr:A}),pipeline:ie("|>",0),nullishCoalescing:ie("??",1),logicalOR:ie("||",1),logicalAND:ie("&&",2),bitwiseOR:ie("|",3),bitwiseXOR:ie("^",4),bitwiseAND:ie("&",5),equality:ie("==/!=/===/!==",6),lt:ie("</>/<=/>=",7),gt:ie("</>/<=/>=",7),relational:ie("</>/<=/>=",7),bitShift:ie("<</>>/>>>",8),bitShiftL:ie("<</>>/>>>",8),bitShiftR:ie("<</>>/>>>",8),plusMin:O("+/-",{beforeExpr:_,binop:9,prefix:Re,startsExpr:A}),modulo:O("%",{binop:10,startsExpr:A}),star:O("*",{binop:10}),slash:ie("/",10),exponent:O("**",{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:A}),_if:j("if"),_return:j("return",{beforeExpr:_}),_switch:j("switch"),_throw:j("throw",{beforeExpr:_,prefix:Re,startsExpr:A}),_try:j("try"),_var:j("var"),_const:j("const"),_with:j("with"),_new:j("new",{beforeExpr:_,startsExpr:A}),_this:j("this",{startsExpr:A}),_super:j("super",{startsExpr:A}),_class:j("class",{startsExpr:A}),_extends:j("extends",{beforeExpr:_}),_export:j("export"),_import:j("import",{startsExpr:A}),_null:j("null",{startsExpr:A}),_true:j("true",{startsExpr:A}),_false:j("false",{startsExpr:A}),_typeof:j("typeof",{beforeExpr:_,prefix:Re,startsExpr:A}),_void:j("void",{beforeExpr:_,prefix:Re,startsExpr:A}),_delete:j("delete",{beforeExpr:_,prefix:Re,startsExpr:A}),_do:j("do",{isLoop:pr,beforeExpr:_}),_for:j("for",{isLoop:pr}),_while:j("while",{isLoop:pr}),_as:B("as",{startsExpr:A}),_assert:B("assert",{startsExpr:A}),_async:B("async",{startsExpr:A}),_await:B("await",{startsExpr:A}),_defer:B("defer",{startsExpr:A}),_from:B("from",{startsExpr:A}),_get:B("get",{startsExpr:A}),_let:B("let",{startsExpr:A}),_meta:B("meta",{startsExpr:A}),_of:B("of",{startsExpr:A}),_sent:B("sent",{startsExpr:A}),_set:B("set",{startsExpr:A}),_source:B("source",{startsExpr:A}),_static:B("static",{startsExpr:A}),_using:B("using",{startsExpr:A}),_yield:B("yield",{startsExpr:A}),_asserts:B("asserts",{startsExpr:A}),_checks:B("checks",{startsExpr:A}),_exports:B("exports",{startsExpr:A}),_global:B("global",{startsExpr:A}),_implements:B("implements",{startsExpr:A}),_intrinsic:B("intrinsic",{startsExpr:A}),_infer:B("infer",{startsExpr:A}),_is:B("is",{startsExpr:A}),_mixins:B("mixins",{startsExpr:A}),_proto:B("proto",{startsExpr:A}),_require:B("require",{startsExpr:A}),_satisfies:B("satisfies",{startsExpr:A}),_keyof:B("keyof",{startsExpr:A}),_readonly:B("readonly",{startsExpr:A}),_unique:B("unique",{startsExpr:A}),_abstract:B("abstract",{startsExpr:A}),_declare:B("declare",{startsExpr:A}),_enum:B("enum",{startsExpr:A}),_module:B("module",{startsExpr:A}),_namespace:B("namespace",{startsExpr:A}),_interface:B("interface",{startsExpr:A}),_type:B("type",{startsExpr:A}),_opaque:B("opaque",{startsExpr:A}),name:O("name",{startsExpr:A}),placeholder:O("%%",{startsExpr:A}),string:O("string",{startsExpr:A}),num:O("num",{startsExpr:A}),bigint:O("bigint",{startsExpr:A}),decimal:O("decimal",{startsExpr:A}),regexp:O("regexp",{startsExpr:A}),privateName:O("#name",{startsExpr:A}),eof:O("eof"),jsxName:O("jsxName"),jsxText:O("jsxText",{beforeExpr:_}),jsxTagStart:O("jsxTagStart",{startsExpr:A}),jsxTagEnd:O("jsxTagEnd")};function $(i){return i>=93&&i<=133}function rl(i){return i<=92}function Se(i){return i>=58&&i<=133}function dn(i){return i>=58&&i<=137}function il(i){return Ur[i]}function Lt(i){return $r[i]}function nl(i){return i>=29&&i<=33}function tn(i){return i>=129&&i<=131}function al(i){return i>=90&&i<=92}function qr(i){return i>=58&&i<=92}function ol(i){return i>=39&&i<=59}function ll(i){return i===34}function cl(i){return Vr[i]}function ul(i){return i>=121&&i<=123}function hl(i){return i>=124&&i<=130}function Ve(i){return jr[i]}function ms(i){return Rr[i]}function pl(i){return i===57}function bs(i){return i>=24&&i<=25}function Oe(i){return De[i]}De[8].updateContext=i=>{i.pop()},De[5].updateContext=De[7].updateContext=De[23].updateContext=i=>{i.push(R.brace)},De[22].updateContext=i=>{i[i.length-1]===R.template?i.pop():i.push(R.template)},De[143].updateContext=i=>{i.push(R.j_expr,R.j_oTag)};var Kr="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",fn="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",dl=new RegExp("["+Kr+"]"),fl=new RegExp("["+Kr+fn+"]");Kr=fn=null;var mn=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],ml=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function gr(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&&dl.test(String.fromCharCode(i)):gr(i,mn)}function lt(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&&fl.test(String.fromCharCode(i)):gr(i,mn)||gr(i,ml)}var zr={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"]},yl=new Set(zr.keyword),gl=new Set(zr.strict),bl=new Set(zr.strictBind);function yn(i,s){return s&&i==="await"||i==="enum"}function gn(i,s){return yn(i,s)||gl.has(i)}function bn(i){return bl.has(i)}function xn(i,s){return gn(i,s)||bn(i)}function xl(i){return yl.has(i)}function Tl(i,s,e){return i===64&&s===64&&Me(e)}var Pl=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 Sl(i){return Pl.has(i)}var Mt=class{constructor(s){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=s}},Ft=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 allowNewTarget(){return(this.currentThisScopeFlags()&512)>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&1731)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(s){return new Mt(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&1667));--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&1667)return e}}currentThisScopeFlags(){for(let s=this.scopeStack.length-1;;s--){let{flags:e}=this.scopeStack[s];if(e&1731&&!(e&4))return e}}},br=class extends Mt{constructor(...s){super(...s),this.declareFunctions=new Set}},xr=class extends Ft{createScope(s){return new br(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)}},kl=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),M=Ae`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 wl(i){return i.type==="DeclareExportAllDeclaration"||i.type==="DeclareExportDeclaration"&&(!i.declaration||i.declaration.type!=="TypeAlias"&&i.declaration.type!=="InterfaceDeclaration")}function sn(i){return i.importKind==="type"||i.importKind==="typeof"}var El={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function vl(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 Al=/\*?\s*@((?:no)?flow)\b/,Cl=i=>class extends i{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return xr}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,t){e!==134&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,t)}addComment(e){if(this.flowPragma===void 0){let t=Al.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(M.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(M.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(134)?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(M.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(o)):(this.expectContextual(125,M.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=>{wl(o)?(n==="CommonJS"&&this.raise(M.AmbiguousDeclareModuleKind,o),n="ES"):o.type==="DeclareModuleExports"&&(a&&this.raise(M.DuplicateDeclareModuleExports,o),n==="ES"&&this.raise(M.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(M.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:r,suggestion:El[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.default=!1,delete e.exportKind,this.castNodeTo(e,"DeclareExportDeclaration")):this.castNodeTo(e,"DeclareExportAllDeclaration");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 this.castNodeTo(t,"DeclareTypeAlias"),t}flowParseDeclareOpaqueType(e){this.next();let t=this.flowParseOpaqueType(e,!0);return this.castNodeTo(t,"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(M.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,t,r){kl.has(e)&&this.raise(r?M.AssignReservedType:M.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(M.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(143)?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")}flowInTopLevelContext(e){if(this.curContext()!==R.brace){let t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}else return e()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===47)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let e=this.startNode(),t=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{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);this.state.noAnonFunctionType=r}),this.state.inType=t,!this.state.inType&&this.curContext()===R.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return;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(135)||this.match(134)?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 f=!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(),f=!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,f))):l.indexers.push(this.flowParseObjectTypeIndexer(y,f,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,f));else{let P="init";if(this.isContextual(99)||this.isContextual(104)){let T=this.lookahead();dn(T.type)&&(P=this.state.value,this.next())}let I=this.flowParseObjectTypeProperty(y,f,p,b,P,r,a??!u);I===null?(h=!0,g=this.state.lastTokStartLoc):l.properties.push(I)}this.flowObjectTypeSemicolon(),g&&!this.match(8)&&!this.match(9)&&this.raise(M.UnexpectedExplicitInexactInObject,g)}this.expect(c),r&&(l.inexact=h);let d=this.finishNode(l,"ObjectTypeAnnotation");return this.state.inType=o,d}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(M.InexactInsideExact,this.state.lastTokStartLoc):this.raise(M.InexactInsideNonObject,this.state.lastTokStartLoc),n&&this.raise(M.InexactVariance,n),null):(o||this.raise(M.UnexpectedSpreadType,this.state.lastTokStartLoc),r!=null&&this.unexpected(r),n&&this.raise(M.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(M.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"?M.GetterMayNotHaveThisParam:M.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){e??(e=this.state.startLoc);let r=t||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let n=this.startNodeAt(e);n.qualification=r,n.id=this.flowParseRestrictedIdentifier(!0),r=this.finishNode(n,"QualifiedTypeIdentifier")}return r}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(M.ThisParamMustBeFirst,a),t=this.parseIdentifier(l),this.eat(17)&&(r=!0,l&&this.raise(M.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($(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 134: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(135))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",t);if(this.match(136))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",t);throw this.raise(M.UnexpectedSubtractionOperand,this.state.startLoc)}this.unexpected();return;case 135:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 136: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(qr(this.state.type)){let l=Ve(this.state.type);return this.next(),super.createIdentifier(t,l)}else if($(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(Se(r.type)){let n=this.startNode();return this.next(),this.flowParseInterface(n)}}else if(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)||$(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if($(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 e===126||tn(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===126||tn(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(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 d=this.lookaheadCharCode();if(d===44||d===61||d===58||d===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 d=[...a];if(h.length>0){this.state=n,this.state.noArrowAt=d;for(let f=0;f<h.length;f++)d.push(h[f].start);({consequent:l,failed:c}=this.tryParseConditionalConsequent()),[u,h]=this.getArrowLikeExpressions(l)}c&&u.length>1&&this.raise(M.AmbiguousConditionalArrow,n.startLoc),c&&u.length===1&&(this.state=n,d.push(u[0].start),this.state.noArrowAt=d,{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,[]]):vl(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(518),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,t){let r;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(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.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(M.DeclareClassElement,n):t.value&&this.raise(M.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):Tl(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(M.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(M.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(M.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)||this.match(51))&&(e.superTypeParameters=this.flowParseTypeParameterInstantiationInExpression()),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(M.GetterMayNotHaveThisParam,r):this.isThisParam(r)&&this.raise(M.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}parseFunctionParamType(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(M.PatternIsOptional,e),this.isThisParam(e)&&this.raise(M.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(M.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(M.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(M.TypeBeforeInitializer,r.typeAnnotation),r}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(M.ImportReflectionHasImportType,e.specifiers[0].loc.start)}parseImportSpecifierLocal(e,t,r){t.local=sn(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&&!Se(this.state.type)?(e.imported=h,e.importKind=l,e.local=this.cloneIdentifier(h)):(e.imported=o,e.importKind=null,e.local=this.parseIdentifier())}else{if(l!==null&&Se(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=this.cloneIdentifier(e.imported))}let u=sn(e);return r&&u&&this.raise(M.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(143)||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===R.j_oTag||u===R.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(d=>{var f;c=this.flowParseTypeParameterDeclaration();let p=this.forwardNoArrowParamsConversionAt(c,()=>{let y=super.parseMaybeAssign(e,t);return this.resetStartLocationFromNode(y,c),y});(f=p.extra)!=null&&f.parenthesized&&d();let g=this.maybeUnwrapTypeCastExpression(p);return g.type!=="ArrowFunctionExpression"&&d(),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(M.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(M.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(this.offsetToSourcePos(e.start))?e.params=t:super.setArrowFunctionParameters(e,t)}checkParams(e,t,r,n=!0){if(!(r&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let a=0;a<e.params.length;a++)this.isThisParam(e.params[a])&&a>0&&this.raise(M.ThisParamMustBeFirst,e.params[a]);super.checkParams(e,t,r,n)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(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(),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.flowParseTypeParameterInstantiationInExpression(),this.expect(10),a.arguments=this.parseCallExpressionArguments(),a.optional=!0,this.finishCallExpression(a,!0)}else if(!r&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){let a=this.startNodeAt(t);a.callee=e;let o=this.tryParse(()=>(a.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),a.arguments=super.parseCallExpressionArguments(),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(M.UnterminatedFlowComment,this.state.curPosition()),r}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(M.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(M.EnumBooleanMemberNotInitialized,e,{memberName:r,enumName:t})}flowEnumErrorInvalidMemberInitializer(e,t){return this.raise(t.explicitType?t.explicitType==="symbol"?M.EnumInvalidMemberInitializerSymbolType:M.EnumInvalidMemberInitializerPrimaryType:M.EnumInvalidMemberInitializerUnknownType,e,t)}flowEnumErrorNumberMemberNotInitialized(e,t){this.raise(M.EnumNumberMemberNotInitialized,e,t)}flowEnumErrorStringMemberInconsistentlyInitialized(e,t){this.raise(M.EnumStringMemberInconsistentlyInitialized,e,t)}flowEnumMemberInit(){let e=this.state.startLoc,t=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{let r=this.parseNumericLiteral(this.state.value);return t()?{type:"number",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 134:{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(M.EnumInvalidMemberName,l,{memberName:u,suggestion:u[0].toUpperCase()+u.slice(1),enumName:e}),r.has(u)&&this.raise(M.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(!$(this.state.type))throw this.raise(M.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:t}=this.state;return this.next(),t!=="boolean"&&t!=="number"&&t!=="string"&&t!=="symbol"&&this.raise(M.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,d=o.stringMembers.length,f=o.defaultedMembers.length;if(!u&&!h&&!d&&!f)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&&!d&&u>=f){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&&!d&&h>=f){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(M.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")}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}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}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}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},Il={__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"},Nl=/\r\n|[\r\n\u2028\u2029]/,ps=new RegExp(Nl.source,"g");function ct(i){switch(i){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function rn(i,s,e){for(let t=s;t<e;t++)if(ct(i.charCodeAt(t)))return!0;return!1}var dr=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,fr=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function Ll(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 Je=Ae`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 Ue(i){return i?i.type==="JSXOpeningFragment"||i.type==="JSXClosingFragment":!1}function ot(i){if(i.type==="JSXIdentifier")return i.name;if(i.type==="JSXNamespacedName")return i.namespace.name+":"+i.name.name;if(i.type==="JSXMemberExpression")return ot(i.object)+"."+ot(i.property);throw new Error("Node had unexpected type: "+i.type)}var Ol=i=>class extends i{jsxReadToken(){let e="",t=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(Je.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(143)):super.getTokenFromCode(r);return}e+=this.input.slice(t,this.state.pos),this.finishToken(142,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:ct(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?`
5
- `:`\r
6
- `):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):ct(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(134,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=Il[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(lt(e)||e===45);this.finishToken(141,this.input.slice(t,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(141)?e.name=this.state.value:qr(this.state.type)?e.name=Ve(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(R.brace),this.next(),e=this.jsxParseExpressionContainer(e,R.j_oTag),e.expression.type==="JSXEmptyExpression"&&this.raise(Je.AttributeIsEmpty,e),e;case 143:case 134:return this.parseExprAtom();default:throw this.raise(Je.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(R.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(R.brace),this.next(),this.expect(21),e.argument=this.parseMaybeAssignAllowIn(),this.setContext(R.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(144)?this.finishNode(t,"JSXOpeningFragment"):(t.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(t))}jsxParseOpeningElementAfterName(e){let t=[];for(;!this.match(56)&&!this.match(144);)t.push(this.jsxParseAttribute());return e.attributes=t,e.selfClosing=this.eat(56),this.expect(144),this.finishNode(e,"JSXOpeningElement")}jsxParseClosingElementAt(e){let t=this.startNodeAt(e);return this.eat(144)?this.finishNode(t,"JSXClosingFragment"):(t.name=this.jsxParseElementName(),this.expect(144),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 143:if(e=this.state.startLoc,this.next(),this.eat(56)){a=this.jsxParseClosingElementAt(e);break e}r.push(this.jsxParseElementAt(e));break;case 142:r.push(this.parseLiteral(this.state.value,"JSXText"));break;case 5:{let o=this.startNode();this.setContext(R.brace),this.next(),this.match(21)?r.push(this.jsxParseSpreadChild(o)):r.push(this.jsxParseExpressionContainer(o,R.j_expr));break}default:this.unexpected()}Ue(n)&&!Ue(a)&&a!==null?this.raise(Je.MissingClosingTagFragment,a):!Ue(n)&&Ue(a)?this.raise(Je.MissingClosingTagElement,a,{openingTagName:ot(n.name)}):!Ue(n)&&!Ue(a)&&ot(a.name)!==ot(n.name)&&this.raise(Je.MissingClosingTagElement,a,{openingTagName:ot(n.name)})}if(Ue(n)?(t.openingFragment=n,t.closingFragment=a):(t.openingElement=n,t.closingElement=a),t.children=r,this.match(47))throw this.raise(Je.UnwrappedAdjacentJSXElements,this.state.startLoc);return Ue(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(143)?this.jsxParseElement():this.match(47)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(143),this.jsxParseElement()):super.parseExprAtom(e)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(e){let t=this.curContext();if(t===R.j_expr){this.jsxReadToken();return}if(t===R.j_oTag||t===R.j_cTag){if(Me(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(144);return}if((e===34||e===39)&&t===R.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(143);return}super.getTokenFromCode(e)}updateContext(e){let{context:t,type:r}=this.state;if(r===56&&e===143)t.splice(-2,2,R.j_cTag),this.state.canStartJSXElement=!1;else if(r===143)t.push(R.j_oTag);else if(r===144){let n=t[t.length-1];n===R.j_oTag&&e===56||n===R.j_cTag?(t.pop(),this.state.canStartJSXElement=t[t.length-1]===R.j_expr):(this.setContext(R.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=il(r)}},Tr=class extends Mt{constructor(...s){super(...s),this.tsNames=new Map}},Pr=class extends Ft{constructor(...s){super(...s),this.importsStack=[]}createScope(s){return this.importsStack.push(new Set),new Tr(s)}enter(s){s===1024&&this.importsStack.push(new Set),super.enter(s)}exit(){let s=super.exit();return s===1024&&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)}},Sr=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 ys(i,s){return(i?2:0)|(s?1:0)}var kr=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}sourceToOffsetPos(s){return s+this.startIndex}offsetToSourcePos(s){return s-this.startIndex}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 Tn(i,s){i.trailingComments===void 0?i.trailingComments=s:i.trailingComments.unshift(...s)}function Dl(i,s){i.leadingComments===void 0?i.leadingComments=s:i.leadingComments.unshift(...s)}function _t(i,s){i.innerComments===void 0?i.innerComments=s:i.innerComments.unshift(...s)}function $e(i,s,e){let t=null,r=s.length;for(;t===null&&r>0;)t=s[--r];t===null||t.start>e.start?_t(i,e.comments):Tn(t,e.comments)}var wr=class extends kr{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){var e;let{comments:t}=s;if(s.leadingNode!==null||s.trailingNode!==null)s.leadingNode!==null&&Tn(s.leadingNode,t),s.trailingNode!==null&&Dl(s.trailingNode,t);else{let{containingNode:r,start:n}=s;if(this.input.charCodeAt(this.offsetToSourcePos(n)-1)===44)switch(r.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":$e(r,r.properties,s);break;case"CallExpression":case"OptionalCallExpression":$e(r,r.arguments,s);break;case"ImportExpression":$e(r,[r.source,(e=r.options)!=null?e:null],s);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":$e(r,r.params,s);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":$e(r,r.elements,s);break;case"ExportNamedDeclaration":case"ImportDeclaration":$e(r,r.specifiers,s);break;case"TSEnumDeclaration":$e(r,r.members,s);break;case"TSEnumBody":$e(r,r.members,s);break;default:_t(r,t)}else _t(r,t)}}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)}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}}},Er=class i{constructor(){this.flags=1024,this.startIndex=void 0,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=140,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.context=[R.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,startIndex:t,startLine:r,startColumn:n}){this.strict=s===!1?!1:s===!0?!0:e==="module",this.startIndex=t,this.curLine=r,this.lineStart=-n,this.startLoc=this.endLoc=new Ce(r,n,t)}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 Ce(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let s=new i;return s.flags=this.flags,s.startIndex=this.startIndex,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}},Ml=function(s){return s>=48&&s<=57},nn={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},ds={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 an(i,s,e,t,r,n){let a=e,o=t,l=r,c="",u=null,h=e,{length:d}=s;for(;;){if(e>=d){n.unterminated(a,o,l),c+=s.slice(h,e);break}let f=s.charCodeAt(e);if(Fl(i,f,s,e)){c+=s.slice(h,e);break}if(f===92){c+=s.slice(h,e);let p=_l(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 f===8232||f===8233?(++e,++r,t=e):f===10||f===13?i==="template"?(c+=s.slice(h,e)+`
7
- `,++e,f===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 Fl(i,s,e,t){return i==="template"?s===96||s===36&&e.charCodeAt(t+1)===123:s===(i==="double"?34:39)}function _l(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(`
8
- `);case 114:return o("\r");case 120:{let c;return{code:c,pos:s}=vr(i,s,e,t,2,!1,a,n),o(c===null?null:String.fromCharCode(c))}case 117:{let c;return{code:c,pos:s}=Sn(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],d=parseInt(h,8);d>255&&(h=h.slice(0,-1),d=parseInt(h,8)),s+=h.length-1;let f=i.charCodeAt(s);if(h!=="0"||f===56||f===57){if(r)return o(null);n.strictNumericEscape(c,e,t)}return o(String.fromCharCode(d))}return o(String.fromCharCode(l))}}function vr(i,s,e,t,r,n,a,o){let l=s,c;return{n:c,pos:s}=Pn(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 Pn(i,s,e,t,r,n,a,o,l,c){let u=s,h=r===16?nn.hex:nn.decBinOct,d=r===16?ds.hex:r===10?ds.dec:r===8?ds.oct:ds.bin,f=!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 I=i.charCodeAt(s-1),T=i.charCodeAt(s+1);if(o){if(Number.isNaN(T)||!d(T)||h.has(I)||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:Ml(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,f=!0;else break}++s,p=p*r+P}return s===u||n!=null&&s-u!==n||f?{n:null,pos:s}:{n:p,pos:s}}function Sn(i,s,e,t,r,n){let a=i.charCodeAt(s),o;if(a===123){if(++s,{code:o,pos:s}=vr(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}=vr(i,s,e,t,4,!1,r,n));return{code:o,pos:s}}function Nt(i,s,e){return new Ce(e,i-s,i)}var Bl=new Set([103,109,115,105,121,117,100,118]),ve=class{constructor(s){let e=s.startIndex||0;this.type=s.type,this.value=s.value,this.start=e+s.start,this.end=e+s.end,this.loc=new ht(s.startLoc,s.endLoc)}},Ar=class extends wr{constructor(s,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(t,r,n,a)=>this.optionFlags&2048?(this.raise(m.InvalidDigit,Nt(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,Nt(t,r,n))},unterminated:(t,r,n)=>{throw this.raise(m.UnterminatedString,Nt(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,Nt(t,r,n))}}),this.state=new Er,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.optionFlags&256&&this.pushToken(new ve(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 dr.lastIndex=s,dr.test(this.input)?dr.lastIndex:s}lookaheadCharCode(){return this.lookaheadCharCodeSince(this.state.pos)}lookaheadCharCodeSince(s){return this.input.charCodeAt(this.nextTokenStartSince(s))}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(s){return fr.lastIndex=s,fr.test(this.input)?fr.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(140);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,ps.lastIndex=t+2;ps.test(this.input)&&ps.lastIndex<=r;)++this.state.curLine,this.state.lineStart=ps.lastIndex;if(this.isLookahead)return;let n={type:"CommentBlock",value:this.input.slice(t+2,r),start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(r+s.length),loc:new ht(e,this.state.curPosition())};return this.optionFlags&256&&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(;!ct(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:this.sourceToOffsetPos(e),end:this.sourceToOffsetPos(n),loc:new ht(t,this.state.curPosition())};return this.optionFlags&256&&this.pushToken(o),o}skipSpace(){let s=this.state.pos,e=this.optionFlags&4096?[]:null;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),e?.push(r));break}case 47:{let r=this.skipLineComment(2);r!==void 0&&(this.addComment(r),e?.push(r));break}default:break e}break;default:if(Ll(t))++this.state.pos;else if(t===45&&!this.inModule&&this.optionFlags&8192){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),e?.push(n))}else break e}else if(t===60&&!this.inModule&&this.optionFlags&8192){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),e?.push(n))}else break e}else break e}}if(e?.length>0){let t=this.state.pos,r={start:this.sourceToOffsetPos(s),end:this.sourceToOffsetPos(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(139,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(139,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;!ct(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,ne(s,1));let c=this.input.charCodeAt(n);if(ct(c))throw this.raise(m.UnterminatedRegExp,ne(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=()=>ne(s,n+2-e);for(;n<this.length;){let c=this.codePointAtPos(n),u=String.fromCharCode(c);if(Bl.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(lt(c)||c===92)this.raise(m.MalformedRegExpFlags,l());else break;++n,o+=u}this.state.pos=n,this.finishToken(138,{pattern:a,flags:o})}readInt(s,e,t=!1,r=!0){let{n,pos:a}=Pn(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.pos,t=this.state.curPosition(),r=!1;this.state.pos+=2;let n=this.readInt(s);n==null&&this.raise(m.InvalidDigit,ne(t,2),{radix:s});let a=this.input.charCodeAt(this.state.pos);if(a===110)++this.state.pos,r=!0;else if(a===109)throw this.raise(m.InvalidDecimal,t);if(Me(this.codePointAtPos(this.state.pos)))throw this.raise(m.NumberIdentifier,this.state.curPosition());if(r){let o=this.input.slice(e,this.state.pos).replace(/[_n]/g,"");this.finishToken(136,o);return}this.finishToken(135,n)}readNumber(s){let e=this.state.pos,t=this.state.curPosition(),r=!1,n=!1,a=!1,o=!1;!s&&this.readInt(10)===null&&this.raise(m.InvalidNumber,this.state.curPosition());let l=this.state.pos-e>=2&&this.input.charCodeAt(e)===48;if(l){let f=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(m.StrictOctalLiteral,t),!this.state.strict){let p=f.indexOf("_");p>0&&this.raise(m.ZeroDigitNumericSeparator,ne(t,p))}o=l&&!/[89]/.test(f)}let c=this.input.charCodeAt(this.state.pos);if(c===46&&!o&&(++this.state.pos,this.readInt(10),r=!0,c=this.input.charCodeAt(this.state.pos)),(c===69||c===101)&&!o&&(c=this.input.charCodeAt(++this.state.pos),(c===43||c===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(m.InvalidOrMissingExponent,t),r=!0,a=!0,c=this.input.charCodeAt(this.state.pos)),c===110&&((r||l)&&this.raise(m.InvalidBigIntLiteral,t),++this.state.pos,n=!0),c===109){this.expectPlugin("decimal",this.state.curPosition()),(a||l)&&this.raise(m.InvalidDecimal,t),++this.state.pos;var u=!0}if(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(136,h);return}if(u){this.finishToken(137,h);return}let d=o?parseInt(h,8):parseFloat(h);this.finishToken(135,d)}readCodePoint(s){let{code:e,pos:t}=Sn(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}=an(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(134,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}=an("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 Ce(t.curLine,t.pos-t.lineStart,this.sourceToOffsetPos(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(lt(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:lt;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=Br.get(e);t!==void 0?this.finishToken(t,Ve(t)):this.finishToken(132,e)}checkKeywordEscapes(){let{type:s}=this.state;qr(s)&&this.state.containsEsc&&this.raise(m.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:Ve(s)})}raise(s,e,t={}){let r=e instanceof Ce?e:e.loc.start,n=s(r,t);if(!(this.optionFlags&2048))throw n;return this.isLookahead||this.state.errors.push(n),n}raiseOverwrite(s,e,t={}){let r=e instanceof Ce?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?Ve(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,Nt(e,t,r))}}},Cr=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},Ir=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 Cr)}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,d=e&3;o=h===d||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})}},pt=class{constructor(s=0){this.type=s}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},xs=class extends pt{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)}},Nr=class{constructor(s){this.parser=void 0,this.stack=[new pt],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 jl(){return new pt(3)}function Rl(){return new xs(1)}function Ul(){return new xs(2)}function kn(){return new pt}var Lr=class extends Ar{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){if(this.input.startsWith(e,s)){let t=this.input.charCodeAt(s+e.length);return!(lt(t)||(t&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(140)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return rn(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return rn(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,voidPatternLoc:o}=s,l=!!t||!!r||!!a||!!n||!!o;if(!e)return l;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),o!=null&&this.raise(m.InvalidCoverDiscardElement,o)}isLiteralPropertyName(){return dn(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 Sr;let l=this.classScope;this.classScope=new Ir(this);let c=this.expressionScope;return this.expressionScope=new Nr(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||this.optionFlags&1)&&(s|=2),this.optionFlags&32&&(s|=1);let e=!this.inModule&&this.options.sourceType==="commonjs";(e||this.optionFlags&2)&&(s|=4),this.prodParam.enter(s);let t=e?514:1;this.optionFlags&4&&(t|=512),this.scope.enter(t)}checkDestructuringPrivate(s){let{privateKeyLoc:e}=s;e!==null&&this.expectPlugin("destructuringPrivate",e)}},ut=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null,this.voidPatternLoc=null}},dt=class{constructor(s,e,t){this.type="",this.start=e,this.end=0,this.loc=new ht(t),s?.optionFlags&128&&(this.range=[e,0]),s!=null&&s.filename&&(this.loc.filename=s.filename)}},Or=dt.prototype;Or.__clone=function(){let i=new dt(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};var Dr=class extends Lr{startNode(){let s=this.state.startLoc;return new dt(this,s.index,s)}startNodeAt(s){return new dt(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.optionFlags&128&&(s.range[1]=t.index),this.optionFlags&4096&&this.processComment(s),s}resetStartLocation(s,e){s.start=e.index,s.loc.start=e,this.optionFlags&128&&(s.range[0]=e.index)}resetEndLocation(s,e=this.state.lastTokEndLoc){s.end=e.index,s.loc.end=e,this.optionFlags&128&&(s.range[1]=e.index)}resetStartLocationFromNode(s,e){this.resetStartLocation(s,e.loc.start)}castNodeTo(s,e){return s.type=e,s}cloneIdentifier(s){let{type:e,start:t,end:r,loc:n,range:a,name:o}=s,l=Object.create(Or);return l.type=e,l.start=t,l.end=r,l.loc=n,l.range=a,l.name=o,s.extra&&(l.extra=s.extra),l}cloneStringLiteral(s){let{type:e,start:t,end:r,loc:n,range:a,extra:o}=s,l=Object.create(Or);return l.type=e,l.start=t,l.end=r,l.loc=n,l.range=a,l.extra=o,l.value=s.value,l}},wn=i=>i.type==="ParenthesizedExpression"?wn(i.expression):i,Mr=class extends Dr{toAssignable(s,e=!1){var t,r;let n;switch((s.type==="ParenthesizedExpression"||(t=s.extra)!=null&&t.parenthesized)&&(n=wn(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":case"VoidPattern":break;case"ObjectExpression":this.castNodeTo(s,"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":this.castNodeTo(s,"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),this.castNodeTo(s,"AssignmentPattern"),delete s.operator,s.left.type==="VoidPattern"&&this.raise(m.VoidPatternInitializer,s.left),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"){this.castNodeTo(s,"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];a&&(this.toAssignableListItem(s,n,t),a.type==="RestElement"&&(n<r?this.raise(m.RestTrailingComma,a):e&&this.raise(m.RestTrailingComma,e)))}}toAssignableListItem(s,e,t){let r=s[e];if(r.type==="SpreadElement"){this.castNodeTo(r,"RestElement");let n=r.argument;this.checkToRestConversion(n,!0),this.toAssignable(n,t)}else this.toAssignable(r,t)}isAssignable(s,e){switch(s.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":case"VoidPattern":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();this.next();let e=this.parseBindingAtom();return e.type==="VoidPattern"&&this.raise(m.UnexpectedVoidPattern,e),s.argument=e,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);case 88:return this.parseVoidPattern(null)}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)){let o=this.parseRestBinding();if((this.hasPlugin("flow")||t&2)&&(o=this.parseFunctionParamType(o)),n.push(o),!this.checkCommaAfterRest(e)){this.expect(s);break}}else{let o=[];if(t&2)for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(m.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)o.push(this.parseDecorator());n.push(this.parseBindingElement(t,o))}}return n}parseBindingRestProperty(s){return this.next(),this.hasPlugin("discardBinding")&&this.match(88)?(s.argument=this.parseVoidPattern(null),this.raise(m.UnexpectedVoidPattern,s.argument)):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===139?(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)}parseBindingElement(s,e){let t=this.parseMaybeDefault();return(this.hasPlugin("flow")||s&2)&&this.parseFunctionParamType(t),e.length&&(t.decorators=e,this.resetStartLocationFromNode(t,e[0])),this.parseMaybeDefault(t.loc.start,t)}parseFunctionParamType(s){return s}parseMaybeDefault(s,e){if(s??(s=this.state.startLoc),e=e??this.parseBindingAtom(),!this.eat(29))return e;let t=this.startNodeAt(s);return e.type==="VoidPattern"&&this.raise(m.VoidPatternInitializer,e),t.left=e,t.right=this.parseMaybeAssignAllowIn(),this.finishNode(t,"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";case"VoidPattern":return!0}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}else l==="VoidPattern"&&e.type==="CatchClause"&&this.raise(m.VoidPatternCatchClauseParam,s);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,d;typeof u=="string"?(h=u,d=l==="ParenthesizedExpression"):[h,d]=u;let f=l==="ArrayPattern"||l==="ObjectPattern"?{type:l}:e,p=s[h];if(Array.isArray(p))for(let g of p)g&&this.checkLVal(g,f,t,r,n,d);else p&&this.checkLVal(p,f,t,r,n,d)}checkIdentifier(s,e,t=!1){this.state.strict&&(t?xn(s.name,this.inModule):bn(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 $l(i){if(i==null)throw new Error(`Unexpected ${i} value.`);return i}function on(i){if(!i)throw new Error("Assert fail")}var C=Ae`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: '${i}'.`,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.",InvalidHeritageClauseType:({token:i})=>`'${i}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnAwaitUsingDeclaration:i=>`'${i}' modifier cannot appear on an await using declaration.`,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.`,InvalidModifierOnUsingDeclaration:i=>`'${i}' modifier cannot appear on a using declaration.`,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.",NonClassMethodPropertyHasAbstractModifier:"'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}.`,UsingDeclarationInAmbientContext:i=>`'${i}' declarations are not allowed in ambient contexts.`});function Vl(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 ln(i){return i==="private"||i==="public"||i==="protected"}function ql(i){return i==="in"||i==="out"}var Kl=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:C.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:C.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:C.InvalidModifierOnTypeParameter})}getScopeHandler(){return Pr}tsIsIdentifier(){return $(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(139)||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,r){if(!$(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let n=this.state.value;if(e.includes(n)){if(r&&this.match(106)||t&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return n}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:t,stopOnStartOfClassStaticBlock:r,errorTemplate:n=C.InvalidModifierOnTypeMember},a){let o=(c,u,h,d)=>{u===h&&a[d]&&this.raise(C.InvalidModifiersOrder,c,{orderedModifiers:[h,d]})},l=(c,u,h,d)=>{(a[h]&&u===d||a[d]&&u===h)&&this.raise(C.IncompatibleModifiers,c,{modifiers:[h,d]})};for(;;){let{startLoc:c}=this.state,u=this.tsParseModifier(e.concat(t??[]),r,a.static);if(!u)break;ln(u)?a.accessibility?this.raise(C.DuplicateAccessibilityModifier,c,{modifier:u}):(o(c,u,u,"override"),o(c,u,u,"static"),o(c,u,u,"readonly"),a.accessibility=u):ql(u)?(a[u]&&this.raise(C.DuplicateModifier,c,{modifier:u}),a[u]=!0,o(c,u,"in","out")):(hasOwnProperty.call(a,u)?this.raise(C.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 $l(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(134)?e.argument=this.parseStringLiteral(this.state.value):(this.raise(C.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=super.parseExprAtom()),this.eat(12)?e.options=this.tsParseImportTypeOptions():e.options=null,this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName(3)),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseImportTypeOptions(){let e=this.startNode();this.expect(5);let t=this.startNode();return this.isContextual(76)?(t.method=!1,t.key=this.parseIdentifier(!0),t.computed=!1,t.shorthand=!1):this.unexpected(null,76),this.expect(14),t.value=this.tsParseImportTypeWithPropertyValue(),e.properties=[this.finishObjectProperty(t)],this.expect(8),this.finishNode(e,"ObjectExpression")}tsParseImportTypeWithPropertyValue(){let e=this.startNode(),t=[];for(this.expect(5);!this.match(8);){let r=this.state.type;$(r)||r===134?t.push(super.parsePropertyDefinition(null)):this.unexpected(),this.eat(12)}return e.properties=t,this.next(),this.finishNode(e,"ObjectExpression")}tsParseEntityName(e){let t;if(e&1&&this.match(78))if(e&2)t=this.parseIdentifier(!0);else{let r=this.startNode();this.next(),t=this.finishNode(r,"ThisExpression")}else t=this.parseIdentifier(!!(e&1));for(;this.eat(16);){let r=this.startNodeAtNode(t);r.left=t,r.right=this.parseIdentifier(!!(e&1)),t=this.finishNode(r,"TSQualifiedName")}return t}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(1),!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(3),!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(143)?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(C.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(C.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(),$(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){if(this.eat(17)&&(e.optional=!0),this.match(10)||this.match(47)){t&&this.raise(C.ReadonlyForMethodSignature,e);let r=e;r.kind&&this.match(47)&&this.raise(C.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,r),this.tsParseTypeMemberSemicolon();let n="parameters",a="typeAnnotation";if(r.kind==="get")r[n].length>0&&(this.raise(m.BadGetterArity,this.state.curPosition()),this.isThisParam(r[n][0])&&this.raise(C.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(r.kind==="set"){if(r[n].length!==1)this.raise(m.BadSetterArity,this.state.curPosition());else{let o=r[n][0];this.isThisParam(o)&&this.raise(C.AccessorCannotDeclareThisParameter,this.state.curPosition()),o.type==="Identifier"&&o.optional&&this.raise(C.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),o.type==="RestElement"&&this.raise(C.SetAccessorCannotHaveRestParameter,this.state.curPosition())}r[a]&&this.raise(C.SetAccessorCannotHaveReturnType,r[a])}else r.kind="method";return this.finishNode(r,"TSMethodSignature")}else{let r=e;t&&(r.readonly=!0);let n=this.tsTryParseTypeAnnotation();return n&&(r.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(r,"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.match(10)&&!this.match(47)&&this.unexpected(null,10)),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(C.OptionalTypeBeforeRequired,r),t||(t=n==="TSNamedTupleMember"&&r.optional||n==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let e=this.state.startLoc,t=this.eat(21),{startLoc:r}=this.state,n,a,o,l,u=Se(this.state.type)?this.lookaheadCharCode():null;if(u===58)n=!0,o=!1,a=this.parseIdentifier(!0),this.expect(14),l=this.tsParseType();else if(u===63){o=!0;let h=this.state.value,d=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(n=!0,a=this.createIdentifier(this.startNodeAt(r),h),this.expect(17),this.expect(14),l=this.tsParseType()):(n=!1,l=d,this.expect(17))}else l=this.tsParseType(),o=this.eat(17),n=this.eat(14);if(n){let h;a?(h=this.startNodeAt(r),h.optional=o,h.label=a,h.elementType=l,this.eat(17)&&(h.optional=!0,this.raise(C.TupleOptionalAfterType,this.state.lastTokStartLoc))):(h=this.startNodeAt(r),h.optional=o,this.raise(C.InvalidTupleMemberLabel,l),h.label=l,h.elementType=this.tsParseType()),l=this.finishNode(h,"TSNamedTupleMember")}else if(o){let h=this.startNodeAt(r);h.typeAnnotation=l,l=this.finishNode(h,"TSOptionalType")}if(t){let h=this.startNodeAt(e);h.typeAnnotation=l,l=this.finishNode(h,"TSRestType")}return l}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 135:case 136:case 134: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 134:case 135:case 136:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let e=this.startNode(),t=this.lookahead();return t.type!==135&&t.type!==136&&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($(e)||e===88||e===84){let t=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":Vl(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{startLoc:e}=this.state,t=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let r=this.startNodeAt(e);r.elementType=t,this.expect(3),t=this.finishNode(r,"TSArrayType")}else{let r=this.startNodeAt(e);r.objectType=t,r.indexType=this.tsParseType(),this.expect(3),t=this.finishNode(r,"TSIndexedAccessType")}return t}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(C.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 ul(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($(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(),!$(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(){on(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.isLookaheadContextual("new")}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(C.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(3),this.match(47)&&(n.typeParameters=this.tsParseTypeArguments()),this.finishNode(n,"TSExpressionWithTypeArguments")}});return r.length||this.raise(C.EmptyHeritageClauseType,t,{token:e}),r}tsParseInterfaceDeclaration(e,t={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),t.declare&&(e.declare=!0),$(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(C.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.lookaheadCharCode()!==46){let t=this.startNode();return this.next(),this.finishNode(t,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInTopLevelContext(e){if(this.curContext()!==R.brace){let t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}else return e()}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(134)?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")}tsParseEnumBody(){let e=this.startNode();return this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumBody")}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(1024),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.kind="global",e.global=!0,e.id=this.parseIdentifier()):this.match(134)?(e.kind="module",e.id=super.parseStringLiteral(this.state.value)):this.unexpected(),this.match(5)?(this.scope.enter(1024),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(C.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(0)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(119),this.expect(10),this.match(134)||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;return 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 100:if(this.state.containsEsc)return;case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 107:if(this.isUsing())return this.raise(C.InvalidModifierOnUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.parseVarStatement(e,"using",!0);break;case 96:if(this.isAwaitUsing())return this.raise(C.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.next(),this.parseVarStatement(e,"await using",!0);break;case 129:{let r=this.tsParseInterfaceDeclaration(e,{declare:!0});if(r)return r}default:if($(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(1024),this.prodParam.enter(0);let n=e;return n.kind="global",e.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)||$(this.state.type)))return this.tsParseAbstractDeclaration(e,n);break;case"module":if(this.tsCheckLineTerminator(r)){if(this.match(134))return this.tsParseAmbientExternalModuleDeclaration(e);if($(this.state.type))return e.kind="module",this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(r)&&$(this.state.type))return e.kind="namespace",this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(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.tsInTopLevelContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),e.params.length===0?this.raise(C.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===R.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return hl(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseBindingElement(e,t){let r=t.length?t[0].loc.start: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(C.UnexpectedParameterModifier,r);let c=this.parseMaybeDefault();e&2&&this.parseFunctionParamType(c);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(C.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(C.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(C.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(C.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 d=this.tsTryParseGenericAsyncArrowFunction(t);if(d)return d}let c=this.tsParseTypeArgumentsInExpression();if(!c)return;if(a&&!this.match(10)){o=this.state.curPosition();return}if(bs(this.state.type)){let d=super.parseTaggedTemplateExpression(e,t,n);return d.typeParameters=c,d}if(!r&&this.eat(10)){let d=this.startNodeAt(t);return d.callee=e,d.arguments=this.parseCallExpressionArguments(),this.tsCheckForInvalidTypeCasts(d.arguments),d.typeParameters=c,n.optionalChainMember&&(d.optional=a),this.finishCallExpression(d,n.optionalChainMember)}let u=this.state.type;if(u===48||u===52||u!==10&&Lt(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(C.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),!this.match(16)&&!this.match(18)&&(l.expression=super.stopParseSubscript(e,n))),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(ms(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(C.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(134))return e.importKind="value",super.parseImport(e);let t;if($(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(C.TypeImportCannotSpecifyDefaultAndNamed,t),t}parseExport(e,t){if(this.match(83)){let r=e;this.next();let n=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?n=this.parseMaybeImportPhase(r,!1):r.importKind="value",this.tsParseImportEqualsDeclaration(r,n,!0)}else if(this.eat(29)){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.isLookaheadContextual("class")}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;if(!e.declare&&(t==="using"||t==="await using"))return this.raiseOverwrite(C.UsingDeclarationInAmbientContext,e,t),a;for(let{id:o,init:l}of a.declarations)l&&(t==="var"||t==="let"||o.typeAnnotation?this.raise(C.InitializerNotAllowedInAmbientContext,l):Wl(l,this.hasPlugin("estree"))||this.raise(C.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=>ln(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:C.InvalidModifierOnTypeParameterPositions},t);let a=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(t,n)&&this.raise(C.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(C.IndexSignatureHasAbstract,t),t.accessibility&&this.raise(C.IndexSignatureHasAccessibility,t,{modifier:t.accessibility}),t.declare&&this.raise(C.IndexSignatureHasDeclare,t),t.override&&this.raise(C.IndexSignatureHasOverride,t);return}!this.state.inAbstractClass&&t.abstract&&this.raise(C.NonAbstractClassHasAbstractMethod,t),t.override&&(r.hadSuperClass||this.raise(C.OverrideNotInSubClass,t)),super.parseClassMemberWithIsStatic(e,t,r,n)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(C.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(C.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.match(17))return e;if(this.state.maybeInArrowParameters){let n=this.lookaheadCharCode();if(n===44||n===61||n===58||n===41)return this.setOptionalParametersError(r),e}return super.parseConditional(e,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=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(C.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let a=$(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return a?((a.type==="TSInterfaceDeclaration"||a.type==="TSTypeAliasDeclaration"||r)&&(e.exportKind="type"),r&&a.type!=="TSImportEqualsDeclaration"&&(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(C.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){let{key:t}=e;this.raise(C.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:t.type==="Identifier"&&!e.computed?t.name:`[${this.input.slice(this.offsetToSourcePos(t.start),this.offsetToSourcePos(t.end))}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(C.PrivateElementHasAbstract,e),e.accessibility&&this.raise(C.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(C.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,t,r,n,a,o){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);l&&a&&this.raise(C.ConstructorHasTypeParameters,l);let{declare:c=!1,kind:u}=t;c&&(u==="get"||u==="set")&&this.raise(C.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"&&e.value.body==null||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(143)||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===R.j_oTag||g===R.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 d,f=this.tryParse(p=>{var g,y;d=this.tsParseTypeParameters(this.tsParseConstModifier);let b=super.parseMaybeAssign(e,t);return(b.type!=="ArrowFunctionExpression"||(g=b.extra)!=null&&g.parenthesized)&&p(),((y=d)==null?void 0:y.params.length)!==0&&this.resetStartLocationFromNode(b,d),b.typeParameters=d,b},c);if(!f.error&&!f.aborted)return d&&this.reportReservedArrowTypeParam(d),f.node;if(!u&&(on(!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(f.node)return this.state=f.failState,d&&this.reportReservedArrowTypeParam(d),f.node;if((a=h)!=null&&a.node)return this.state=h.failState,h.node;throw((o=u)==null?void 0:o.error)||f.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(C.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)}parseFunctionParamType(e){this.eat(17)&&(e.optional=!0);let t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t),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(C.UnexpectedTypeCastInParameter,e):this.raise(C.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":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,t){if(this.match(47)||this.match(51)){let r=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let n=super.parseMaybeDecoratorArguments(e,t);return n.typeParameters=r,n}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(e,t)}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(C.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}toAssignableListItem(e,t,r){let n=e[t];n.type==="TSTypeCastExpression"&&(e[t]=this.typeCastToParameter(n)),super.toAssignableListItem(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(C.NonClassMethodPropertyHasAbstractModifier,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||c.type==="TSAbstractMethodDefinition")&&(this.hasPlugin("estree")?c.value:c).body){let{key:d}=c;this.raise(C.AbstractMethodHasImplementation,c,{methodName:d.type==="Identifier"&&!c.computed?d.name:`[${this.input.slice(this.offsetToSourcePos(d.start),this.offsetToSourcePos(d.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 f=this.parseIdentifier();if(this.isContextual(93)){let p=this.parseIdentifier();Se(this.state.type)?(c=!0,o=f,l=t?this.parseIdentifier():this.parseModuleExportName(),u=!1):(l=p,u=!1)}else Se(this.state.type)?(u=!1,l=t?this.parseIdentifier():this.parseModuleExportName()):(c=!0,o=f)}else Se(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?C.TypeModifierIsUsedInTypeImports:C.TypeModifierIsUsedInTypeExports,h),e[n]=o,e[a]=l;let d=t?"importKind":"exportKind";e[d]=c?"type":"value",u&&this.eatContextual(93)&&(e[a]=t?this.parseIdentifier():this.parseModuleExportName()),e[a]||(e[a]=this.cloneIdentifier(e[n])),t&&this.checkIdentifier(e[a],c?4098:4096)}fillOptionalPropertiesForTSESLint(e){var t,r,n,a,o,l,c,u,h,d,f,p,g,y,b,P,I,T,k,w,N,q,te,ue,wt,et,tt,Zt,es,ts,ss,st,rs,E,v,D,F,V,K,W,re,ye,ze,is,je,ns;switch(e.type){case"ExpressionStatement":(t=e.directive)!=null||(e.directive=void 0);return;case"RestElement":e.value=void 0;case"Identifier":case"ArrayPattern":case"AssignmentPattern":case"ObjectPattern":(r=e.decorators)!=null||(e.decorators=[]),(n=e.optional)!=null||(e.optional=!1),(a=e.typeAnnotation)!=null||(e.typeAnnotation=void 0);return;case"TSParameterProperty":(o=e.accessibility)!=null||(e.accessibility=void 0),(l=e.decorators)!=null||(e.decorators=[]),(c=e.override)!=null||(e.override=!1),(u=e.readonly)!=null||(e.readonly=!1),(h=e.static)!=null||(e.static=!1);return;case"TSEmptyBodyFunctionExpression":e.body=null;case"TSDeclareFunction":case"FunctionDeclaration":case"FunctionExpression":case"ClassMethod":case"ClassPrivateMethod":(d=e.declare)!=null||(e.declare=!1),(f=e.returnType)!=null||(e.returnType=void 0),(p=e.typeParameters)!=null||(e.typeParameters=void 0);return;case"Property":(g=e.optional)!=null||(e.optional=!1);return;case"TSMethodSignature":case"TSPropertySignature":(y=e.optional)!=null||(e.optional=!1);case"TSIndexSignature":(b=e.accessibility)!=null||(e.accessibility=void 0),(P=e.readonly)!=null||(e.readonly=!1),(I=e.static)!=null||(e.static=!1);return;case"TSAbstractPropertyDefinition":case"PropertyDefinition":case"TSAbstractAccessorProperty":case"AccessorProperty":(T=e.declare)!=null||(e.declare=!1),(k=e.definite)!=null||(e.definite=!1),(w=e.readonly)!=null||(e.readonly=!1),(N=e.typeAnnotation)!=null||(e.typeAnnotation=void 0);case"TSAbstractMethodDefinition":case"MethodDefinition":(q=e.accessibility)!=null||(e.accessibility=void 0),(te=e.decorators)!=null||(e.decorators=[]),(ue=e.override)!=null||(e.override=!1),(wt=e.optional)!=null||(e.optional=!1);return;case"ClassExpression":(et=e.id)!=null||(e.id=null);case"ClassDeclaration":(tt=e.abstract)!=null||(e.abstract=!1),(Zt=e.declare)!=null||(e.declare=!1),(es=e.decorators)!=null||(e.decorators=[]),(ts=e.implements)!=null||(e.implements=[]),(ss=e.superTypeArguments)!=null||(e.superTypeArguments=void 0),(st=e.typeParameters)!=null||(e.typeParameters=void 0);return;case"TSTypeAliasDeclaration":case"VariableDeclaration":(rs=e.declare)!=null||(e.declare=!1);return;case"VariableDeclarator":(E=e.definite)!=null||(e.definite=!1);return;case"TSEnumDeclaration":(v=e.const)!=null||(e.const=!1),(D=e.declare)!=null||(e.declare=!1);return;case"TSEnumMember":(F=e.computed)!=null||(e.computed=!1);return;case"TSImportType":(V=e.qualifier)!=null||(e.qualifier=null),(K=e.options)!=null||(e.options=null);return;case"TSInterfaceDeclaration":(W=e.declare)!=null||(e.declare=!1),(re=e.extends)!=null||(e.extends=[]);return;case"TSModuleDeclaration":(ye=e.declare)!=null||(e.declare=!1),(ze=e.global)!=null||(e.global=e.kind==="global");return;case"TSTypeParameter":(is=e.const)!=null||(e.const=!1),(je=e.in)!=null||(e.in=!1),(ns=e.out)!=null||(e.out=!1);return}}};function zl(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:vn(i.object)}function Wl(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)||Hl(i,s)||t==="TemplateLiteral"&&i.expressions.length===0||zl(i))}function En(i,s){return s?i.type==="Literal"&&(typeof i.value=="number"||"bigint"in i):i.type==="NumericLiteral"||i.type==="BigIntLiteral"}function Hl(i,s){if(i.type==="UnaryExpression"){let{operator:e,argument:t}=i;if(e==="-"&&En(t,s))return!0}return!1}function vn(i){return i.type==="Identifier"?!0:i.type!=="MemberExpression"||i.computed?!1:vn(i.object)}var cn=Ae`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),Jl=i=>class extends i{parsePlaceholder(e){if(this.match(133)){let t=this.startNode();return this.next(),this.assertNoSpace(),t.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(133),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(133,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)}cloneIdentifier(e){let t=super.cloneIdentifier(e);return t.type==="Placeholder"&&(t.expectedNode=e.expectedNode),t}cloneStringLiteral(e){return e.type==="Placeholder"?this.cloneIdentifier(e):super.cloneStringLiteral(e)}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){if(super.chStartsBindingIdentifier(e,t))return!0;let r=this.nextTokenStart();return this.input.charCodeAt(r)===37&&this.input.charCodeAt(r+1)===37}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(133)||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(cn.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(Ve(133),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.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(cn.UnexpectedSpace,this.state.lastTokEndLoc)}},Xl=i=>class extends i{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,t=this.startNode();if(this.next(),$(this.state.type)){let r=this.parseIdentifierName(),n=this.createIdentifier(t,r);if(this.castNodeTo(n,"V8IntrinsicIdentifier"),this.match(10))return n}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},un=["minimal","fsharp","hack","smart"],hn=["^^","@@","^","%","#"];function Gl(i){if(i.has("decorators")){if(i.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let t=i.get("decorators").decoratorsBeforeExport;if(t!=null&&typeof t!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let r=i.get("decorators").allowCallParenthesized;if(r!=null&&typeof r!="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 t=i.get("pipelineOperator").proposal;if(!un.includes(t)){let r=un.map(n=>`"${n}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${r}.`)}if(t==="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(!hn.includes(r)){let n=hn.map(a=>`"${a}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${n}.`)}{var e;if(r==="#"&&((e=i.get("recordAndTuple"))==null?void 0:e.syntaxType)==="hash")throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",i.get("recordAndTuple")])}\`.`)}}else if(t==="smart"&&((s=i.get("recordAndTuple"))==null?void 0:s.syntaxType)==="hash")throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",i.get("recordAndTuple")])}\`.`)}if(i.has("moduleAttributes")){if(i.has("deprecatedImportAssert")||i.has("importAssertions"))throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");if(i.get("moduleAttributes").version!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(i.has("importAssertions")&&i.has("deprecatedImportAssert"))throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.");if(!i.has("deprecatedImportAssert")&&i.has("importAttributes")&&i.get("importAttributes").deprecatedAssertSyntax&&i.set("deprecatedImportAssert",{}),i.has("recordAndTuple")){let t=i.get("recordAndTuple").syntaxType;if(t!=null){let r=["hash","bar"];if(!r.includes(t))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+r.map(n=>`'${n}'`).join(", "))}}if(i.has("asyncDoExpressions")&&!i.has("doExpressions")){let t=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw t.missingPlugins="doExpressions",t}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'.");if(i.has("discardBinding")&&i.get("discardBinding").syntaxType!=="void")throw new Error("The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'.")}var An={estree:el,jsx:Ol,flow:Cl,typescript:Kl,v8intrinsic:Xl,placeholders:Jl},Yl=Object.keys(An),Fr=class extends Mr{checkProto(s,e,t,r){if(s.type==="SpreadElement"||this.isObjectMethod(s)||s.computed||s.shorthand)return t;let n=s.key;return(n.type==="Identifier"?n.name:n.value)==="__proto__"?e?(this.raise(m.RecordNoProto,n),!0):(t&&(r?r.doubleProtoLoc===null&&(r.doubleProtoLoc=n.loc.start):this.raise(m.DuplicateProto,n)),!0):t}shouldExitDescending(s,e){return s.type==="ArrowFunctionExpression"&&this.offsetToSourcePos(s.start)===e}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(140))throw this.raise(m.ParseExpressionEmptyInput,this.state.startLoc);let s=this.parseExpression();if(!this.match(140))throw this.raise(m.ParseExpressionExpectsEOF,this.state.startLoc,{unexpected:this.input.codePointAt(this.state.start)});return this.finalizeRemainingComments(),s.comments=this.comments,s.errors=this.state.errors,this.optionFlags&256&&(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){s.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(s,e){let t=this.state.startLoc,r=this.isContextual(108);if(r&&this.prodParam.hasYield){this.next();let l=this.parseYield(t);return e&&(l=e.call(this,l,t)),l}let n;s?n=!1:(s=new ut,n=!0);let{type:a}=this.state;(a===10||$(a))&&(this.state.potentialArrowAt=this.state.start);let o=this.parseMaybeConditional(s);if(e&&(o=e.call(this,o,t)),nl(this.state.type)){let l=this.startNodeAt(t),c=this.state.value;if(l.operator=c,this.match(29)){this.toAssignable(o,!0),l.left=o;let u=t.index;s.doubleProtoLoc!=null&&s.doubleProtoLoc.index>=u&&(s.doubleProtoLoc=null),s.shorthandAssignLoc!=null&&s.shorthandAssignLoc.index>=u&&(s.shorthandAssignLoc=null),s.privateKeyLoc!=null&&s.privateKeyLoc.index>=u&&(this.checkDestructuringPrivate(s),s.privateKeyLoc=null),s.voidPatternLoc!=null&&s.voidPatternLoc.index>=u&&(s.voidPatternLoc=null)}else l.left=o;return this.next(),l.right=this.parseMaybeAssign(),this.checkLVal(o,this.finishNode(l,"AssignmentExpression")),l}else n&&this.checkExpressionErrors(s,!0);if(r){let{type:l}=this.state;if((this.hasPlugin("v8intrinsic")?Lt(l):Lt(l)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(m.YieldNotInGeneratorFunction,t),this.parseYield(t)}return o}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(139)?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>=ms(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(ol(r)&&(this.prodParam.hasIn||!this.match(58))){let n=ms(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=ms(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"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}if(this.getPluginOption("pipelineOperator","proposal")==="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)});default:return this.parseExprOpBaseRightExpr(s,e)}}parseExprOpBaseRightExpr(s,e){let t=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),t,pl(s)?e-1:e)}parseHackPipeBody(){var s;let{startLoc:e}=this.state,t=this.parseMaybeAssign();return Ho.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(cl(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")?Lt(l):Lt(l)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())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(;ll(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(bs(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 this.stopParseSubscript(s,r);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):this.stopParseSubscript(s,r)}}stopParseSubscript(s,e){return e.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(139)?(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(Ul()),a=new ut),c&&(o.optional=r),r?o.arguments=this.parseCallExpressionArguments():o.arguments=this.parseCallExpressionArguments(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&&this.offsetToSourcePos(s.start)===this.state.potentialArrowAt}finishCallExpression(s,e){if(s.callee.type==="Import")if(s.arguments.length===0||s.arguments.length>2)this.raise(m.ImportCallArity,s);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){let r=[],n=!0,a=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(11);){if(n)n=!1;else if(this.expect(12),this.match(11)){e&&this.addTrailingCommaExtraToNode(e),this.next();break}r.push(this.parseExprListItem(11,!1,t,s))}return this.state.inFSharpPipelineDirectBody=a,r}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&&_t(s,e.innerComments),e.callee.trailingComments&&_t(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.parseImportMetaPropertyOrPhaseCall(e):this.match(10)?this.optionFlags&512?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 135:return this.parseNumericLiteral(this.state.value);case 136:return this.parseBigIntLiteral(this.state.value);case 134: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 0:return this.parseArrayLike(3,!0,!1,s);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 139: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===137)return this.parseDecimalLiteral(this.state.value);if(r===2||r===1)return this.parseArrayLike(this.state.type===2?4:3,!1,!0);if(r===6||r===7)return this.parseObjectLike(this.state.type===6?9:8,!1,!0)}if($(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($(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=ne(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))return t==="hack"?(this.topicReferenceIsAllowedInCurrentContext()||this.raise(m.PipeTopicUnbound,e),this.registerTopicReference(),this.finishNode(s,"TopicReference")):(this.topicReferenceIsAllowedInCurrentContext()||this.raise(m.PrimaryTopicNotAllowed,e),this.registerTopicReference(),this.finishNode(s,"PipelinePrimaryTopicReference"));throw this.raise(m.PipeTopicUnconfiguredToken,e,{token:Ve(r)})}testTopicReferenceConfiguration(s,e,t){switch(s){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:Ve(t)}]);case"smart":return t===27;default:throw this.raise(m.PipeTopicRequiresHackPipes,e)}}parseAsyncArrowUnaryFunction(s){this.prodParam.enter(ys(!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.optionFlags&16)?this.raise(m.SuperNotAllowed,s):!this.scope.allowSuper&&!(this.optionFlags&16)&&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(ne(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")}parseImportMetaPropertyOrPhaseCall(s){if(this.next(),this.isContextual(105)||this.isContextual(97)){let e=this.isContextual(105);return this.expectPlugin(e?"sourcePhaseImports":"deferredImportEvaluation"),this.next(),s.phase=e?"source":"defer",this.parseImportCall(s)}else{let e=this.createIdentifierAt(this.startNodeAtNode(s),"import",this.state.lastTokStartLoc);return this.isContextual(101)&&(this.inModule||this.raise(m.ImportMetaOutsideModule,e),this.sawUnambiguousESM=!0),this.parseMetaProperty(s,e,"meta")}}parseLiteralAtNode(s,e,t){return this.addExtra(t,"rawValue",s),this.addExtra(t,"raw",this.input.slice(this.offsetToSourcePos(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(this.offsetToSourcePos(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(Rl());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 ut,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.parseMaybeAssignAllowInOrVoidPattern(11,l,this.parseParenItem))}let d=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=r,this.state.inFSharpPipelineDirectBody=n;let f=this.startNodeAt(e);return s&&this.shouldParseArrow(o)&&(f=this.parseArrow(f))?(this.checkDestructuringPrivate(l),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(f,o,!1),f):(this.expressionScope.exit(),o.length||this.unexpected(this.state.lastTokStartLoc),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,d)):t=o[0],this.wrapParenthesis(e,t))}wrapParenthesis(s,e){if(!(this.optionFlags&1024))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.allowNewTarget||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(ne(t,1));n===null&&(s||this.raise(m.InvalidEscapeSequenceTemplate,ne(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,ne(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=!1,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),a=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.parseMaybeAssignAllowInOrVoidPattern(8,r),this.finishObjectProperty(s);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,this.cloneIdentifier(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,this.cloneIdentifier(s.key))}else s.value=this.cloneIdentifier(s.key);return s.shorthand=!0,this.finishObjectProperty(s)}}finishObjectProperty(s){return 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(Se(t))n=this.parseIdentifier(!0);else switch(t){case 135:n=this.parseNumericLiteral(r);break;case 134:n=this.parseStringLiteral(r);break;case 136:n=this.parseBigIntLiteral(r);break;case 139:{let a=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=a):this.raise(m.UnexpectedPrivateField,a),n=this.parsePrivateName();break}default:if(t===137){n=this.parseDecimalLiteral(r);break}this.unexpected()}s.key=n,t!==139&&(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(530|(o?576:0)|(n?32:0)),this.prodParam.enter(ys(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(518);let n=ys(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(kn()),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(s,e,t))}return n}parseExprListItem(s,e,t,r){let n;if(this.match(12))e||this.raise(m.UnexpectedToken,this.state.curPosition(),{unexpected:","}),n=null;else if(this.match(21)){let a=this.state.startLoc;n=this.parseParenItem(this.parseSpread(t),a)}else if(this.match(17)){this.expectPlugin("partialApplication"),r||this.raise(m.UnexpectedArgumentPlaceholder,this.state.startLoc);let a=this.startNode();this.next(),n=this.finishNode(a,"ArgumentPlaceholder")}else n=this.parseMaybeAssignAllowInOrVoidPattern(s,t,this.parseParenItem);return n}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")}createIdentifierAt(s,e,t){return s.name=e,s.loc.identifierName=e,this.finishNodeAt(s,"Identifier",t)}parseIdentifierName(s){let e,{startLoc:t,type:r}=this.state;Se(r)?e=this.state.value:this.unexpected();let n=rl(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||!Sl(s))return;if(t&&xl(s)){this.raise(m.UnexpectedKeyword,e,{keyword:s});return}if((this.state.strict?r?xn:gn:yn)(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;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.optionFlags&1)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(e.argument=this.parseMaybeUnary(null,!0)),this.finishNode(e,"AwaitExpression")}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;let{type:s}=this.state;return s===53||s===10||s===0||bs(s)||s===102&&!this.state.containsEsc||s===138||s===56||this.hasPlugin("v8intrinsic")&&s===54}parseYield(s){let e=this.startNodeAt(s);this.expressionScope.recordParameterInitializerError(m.YieldInParameter,e);let t=!1,r=null;if(!this.hasPrecedingLineBreak())switch(t=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!t)break;default:r=this.parseMaybeAssign()}return e.delegate=t,e.argument=r,this.finishNode(e,"YieldExpression")}parseImportCall(s){if(this.next(),s.source=this.parseMaybeAssignAllowIn(),s.options=null,this.eat(12)){if(this.match(11))this.addTrailingCommaExtraToNode(s.source);else if(s.options=this.parseMaybeAssignAllowIn(),this.eat(12)&&(this.addTrailingCommaExtraToNode(s.options),!this.match(11))){do this.parseMaybeAssignAllowIn();while(this.eat(12)&&!this.match(11));this.raise(m.ImportCallArity,s)}}return 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")}parseVoidPattern(s){this.expectPlugin("discardBinding");let e=this.startNode();return s!=null&&(s.voidPatternLoc=this.state.startLoc),this.next(),this.finishNode(e,"VoidPattern")}parseMaybeAssignAllowInOrVoidPattern(s,e,t){if(e!=null&&this.match(88)){let r=this.lookaheadCharCode();if(r===44||r===(s===3?93:s===8?125:41)||r===61)return this.parseMaybeDefault(this.state.startLoc,this.parseVoidPattern(e))}return this.parseMaybeAssignAllowIn(e,t)}parsePropertyNamePrefixOperator(s){}},mr={kind:1},Ql={kind:2},Zl=/[\uD800-\uDFFF]/u,yr=/in(?:stanceof)?/y;function ec(i,s,e){for(let t=0;t<i.length;t++){let r=i[t],{type:n}=r;if(typeof n=="number"){{if(n===139){let{loc:a,start:o,value:l,end:c}=r,u=o+1,h=ne(a.start,1);i.splice(t,1,new ve({type:Oe(27),value:"#",start:o,end:u,startLoc:a.start,endLoc:h}),new ve({type:Oe(132),value:l,start:u,end:c,startLoc:h,endLoc:a.end})),t++;continue}if(bs(n)){let{loc:a,start:o,value:l,end:c}=r,u=o+1,h=ne(a.start,1),d;s.charCodeAt(o-e)===96?d=new ve({type:Oe(22),value:"`",start:o,end:u,startLoc:a.start,endLoc:h}):d=new ve({type:Oe(8),value:"}",start:o,end:u,startLoc:a.start,endLoc:h});let f,p,g,y;n===24?(p=c-1,g=ne(a.end,-1),f=l===null?null:l.slice(1,-1),y=new ve({type:Oe(22),value:"`",start:p,end:c,startLoc:g,endLoc:a.end})):(p=c-2,g=ne(a.end,-2),f=l===null?null:l.slice(1,-2),y=new ve({type:Oe(23),value:"${",start:p,end:c,startLoc:g,endLoc:a.end})),i.splice(t,1,d,new ve({type:Oe(20),value:f,start:u,end:p,startLoc:h,endLoc:g}),y),t+=2;continue}}r.type=Oe(n)}}return i}var _r=class extends Fr{parseTopLevel(s,e){return s.program=this.parseProgram(e,140,this.options.sourceType==="module"?"module":"script"),s.comments=this.comments,this.optionFlags&256&&(s.tokens=ec(this.tokens,this.input,this.startIndex)),this.finishNode(s,"File")}parseProgram(s,e,t){if(s.sourceType=t,s.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(s,!0,!0,e),this.inModule){if(!(this.optionFlags&64)&&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===140?r=this.finishNode(s,"Program"):r=this.finishNodeAt(s,"Program",ne(this.state.startLoc,-1)),r}stmtToDirective(s){let e=this.castNodeTo(s,"Directive"),t=this.castNodeTo(s.expression,"DirectiveLiteral"),r=t.value,n=this.input.slice(this.offsetToSourcePos(t.start),this.offsetToSourcePos(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),e.value=t,delete s.expression,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}isUsing(){if(!this.isContextual(107))return!1;let s=this.nextTokenInLineStart(),e=this.codePointAtPos(s);return this.chStartsBindingIdentifier(e,s)}isForUsing(){if(!this.isContextual(107))return!1;let s=this.nextTokenInLineStart(),e=this.codePointAtPos(s);if(this.isUnparsedContextual(s,"of")){let t=this.lookaheadCharCodeSince(s+2);if(t!==61&&t!==58&&t!==59)return!1}return!!(this.chStartsBindingIdentifier(e,s)||this.isUnparsedContextual(s,"void"))}isAwaitUsing(){if(!this.isContextual(96))return!1;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!0}return!1}chStartsBindingIdentifier(s,e){if(Me(s)){if(yr.lastIndex=e,yr.test(this.input)){let t=this.codePointAtPos(yr.lastIndex);if(!lt(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)}allowsUsing(){return(this.scope.inModule||!this.scope.inTopLevel)&&!this.scope.inBareCaseStatement}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.isAwaitUsing())return this.allowsUsing()?n?this.recordAwaitIfAllowed()||this.raise(m.AwaitUsingNotInAsyncContext,r):this.raise(m.UnexpectedLexicalDeclaration,r):this.raise(m.UnexpectedUsingDeclaration,r),this.next(),this.parseVarStatement(r,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.allowsUsing()?n||this.raise(m.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(m.UnexpectedUsingDeclaration,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.optionFlags&8)&&!o&&this.raise(m.UnexpectedImportExport,this.state.startLoc),this.next();let u;return t===83?u=this.parseImport(r):u=this.parseExport(r,e),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 $(t)&&c.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(r,l,c,s):this.parseExpressionStatement(r,c,e)}assertModuleNodeAllowed(s){!(this.optionFlags&8)&&!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){if(s){var r;(r=e.decorators)!=null&&r.length?(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)}return 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,r),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(139)?(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,e)}}else s.expression=this.parseExprSubscripts();return this.finishNode(s,"Decorator")}parseMaybeDecoratorArguments(s,e){if(this.eat(10)){let t=this.startNodeAt(e);return t.callee=s,t.arguments=this.parseCallExpressionArguments(),this.toReferencedList(t.arguments),this.finishNode(t,"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(mr),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(mr);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.isAwaitUsing(),c=l||this.isForUsing(),u=t&&this.hasFollowingBindingAtom()||c;if(this.match(74)||this.match(75)||u){let h=this.startNode(),d;l?(d="await using",this.recordAwaitIfAllowed()||this.raise(m.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):d=this.state.value,this.next(),this.parseVar(h,!0,d);let f=this.finishNode(h,"VariableDeclaration"),p=this.match(58);return p&&c&&this.raise(m.ForInUsing,f),(p||this.isContextual(102))&&f.declarations.length===1?this.parseForIn(s,f,e):(e!==null&&this.unexpected(e),this.parseFor(s,f))}}let r=this.isContextual(95),n=new ut,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.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(Ql),this.scope.enter(256);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(mr),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=al(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.sourceToOffsetPos(this.state.start),o.kind=n;else break}return this.state.labels.push({name:e,kind:n,statementStart:this.sourceToOffsetPos(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):t.type==="VoidPattern"&&this.raise(m.UnexpectedVoidPattern,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(514),this.prodParam.enter(ys(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||$(this.state.type)?this.parseIdentifier():null}parseFunctionParams(s,e){this.expect(10),this.expressionScope.enter(jl()),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(139);if(this.parseClassElementName(u),this.parsePostMemberNameModifiers(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 d=!this.state.containsEsc&&$(this.state.type),f=this.parseClassElementName(e),p=d?f.name:null,g=this.isPrivateName(f),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,f),b&&this.hasPlugin("typescript")&&e.override&&this.raise(m.OverrideOnConstructor,f),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(f);let b=this.eat(55);h.optional&&this.unexpected(y),u.kind="method";let P=this.match(139);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(f),u.kind=p;let b=this.match(139);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(f);let b=this.match(139);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===134)&&s.static&&t==="prototype"&&this.raise(m.StaticPrototype,this.state.startLoc),e===139){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(720);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(592),this.expressionScope.enter(kn()),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($(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.sawUnambiguousESM=!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 d;let f=s;if(this.checkExport(f,!0,!1,!!f.source),((d=f.declaration)==null?void 0:d.type)==="ClassDeclaration")this.maybeTakeDecorators(e,f.declaration,f);else if(e)throw this.raise(m.UnsupportedDecoratorExport,s);return this.sawUnambiguousESM=!0,this.finishNode(f,"ExportNamedDeclaration")}if(this.eat(65)){let f=s,p=this.parseExportDefaultExpression();if(f.declaration=p,p.type==="ClassDeclaration")this.maybeTakeDecorators(e,p,f);else if(e)throw this.raise(m.UnsupportedDecoratorExport,s);return this.checkExport(f,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(f,"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,this.hasPlugin("importAssertions")?e.assertions=[]:e.attributes=[],e.declaration=null,!0}return!1}maybeParseExportDeclaration(s){return this.shouldParseExportDeclaration()?(s.specifiers=[],s.source=null,this.hasPlugin("importAssertions")?s.assertions=[]:s.attributes=[],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()||this.isUsing()||this.isAwaitUsing())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($(s)){if(s===95&&!this.state.containsEsc||s===100)return!1;if((s===130||s===129)&&!this.state.containsEsc){let r=this.nextTokenStart(),n=this.input.charCodeAt(r);if(n===123||this.chStartsBindingIdentifier(n,r)&&!this.input.startsWith("from",r))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||$(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.isUsing()?(this.raise(m.UsingDeclarationExport,this.state.startLoc),!0):this.isAwaitUsing()?(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(134),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=this.cloneStringLiteral(s.local):s.exported||(s.exported=this.cloneIdentifier(s.local)),this.finishNode(s,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){let s=this.parseStringLiteral(this.state.value),e=Zl.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.startNode(),r=this.parseIdentifierName(!0),{type:n}=this.state;return(Se(n)?n!==98||this.lookaheadCharCode()===102:n!==12)?(this.applyImportPhase(s,e,r,t.loc.start),null):(this.applyImportPhase(s,e,null),this.createIdentifier(t,r))}isPrecedingIdImportPhase(s){let{type:e}=this.state;return $(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(s){return this.match(134)?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.sawUnambiguousESM=!0,this.finishNode(s,"ImportDeclaration")}parseImportSource(){return this.match(134)||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(134)?t.key=this.parseStringLiteral(r):t.key=this.parseIdentifier(!0),this.expect(14),!this.match(134))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(134))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;var t=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?(e=this.parseModuleAttributes(),this.addExtra(s,"deprecatedWithLegacySyntax",!0)):e=this.parseImportAttributes(),t=!0}else this.isContextual(94)&&!this.hasPrecedingLineBreak()?(!this.hasPlugin("deprecatedImportAssert")&&!this.hasPlugin("importAssertions")&&this.raise(m.ImportAttributesUseAssert,this.state.startLoc),this.hasPlugin("importAssertions")||this.addExtra(s,"deprecatedAssertSyntax",!0),this.next(),e=this.parseImportAttributes()):e=[];!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(Se(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(134),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=this.cloneIdentifier(a))}return this.finishImportSpecifier(s,"ImportSpecifier",n)}isThisParam(s){return s.type==="Identifier"&&s.name==="this"}},Ts=class extends _r{constructor(s,e,t){s=Qo(s),super(s,e),this.options=s,this.initializeScopes(),this.plugins=t,this.filename=s.sourceFilename,this.startIndex=s.startIndex;let r=0;s.allowAwaitOutsideFunction&&(r|=1),s.allowReturnOutsideFunction&&(r|=2),s.allowImportExportEverywhere&&(r|=8),s.allowSuperOutsideMethod&&(r|=16),s.allowUndeclaredExports&&(r|=64),s.allowNewTargetOutsideFunction&&(r|=4),s.allowYieldOutsideFunction&&(r|=32),s.ranges&&(r|=128),s.tokens&&(r|=256),s.createImportExpressions&&(r|=512),s.createParenthesizedExpressions&&(r|=1024),s.errorRecovery&&(r|=2048),s.attachComment&&(r|=4096),s.annexB&&(r|=8192),this.optionFlags=r}getScopeHandler(){return Ft}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 tc(i,s){var e;if(((e=s)==null?void 0:e.sourceType)==="unambiguous"){s=Object.assign({},s);try{s.sourceType="module";let t=Ot(s,i),r=t.parse();if(t.sawUnambiguousESM)return r;if(t.ambiguousScriptDifferentAst)try{return s.sourceType="script",Ot(s,i).parse()}catch{}else r.program.sourceType="script";return r}catch(t){try{return s.sourceType="script",Ot(s,i).parse()}catch{}throw t}}else return Ot(s,i).parse()}function sc(i,s){let e=Ot(s,i);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function rc(i){let s={};for(let e of Object.keys(i))s[e]=Oe(i[e]);return s}var ic=rc(sl);function Ot(i,s){let e=Ts,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||{})}Gl(t),e=nc(t)}return new e(i,s,t)}var pn=new Map;function nc(i){let s=[];for(let r of Yl)i.has(r)&&s.push(r);let e=s.join("|"),t=pn.get(e);if(!t){t=Ts;for(let r of s)t=An[r](t);pn.set(e,t)}return t}Bt.parse=tc;Bt.parseExpression=sc;Bt.tokTypes=ic});import{Command as _h}from"commander";var Ei="0.1.56";import Xs from"path";import{updateConfig as $a}from"c12/update";import{Command as Zu}from"commander";import{consola as Js}from"consola";import Be from"kleur";import Yt from"lodash";import gi from"prompts";import{join as Ma}from"path";import{loadConfig as Ru}from"c12";import kt from"fs-extra";import Uu from"lodash";import{promises as Gr}from"fs";var Bs=as(hr(),1),Vn=as(Wr(),1);function de(i){var s=i.use(X),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 z(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 ac=Object.defineProperty,oc=(i,s,e)=>s in i?ac(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e,ae=(i,s,e)=>(oc(i,typeof s!="symbol"?s+"":s,e),e),qn=Object.prototype,Ns=qn.toString,xe=qn.hasOwnProperty,Ze=class{assert(s,e){if(!this.check(s,e)){var t=ai(s);throw new Error(t+" does not match type "+this)}return!0}arrayOf(){let s=this;return new Wt(s)}},Wt=class extends Ze{constructor(s){super(),this.elemType=s,ae(this,"kind","ArrayType")}toString(){return"["+this.elemType+"]"}check(s,e){return Array.isArray(s)&&s.every(t=>this.elemType.check(t,e))}},Ls=class extends Ze{constructor(s){super(),this.value=s,ae(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}},Os=class extends Ze{constructor(s){super(),this.fields=s,ae(this,"kind","ObjectType")}toString(){return"{ "+this.fields.join(", ")+" }"}check(s,e){return Ns.call(s)===Ns.call({})&&this.fields.every(t=>t.type.check(s[t.name],e))}},Ds=class extends Ze{constructor(s){super(),this.types=s,ae(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)}},Qe=class extends Ze{constructor(s,e){super(),this.name=s,this.predicate=e,ae(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}},Kt=class i{constructor(s,e){this.type=s,this.typeName=e,ae(this,"baseNames",[]),ae(this,"ownFields",Object.create(null)),ae(this,"allSupertypes",Object.create(null)),ae(this,"supertypeList",[]),ae(this,"allFields",Object.create(null)),ae(this,"fieldNames",[]),ae(this,"finalized",!1),ae(this,"buildable",!1),ae(this,"buildParams",[])}isSupertypeOf(s){if(s instanceof i){if(this.finalized!==!0||s.finalized!==!0)throw new Error("");return xe.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}},Ms=class{constructor(s,e,t,r){this.name=s,this.type=e,this.defaultFn=t,ae(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 ai(i){return Array.isArray(i)?"["+i.map(ai).join(", ")+"]":i&&typeof i=="object"?"{ "+Object.keys(i).map(function(s){return s+": "+i[s]}).join(", ")+" }":JSON.stringify(i)}function X(i){let s={or(...E){return new Ds(E.map(v=>s.from(v)))},from(E,v){if(E instanceof Wt||E instanceof Ls||E instanceof Os||E instanceof Ds||E instanceof Qe)return E;if(E instanceof Kt)return E.type;if(o.check(E)){if(E.length!==1)throw new Error("only one element type is permitted for typed arrays");return new Wt(s.from(E[0]))}if(l.check(E))return new Os(Object.keys(E).map(F=>new Ms(F,s.from(E[F],F))));if(typeof E=="function"){var D=e.indexOf(E);if(D>=0)return t[D];if(typeof v!="string")throw new Error("missing name");return new Qe(v,E)}return new Ls(E)},def(E){return xe.call(b,E)?b[E]:b[E]=new I(E)},hasDef(E){return xe.call(b,E)}};var e=[],t=[];function r(E,v){let D=Ns.call(v),F=new Qe(E,V=>Ns.call(V)===D);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),d=r("boolean",!0),f=r("null",null),p=r("undefined",void 0),g=typeof BigInt=="function"?r("BigInt",BigInt(1234)):new Qe("BigInt",()=>!1),y={string:n,function:a,array:o,object:l,RegExp:c,Date:u,number:h,boolean:d,null:f,undefined:p,BigInt:g};var b=Object.create(null);function P(E){if(E&&typeof E=="object"){var v=E.type;if(typeof v=="string"&&xe.call(b,v)){var D=b[v];if(D.finalized)return D}}return null}class I extends Kt{constructor(v){super(new Qe(v,(D,F)=>this.check(D,F)),v)}check(v,D){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?D&&F===this?this.checkAllFields(v,D):this.isSupertypeOf(F)?D?F.checkAllFields(v,D)&&this.checkAllFields(v,!1):!0:!1:this.typeName==="SourceLocation"||this.typeName==="Position"?this.checkAllFields(v,D):!1}build(...v){if(this.buildParams=v,this.buildable)return this;this.field("type",String,()=>this.typeName),this.buildable=!0;let D=(V,K,W,re)=>{if(!xe.call(V,K)){var ye=this.allFields;if(!xe.call(ye,K))throw new Error(""+K);var ze=ye[K],is=ze.type,je;if(re)je=W;else if(ze.defaultFn)je=ze.defaultFn.call(V);else{var ns="no value or default function given for field "+JSON.stringify(K)+" of "+this.typeName+"("+this.buildParams.map(function(co){return ye[co]}).join(", ")+")";throw new Error(ns)}if(!is.check(je))throw new Error(ai(je)+" does not match field "+ze+" of type "+this.typeName);V[K]=je}},F=(...V)=>{var K=V.length;if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var W=Object.create(N);if(this.buildParams.forEach(function(re,ye){ye<K?D(W,re,V[ye],!0):D(W,re,null,!1)}),Object.keys(this.allFields).forEach(function(re){D(W,re,null,!1)}),W.type!==this.typeName)throw new Error("");return W};return F.from=V=>{if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var K=Object.create(N);if(Object.keys(this.allFields).forEach(function(W){xe.call(V,W)?D(K,W,V[W],!0):D(K,W,null,!1)}),K.type!==this.typeName)throw new Error("");return K},Object.defineProperty(w,te(this.typeName),{enumerable:!0,value:F}),this}field(v,D,F,V){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 Ms(v,s.from(D),F,V),this)}finalize(){if(!this.finalized){var v=this.allFields,D=this.allSupertypes;this.baseNames.forEach(V=>{var K=b[V];if(K instanceof Kt)K.finalize(),st(v,K.allFields),st(D,K.allSupertypes);else{var W="unknown supertype name "+JSON.stringify(V)+" for subtype "+JSON.stringify(this.typeName);throw new Error(W)}}),st(v,this.ownFields),D[this.typeName]=this,this.fieldNames.length=0;for(var F in v)xe.call(v,F)&&!v[F].hidden&&this.fieldNames.push(F);Object.defineProperty(wt,this.typeName,{enumerable:!0,value:this.type}),this.finalized=!0,ss(this.typeName,this.supertypeList),this.buildable&&this.supertypeList.lastIndexOf("Expression")>=0&&ts(this.typeName)}}}function T(E){if(!xe.call(b,E))throw new Error("");var v=b[E];if(v.finalized!==!0)throw new Error("");return v.supertypeList.slice(1)}function k(E){for(var v={},D=Object.keys(b),F=D.length,V=0;V<F;++V){var K=D[V],W=b[K];if(W.finalized!==!0)throw new Error(""+K);for(var re=0;re<W.supertypeList.length;++re){var ye=W.supertypeList[re];if(xe.call(E,ye)){v[K]=ye;break}}}return v}var w=Object.create(null),N={};function q(E,v){var D=N[E];return p.check(v)?delete N[E]:(a.assert(v),Object.defineProperty(N,E,{enumerable:!0,configurable:!0,value:v})),D}function te(E){return E.replace(/^[A-Z]+/,function(v){var D=v.length;switch(D){case 0:return"";case 1:return v.toLowerCase();default:return v.slice(0,D-1).toLowerCase()+v.charAt(D-1)}})}function ue(E){return E=te(E),E.replace(/(Expression)?$/,"Statement")}var wt={};function et(E){var v=P(E);if(v)return v.fieldNames.slice(0);if("type"in E)throw new Error("did not recognize object of type "+JSON.stringify(E.type));return Object.keys(E)}function tt(E,v){var D=P(E);if(D){var F=D.allFields[v];if(F)return F.getValue(E)}return E&&E[v]}function Zt(E,v,D){et(E).forEach(function(F){v.call(this,F,tt(E,F))},D)}function es(E,v,D){return et(E).some(function(F){return v.call(this,F,tt(E,F))},D)}function ts(E){var v=ue(E);if(w[v])return;var D=w[te(E)];if(!D)return;let F=function(...V){return w.expressionStatement(D.apply(w,V))};F.from=function(...V){return w.expressionStatement(D.from.apply(w,V))},w[v]=F}function ss(E,v){v.length=0,v.push(E);for(var D=Object.create(null),F=0;F<v.length;++F){E=v[F];var V=b[E];if(V.finalized!==!0)throw new Error("");xe.call(D,E)&&delete v[D[E]],D[E]=F,v.push.apply(v,V.baseNames)}for(var K=0,W=K,re=v.length;W<re;++W)xe.call(v,W)&&(v[K++]=v[W]);v.length=K}function st(E,v){return Object.keys(v).forEach(function(D){E[D]=v[D]}),E}function rs(){Object.keys(b).forEach(function(E){b[E].finalize()})}return{Type:s,builtInTypes:y,getSupertypeNames:T,computeSupertypeLookupTable:k,builders:w,defineMethod:q,getBuilderName:te,getStatementBuilderName:ue,namedTypes:wt,getFieldNames:et,getFieldValue:tt,eachField:Zt,someField:es,finalize:rs}}z(()=>module);var lc=Object.prototype,Ps=lc.hasOwnProperty;function Kn(i){var s=i.use(X),e=s.builtInTypes.array,t=s.builtInTypes.number;let r=function h(d,f,p){if(!(this instanceof h))throw new Error("Path constructor cannot be invoked without 'new'");if(f){if(!(f instanceof h))throw new Error("")}else f=null,p=null;this.value=d,this.parentPath=f,this.name=p,this.__childCache=null};var n=r.prototype;function a(h){return h.__childCache||(h.__childCache=Object.create(null))}function o(h,d){var f=a(h),p=h.getValueProperty(d),g=f[d];return(!Ps.call(f,d)||g.value!==p)&&(g=f[d]=new h.constructor(p,h,d)),g}n.getValueProperty=function(d){return this.value[d]},n.get=function(...d){for(var f=this,p=d.length,g=0;g<p;++g)f=o(f,d[g]);return f},n.each=function(d,f){for(var p=[],g=this.value.length,y=0,y=0;y<g;++y)Ps.call(this.value,y)&&(p[y]=this.get(y));for(f=f||this,y=0;y<g;++y)Ps.call(p,y)&&d.call(f,p[y])},n.map=function(d,f){var p=[];return this.each(function(g){p.push(d.call(this,g))},f),p},n.filter=function(d,f){var p=[];return this.each(function(g){d.call(this,g)&&p.push(g)},f),p};function l(){}function c(h,d,f,p){if(e.assert(h.value),d===0)return l;var g=h.value.length;if(g<1)return l;var y=arguments.length;y===2?(f=0,p=g):y===3?(f=Math.max(f,0),p=g):(f=Math.max(f,0),p=Math.min(p,g)),t.assert(f),t.assert(p);for(var b=Object.create(null),P=a(h),I=f;I<p;++I)if(Ps.call(h.value,I)){var T=h.get(I);if(T.name!==I)throw new Error("");var k=I+d;T.name=k,b[k]=T,delete P[I]}return delete P.length,function(){for(var w in b){var N=b[w];if(N.name!==+w)throw new Error("");P[w]=N,h.value[w]=N.value}}}n.shift=function(){var d=c(this,-1),f=this.value.shift();return d(),f},n.unshift=function(...d){var f=c(this,d.length),p=this.value.unshift.apply(this.value,d);return f(),p},n.push=function(...d){return e.assert(this.value),delete a(this).length,this.value.push.apply(this.value,d)},n.pop=function(){e.assert(this.value);var d=a(this);return delete d[this.value.length-1],delete d.length,this.value.pop()},n.insertAt=function(d){var f=arguments.length,p=c(this,f-1,d);if(p===l&&f<=1)return this;d=Math.max(d,0);for(var g=1;g<f;++g)this.value[d+g-1]=arguments[g];return p(),this},n.insertBefore=function(...d){for(var f=this.parentPath,p=d.length,g=[this.name],y=0;y<p;++y)g.push(d[y]);return f.insertAt.apply(f,g)},n.insertAfter=function(...d){for(var f=this.parentPath,p=d.length,g=[this.name+1],y=0;y<p;++y)g.push(d[y]);return f.insertAt.apply(f,g)};function u(h){if(!(h instanceof r))throw new Error("");var d=h.parentPath;if(!d)return h;var f=d.value,p=a(d);if(f[h.name]===h.value)p[h.name]=h;else if(e.check(f)){var g=f.indexOf(h.value);g>=0&&(p[h.name=g]=h)}else f[h.name]=h.value,p[h.name]=h;if(f[h.name]!==h.value)throw new Error("");if(h.parentPath.get(h.name)!==h)throw new Error("");return h}return n.replace=function(d){var f=[],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),I=[this.name,1],T=0;T<y;++T)I.push(arguments[T]);var k=p.splice.apply(p,I);if(k[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]!==d)throw new Error("");for(this.value!==d&&(this.value=d,this.__childCache=null),T=0;T<y;++T)f.push(this.parentPath.get(this.name+T));if(f[0]!==this)throw new Error("")}}else if(y===1)this.value!==d&&(this.__childCache=null),this.value=p[this.name]=d,f.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 f},r}z(()=>module);var ft=Object.prototype.hasOwnProperty;function cc(i){var s=i.use(X),e=s.Type,t=s.namedTypes,r=t.Node,n=t.Expression,a=s.builtInTypes.array,o=s.builders;let l=function T(k,w){if(!(this instanceof T))throw new Error("Scope constructor cannot be invoked without 'new'");u.check(k.value)||c.assert(k.value);var N;if(w){if(!(w instanceof T))throw new Error("");N=w.depth+1}else w=null,N=0;Object.defineProperties(this,{path:{value:k},node:{value:k.value},isGlobal:{value:!w,enumerable:!0},depth:{value:N},parent:{value:w},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 d=l.prototype;d.didScan=!1,d.declares=function(T){return this.scan(),ft.call(this.bindings,T)},d.declaresType=function(T){return this.scan(),ft.call(this.types,T)},d.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 k=0;this.declares(T+k);)++k;var w=T+k;return this.bindings[w]=s.builders.identifier(w)},d.injectTemporary=function(T,k){T||(T=this.declareTemporary());var w=this.path.get("body");return t.BlockStatement.check(w.value)&&(w=w.get("body")),w.unshift(o.variableDeclaration("var",[o.variableDeclarator(T,k||null)])),T},d.scan=function(T){if(T||!this.didScan){for(var k in this.bindings)delete this.bindings[k];for(var k in this.types)delete this.types[k];f(this.path,this.bindings,this.types),this.didScan=!0}},d.getBindings=function(){return this.scan(),this.bindings},d.getTypes=function(){return this.scan(),this.types};function f(T,k,w){var N=T.value;if(u.check(N)){let q=T.get("typeParameters","params");a.check(q.value)&&q.each(te=>{I(te,w)})}c.check(N)&&(t.CatchClause.check(N)?b(T.get("param"),k):p(T,k,w))}function p(T,k,w){var N=T.value;T.parent&&t.FunctionExpression.check(T.parent.node)&&T.parent.node.id&&b(T.parent.get("id"),k),N&&(a.check(N)?T.each(q=>{y(q,k,w)}):t.Function.check(N)?(T.get("params").each(q=>{b(q,k)}),y(T.get("body"),k,w),p(T.get("typeParameters"),k,w)):t.TypeAlias&&t.TypeAlias.check(N)||t.InterfaceDeclaration&&t.InterfaceDeclaration.check(N)||t.TSTypeAliasDeclaration&&t.TSTypeAliasDeclaration.check(N)||t.TSInterfaceDeclaration&&t.TSInterfaceDeclaration.check(N)?P(T.get("id"),w):t.VariableDeclarator.check(N)?(b(T.get("id"),k),y(T.get("init"),k,w)):N.type==="ImportSpecifier"||N.type==="ImportNamespaceSpecifier"||N.type==="ImportDefaultSpecifier"?b(T.get(N.local?"local":N.name?"name":"id"),k):r.check(N)&&!n.check(N)&&s.eachField(N,function(q,te){var ue=T.get(q);if(!g(ue,te))throw new Error("");y(ue,k,w)}))}function g(T,k){return!!(T.value===k||Array.isArray(T.value)&&T.value.length===0&&Array.isArray(k)&&k.length===0)}function y(T,k,w){var N=T.value;if(!(!N||n.check(N)))if(t.FunctionDeclaration.check(N)&&N.id!==null)b(T.get("id"),k);else if(t.ClassDeclaration&&t.ClassDeclaration.check(N)&&N.id!==null)b(T.get("id"),k),p(T.get("typeParameters"),k,w);else if(t.InterfaceDeclaration&&t.InterfaceDeclaration.check(N)||t.TSInterfaceDeclaration&&t.TSInterfaceDeclaration.check(N))P(T.get("id"),w);else if(c.check(N)){if(t.CatchClause.check(N)&&t.Identifier.check(N.param)){var q=N.param.name,te=ft.call(k,q);p(T.get("body"),k,w),te||delete k[q]}}else p(T,k,w)}function b(T,k){var w=T.value;t.Pattern.assert(w),t.Identifier.check(w)?ft.call(k,w.name)?k[w.name].push(T):k[w.name]=[T]:t.AssignmentPattern&&t.AssignmentPattern.check(w)?b(T.get("left"),k):t.ObjectPattern&&t.ObjectPattern.check(w)?T.get("properties").each(function(N){var q=N.value;t.Pattern.check(q)?b(N,k):t.Property.check(q)||t.ObjectProperty&&t.ObjectProperty.check(q)?b(N.get("value"),k):t.SpreadProperty&&t.SpreadProperty.check(q)&&b(N.get("argument"),k)}):t.ArrayPattern&&t.ArrayPattern.check(w)?T.get("elements").each(function(N){var q=N.value;t.Pattern.check(q)?b(N,k):t.SpreadElement&&t.SpreadElement.check(q)&&b(N.get("argument"),k)}):t.PropertyPattern&&t.PropertyPattern.check(w)?b(T.get("pattern"),k):(t.SpreadElementPattern&&t.SpreadElementPattern.check(w)||t.RestElement&&t.RestElement.check(w)||t.SpreadPropertyPattern&&t.SpreadPropertyPattern.check(w))&&b(T.get("argument"),k)}function P(T,k){var w=T.value;t.Pattern.assert(w),t.Identifier.check(w)&&(ft.call(k,w.name)?k[w.name].push(T):k[w.name]=[T])}function I(T,k){var w=T.value;h.assert(w),ft.call(k,w.name)?k[w.name].push(T):k[w.name]=[T]}return d.lookup=function(T){for(var k=this;k&&!k.declares(T);k=k.parent);return k},d.lookupType=function(T){for(var k=this;k&&!k.declaresType(T);k=k.parent);return k},d.getGlobalScope=function(){for(var T=this;!T.isGlobal;)T=T.parent;return T},l}z(()=>module);function zn(i){var s=i.use(X),e=s.namedTypes,t=s.builders,r=s.builtInTypes.number,n=s.builtInTypes.array,a=i.use(Kn),o=i.use(cc);let l=function y(b,P,I){if(!(this instanceof y))throw new Error("NodePath constructor cannot be invoked without 'new'");a.call(this,b,P,I)};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 I=b.value;switch(P.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return I.type==="MemberExpression"&&this.name==="object"&&I.object===P;case"BinaryExpression":case"LogicalExpression":switch(I.type){case"CallExpression":return this.name==="callee"&&I.callee===P;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return this.name==="object"&&I.object===P;case"BinaryExpression":case"LogicalExpression":{let T=P,k=I.operator,w=h[k],N=T.operator,q=h[N];if(w>q)return!0;if(w===q&&this.name==="right"){if(I.right!==T)throw new Error("Nodes must be equal");return!0}}default:return!1}case"SequenceExpression":switch(I.type){case"ForStatement":return!1;case"ExpressionStatement":return this.name!=="expression";default:return!0}case"YieldExpression":switch(I.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 I.type==="MemberExpression"&&r.check(P.value)&&this.name==="object"&&I.object===P;case"AssignmentExpression":case"ConditionalExpression":switch(I.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return this.name==="callee"&&I.callee===P;case"ConditionalExpression":return this.name==="test"&&I.test===P;case"MemberExpression":return this.name==="object"&&I.object===P;default:return!1}default:if(I.type==="NewExpression"&&this.name==="callee"&&I.callee===P)return d(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 d(y){return e.CallExpression.check(y)?!0:n.check(y)?y.some(d):e.Node.check(y)?s.someField(y,function(b,P){return d(P)}):!1}c.canBeFirstInStatement=function(){var y=this.node;return!e.FunctionExpression.check(y)&&!e.ObjectExpression.check(y)},c.firstInStatement=function(){return f(this)};function f(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,I=y.get("consequent").value;if(!I&&!P){var T=t.expressionStatement(b);y.replace(T)}else if(!I&&P){var k=t.unaryExpression("!",b,!0);e.UnaryExpression.check(b)&&b.operator==="!"&&(k=b.argument),y.get("test").replace(k),y.get("consequent").replace(P),y.get("alternate").replace()}}return l}z(()=>module);var Ss=Object.prototype.hasOwnProperty;function uc(i){var s=i.use(X),e=i.use(zn),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=Ss.call(this._methodNameTable,"Block")||Ss.call(this._methodNameTable,"Line"),this.Context=d(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),I=Object.keys(b),T=I.length,k=0;k<T;++k){var w=I[k];y="visit"+b[w],n.check(p[y])&&(P[w]=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)Ss.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,I=[],T=0;T<P;++T){var k=b[T];Ss.call(y,k)||(y[k]=s.getFieldValue(y,k)),I.push(p.get(k))}for(var T=0;T<P;++T)g.visitWithoutReset(I[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 d(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,f),g}var f=Object.create(null);return f.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},f.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},f.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))},f.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)},f.reportChanged=function(){this.visitor.reportChanged()},f.abort=function(){this.needToCallTraverse=!1,this.visitor.abort()},o}z(()=>module);function hc(i){var s=i.use(X),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)?d(p,g,y):n.check(p)?f(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 d(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 I=y.pop();if(I!==P)throw new Error(""+I)}}return!0}function f(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,I=e(g),T=I.length;if(P===T){for(var k=0;k<P;++k){var w=b[k],N=t(p,w),q=t(g,w);if(y&&y.push(w),!h(N,q,y))return!1;if(y){var te=y.pop();if(te!==w)throw new Error(""+te)}}return!0}if(!y)return!1;var ue=Object.create(null);for(k=0;k<P;++k)ue[b[k]]=!0;for(k=0;k<T;++k){if(w=I[k],!l.call(ue,w))return y.push(w),!1;delete ue[w]}for(w in ue){y.push(w);break}return!1}return c}z(()=>module);function pc(i){let s=dc(),e=s.use(X);i.forEach(s.use),e.finalize();let t=s.use(uc);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(hc),finalize:e.finalize,Path:s.use(Kn),NodePath:s.use(zn),PathVisitor:t,use:s.use,visit:t.visit}}function dc(){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}z(()=>module);function Wn(){return{BinaryOperators:["==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof"],AssignmentOperators:["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&="],LogicalOperators:["||","&&"]}}z(()=>module);function Hn(i){let s=i.use(Wn);return s.BinaryOperators.indexOf("**")<0&&s.BinaryOperators.push("**"),s.AssignmentOperators.indexOf("**=")<0&&s.AssignmentOperators.push("**="),s}z(()=>module);function Jn(i){let s=i.use(Hn);return s.LogicalOperators.indexOf("??")<0&&s.LogicalOperators.push("??"),s}z(()=>module);function fc(i){let s=i.use(Jn);return s.LogicalOperators.forEach(e=>{let t=e+"=";s.AssignmentOperators.indexOf(t)<0&&s.AssignmentOperators.push(t)}),s}z(()=>module);function mc(i){var s=i.use(X),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(Wn);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 d=r(...l);t("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",d).field("left",t("Expression")).field("right",t("Expression"));let f=r(...c);t("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",f).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)}z(()=>module);function yc(i){i.use(mc);let s=i.use(X),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"))}z(()=>module);function gc(i){i.use(Hn),i.use(yc)}z(()=>module);function bc(i){i.use(gc);let e=i.use(X).Type.def,t=i.use(de).defaults;e("Function").field("async",Boolean,t.false),e("AwaitExpression").bases("Expression").build("argument").field("argument",e("Expression"))}z(()=>module);function xc(i){i.use(bc);let s=i.use(X),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"))])}z(()=>module);function Tc(i){i.use(xc);let s=i.use(X),e=s.Type.def,t=s.Type.or,r=i.use(de).defaults;e("CatchClause").field("param",t(e("Pattern"),null),r.null)}z(()=>module);function Pc(i){i.use(Jn),i.use(Tc);let s=i.use(X),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)}z(()=>module);function Sc(i){i.use(fc),i.use(Pc)}z(()=>module);function kc(i){i.use(Sc);let e=i.use(X).Type.def;e("StaticBlock").bases("Declaration").build("body").field("body",[e("Statement")])}z(()=>module);function Gt(i){i.use(kc);let s=i.use(X),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"))}z(()=>module);function wc(i){i.use(Gt);let s=i.use(X),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"))}z(()=>module);function Xn(i){var s=i.use(X),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)})}z(()=>module);function Gn(i){i.use(Gt),i.use(Xn);let s=i.use(X),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"))}z(()=>module);function Ec(i){i.use(Gt);var s=i.use(X),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")}z(()=>module);function Yn(i){i.use(Gt);let s=i.use(X),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 f=s.getFieldValue(this,"value");return{rawValue:f,raw:h?h(f):String(f)}}]}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()}z(()=>module);function vc(i){let e=i.use(X).Type.def;i.use(Yn),i.use(Gn),e("V8IntrinsicIdentifier").bases("Expression").build("name").field("name",String),e("TopicReference").bases("Expression").build()}z(()=>module);function Ac(i){i.use(Yn),i.use(Xn);var s=i.use(X),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)])}z(()=>module);var we;we||(we={});var{astNodesAreEquivalent:ip,builders:Pt,builtInTypes:Ee,defineMethod:np,eachField:ap,finalize:op,getBuilderName:lp,getFieldNames:Cc,getFieldValue:Fe,getSupertypeNames:cp,namedTypes:Ic,NodePath:Nc,Path:up,PathVisitor:hp,someField:Lc,Type:pp,use:dp,visit:fp}=pc([Gt,wc,Gn,Ec,vc,Ac]);Object.assign(we,Ic);var ks=we,Cn=Bs.default.SourceMapConsumer,Oc=Bs.default.SourceMapGenerator,Qn=Object.prototype.hasOwnProperty;function Dc(){return`
10
- `}function In(i,s,e){return i&&Qn.call(i,s)?i[s]:e}function Mc(...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 Ke(i){return{line:i.line,column:i.column}}function Fc(i,s){if(i){if(!s)return i}else return s||null;let e=new Cn(i),t=new Cn(s),r=new Oc({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:Ke(o),generated:{line:a.generatedLine,column:a.generatedColumn},name:a.name});let c=e.sourceContentFor(l);c&&!Qn.call(n,l)&&(n[l]=c,r.setSourceContent(l,c))}),r.toJSON()}function Zn(i,s){if(!i.loc)return null;let e={start:i.loc.start,end:i.loc.end};function t(r){Yr(e,r.loc)}return i.declaration&&i.declaration.decorators&&js(i)&&i.declaration.decorators.forEach(t),U(e.start,e.end)<0&&(e.start=Ke(e.start),s.skipSpaces(e.start,!1,!0),U(e.start,e.end)<0&&(e.end=Ke(e.end),s.skipSpaces(e.end,!0,!0))),i.comments&&i.comments.forEach(t),e}function Yr(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 oi(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()),_c(i,s),Bc(i,s),e&&i.decorators)i.decorators.forEach(function(t){Yr(e,t.loc)});else if(i.declaration&&js(i)){i.declaration.loc=null;let t=i.declaration.decorators;t&&t.forEach(function(r){Yr(e,r.loc)})}else if(ks.MethodDefinition&&ks.MethodDefinition.check(i)||ks.Property.check(i)&&(i.method||i.shorthand))i.value.loc=null,ks.FunctionExpression.check(i.value)&&(i.value.id=null);else if(i.type==="ObjectTypeProperty"){let t=i.loc,r=t&&t.end;r&&(r=Ke(r),s.prevPos(r)&&s.charAt(r)===","&&(r=s.skipSpaces(r,!0,!0))&&(t.end=r))}}function _c(i,s){if(i.type!=="ForStatement")return;function e(t){let r=t&&t.loc,n=r&&r.start,a=r&&Ke(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 Bc(i,s){if(i.type==="TemplateLiteral"&&i.quasis.length!==0){if(i.loc){let e=Ke(i.loc.start),t=i.quasis[0];U(t.loc.start,e)<0&&(t.loc.start=e);let r=Ke(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 js(i){if(i)switch(i.type){case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportDefaultSpecifier":case"DeclareExportDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return!0}return!1}function ea(i){let s=i.getParentNode();return i.getName()==="declaration"&&js(s)?s:null}function zt(i,s){let e=i.trailingComma;return typeof e=="object"?!!e[s]:!!e}var Qr={tabWidth:4,useTabs:!1,reuseWhitespace:!0,lineTerminator:Dc(),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},jc=Qr.hasOwnProperty;function Rs(i){let s=i||Qr;function e(t){return jc.call(s,t)?s[t]:Qr[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 Zr=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),Rc(r,c,s,u,h)}if(U(e,a.start)<=0)if(U(a.end,t)<=0)a={start:qe(a.start,e.line,e.column),end:qe(a.end,e.line,e.column)};else{if(U(t,a.start)<=0)return null;n={start:n.start,end:o("end")},a={start:qe(a.start,e.line,e.column),end:qe(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:qe(a.end,e.line,e.column)}):(n={start:o("start"),end:o("end")},a={start:{line:1,column:0},end:qe(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:qe(this.targetLoc.start,s,e),end:qe(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 qe(i,s,e){return{line:i.line-s+1,column:i.line===s?i.column-e:i.column}}function Rc(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 Uc=Object.defineProperty,$c=(i,s,e)=>s in i?Uc(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e,jt=(i,s,e)=>($c(i,typeof s!="symbol"?s+"":s,e),e),xt=class i{constructor(s,e=null){this.infos=s,jt(this,"length"),jt(this,"name"),jt(this,"mappings",[]),jt(this,"cachedSourceMap",null),jt(this,"cachedTabWidth"),this.length=s.length,this.name=e||null,this.name&&this.mappings.push(new Zr(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 Bs.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}}),!ei.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(ti),n=r[e-1];return typeof n>"u"?"":t===n.length&&e<r.length?`
11
- `: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(mt(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)ei.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 mt(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 mt(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(!mt(this.charAt(s))&&this.nextPos(s))return s;return null}else{for(;mt(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):Ye}trimRight(){let s=this.skipSpaces(this.lastPos(),!0,!0);return s?this.slice(this.firstPos(),s):Ye}trim(){let s=this.skipSpaces(this.firstPos(),!1,!0);if(s===null)return Ye;let e=this.skipSpaces(this.lastPos(),!0,!0);return e===null?Ye: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(ti).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]=yt(t[0],s.column,e.column):(t[0]=yt(t[0],s.column),t.push(yt(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}=Rs(t),l=[];for(let c=s.line;c<=e.line;++c){let u=this.infos[c-1];c===s.line?c===e.line?u=yt(u,s.column,e.column):u=yt(u,s.column):c===e.line&&(u=yt(u,0,e.column));let h=Math.max(u.indent,0),d=u.line.slice(0,u.sliceStart);if(a&&mt(d)&&ta(d,r)===h){l.push(u.line.slice(0,u.sliceEnd));continue}let f=0,p=h;n&&(f=Math.floor(h/r),p-=f*r);let g="";f>0&&(g+=new Array(f+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(" "),d=t.length,f=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(d,f))})}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 Ye;let l=new i(t);return l.mappings=r,l}concat(...s){let e=[this];return e.push.apply(e,s),Ye.join(e)}},Cs={},ei=Cs.hasOwnProperty,Vc=10;function ta(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 qc=/^\s*/,ti=/\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/;function S(i,s){if(i instanceof xt)return i;i+="";let e=s&&s.tabWidth,t=i.indexOf(" ")<0,r=!s&&t&&i.length<=Vc;if(r&&ei.call(Cs,i))return Cs[i];let n=new xt(i.split(ti).map(function(a){let o=qc.exec(a)[0];return{line:a,indent:ta(o,e),locked:!1,sliceStart:o.length,sliceEnd:a.length}}),Rs(s).sourceFileName);return r&&(Cs[i]=n),n}function mt(i){return!/\S/.test(i)}function yt(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 Ye.join(i)}var Ye=S(""),Tt=we,sa=Ee.array,Kc=Ee.object,Ln=new WeakMap;function ra(i,s,e){if(!i)return e;if(oi(i,s),e){if(Tt.Node.check(i)&&Tt.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(sa.check(i))t=Object.keys(i);else if(Kc.check(i))t=Cc(i);else return e;e||Ln.set(i,e=[]);for(let r=0,n=t.length;r<n;++r)ra(i[t[r]],s,e);return e}function ia(i,s,e){let t=ra(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){ia(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 zc(i,s,e){if(!sa.check(i))return;let t=[];i.forEach(function(r){r.loc.lines=e,ia(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&&Rt(t,e),t.push(r)}else if(n)Rt(t,e),aa(n,r);else if(o)Rt(t,e),na(o,r);else if(a)Rt(t,e),Wc(a,r);else throw new Error("AST contains no nodes at all?")}),Rt(t,e),i.forEach(function(r){delete r.precedingNode,delete r.enclosingNode,delete r.followingNode})}function Rt(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?aa(t,l):na(r,l)}),i.length=0}function li(i,s){(i.comments||(i.comments=[])).push(s)}function na(i,s){s.leading=!0,s.trailing=!1,li(i,s)}function Wc(i,s){s.leading=!1,s.trailing=!1,li(i,s)}function aa(i,s){s.leading=!1,s.trailing=!0,li(i,s)}function Hc(i,s){let e=i.getValue();Tt.Comment.assert(e);let t=e.loc,r=t&&t.lines,n=[s(i)];if(e.trailing)n.push(`
14
- `);else if(r instanceof xt){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
- `))}else n.push(`
16
- `);return x(n)}function Jc(i,s){let e=i.getValue(i);Tt.Comment.assert(e);let t=e.loc,r=t&&t.lines,n=[];if(r instanceof xt){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=Tt.Node.check(e)&&Fe(e,"comments");if(!r||r.length===0)return t;let n=[],a=[t];return i.each(function(o){let l=o.getValue(),c=Fe(l,"leading"),u=Fe(l,"trailing");c||u&&!(Tt.Statement.check(e)||l.type==="Block"||l.type==="CommentBlock")?n.push(Hc(o,s)):u&&a.push(Jc(o,s))},"comments"),n.push.apply(n,a),x(n)}var Xc=Pt,Gc=Ee.object,Yc=Ee.array;function oa(i,s){s=Rs(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:In(s,"tolerant",!0),ecmaVersion:6,sourceType:In(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?oi(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=Xc.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=Zn({type:l.type,loc:l.loc,body:[],comments:r},e);return l.loc.start=c.start,l.loc.end=c.end,zc(r,l.body.length?o.program:o,e),new la(e,a).copy(o)}var la=function(s,e){this.lines=s,this.tokens=e,this.startTokenIndex=0,this.endTokenIndex=e.length,this.indent=0,this.seen=new Map},ca=la.prototype;ca.copy=function(i){if(this.seen.has(i))return this.seen.get(i);if(Yc.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(!Gc.check(i))return i;oi(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};ca.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 J=we,Qc=Ee.array,Zc=Ee.number,si={};[["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].forEach(function(i,s){i.forEach(function(e){si[e]=s})});var ke=function(s){this.stack=[s]},se=ke.prototype;ke.from=function(i){if(i instanceof ke)return i.copy();if(i instanceof Nc){let s=Object.create(ke.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 ke(i)};se.copy=function(){let s=Object.create(ke.prototype);return s.stack=this.stack.slice(0),s};se.getName=function(){let s=this.stack,e=s.length;return e>1?s[e-2]:null};se.getValue=function(){let s=this.stack;return s[s.length-1]};se.valueIsDuplicate=function(){let i=this.stack,s=i.length-1;return i.lastIndexOf(i[s],s-1)>=0};function ua(i,s){let e=i.stack;for(let t=e.length-1;t>=0;t-=2){let r=e[t];if(J.Node.check(r)&&--s<0)return r}return null}se.getNode=function(s=0){return ua(this,~~s)};se.getParentNode=function(s=0){return ua(this,~~s+1)};se.getRootValue=function(){let s=this.stack;return s.length%2===0?s[1]:s[0]};se.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};se.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};se.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};se.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};se.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};se.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};se.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||J.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=si[r],a=s.operator,o=si[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"&&Zc.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 J.CallExpression.check(e)&&t==="callee"&&e.callee===s||J.MemberExpression.check(e)&&t==="object"&&e.object===s||J.TSAsExpression&&J.TSAsExpression.check(e)&&t==="expression"&&e.expression===s?!0:ha(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"&&J.ExportDefaultDeclaration.check(e)&&J.FunctionExpression.check(s.callee))return!0}return e.type==="NewExpression"&&t==="callee"&&e.callee===s?ri(s):!!(i!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function ha(i){return J.BinaryExpression.check(i)||J.LogicalExpression.check(i)}function ri(i){return J.CallExpression.check(i)?!0:Qc.check(i)?i.some(ri):J.Node.check(i)?Lc(i,(s,e)=>ri(e)):!1}se.canBeFirstInStatement=function(){let i=this.getNode();return!(J.FunctionExpression.check(i)||J.ObjectExpression.check(i)||J.ClassExpression.check(i))};se.firstInStatement=function(){let i=this.stack,s,e,t,r;for(let n=i.length-1;n>=0;n-=2)if(J.Node.check(i[n])&&(t=s,r=e,s=i[n-1],e=i[n]),!(!e||!r)){if(J.BlockStatement.check(e)&&s==="body"&&t===0||J.ExpressionStatement.check(e)&&t==="expression"||J.AssignmentExpression.check(e)&&t==="left"||J.ArrowFunctionExpression.check(e)&&t==="body")return!0;if(!(J.SequenceExpression.check(e)&&i[n+1]==="expressions"&&t===0)&&!(J.CallExpression.check(e)&&t==="callee")&&!(J.MemberExpression.check(e)&&t==="object")&&!(J.ConditionalExpression.check(e)&&t==="test")&&!(ha(e)&&t==="left")&&!(J.UnaryExpression.check(e)&&!e.prefix&&t==="argument"))return!1}return!0};var Ht=we.Printable,Dn=we.Expression,eu=we.ReturnStatement,tu=we.SourceLocation,Jt=Ee.object,ii=Ee.array,su=Ee.string,Fs=/[0-9a-z_$]/i,pa=function(s){let e=this,t=[];e.replace=function(r,n){su.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)}},da=pa.prototype;da.tryToReprintComments=function(i,s,e){let t=this;if(!i.comments&&!s.comments)return!0;let r=ke.from(i),n=ke.from(s);r.stack.push("comments",Mn(i)),n.stack.push("comments",Mn(s));let a=[],o=ma(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 Mn(i){let s=[];return i.comments&&i.comments.length>0&&i.comments.forEach(function(e){(e.leading||e.trailing)&&s.push(e)}),s}da.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 ru(i){let s=i.getValue();if(!Ht.check(s))return;let e=s.original,t=e&&e.loc,r=t&&t.lines,n=[];if(!(!r||!au(i,n)))return function(a){let o=new pa(r);n.forEach(function(c){let u=c.newPath.getValue(),h=c.oldPath.getValue();tu.assert(h.loc,!0);let d=!o.tryToReprintComments(u,h,a);d&&o.deleteComments(h);let f=a(c.newPath,{includeComments:d,avoidRootParens:h.type===u.type&&c.oldPath.hasParens()}).indentTail(h.loc.indent),p=iu(r,h.loc,f),g=nu(r,h.loc,f);if(p||g){let y=[];p&&y.push(" "),y.push(f),g&&y.push(" "),f=x(y)}o.replace(h.loc,f)});let l=o.get(t).indentTail(-e.loc.indent);return i.needsParens()?x(["(",l,")"]):l}}function iu(i,s,e){let t=Ke(s.start),r=i.prevPos(t)&&i.charAt(t),n=e.charAt(e.firstPos());return r&&Fs.test(r)&&n&&Fs.test(n)}function nu(i,s,e){let t=i.charAt(s.end),r=e.lastPos(),n=e.prevPos(r)&&e.charAt(r);return n&&Fs.test(n)&&t&&Fs.test(t)}function au(i,s){let e=i.getValue();Ht.assert(e);let t=e.original;if(Ht.assert(t),e.type!==t.type)return!1;let r=new ke(t),n=ni(i,r,s);return n||(s.length=0),n}function fa(i,s,e){let t=i.getValue(),r=s.getValue();return t===r?!0:ii.check(t)?ma(i,s,e):Jt.check(t)?ou(i,s,e):!1}function ma(i,s,e){let t=i.getValue(),r=s.getValue();if(t===r||i.valueIsDuplicate()||s.valueIsDuplicate())return!0;ii.assert(t);let n=t.length;if(!(ii.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=fa(i,s,e);if(i.stack.length-=2,s.stack.length-=2,!o)return!1}return!0}function ou(i,s,e){let t=i.getValue();if(Jt.assert(t),t.original===null)return!1;let r=s.getValue();if(!Jt.check(r))return!1;if(t===r||i.valueIsDuplicate()||s.valueIsDuplicate())return!0;if(Ht.check(t)){if(!Ht.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(ni(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 Dn.check(t)&&Dn.check(r)&&r.loc?(e.push({oldPath:s.copy(),newPath:i.copy()}),!0):!1}return ni(i,s,e)}function ni(i,s,e){let t=i.getValue(),r=s.getValue();if(Jt.assert(t),Jt.assert(r),t.original===null||i.needsParens()&&!s.hasParens())return!1;let n=Mc(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,Fe(t,o)),s.stack.push(o,Fe(r,o));let l=fa(i,s,e);if(i.stack.length-=2,s.stack.length-=2,!l)return!1}return!(eu.check(i.getNode())&&e.length>a)}var Y=we,ci=Ee.string,lu=Ee.object,_s=function(s,e){ci.assert(s),this.code=s,e&&(lu.assert(e),this.map=e)},cu=_s.prototype,Fn=!1;cu.toString=function(){return Fn||(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."),Fn=!0),this.code};var _n=new _s(""),uu=function(s){let e=s&&s.tabWidth;s=Rs(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=ru(n),c=l?l(r):Bn(n,s,a,t(a,{includeComments:!0,avoidRootParens:!1}));return s.tabWidth=o,c}this.print=function(n){if(!n)return _n;let a=r(ke.from(n),{includeComments:!0,avoidRootParens:!1});return new _s(a.toString(s),Fc(s.inputSourceMap,a.getSourceMap(s.sourceMapName,s.sourceRoot)))},this.printGenerically=function(n){if(!n)return _n;function a(u){return On(u,h=>Bn(h,s,{includeComments:!0,avoidRootParens:!1},a))}let o=ke.from(n),l=s.reuseWhitespace;s.reuseWhitespace=!1;let c=new _s(a(o).toString(s));return s.reuseWhitespace=l,c}};function Bn(i,s,e,t){let r=i.getValue(),n=[],a=hu(i,s,t);if(!r||a.isEmpty())return a;let o=!1,l=pu(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 hu(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=>gt(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=Fe(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("(",Ie(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("(",Ie(i,s,e),")",i.call(e,"returnType")),r.push(" => ",i.call(e,"body")),x(r);case"MethodDefinition":return Hr(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
- `,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 Rn(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")),Is(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
- `).join(a).indent(s.tabWidth),","])),n.length>0&&r.push(", "),o.length>1?r.push(`{
22
- `,o,`
23
- }`):s.objectCurlySpacing?r.push("{ ",o," }"):r.push("{",o,"}")}r.push(" from ")}return r.push(i.call(e,"source"),ga(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=>gt(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(Is(e(a).indent(s.tabWidth)),t.directives.length>1||!n.isEmpty()?`
25
- `:"")},"directives"),r.push(n.indent(s.tabWidth)),r.push(`
26
- }`),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
- `,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")),Fe(t,"optional")&&r.push("?."),r.push(jn(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?"{|":"{",d=t.exact?"|}":"}";r.push(u?h:h+`
29
- `);let f=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
- `),r.push(b),p<c-1?(r.push(a+(P?`
31
-
32
- `:`
33
- `)),l=!P):(c!==1&&n||!u&&zt(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
- `,g.indent(s.tabWidth))}return r.push(u?d:`
35
- `+d),p!==0&&u&&s.objectCurlySpacing&&(r[f]=h+" ",r[r.length-1]=" "+d),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 Hr(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 Hr(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
- `),i.each(function(u){let h=u.getName();if(!u.getValue())r.push(",");else{let f=o[h];c?h>0&&r.push(" "):f=f.indent(s.tabWidth),r.push(f),(h<a-1||!c&&zt(s,"arrays"))&&r.push(","),c||r.push(`
37
- `)}},"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(bt(t)||`/${t.pattern}/${t.flags||""}`,s);case"BigIntLiteral":return S(bt(t)||t.value+"n",s);case"NumericLiteral":return S(bt(t)||t.value,s);case"DecimalLiteral":return S(bt(t)||t.value+"m",s);case"StringLiteral":return S(Vt(t.value,s));case"BooleanLiteral":case"Literal":return S(bt(t)||(typeof t.value=="string"?Vt(t.value,s):t.value),s);case"Directive":return i.call(e,"value");case"DirectiveLiteral":return S(bt(t)||Vt(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(Vt(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(jn(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=Ge(i.call(e,"consequent"),s);return r.push("if (",i.call(e,"test"),")",n),t.alternate&&r.push(Un(n)?" else":`
40
- else`,Ge(i.call(e,"alternate"),s)),x(r)}case"ForStatement":{let n=i.call(e,"init"),a=n.length>1?`;
41
- `:"; ",o="for (",l=S(a).join([n,i.call(e,"test"),i.call(e,"update")]).indentTail(o.length),c=x([o,l,")"]),u=Ge(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"),")",Ge(i.call(e,"body"),s)]);case"ForInStatement":return x([t.each?"for each (":"for (",i.call(e,"left")," in ",i.call(e,"right"),")",Ge(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"),")",Ge(i.call(e,"body"),s)),x(r);case"DoWhileStatement":{let n=x(["do",Ge(i.call(e,"body"),s)]);return r.push(n),Un(n)?r.push(" while"):r.push(`
43
- while`),r.push(" (",i.call(e,"test"),");"),x(r)}case"DoExpression":{let n=i.call(a=>gt(a,s,e),"body");return x([`do {
44
- `,n.indent(s.tabWidth),`
45
- }`])}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"),`:
46
- `,i.call(e,"body")]);case"TryStatement":return r.push("try ",i.call(e,"block")),t.handler?r.push(" ",i.call(e,"handler")):t.handlers&&i.each(function(n){r.push(" ",e(n))},"handlers"),t.finalizer&&r.push(" finally ",i.call(e,"finalizer")),x(r);case"CatchClause":return r.push("catch "),t.param&&r.push("(",i.call(e,"param")),t.guard&&r.push(" if ",i.call(e,"guard")),t.param&&r.push(") "),r.push(i.call(e,"body")),x(r);case"ThrowStatement":return x(["throw ",i.call(e,"argument"),";"]);case"SwitchStatement":return x(["switch (",i.call(e,"discriminant"),`) {
47
- `,S(`
48
- `).join(i.map(e,"cases")),`
49
- }`]);case"SwitchCase":return t.test?r.push("case ",i.call(e,"test"),":"):r.push("default:"),t.consequent.length>0&&r.push(`
50
- `,i.call(n=>gt(n,s,e),"consequent").indent(s.tabWidth)),x(r);case"DebuggerStatement":return S("debugger;");case"JSXAttribute":return r.push(i.call(e,"name")),t.value&&r.push("=",i.call(e,"value")),x(r);case"JSXIdentifier":return S(t.name,s);case"JSXNamespacedName":return S(":").join([i.call(e,"namespace"),i.call(e,"name")]);case"JSXMemberExpression":return S(".").join([i.call(e,"object"),i.call(e,"property")]);case"JSXSpreadAttribute":return x(["{...",i.call(e,"argument"),"}"]);case"JSXSpreadChild":return x(["{...",i.call(e,"expression"),"}"]);case"JSXExpressionContainer":return x(["{",i.call(e,"expression"),"}"]);case"JSXElement":case"JSXFragment":{let n="opening"+(t.type==="JSXElement"?"Element":"Fragment"),a="closing"+(t.type==="JSXElement"?"Element":"Fragment"),o=i.call(e,n);if(t[n].selfClosing)return o;let l=x(i.map(function(u){let h=u.getValue();if(Y.Literal.check(h)&&typeof h.value=="string"){if(/\S/.test(h.value))return h.value.replace(/^\s+|\s+$/g,"");if(/\n/.test(h.value))return`
51
- `}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
- `)}),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
- `,i.call(n=>gt(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([$t(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(...ya(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"?Ut(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
- `),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&&zt(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 Ut(i,["function ",i.call(e,"id"),";"]);case"DeclareModule":return Ut(i,["module ",i.call(e,"id")," ",i.call(e,"body")]);case"DeclareModuleExports":return Ut(i,["module.exports",i.call(e,"typeAnnotation")]);case"DeclareVariable":return Ut(i,["var ",i.call(e,"id"),";"]);case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":return x(["declare ",Rn(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
- `,S(`
58
- `).join(i.map(e,"members")).indent(s.tabWidth),`
59
- }`),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?"(":"",Ie(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($t(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([$t(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(Vt(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($t(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"),"(",Ie(i,s,e),") => ",i.call(e,"typeAnnotation","typeAnnotation")]);case"TSConstructorType":return x(["new ",i.call(e,"typeParameters"),"(",Ie(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([`{
60
- `,x(r).indent(s.tabWidth),`
61
- }`]);case"TSTupleType":return x(["[",S(", ").join(i.map(e,"elementTypes")),"]"]);case"TSNamedTupleMember":return r.push(i.call(e,"label")),t.optional&&r.push("?"),r.push(": ",i.call(e,"elementType")),x(r);case"TSRestType":return x(["...",i.call(e,"typeAnnotation")]);case"TSOptionalType":return x([i.call(e,"typeAnnotation"),"?"]);case"TSIndexedAccessType":return x([i.call(e,"objectType"),"[",i.call(e,"indexType"),"]"]);case"TSTypeOperator":return x([i.call(e,"operator")," ",i.call(e,"typeAnnotation")]);case"TSTypeLiteral":{let n=S(`
62
- `).join(i.map(e,"members").map(a=>Xt(a)!==";"?a.concat(";"):a));return n.isEmpty()?S("{}",s):(r.push(`{
63
- `,n.indent(s.tabWidth),`
64
- }`),x(r))}case"TSEnumMember":return r.push(i.call(e,"id")),t.initializer&&r.push(" = ",i.call(e,"initializer")),x(r);case"TSTypeQuery":return x(["typeof ",i.call(e,"exprName")]);case"TSParameterProperty":return t.accessibility&&r.push(t.accessibility," "),t.export&&r.push("export "),t.static&&r.push("static "),t.readonly&&r.push("readonly "),r.push(i.call(e,"parameter")),x(r);case"TSTypeReference":return x([i.call(e,"typeName"),i.call(e,"typeParameters")]);case"TSQualifiedName":return x([i.call(e,"left"),".",i.call(e,"right")]);case"TSAsExpression":case"TSSatisfiesExpression":{let n=i.call(e,"expression");return r.push(n,t.type==="TSSatisfiesExpression"?" satisfies ":" as ",i.call(e,"typeAnnotation")),x(r)}case"TSTypeCastExpression":return x([i.call(e,"expression"),i.call(e,"typeAnnotation")]);case"TSNonNullExpression":return x([i.call(e,"expression"),"!"]);case"TSTypeAnnotation":return x([": ",i.call(e,"typeAnnotation")]);case"TSIndexSignature":return x([t.readonly?"readonly ":"","[",i.map(e,"parameters"),"]",i.call(e,"typeAnnotation")]);case"TSPropertySignature":return r.push($t(i,e),t.readonly?"readonly ":""),t.computed?r.push("[",i.call(e,"key"),"]"):r.push(i.call(e,"key")),r.push(t.optional?"?":"",i.call(e,"typeAnnotation")),x(r);case"TSMethodSignature":return t.computed?r.push("[",i.call(e,"key"),"]"):r.push(i.call(e,"key")),t.optional&&r.push("?"),r.push(i.call(e,"typeParameters"),"(",Ie(i,s,e),")",i.call(e,"typeAnnotation")),x(r);case"TSTypePredicate":return t.asserts&&r.push("asserts "),r.push(i.call(e,"parameterName")),t.typeAnnotation&&r.push(" is ",i.call(e,"typeAnnotation","typeAnnotation")),x(r);case"TSCallSignatureDeclaration":return x([i.call(e,"typeParameters"),"(",Ie(i,s,e),")",i.call(e,"typeAnnotation")]);case"TSConstructSignatureDeclaration":return t.typeParameters?r.push("new",i.call(e,"typeParameters")):r.push("new "),r.push("(",Ie(i,s,e),")",i.call(e,"typeAnnotation")),x(r);case"TSTypeAliasDeclaration":return x([t.declare?"declare ":"","type ",i.call(e,"id"),i.call(e,"typeParameters")," = ",i.call(e,"typeAnnotation"),";"]);case"TSTypeParameter":{r.push(i.call(e,"name"));let n=i.getParentNode(0),a=Y.TSMappedType.check(n);return t.constraint&&r.push(a?" in ":" extends ",i.call(e,"constraint")),t.default&&r.push(" = ",i.call(e,"default")),x(r)}case"TSTypeAssertion":return r.push("<",i.call(e,"typeAnnotation"),"> ",i.call(e,"expression")),x(r);case"TSTypeParameterDeclaration":case"TSTypeParameterInstantiation":return x(["<",S(", ").join(i.map(e,"params")),">"]);case"TSEnumDeclaration":{r.push(t.declare?"declare ":"",t.const?"const ":"","enum ",i.call(e,"id"));let n=S(`,
65
- `).join(i.map(e,"members"));return n.isEmpty()?r.push(" {}"):r.push(` {
66
- `,n.indent(s.tabWidth),`
67
- }`),x(r)}case"TSExpressionWithTypeArguments":return x([i.call(e,"expression"),i.call(e,"typeParameters")]);case"TSInterfaceBody":{let n=S(`
68
- `).join(i.map(e,"body").map(a=>Xt(a)!==";"?a.concat(";"):a));return n.isEmpty()?S("{}",s):x([`{
69
- `,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")),Is(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=>gt(a,s,e),"body");return n.isEmpty()?r.push("{}"):r.push(`{
71
- `,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 pu(i,s){let e=[],t=i.getValue();return t.decorators&&t.decorators.length>0&&!ea(i)?i.each(function(r){e.push(s(r),`
73
- `)},"decorators"):js(t)&&t.declaration&&t.declaration.decorators&&i.each(function(r){e.push(s(r),`
74
- `)},"declaration","decorators"),x(e)}function gt(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)||ci.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,d=l>0,f=l<n-1,p,g,y=u&&u.loc&&u.loc.lines,b=y&&s.reuseWhitespace&&Zn(u,y);if(d)if(b){let P=y.skipSpaces(b.start,!0),I=P?P.line:1,T=b.start.line-I;p=Array(T+1).join(`
75
- `)}else p=h?`
76
-
77
- `:`
78
- `;else p="";if(f)if(b){let P=y.skipSpaces(b.end),T=(P?P.line:y.length)-b.end.line;g=Array(T+1).join(`
79
- `)}else g=h?`
80
-
81
- `:`
82
- `;else g="";a.push(du(r,p),c),f?r=g:g&&a.push(g)}),x(a)}function du(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 ya(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 Hr(i,s,e){let t=i.getNode(),r=t.kind,n=[],a=t.value;Y.FunctionExpression.check(a)||(a=t),n.push(...ya(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"),"(",Ie(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=>Ie(l,s,e),"value"),")",i.call(e,"value","returnType")),a.body?n.push(" ",i.call(e,"value","body")):n.push(";")),x(n)}function jn(i,s,e){let t=i.map(e,"arguments"),r=zt(s,"parameters"),n=S(", ").join(t);return n.getLineLength(1)>s.wrapColumn?(n=S(`,
83
- `).join(t),x([`(
84
- `,n.indent(s.tabWidth),r?`,
85
- )`:`
86
- )`])):x(["(",n,")"])}function Ie(i,s,e){let t=i.getValue(),r,n=[];t.params?(r=t.params,n=i.map(e,"params")):t.parameters&&(r=t.parameters,n=i.map(e,"parameters")),t.defaults&&i.each(function(o){let l=o.getName(),c=n[l];c&&o.getValue()&&(n[l]=x([c," = ",e(o)]))},"defaults"),t.rest&&n.push(x(["...",i.call(e,"rest")]));let a=S(", ").join(n);return a.length>1||a.getLineLength(1)>s.wrapColumn?(a=S(`,
87
- `).join(n),zt(s,"parameters")&&!t.rest&&r[r.length-1].type!=="RestElement"?a=x([a,`,
88
- `]):a=x([a,`
89
- `]),x([`
90
- `,a.indent(s.tabWidth)])):a}function ga(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
- `,S(`,
92
- `).join(n).indent(s.tabWidth),`
93
- }`):r.push(" ",a," }"),x(r)}return S("")}function Rn(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
- `).join(l).indent(s.tabWidth),","])),o.length>0&&r.push(", "),c.length>1?r.push(`{
95
- `,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"),ga(i,s,e))}let a=x(r);return Xt(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 Ut(i,s){return ea(i)||s.unshift("declare "),x(s)}function $t(i,s){return i.call(function(e){let t=e.getValue();return t?t==="plus"?S("+"):t==="minus"?S("-"):s(e):S("")},"variance")}function Ge(i,s){return i.length>1?x([" ",i]):x([`
97
- `,Is(i).indent(s.tabWidth)])}function Xt(i){let s=i.lastPos();do{let e=i.charAt(s);if(/\S/.test(e))return e}while(i.prevPos(s))}function Un(i){return Xt(i)==="}"}function ws(i){return i.replace(/['"]/g,s=>s==='"'?"'":'"')}function bt(i){let s=Fe(i,"value"),e=Fe(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 Es(i){return JSON.stringify(i).replace(/[\u2028\u2029]/g,function(s){return"\\u"+s.charCodeAt(0).toString(16)})}function Vt(i,s){switch(ci.assert(i),s.quote){case"auto":{let e=Es(i),t=ws(Es(ws(i)));return e.length>t.length?t:e}case"single":return ws(Es(ws(i)));case"double":default:return Es(i)}}function Is(i){let s=Xt(i);return!s||`
98
- };`.indexOf(s)<0?x([i,";"]):i}function fu(i,s){return new uu(s).print(i)}var vs;function ba(){if(vs)return vs;let i=mu();return vs={parse(s,e){return Vn.parse(s,{...i,...e})}},vs}function mu(){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 yu=Object.defineProperty,gu=(i,s,e)=>s in i?yu(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e,$n=(i,s,e)=>(gu(i,typeof s!="symbol"?s+"":s,e),e),ce=class extends Error{constructor(s,e){if(super(""),$n(this,"rawMessage"),$n(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
- `),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
- ${" ".repeat(6+r)}^`),c));s+=`
101
-
102
- ${l.join(`
103
- `)}
104
- `}this.message=s}},bu=new Set(["Literal","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","RegExpLiteral","BigIntLiteral"]),xa=new Set(["string","number","boolean","bigint","symbol","undefined"]),Q=Pt;function xu(i){return/^[$A-Z_a-z][\w$]*$/.test(i)}var ui="__magicast_proxy";function le(i,s=new Set){if(i===void 0)return Q.identifier("undefined");if(i===null)return Q.literal(null);if(xa.has(typeof i))return Q.literal(i);if(s.has(i))throw new ce("Can not serialize circular reference");if(s.add(i),i[ui])return i.$ast;if(i instanceof RegExp){let e=Q.regExpLiteral(i.source,i.flags);return delete e.extra.raw,e}return i instanceof Set?Q.newExpression(Q.identifier("Set"),[Q.arrayExpression([...i].map(e=>le(e,s)))]):i instanceof Date?Q.newExpression(Q.identifier("Date"),[Q.literal(i.toISOString())]):i instanceof Map?Q.newExpression(Q.identifier("Map"),[Q.arrayExpression([...i].map(([e,t])=>Q.arrayExpression([le(e,s),le(t,s)])))]):Array.isArray(i)?Q.arrayExpression(i.map(e=>le(e,s))):typeof i=="object"?Q.objectExpression(Object.entries(i).map(([e,t])=>Q.property("init",/^[$A-Z_a-z][\w$]*$/g.test(e)?Q.identifier(e):Q.literal(e),le(t,s)))):Q.literal(i)}function Tu(i,s={}){let e=s;return e[ui]=!0,e.$ast=i,e.$type||(e.$type="object"),e}var Pu={enumerable:!0,configurable:!0};function Te(i,s,e){let t=Tu(i,s);return new Proxy({},{ownKeys(){return Object.keys(t).filter(r=>r!==ui&&!r.startsWith("$"))},getOwnPropertyDescriptor(){return Pu},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 pe=Pt,Jr=new WeakMap;function Su(i,s,e){if(Jr.has(s))return Jr.get(s);let t=Te(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 ce("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(pe.importDeclaration([s],pe.stringLiteral(r)))},toJSON(){return{imported:this.imported,local:this.local,from:this.from}}},{ownKeys(){return["imported","local","from","toJSON"]}});return Jr.set(s,t),t}function ku(i,s){let e=()=>{let a=[];for(let o of i.body)if(o.type==="ImportDeclaration")for(let l of o.specifiers)a.push(Su(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 d=o.imported==="default"?pe.importDefaultSpecifier(pe.identifier(h)):o.imported==="*"?pe.importNamespaceSpecifier(pe.identifier(h)):pe.importSpecifier(pe.identifier(o.imported),pe.identifier(h)),f=c.find(p=>p.from===o.from)?.$declaration;if(f)f.specifiers.push(d);else if(l==="prepend"||c.length===0)i.body.unshift(pe.importDeclaration([d],pe.stringLiteral(o.from)));else{let p=c.at(-1).$declaration,g=i.body.indexOf(p);i.body.splice(g+1,0,pe.importDeclaration([d],pe.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 Te(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 Us(i,s,e){let t=n=>s[n],r=(n,a)=>{s[n]=a};return Te(i,{$type:"array",push(n){s.push(le(n))},pop(){return oe(s.pop(),e)},unshift(n){s.unshift(le(n))},shift(){return oe(s.shift(),e)},splice(n,a,...o){return s.splice(n,a,...o.map(c=>le(c))).map(c=>oe(c,e))},find(n){return s.map(a=>oe(a,e)).find(n)},findIndex(n){return s.map(a=>oe(a,e)).findIndex(n)},includes(n){return s.map(a=>oe(a,e)).includes(n)},toJSON(){return s.map(n=>oe(n,e))}},{get(n,a){if(a==="length")return s.length;if(a===Symbol.iterator)return function*(){for(let c of s)yield oe(c,e)};if(typeof a=="symbol")return;let o=+a;if(Number.isNaN(o))return;let l=t(o);if(l)return oe(l,e)},set(n,a,o){if(typeof a=="symbol")return!1;let l=+a;return Number.isNaN(l)?!1:(r(l,le(o)),!0)},deleteProperty(n,a){if(typeof a=="symbol")return!1;let o=+a;return Number.isNaN(o)?!1:(s[o]=le(void 0),!0)},ownKeys(){return["length",...s.map((n,a)=>a.toString())]}})}function wu(i,s){if("elements"in i)return Us(i,i.elements,s)}function Ta(i,s){if(i.type!=="CallExpression")throw new ce("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 ce("Not implemented")}let t=Us(i,i.arguments,s);return Te(i,{$type:"function-call",$callee:e(i.callee),$args:t},{})}function Eu(i,s){if(i.type!=="ArrowFunctionExpression")throw new ce("Not an arrow function expression");let e=Us(i,i.params,s);return Te(i,{$type:"arrow-function-expression",$params:e,$body:oe(i.body,s)},{})}var vu=Pt;function Au(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 ce(`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:xu(n)?i.properties.push({type:"Property",key:{type:"Identifier",name:n},value:a}):i.properties.push({type:"ObjectProperty",key:vu.stringLiteral(n),value:a})};return Te(i,{$type:"object",toJSON(){return i.properties.reduce((n,a)=>("key"in a&&"name"in a.key&&(n[a.key.name]=oe(a.value,s)),n),{})}},{get(n,a){let o=e(a);if(o)return oe(o,s)},set(n,a,o){return typeof a!="string"&&(a=String(a)),r(a,le(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 Pa(i,s){if(i.type!=="NewExpression")throw new ce("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 ce("Not implemented")}let t=Us(i,i.arguments,s);return Te(i,{$type:"new-expression",$callee:e(i.callee),$args:t},{})}function Cu(i){if(i.type!=="Identifier")throw new ce("Not an identifier");return Te(i,{$type:"identifier",$name:i.name},{})}function Iu(i){if(i.type!=="LogicalExpression")throw new ce("Not a logical expression");return Te(i,{$type:"logicalExpression"},{})}function Nu(i){if(i.type!=="MemberExpression")throw new ce("Not a member expression");return Te(i,{$type:"memberExpression"},{})}var Xr=new WeakMap;function oe(i,s){if(xa.has(typeof i))return i;if(bu.has(i.type))return i.value;if(Xr.has(i))return Xr.get(i);let e;switch(i.type){case"ObjectExpression":{e=Au(i,s);break}case"ArrayExpression":{e=wu(i,s);break}case"CallExpression":{e=Ta(i,s);break}case"ArrowFunctionExpression":{e=Eu(i,s);break}case"NewExpression":{e=Pa(i,s);break}case"Identifier":{e=Cu(i);break}case"LogicalExpression":{e=Iu(i);break}case"MemberExpression":{e=Nu(i);break}case"TSAsExpression":case"TSSatisfiesExpression":{e=oe(i.expression,s);break}default:throw new ce(`Casting "${i.type}" is not supported`,{ast:i,code:s?.$code})}return Xr.set(i,e),e}var qt=Pt;function Lu(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=le(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"?qt.exportDefaultDeclaration(o):qt.exportNamedDeclaration(qt.variableDeclaration("const",[qt.variableDeclarator(qt.identifier(r),o)])))};return Te(i,{$type:"exports"},{get(r,n){let a=e(n);if(a)return oe(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 Ou(i,s){let e=i.program;if(e.type!=="Program")throw new ce(`Cannot proxify ${i.type} as module`);let t={$code:s,$type:"module"},r=Te(e,t,{ownKeys(){return["imports","exports","generate"]}});return t.exports=Lu(e,r),t.imports=ku(e),t.generate=n=>Sa(r,n),r}function Du(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 d of u){let f=d.trim();if(f.length!==0){if(e.wrapColumn&&d.length>a&&(a=d.length),e.indent){let p=d.match(/^\s+/)?.[0]||"";p.length>0&&(p.length>0&&p.length<t&&(t=p.length),p[0]===" "?r++:p.length>0&&r--)}if(f.at(-1)===";"?n++:f.length>0&&n--,e.quote||e.arrowParens){let p=f.matchAll(l);for(let g of p)if(g.groups)for(let y in c)g.groups[y]&&c[y]++}e.trailingComma&&((d.startsWith("}")||d.startsWith("]"))&&(h?o++:o--),h=f.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 Mu(i,s){let e=oa(i,{parser:s?.parser||ba(),...s});return Ou(e,i)}function Fu(i,s){let e=oa("("+i+")",{parser:s?.parser||ba(),...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 oe(t,r)}function Sa(i,s={}){let e=i.$ast||i,t=s.format===!1||!("$code"in i)?{}:Du(i.$code,s.format),{code:r,map:n}=fu(e,{...s,...t});return{code:r,map:n}}async function $s(i,s={}){let e=await Gr.readFile(i,"utf8");return s.sourceFileName=s.sourceFileName??i,Mu(e,s)}async function Vs(i,s,e){let t="$ast"in i?i.$ast:i,{code:r,map:n}=Sa(t,e);await Gr.writeFile(s,r),n&&await Gr.writeFile(s+".map",n)}var As=Pt,ka={functionCall(i,...s){let e=As.callExpression(As.identifier(i),s.map(t=>le(t)));return Ta(e)},newExpression(i,...s){let e=As.newExpression(As.identifier(i),s.map(t=>le(t)));return Pa(e)},literal(i){return le(i)},raw(i){return Fu(i)}};import"fs";var gp=as(hr(),1),bp=as(Wr(),1);function wa(i,s){if(typeof s=="object")for(let e in s)typeof i[e]=="object"&&typeof s[e]=="object"?wa(i[e],s[e]):i[e]=s[e]}function hi(i){return _u(i.exports.default)}function _u(i){return i.$type==="function-call"?i.$args[0]:i}function Ea(i,s,e,t){let r=hi(i);r.modules||(r.modules=[]),r.modules.includes(s)||r.modules.push(s),e&&(r[e]||(r[e]={}),wa(r[e],t))}import $u from"prompts";var qs="ui-thing.config.ts",va={theme:"zinc",tailwindCSSLocation:"assets/css/tailwind.css",componentsLocation:"components/Ui",composablesLocation:"composables",pluginsLocation:"plugins",utilsLocation:"utils",force:!0,useDefaultFilename:!0,packageManager:"npm"},Aa={theme:"zinc",tailwindCSSLocation:"app/assets/css/tailwind.css",componentsLocation:"app/components/Ui",composablesLocation:"app/composables",pluginsLocation:"app/plugins",utilsLocation:"app/utils",force:!0,useDefaultFilename:!0,packageManager:"npm"},Ca=["tailwindcss","motion-v","@tailwindcss/vite","reka-ui","tailwind-variants","tailwind-merge","@nuxt/fonts","@nuxtjs/color-mode","@nuxt/icon","@vueuse/nuxt","@tailwindcss/forms"],Ia=["typescript","prettier-plugin-tailwindcss","prettier","@ianvs/prettier-plugin-sort-imports","tw-animate-css"],Na=["@nuxtjs/color-mode","motion-v/nuxt","@vueuse/nuxt","@nuxt/icon","@nuxt/fonts"],St=[{title:"Npm",value:"npm"},{title:"Yarn",value:"yarn"},{title:"Pnpm",value:"pnpm"},{title:"Bun",value:"bun"}],Ks=[{title:"Zinc",value:"zinc"},{title:"Slate",value:"slate"},{title:"Stone",value:"stone"},{title:"Gray",value:"gray"},{title:"Neutral",value:"neutral"},{title:"Red",value:"red"},{title:"Rose",value:"rose"},{title:"Orange",value:"orange"},{title:"Green",value:"green"},{title:"Blue",value:"blue"},{title:"Yellow",value:"yellow"},{title:"Violet",value:"violet"}];import Bu from"fs";function La(){try{let i=JSON.parse(Bu.readFileSync("package.json","utf-8")),s=i.dependencies?.nuxt||i.devDependencies?.nuxt;if(s)return/^[~^>=<\s]*4/.test(s)?4:3}catch{return 4}return 4}import Oa from"kleur";import ju from"prompts";var Da=async i=>{let s=await ju([{name:"theme",type:"autocomplete",message:"Which theme do you want to start with?",choices:Ks},{name:"tailwindCSSLocation",type:"text",message:"Where is your tailwind.css file located?",initial:(e,t)=>i==3?"assets/css/tailwind.css":"app/assets/css/tailwind.css"},{name:"componentsLocation",type:"text",message:"Where should your components be stored?",initial:(e,t)=>i==3?"components/Ui":"app/components/Ui"},{name:"composablesLocation",type:"text",message:"Where should your composables be stored?",initial:(e,t)=>i==3?"composables":"app/composables"},{name:"pluginsLocation",type:"text",message:"Where should your plugins be stored?",initial:(e,t)=>i==3?"plugins":"app/plugins"},{name:"utilsLocation",type:"text",message:"Where should your utils be stored?",initial:(e,t)=>i==3?"utils":"app/utils"},{name:"force",type:"confirm",message:"Should we just replace component files if they already exist?",initial:!0},{name:"useDefaultFilename",type:"confirm",message:"Would you like to use the default filename when adding components?",initial:!0},{name:"packageManager",type:"select",message:"Which package manager do you use?",choices:St}]);return!s||Object.keys(s).length<9?(console.log(Oa.red(Oa.bold("Incomplete configuration submitted. Exiting..."))),process.exit(0)):s};var Fa=process.cwd(),fe=async i=>{let s=kt.existsSync(qs),e={},t=Number(i?.nuxtVersion)||La();if(!s||i?.force){if(e=i?.yes?t===4?Aa:va:await Da(t),await kt.writeFile(qs,`export default ${JSON.stringify(e,null,2)}`),e.packageManager==="pnpm"){let r=kt.existsSync(".npmrc"),n=!0;if(r){let{confirmCreateNpmrc:a}=await $u({type:"confirm",name:"confirmCreateNpmrc",message:"A .npmrc file already exists. Overwrite it?",initial:!1});n=a}n&&await kt.writeFile(".npmrc",`shamefully-hoist=true
2
+ import{Command as Ue}from"commander";var H="0.2.1";import E from"path";import{updateConfig as no}from"c12/update";import{Command as Jo}from"commander";import{consola as S}from"consola";import u from"kleur";import g from"lodash";import A from"prompts";import{join as Q}from"path";import{loadConfig as Fo}from"c12";import f from"fs-extra";import Ko from"lodash";import{loadFile as Ao,writeFile as Lo}from"magicast";import{addNuxtModule as Uo}from"magicast/helpers";import jo from"prompts";var b="ui-thing.config.ts",W={theme:"zinc",tailwindCSSLocation:"assets/css/tailwind.css",componentsLocation:"components/Ui",composablesLocation:"composables",pluginsLocation:"plugins",utilsLocation:"utils",force:!0,useDefaultFilename:!0,packageManager:"npm"},V={theme:"zinc",tailwindCSSLocation:"app/assets/css/tailwind.css",componentsLocation:"app/components/Ui",composablesLocation:"app/composables",pluginsLocation:"app/plugins",utilsLocation:"app/utils",force:!0,useDefaultFilename:!0,packageManager:"npm"},z=["tailwindcss","motion-v","@tailwindcss/vite","reka-ui","tailwind-variants","tailwind-merge","@nuxt/fonts","@nuxtjs/color-mode","@nuxt/icon","@vueuse/nuxt","@tailwindcss/forms"],Y=["typescript","prettier-plugin-tailwindcss","prettier","@ianvs/prettier-plugin-sort-imports","tw-animate-css"],J=["@nuxtjs/color-mode","motion-v/nuxt","@vueuse/nuxt","@nuxt/icon","@nuxt/fonts"],m=[{title:"Npm",value:"npm"},{title:"Yarn",value:"yarn"},{title:"Pnpm",value:"pnpm"},{title:"Bun",value:"bun"}],v=[{title:"Zinc",value:"zinc"},{title:"Slate",value:"slate"},{title:"Stone",value:"stone"},{title:"Gray",value:"gray"},{title:"Neutral",value:"neutral"},{title:"Red",value:"red"},{title:"Rose",value:"rose"},{title:"Orange",value:"orange"},{title:"Green",value:"green"},{title:"Blue",value:"blue"},{title:"Yellow",value:"yellow"},{title:"Violet",value:"violet"}];import Mo from"fs";function X(){try{let o=JSON.parse(Mo.readFileSync("package.json","utf-8")),r=o.dependencies?.nuxt||o.devDependencies?.nuxt;if(r)return/^[~^>=<\s]*4/.test(r)?4:3}catch{return 4}return 4}import Z from"kleur";import Oo from"prompts";var q=async o=>{let r=await Oo([{name:"theme",type:"autocomplete",message:"Which theme do you want to start with?",choices:v},{name:"tailwindCSSLocation",type:"text",message:"Where is your tailwind.css file located?",initial:(e,t)=>o==3?"assets/css/tailwind.css":"app/assets/css/tailwind.css"},{name:"componentsLocation",type:"text",message:"Where should your components be stored?",initial:(e,t)=>o==3?"components/Ui":"app/components/Ui"},{name:"composablesLocation",type:"text",message:"Where should your composables be stored?",initial:(e,t)=>o==3?"composables":"app/composables"},{name:"pluginsLocation",type:"text",message:"Where should your plugins be stored?",initial:(e,t)=>o==3?"plugins":"app/plugins"},{name:"utilsLocation",type:"text",message:"Where should your utils be stored?",initial:(e,t)=>o==3?"utils":"app/utils"},{name:"force",type:"confirm",message:"Should we just replace component files if they already exist?",initial:!0},{name:"useDefaultFilename",type:"confirm",message:"Would you like to use the default filename when adding components?",initial:!0},{name:"packageManager",type:"select",message:"Which package manager do you use?",choices:m}]);return!r||Object.keys(r).length<9?(console.log(Z.red(Z.bold("Incomplete configuration submitted. Exiting..."))),process.exit(0)):r};var oo=process.cwd(),i=async o=>{let r=f.existsSync(b),e={},t=Number(o?.nuxtVersion)||X();if(!r||o?.force){if(e=o?.yes?t===4?V:W:await q(t),await f.writeFile(b,`export default ${JSON.stringify(e,null,2)}`),e.packageManager==="pnpm"){let n=f.existsSync(".npmrc"),a=!0;if(n){let{confirmCreateNpmrc:l}=await jo({type:"confirm",name:"confirmCreateNpmrc",message:"A .npmrc file already exists. Overwrite it?",initial:!1});a=l}a&&await f.writeFile(".npmrc",`shamefully-hoist=true
106
3
  strict-peer-dependencies=false
107
- `)}}else e=(await Ru({configFile:qs.replace(".ts","")})).config;return Uu.isEmpty(e)?fe({force:!0}):(Vu(e),e)},Vu=i=>{let s=(e,t=!1)=>{e&&(t?kt.ensureDirSync(e):kt.ensureFileSync(e))};s(i.tailwindCSSLocation),s(i.pluginsLocation,!0),s(i.componentsLocation,!0),s(i.composablesLocation,!0),s(i.utilsLocation,!0)},_a=async i=>{if(!i)return;let s=typeof i=="string"?[i]:i,e=await $s(Ma(Fa,"nuxt.config.ts"));s.forEach(t=>Ea(e,t)),await Vs(e,Ma(Fa,"nuxt.config.ts"))};var zs=async()=>{let i=await fe(),s={nuxtVersion:3,theme:"string",tailwindCSSLocation:"string",componentsLocation:"string",composablesLocation:"string",utilsLocation:"string",force:!0,useDefaultFilename:!0,packageManager:"string"},e=[];for(let t of Object.keys(s))i[t]===void 0&&e.push(t);return!(e.length>1)};import qu from"axios";import Ku from"dotenv";import zu from"ora";Ku.config();var Ba=async()=>{let i=zu("Fetching components...").start(),{data:s}=await qu.get(process.env.COMPONENTS_API||"https://uithing.com/api/components");return i.succeed("Components fetched."),s};import pi from"fs";var Ws=async i=>{try{return await pi.promises.access(i,pi.constants.F_OK||pi.constants.W_OK),!0}catch{return!1}};import{execa as di}from"execa";import Hs from"lodash";import Wu from"ora";var _e=async(i,s,e)=>{typeof s=="string"&&(s=[s]),typeof e=="string"&&(e=[e]);let t=Wu("Installing dependencies...").start();!Hs.isUndefined(s)&&!Hs.isEmpty(s)&&await di(i,[i==="yarn"?"add":"install",...s]),t.text="Installing dev dependencies...",!Hs.isUndefined(e)&&!Hs.isEmpty(e)&&await di(i,[i==="yarn"?"add":"install","-D",...e]),t.text="Running nuxt prepare...",await di`npx -y nuxt prepare`,t.succeed("Installed dependencies!")};import Hu from"prompts";var ja=async i=>{let s={yup:["yup","@vee-validate/yup"],zod:["zod","@vee-validate/zod"],joi:["joi","@vee-validate/joi"],valibot:["valibot","@vee-validate/valibot"]},{validator:e}=await Hu({type:"select",name:"validator",message:"Choose the validator package to use with Vee Validate: ",choices:[{title:"Yup",value:"yup"},{title:"Zod",value:"zod"},{title:"Joi",value:"joi"},{title:"Valibot",value:"valibot"}]});if(!e){console.log("No validator package selected");return}return console.log(`Selected ${e} as the validator package`),s[e]&&await _e(i,s[e]),e};import Ju from"boxen";import Xu from"figlet";var Gu=(i,s,e={})=>{let{box:t,figletFont:r}=e,n=Xu.textSync(i,{font:r||"Standard"}),o=Ju(n,{...{borderColor:"greenBright",padding:1,borderStyle:"round",titleAlignment:"center"},...t});return s?`${o}
108
- ${s}`:o},me=(i,s,e)=>{console.log(`
109
- `+Gu(i,s,e))};import Yu from"prompts";var Ra=async(i,s=[])=>{if(i)return s.map(t=>t.value);let{components:e}=await Yu({type:"autocompleteMultiselect",name:"components",message:"Select the components you want to add",choices:s.map(t=>({title:t.name,value:t.value}))});return e};import fi from"fs";import Qu from"path";var Ua=async(i,s)=>{if(!await Ws(i)){let t=Qu.dirname(i);fi.existsSync(t)||fi.mkdirSync(t,{recursive:!0})}fi.writeFileSync(i,s)};var bi=[],Qt=process.cwd(),mi=i=>bi.find(s=>s.value.toLowerCase()===i.toLowerCase());async function Va(i,s,e,t){if(await Ws(i)&&!e){let{value:n}=await gi({type:"confirm",name:"value",message:t,initial:!1});if(!n)return Js.info(`Skipped: ${Be.cyan(Xs.basename(i))}`),!1}return await Ua(i,s),!0}async function yi(i,s,e,t){for(let r of s){let n=Xs.join(Qt,e,r.fileName);await Va(n,r.fileContent,t,`The ${i} file ${Be.bold(r.fileName)} already exists. Overwrite?`)}}var eh=async(i,s)=>{let e=await fe();await zs()||(e=await fe({force:!0})),Yt.isEmpty(e)&&(Js.info("Config file not set. Exiting..."),process.exit(0)),bi=await Ba();let t=i;if(t.length===0){let c=await Ra(s.all,bi);(!c||c.length===0)&&(Js.info("No components selected. Exiting..."),process.exit(0)),t=c}let r=t.filter(c=>!mi(c));r.length>0&&Js.error(`Not found: ${Be.bgRed(r.join(", "))}`);let n=t.map(c=>mi(c)).filter(Boolean);for(let c of[...n])c.components&&c.components.forEach(u=>{n.find(h=>h.value===u)||n.push(mi(u))});for(let c of n)for(let u of c.files){let h=e.componentsLocation,d=Xs.join(Qt,h,u.fileName);if(!e.useDefaultFilename){let{value:p}=await gi({type:"text",name:"value",message:`Where should we add the file ${Be.cyan(u.fileName)}?`,initial:h});p&&(h=p,d=Xs.join(Qt,h,u.fileName))}await Va(d,u.fileContent,e.force,`The file ${Be.bold(u.fileName)} already exists. Overwrite?`)&&((c.value==="vue-sonner"||c.value==="sonner")&&await th(),c.value==="datatable"&&await sh(),await yi("utils",c.utils,e.utilsLocation,e.force),await yi("composables",c.composables,e.composablesLocation,e.force),await yi("plugins",c.plugins,e.pluginsLocation??"",e.force))}await _a(Yt.uniq(n.flatMap(c=>c.nuxtModules||[])));let a=Yt.uniq(n.flatMap(c=>c.deps||[])),o=Yt.uniq(n.flatMap(c=>c.devDeps||[]));if(a.length>0||o.length>0)if(s.all)await _e(e.packageManager,a,o);else{let{confirmInstall:c}=await gi({type:"confirm",name:"confirmInstall",message:`Install packages: ${Be.cyan([...a,...o].join(", "))}?`,initial:!0});c&&await _e(e.packageManager,a,o)}n.some(c=>c.askValidator)&&await ja(e.packageManager),me("All Done!",`Run the ${Be.cyan("ui-thing@latest --help")} command to learn more.
110
- `,{box:{title:"Components Added"}});let l=Yt.compact(n.flatMap(c=>c.instructions));l.length>0&&(console.log(""),console.log(Be.bgCyan(" Instructions ")),l.forEach(c=>console.log(`${Be.cyan("-")} ${c}`)))},qa=new Zu().name("add").command("add").description("Add a list of components to your project.").option("-a --all","Add all components to your project.",!1).argument("[componentNames...]","Components that you want to add.").action(eh);async function th(){await $a({configFile:"nuxt.config",cwd:Qt,onUpdate(i){i.imports||={imports:[]},i.imports.imports.find(s=>s.from==="vue-sonner"&&s.name==="toast")||i.imports.imports.push({from:"vue-sonner",name:"toast",as:"useSonner"})}})}async function sh(){await $a({configFile:"nuxt.config",cwd:Qt,onUpdate(i){i.app||={head:{script:[]}},["https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.12/pdfmake.min.js","https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.12/vfs_fonts.min.js"].forEach(e=>{i.app.head.script.find(t=>t.src===e)||i.app.head.script.push({src:e,defer:!0})})}})}import wh from"path";import{updateConfig as Eh}from"c12/update";import{Command as vh}from"commander";import Ga from"fs-extra";import Si from"kleur";import Ah from"ora";var rh=`@import "tailwindcss";
4
+ `)}}else e=(await Fo({configFile:b.replace(".ts","")})).config;return Ko.isEmpty(e)?i({force:!0}):(Po(e),e)},Po=o=>{let r=(e,t=!1)=>{e&&(t?f.ensureDirSync(e):f.ensureFileSync(e))};r(o.tailwindCSSLocation),r(o.pluginsLocation,!0),r(o.componentsLocation,!0),r(o.composablesLocation,!0),r(o.utilsLocation,!0)},eo=async o=>{if(!o)return;let r=typeof o=="string"?[o]:o,e=await Ao(Q(oo,"nuxt.config.ts"));r.forEach(t=>Uo(e,t)),await Lo(e,Q(oo,"nuxt.config.ts"))};var w=async()=>{let o=await i(),r={nuxtVersion:3,theme:"string",tailwindCSSLocation:"string",componentsLocation:"string",composablesLocation:"string",utilsLocation:"string",force:!0,useDefaultFilename:!0,packageManager:"string"},e=[];for(let t of Object.keys(r))o[t]===void 0&&e.push(t);return!(e.length>1)};import Do from"axios";import Ro from"dotenv";import $o from"ora";Ro.config();var ro=async()=>{let o=$o("Fetching components...").start(),{data:r}=await Do.get(process.env.COMPONENTS_API||"https://uithing.com/api/components");return o.succeed("Components fetched."),r};import _ from"fs";var C=async o=>{try{return await _.promises.access(o,_.constants.F_OK||_.constants.W_OK),!0}catch{return!1}};import{execa as M}from"execa";import x from"lodash";import Go from"ora";var h=async(o,r,e)=>{typeof r=="string"&&(r=[r]),typeof e=="string"&&(e=[e]);let t=Go("Installing dependencies...").start();!x.isUndefined(r)&&!x.isEmpty(r)&&await M(o,[o==="yarn"?"add":"install",...r]),t.text="Installing dev dependencies...",!x.isUndefined(e)&&!x.isEmpty(e)&&await M(o,[o==="yarn"?"add":"install","-D",...e]),t.text="Running nuxt prepare...",await M`npx -y nuxt prepare`,t.succeed("Installed dependencies!")};import Bo from"prompts";var to=async o=>{let r={yup:["yup","@vee-validate/yup"],zod:["zod","@vee-validate/zod"],joi:["joi","@vee-validate/joi"],valibot:["valibot","@vee-validate/valibot"]},{validator:e}=await Bo({type:"select",name:"validator",message:"Choose the validator package to use with Vee Validate: ",choices:[{title:"Yup",value:"yup"},{title:"Zod",value:"zod"},{title:"Joi",value:"joi"},{title:"Valibot",value:"valibot"}]});if(!e){console.log("No validator package selected");return}return console.log(`Selected ${e} as the validator package`),r[e]&&await h(o,r[e]),e};import Ho from"boxen";import Wo from"figlet";var Vo=(o,r,e={})=>{let{box:t,figletFont:n}=e,a=Wo.textSync(o,{font:n||"Standard"}),d=Ho(a,{...{borderColor:"greenBright",padding:1,borderStyle:"round",titleAlignment:"center"},...t});return r?`${d}
5
+ ${r}`:d},s=(o,r,e)=>{console.log(`
6
+ `+Vo(o,r,e))};import zo from"prompts";var co=async(o,r=[])=>{if(o)return r.map(t=>t.value);let{components:e}=await zo({type:"autocompleteMultiselect",name:"components",message:"Select the components you want to add",choices:r.map(t=>({title:t.name,value:t.value}))});return e};import O from"fs";import Yo from"path";var ao=async(o,r)=>{if(!await C(o)){let t=Yo.dirname(o);O.existsSync(t)||O.mkdirSync(t,{recursive:!0})}O.writeFileSync(o,r)};var L=[],y=process.cwd(),F=o=>L.find(r=>r.value.toLowerCase()===o.toLowerCase());async function io(o,r,e,t){if(await C(o)&&!e){let{value:a}=await A({type:"confirm",name:"value",message:t,initial:!1});if(!a)return S.info(`Skipped: ${u.cyan(E.basename(o))}`),!1}return await ao(o,r),!0}async function K(o,r,e,t){for(let n of r){let a=E.join(y,e,n.fileName);await io(a,n.fileContent,t,`The ${o} file ${u.bold(n.fileName)} already exists. Overwrite?`)}}var Xo=async(o,r)=>{let e=await i();await w()||(e=await i({force:!0})),g.isEmpty(e)&&(S.info("Config file not set. Exiting..."),process.exit(0)),L=await ro();let t=o;if(t.length===0){let c=await co(r.all,L);(!c||c.length===0)&&(S.info("No components selected. Exiting..."),process.exit(0)),t=c}let n=t.filter(c=>!F(c));n.length>0&&S.error(`Not found: ${u.bgRed(n.join(", "))}`);let a=t.map(c=>F(c)).filter(Boolean);for(let c of[...a])c.components&&c.components.forEach(p=>{a.find(k=>k.value===p)||a.push(F(p))});for(let c of a)for(let p of c.files){let k=e.componentsLocation,G=E.join(y,k,p.fileName);if(!e.useDefaultFilename){let{value:B}=await A({type:"text",name:"value",message:`Where should we add the file ${u.cyan(p.fileName)}?`,initial:k});B&&(k=B,G=E.join(y,k,p.fileName))}await io(G,p.fileContent,e.force,`The file ${u.bold(p.fileName)} already exists. Overwrite?`)&&((c.value==="vue-sonner"||c.value==="sonner")&&await Zo(),c.value==="datatable"&&await qo(),await K("utils",c.utils,e.utilsLocation,e.force),await K("composables",c.composables,e.composablesLocation,e.force),await K("plugins",c.plugins,e.pluginsLocation??"",e.force))}await eo(g.uniq(a.flatMap(c=>c.nuxtModules||[])));let l=g.uniq(a.flatMap(c=>c.deps||[])),d=g.uniq(a.flatMap(c=>c.devDeps||[]));if(l.length>0||d.length>0)if(r.all)await h(e.packageManager,l,d);else{let{confirmInstall:c}=await A({type:"confirm",name:"confirmInstall",message:`Install packages: ${u.cyan([...l,...d].join(", "))}?`,initial:!0});c&&await h(e.packageManager,l,d)}a.some(c=>c.askValidator)&&await to(e.packageManager),s("All Done!",`Run the ${u.cyan("ui-thing@latest --help")} command to learn more.
7
+ `,{box:{title:"Components Added"}});let $=g.compact(a.flatMap(c=>c.instructions));$.length>0&&(console.log(""),console.log(u.bgCyan(" Instructions ")),$.forEach(c=>console.log(`${u.cyan("-")} ${c}`)))},so=new Jo().name("add").command("add").description("Add a list of components to your project.").option("-a --all","Add all components to your project.",!1).argument("[componentNames...]","Components that you want to add.").action(Xo);async function Zo(){await no({configFile:"nuxt.config",cwd:y,onUpdate(o){o.imports||={imports:[]},o.imports.imports.find(r=>r.from==="vue-sonner"&&r.name==="toast")||o.imports.imports.push({from:"vue-sonner",name:"toast",as:"useSonner"})}})}async function qo(){await no({configFile:"nuxt.config",cwd:y,onUpdate(o){o.app||={head:{script:[]}},["https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.12/pdfmake.min.js","https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.12/vfs_fonts.min.js"].forEach(e=>{o.app.head.script.find(t=>t.src===e)||o.app.head.script.push({src:e,defer:!0})})}})}import Se from"path";import{updateConfig as Ee}from"c12/update";import{Command as Ie}from"commander";import fo from"fs-extra";import D from"kleur";import Ne from"ora";var Qo=`@import "tailwindcss";
111
8
  @import "tw-animate-css";
112
9
 
113
10
  @plugin "@tailwindcss/forms" {
@@ -232,7 +129,7 @@ ${s}`:o},me=(i,s,e)=>{console.log(`
232
129
  --gradient-rust: oklch(55.695% 0.19944 34.155);
233
130
  }
234
131
 
235
- `,ih=`@layer base {
132
+ `,oe=`@layer base {
236
133
  * {
237
134
  @apply border-border outline-ring/50;
238
135
  }
@@ -261,7 +158,7 @@ ${s}`:o},me=(i,s,e)=>{console.log(`
261
158
  cursor: pointer;
262
159
  }
263
160
  }
264
- `,Gs=i=>(Ka[i]||(i="ZINC"),`${rh}${Ka[i]}${ih}`),nh=`
161
+ `,I=o=>(lo[o]||(o="ZINC"),`${Qo}${lo[o]}${oe}`),ee=`
265
162
  :root {
266
163
  --radius: 0.65rem;
267
164
  --background: oklch(1 0 0);
@@ -331,7 +228,7 @@ ${s}`:o},me=(i,s,e)=>{console.log(`
331
228
  --sidebar-ring: oklch(0.556 0 0);
332
229
  }
333
230
 
334
- `,ah=`
231
+ `,re=`
335
232
  :root {
336
233
  --radius: 0.625rem;
337
234
  --background: oklch(1 0 0);
@@ -401,7 +298,7 @@ ${s}`:o},me=(i,s,e)=>{console.log(`
401
298
  --sidebar-ring: oklch(0.551 0.027 264.364);
402
299
  }
403
300
 
404
- `,oh=`
301
+ `,te=`
405
302
  :root {
406
303
  --radius: 0.625rem;
407
304
  --background: oklch(1 0 0);
@@ -470,7 +367,7 @@ ${s}`:o},me=(i,s,e)=>{console.log(`
470
367
  --sidebar-ring: oklch(0.553 0.013 58.071);
471
368
  }
472
369
 
473
- `,lh=`
370
+ `,ce=`
474
371
  :root {
475
372
  --radius: 0.625rem;
476
373
  --background: oklch(1 0 0);
@@ -540,7 +437,7 @@ ${s}`:o},me=(i,s,e)=>{console.log(`
540
437
  --sidebar-ring: oklch(0.551 0.027 264.364);
541
438
  }
542
439
 
543
- `,ch=`
440
+ `,ae=`
544
441
  :root {
545
442
  --radius: 0.625rem;
546
443
  --background: oklch(1 0 0);
@@ -610,7 +507,7 @@ ${s}`:o},me=(i,s,e)=>{console.log(`
610
507
  --sidebar-ring: oklch(0.556 0 0);
611
508
  }
612
509
 
613
- `,uh=`
510
+ `,ne=`
614
511
  :root {
615
512
  --radius: 0.65rem;
616
513
  --background: oklch(1 0 0);
@@ -680,7 +577,7 @@ ${s}`:o},me=(i,s,e)=>{console.log(`
680
577
  --sidebar-ring: oklch(0.637 0.237 25.331);
681
578
  }
682
579
 
683
- `,hh=`
580
+ `,ie=`
684
581
  :root {
685
582
  --radius: 0.65rem;
686
583
  --background: oklch(1 0 0);
@@ -750,7 +647,7 @@ ${s}`:o},me=(i,s,e)=>{console.log(`
750
647
  --sidebar-ring: oklch(0.645 0.246 16.439);
751
648
  }
752
649
 
753
- `,ph=`
650
+ `,se=`
754
651
  :root {
755
652
  --radius: 0.65rem;
756
653
  --background: oklch(1 0 0);
@@ -820,7 +717,7 @@ ${s}`:o},me=(i,s,e)=>{console.log(`
820
717
  --sidebar-ring: oklch(0.646 0.222 41.116);
821
718
  }
822
719
 
823
- `,dh=`
720
+ `,le=`
824
721
  :root {
825
722
  --radius: 0.65rem;
826
723
  --background: oklch(1 0 0);
@@ -890,7 +787,7 @@ ${s}`:o},me=(i,s,e)=>{console.log(`
890
787
  --sidebar-ring: oklch(0.527 0.154 150.069);
891
788
  }
892
789
 
893
- `,fh=`
790
+ `,de=`
894
791
  :root {
895
792
  --radius: 0.65rem;
896
793
  --background: oklch(1 0 0);
@@ -960,7 +857,7 @@ ${s}`:o},me=(i,s,e)=>{console.log(`
960
857
  --sidebar-ring: oklch(0.488 0.243 264.376);
961
858
  }
962
859
 
963
- `,mh=`
860
+ `,he=`
964
861
  :root {
965
862
  --radius: 0.65rem;
966
863
  --background: oklch(1 0 0);
@@ -1030,7 +927,7 @@ ${s}`:o},me=(i,s,e)=>{console.log(`
1030
927
  --sidebar-ring: oklch(0.554 0.135 66.442);
1031
928
  }
1032
929
 
1033
- `,yh=`
930
+ `,ue=`
1034
931
  :root {
1035
932
  --radius: 0.65rem;
1036
933
  --background: oklch(1 0 0);
@@ -1100,16 +997,16 @@ ${s}`:o},me=(i,s,e)=>{console.log(`
1100
997
  --sidebar-ring: oklch(0.541 0.281 293.009);
1101
998
  }
1102
999
 
1103
- `,Ka={ZINC:nh,SLATE:ah,STONE:oh,GRAY:lh,NEUTRAL:ch,RED:uh,ROSE:hh,ORANGE:ph,GREEN:dh,BLUE:fh,YELLOW:mh,VIOLET:yh};var za=`/**
1000
+ `,lo={ZINC:ee,SLATE:re,STONE:te,GRAY:ce,NEUTRAL:ae,RED:ne,ROSE:ie,ORANGE:se,GREEN:le,BLUE:de,YELLOW:he,VIOLET:ue};var ho=`/**
1104
1001
  * Utility function to return Tailwind CSS classes.
1105
1002
  */
1106
1003
  export const tw = <T extends TemplateStringsArray | string>(tailwindClasses: T) => tailwindClasses;
1107
- `;import{join as gh}from"path";import{$ as bh}from"execa";import xi from"fs-extra";import xh from"ora";import Th from"prompts";var Ys={arrowParens:"always",endOfLine:"lf",plugins:["@ianvs/prettier-plugin-sort-imports","prettier-plugin-tailwindcss"],printWidth:100,semi:!0,singleQuote:!1,tabWidth:2,trailingComma:"es5",useTabs:!1,vueIndentScriptAndStyle:!0,tailwindFunctions:["tv"],importOrder:["<BUILTIN_MODULES>","<THIRD_PARTY_MODULES>","<TYPES>","","^[.]"]};var Qs=async(i=process.cwd(),s=!0)=>{let e=gh(i,".prettierrc"),t=Ys;if(xi.existsSync(e)){let n=await xi.readFile(e,"utf-8"),a={};try{a=JSON.parse(n)}catch{console.warn("\u26A0\uFE0F Existing .prettierrc is not valid JSON \u2014 will prompt for overwrite.")}let o=await Th({name:"merge",type:"select",message:"A prettier config file already exists. What would you like to do?",choices:[{title:"Merge configs",value:"merge"},{title:"Overwrite with new config",value:"overwrite"},{title:"Cancel",value:"cancel"}],initial:0});if(o.merge==="merge")t={...a,...Ys};else if(o.merge==="overwrite")t=Ys;else return!1}if(await xi.writeFile(e,JSON.stringify(t,null,2),"utf-8"),!s)return!0;let r=xh("Formatting files with prettier...").start();return await bh`npx prettier --write .`,r.succeed("Files formatted with prettier"),!0};import{join as Ph}from"path";var Wa=async()=>{let i=Ph(process.cwd(),"nuxt.config.ts"),s=await $s(i);if(!s.$code.includes("tailwindcss()")){let e=hi(s);e.vite||={},e.vite.plugins||=[],e.vite.plugins.push(ka.functionCall("tailwindcss"))}s.imports.$items.find(e=>e.local==="tailwindcss")||s.imports.$prepend({from:"@tailwindcss/vite",local:"tailwindcss",imported:"default"}),await Vs(s,i)};import kh from"fs-extra";var Ha={recommendations:["vue.volar","bradlc.vscode-tailwindcss","esbenp.prettier-vscode","antfu.iconify","formulahendry.auto-close-tag","formulahendry.auto-rename-tag"]},Ja={"editor.formatOnSave":!0,"editor.quickSuggestions":{strings:"on"},"files.associations":{"*.css":"tailwindcss"},"tailwindCSS.classFunctions":["tw","clsx","tw\\.[a-z-]+"],"tailwindCSS.experimental.classRegex":[["([\"'`][^\"'`]*.*?[\"'`])","[\"'`]([^\"'`]*)[\"'`]"]]};import{merge as Sh}from"es-toolkit";import Ti from"fs-extra";function Pi(i,s){let e={};if(Ti.existsSync(i))try{e=Ti.readJsonSync(i)}catch{console.warn(`\u26A0\uFE0F Could not parse ${i}, starting fresh.`)}let t=Sh(e,s);Ti.writeJsonSync(i,t,{spaces:2})}var Xa=(i=".vscode")=>{kh.ensureDirSync(i),Pi(`${i}/extensions.json`,Ha),Pi(`${i}/settings.json`,Ja)};var Ch=async i=>{let s=await fe(i),e=Ah("Updating nuxt.config...").start();await Eh({cwd:process.cwd(),configFile:"nuxt.config",async onUpdate(t){t.modules||(t.modules=[]),t.imports||(t.imports={imports:[]});for(let r of Na)t.modules.includes(r)||t.modules.push(r);if(!t.colorMode){let r=wh.basename(process.cwd());t.colorMode={storageKey:`${r}-color-mode`}}t.icon||(t.icon={clientBundle:{scan:!0,sizeLimitKb:0},mode:"svg",class:"shrink-0",fetchTimeout:2e3,serverBundle:"local"}),t.imports.imports.find(r=>r.from==="tailwind-variants"&&r.name==="tv")||t.imports.imports.push({from:"tailwind-variants",name:"tv"}),t.imports.imports.find(r=>r.from==="tailwind-variants"&&r.name==="VariantProps")||t.imports.imports.push({from:"tailwind-variants",name:"VariantProps",type:!0}),t.css||=[],t.css.push(`~/${s.tailwindCSSLocation?.split("app/")[1]}`)}}),await Wa(),e.succeed("Updated nuxt.config!"),e.start("Adding initial Tailwind CSS file..."),Ga.writeFileSync(s.tailwindCSSLocation,Gs(s.theme.toUpperCase()),"utf-8"),e.succeed("Added initial Tailwind CSS file!"),e.start("Adding Autocomplete helper..."),Ga.writeFileSync(s.utilsLocation+"/tw-helper.ts",za,"utf-8"),e.succeed("Added Autocomplete helper!"),e.start("Merging VS Code settings..."),Xa(),e.succeed("Merged VS Code settings!"),await _e(s.packageManager,Ca,Ia),await Qs(),me("Initialized",`Feel free to start adding components with the ${Si.bgWhite(" add ")} command.`,{box:{title:"Complete"}})},Ya=new vh().command("init").name("init").summary("Initialize UI Thing in your Nuxt project.").description(`${Si.bold("Initialize UI Thing in your Nuxt project.")}
1004
+ `;import{join as pe}from"path";import{$ as ke}from"execa";import U from"fs-extra";import me from"ora";import fe from"prompts";var N={arrowParens:"always",endOfLine:"lf",plugins:["@ianvs/prettier-plugin-sort-imports","prettier-plugin-tailwindcss"],printWidth:100,semi:!0,singleQuote:!1,tabWidth:2,trailingComma:"es5",useTabs:!1,vueIndentScriptAndStyle:!0,tailwindFunctions:["tv"],importOrder:["<BUILTIN_MODULES>","<THIRD_PARTY_MODULES>","<TYPES>","","^[.]"]};var T=async(o=process.cwd(),r=!0)=>{let e=pe(o,".prettierrc"),t=N;if(U.existsSync(e)){let a=await U.readFile(e,"utf-8"),l={};try{l=JSON.parse(a)}catch{console.warn("\u26A0\uFE0F Existing .prettierrc is not valid JSON \u2014 will prompt for overwrite.")}let d=await fe({name:"merge",type:"select",message:"A prettier config file already exists. What would you like to do?",choices:[{title:"Merge configs",value:"merge"},{title:"Overwrite with new config",value:"overwrite"},{title:"Cancel",value:"cancel"}],initial:0});if(d.merge==="merge")t={...l,...N};else if(d.merge==="overwrite")t=N;else return!1}if(await U.writeFile(e,JSON.stringify(t,null,2),"utf-8"),!r)return!0;let n=me("Formatting files with prettier...").start();return await ke`npx prettier --write .`,n.succeed("Files formatted with prettier"),!0};import{join as ge}from"path";import{builders as ye,loadFile as be,writeFile as ve}from"magicast";import{getDefaultExportOptions as we}from"magicast/helpers";var uo=async()=>{let o=ge(process.cwd(),"nuxt.config.ts"),r=await be(o);if(!r.$code.includes("tailwindcss()")){let e=we(r);e.vite||={},e.vite.plugins||=[],e.vite.plugins.push(ye.functionCall("tailwindcss"))}r.imports.$items.find(e=>e.local==="tailwindcss")||r.imports.$prepend({from:"@tailwindcss/vite",local:"tailwindcss",imported:"default"}),await ve(r,o)};import xe from"fs-extra";var po={recommendations:["vue.volar","bradlc.vscode-tailwindcss","esbenp.prettier-vscode","antfu.iconify","formulahendry.auto-close-tag","formulahendry.auto-rename-tag"]},ko={"editor.formatOnSave":!0,"editor.quickSuggestions":{strings:"on"},"files.associations":{"*.css":"tailwindcss"},"tailwindCSS.classFunctions":["tw","clsx","tw\\.[a-z-]+"],"tailwindCSS.experimental.classRegex":[["([\"'`][^\"'`]*.*?[\"'`])","[\"'`]([^\"'`]*)[\"'`]"]]};import{merge as Ce}from"es-toolkit";import j from"fs-extra";function P(o,r){let e={};if(j.existsSync(o))try{e=j.readJsonSync(o)}catch{console.warn(`\u26A0\uFE0F Could not parse ${o}, starting fresh.`)}let t=Ce(e,r);j.writeJsonSync(o,t,{spaces:2})}var mo=(o=".vscode")=>{xe.ensureDirSync(o),P(`${o}/extensions.json`,po),P(`${o}/settings.json`,ko)};var Te=async o=>{let r=await i(o),e=Ne("Updating nuxt.config...").start();await Ee({cwd:process.cwd(),configFile:"nuxt.config",async onUpdate(t){t.modules||(t.modules=[]),t.imports||(t.imports={imports:[]});for(let a of J)t.modules.includes(a)||t.modules.push(a);if(!t.colorMode){let a=Se.basename(process.cwd());t.colorMode={storageKey:`${a}-color-mode`}}t.icon||(t.icon={clientBundle:{scan:!0,sizeLimitKb:0},mode:"svg",class:"shrink-0",fetchTimeout:2e3,serverBundle:"local"}),t.imports.imports.find(a=>a.from==="tailwind-variants"&&a.name==="tv")||t.imports.imports.push({from:"tailwind-variants",name:"tv"}),t.imports.imports.find(a=>a.from==="tailwind-variants"&&a.name==="VariantProps")||t.imports.imports.push({from:"tailwind-variants",name:"VariantProps",type:!0}),t.css||=[];let n=r.tailwindCSSLocation?.split("app/")[1];n||t.css.push(`~/${n}`)}}),await uo(),e.succeed("Updated nuxt.config!"),e.start("Adding initial Tailwind CSS file..."),fo.writeFileSync(r.tailwindCSSLocation,I(r.theme.toUpperCase()),"utf-8"),e.succeed("Added initial Tailwind CSS file!"),e.start("Adding Autocomplete helper..."),fo.writeFileSync(r.utilsLocation+"/tw-helper.ts",ho,"utf-8"),e.succeed("Added Autocomplete helper!"),e.start("Merging VS Code settings..."),mo(),e.succeed("Merged VS Code settings!"),await h(r.packageManager,z,Y),await T(),s("Initialized",`Feel free to start adding components with the ${D.bgWhite(" add ")} command.`,{box:{title:"Complete"}})},go=new Ie().command("init").name("init").summary("Initialize UI Thing in your Nuxt project.").description(`${D.bold("Initialize UI Thing in your Nuxt project.")}
1108
1005
 
1109
1006
  \u2705 Add tailwindcss to your project
1110
1007
  \u2705 Update your nuxt.config file
1111
1008
  \u2705 Add the necessary dependencies
1112
- \u2705 Create a ${Si.bold("ui-thing.config")} file with the default configuration`).option("-f --force","Overwrite config file if it exists.",!1).option("-y --yes","Skip prompts and use default values.",!1).option("-n --nuxtVersion <number>","Specify the Nuxt version you are using.").action(Ch);import{Command as Ih}from"commander";import Nh from"prompts";var Qa=new Ih().command("prettier").name("prettier").description("Adds prettier config to your project.").action(async()=>{if(!await Qs(void 0,!1)){me("Not Added","Prettier config was not added.",{box:{title:"Prettier Not Added",borderColor:"red"}});return}let{pkgManager:s}=await Nh({name:"pkgManager",type:"select",message:"Which package manager are you using?",choices:St});if(!s)return process.exit(0);await _e(s,void 0,["prettier","prettier-plugin-tailwindcss","@ianvs/prettier-plugin-sort-imports"]),me("All Done!","A .prettierrc file has been added to your project and the code formatted. Enjoy!",{box:{title:"Prettier Added"}})});import{Command as Lh}from"commander";import{execa as Oh}from"execa";import Dh from"ora";import Mh from"prompts";import{join as eo}from"path";import to from"fs-extra";var Za=`import {
1009
+ \u2705 Create a ${D.bold("ui-thing.config")} file with the default configuration`).option("-f --force","Overwrite config file if it exists.",!1).option("-y --yes","Skip prompts and use default values.",!1).option("-n --nuxtVersion <number>","Specify the Nuxt version you are using.").action(Te);import{Command as _e}from"commander";import Me from"prompts";var yo=new _e().command("prettier").name("prettier").description("Adds prettier config to your project.").action(async()=>{if(!await T(void 0,!1)){s("Not Added","Prettier config was not added.",{box:{title:"Prettier Not Added",borderColor:"red"}});return}let{pkgManager:r}=await Me({name:"pkgManager",type:"select",message:"Which package manager are you using?",choices:m});if(!r)return process.exit(0);await h(r,void 0,["prettier","prettier-plugin-tailwindcss","@ianvs/prettier-plugin-sort-imports"]),s("All Done!","A .prettierrc file has been added to your project and the code formatted. Enjoy!",{box:{title:"Prettier Added"}})});import{Command as Oe}from"commander";import{execa as Fe}from"execa";import Ke from"ora";import Ae from"prompts";import{join as vo}from"path";import wo from"fs-extra";var bo=`import {
1113
1010
  createSharedComposable,
1114
1011
  useActiveElement,
1115
1012
  useDebounceFn,
@@ -1429,5 +1326,5 @@ export function defineShortcuts(config: MaybeRef<ShortcutsConfig>, options: Shor
1429
1326
  return useEventListener("keydown", onKeyDown);
1430
1327
  }
1431
1328
 
1432
- `;var so=async(i=process.cwd())=>{let s=await fe(),e=eo(i,s.composablesLocation);await to.ensureDir(e),await to.writeFile(eo(e,"shortcuts.ts"),Za,"utf-8")};var ro=new Lh().command("shortcuts").name("shortcuts").description("Add the shortcuts composables to your project.").action(async()=>{await so();let{pkgManager:i}=await Mh({name:"pkgManager",type:"select",message:"Which package manager are you using?",choices:St});if(!i)return process.exit(0);let s=Dh("Installing vueuse module...").start();await Oh`npx -y nuxi@latest module add vueuse`,s.succeed("VueUse module installed successfully!"),me("All Done!","Check the composables folder for the shortcuts composables.",{box:{title:"Composable Added"}})});import{Command as Fh}from"commander";import io from"fs-extra";import no from"kleur";import ki from"lodash";import ao from"prompts";var oo=new Fh().command("theme").name("theme").description("Add a new theme to your project.").action(async()=>{let i=await fe();await zs()||(i=await fe({force:!0})),ki.isEmpty(i)&&(console.log(no.red("Config file not set. Exiting...")),process.exit(0));let{theme:e}=await ao([{name:"theme",type:"autocomplete",message:"Which theme do you want to add?",choices:Ks}]);if(e||(console.log(no.red("No theme selected. Exiting...")),process.exit(0)),io.existsSync(i.tailwindCSSLocation)){let{force:t}=await ao([{name:"force",type:"confirm",message:"Do you want to overwrite your current css file?",initial:!0}]);if(!t)return console.log("Exiting..."),process.exit(0)}io.writeFileSync(i.tailwindCSSLocation,Gs(e.toUpperCase()),"utf-8"),me(`${ki.capitalize(e)}`,`${ki.capitalize(e)} theme has been added to ${i.tailwindCSSLocation}`,{box:{title:"New Theme Added"}})});process.on("SIGINT",()=>process.exit(0));process.on("SIGTERM",()=>process.exit(0));process.on("SIGTSTP",()=>process.exit(0));var lo=new _h;console.clear();me("UI Thing",void 0,{box:{title:"Welcome"}});console.log();lo.name("ui-thing").description("CLI for adding ui-thing components to your Nuxt application").version(Ei).addCommand(Ya).addCommand(qa).addCommand(oo).addCommand(ro).addCommand(Qa);lo.parse(process.argv);
1329
+ `;var Co=async(o=process.cwd())=>{let r=await i(),e=vo(o,r.composablesLocation);await wo.ensureDir(e),await wo.writeFile(vo(e,"shortcuts.ts"),bo,"utf-8")};var xo=new Oe().command("shortcuts").name("shortcuts").description("Add the shortcuts composables to your project.").action(async()=>{await Co();let{pkgManager:o}=await Ae({name:"pkgManager",type:"select",message:"Which package manager are you using?",choices:m});if(!o)return process.exit(0);let r=Ke("Installing vueuse module...").start();await Fe`npx -y nuxi@latest module add vueuse`,r.succeed("VueUse module installed successfully!"),s("All Done!","Check the composables folder for the shortcuts composables.",{box:{title:"Composable Added"}})});import{Command as Le}from"commander";import So from"fs-extra";import Eo from"kleur";import R from"lodash";import Io from"prompts";var No=new Le().command("theme").name("theme").description("Add a new theme to your project.").action(async()=>{let o=await i();await w()||(o=await i({force:!0})),R.isEmpty(o)&&(console.log(Eo.red("Config file not set. Exiting...")),process.exit(0));let{theme:e}=await Io([{name:"theme",type:"autocomplete",message:"Which theme do you want to add?",choices:v}]);if(e||(console.log(Eo.red("No theme selected. Exiting...")),process.exit(0)),So.existsSync(o.tailwindCSSLocation)){let{force:t}=await Io([{name:"force",type:"confirm",message:"Do you want to overwrite your current css file?",initial:!0}]);if(!t)return console.log("Exiting..."),process.exit(0)}So.writeFileSync(o.tailwindCSSLocation,I(e.toUpperCase()),"utf-8"),s(`${R.capitalize(e)}`,`${R.capitalize(e)} theme has been added to ${o.tailwindCSSLocation}`,{box:{title:"New Theme Added"}})});process.on("SIGINT",()=>process.exit(0));process.on("SIGTERM",()=>process.exit(0));process.on("SIGTSTP",()=>process.exit(0));var To=new Ue;console.clear();s("UI Thing",void 0,{box:{title:"Welcome"}});console.log();To.name("ui-thing").description("CLI for adding ui-thing components to your Nuxt application").version(H).addCommand(go).addCommand(so).addCommand(No).addCommand(xo).addCommand(yo);To.parse(process.argv);
1433
1330
  //# sourceMappingURL=index.js.map