@object-ui/runner 13.1.0 → 14.0.0

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.
@@ -4,7 +4,7 @@ import{i as e,n as t,t as n}from"./react-B8IZ02wI.js";var r=e(n(),1),i;(function
4
4
  `?(t++,n=0):r===` `&&n++;return`
5
5
  `.repeat(t)+` `.repeat(n)}function ot(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(r===`
6
6
  `)if(/\s/.test(e[n+1]))for(t+=` `;n<e.length&&/\s/.test(e[n+1]);)n++;else t+=`
7
- `;else if(r===`&`){let{entity:r,newI:i}=st(e,n+1);t+=r,n=i-1}else t+=r}return JSON.stringify(t)}function st(e,t){let n=``,r=0,i,a=t;if(e[a]===`#`){let t=10;a++;let n;if(e[a]===`x`)for(t=16,a++,n=a;a<e.length&&lt(e.charCodeAt(a));)a++;else for(n=a;a<e.length&&ct(e.charCodeAt(a));)a++;if(e[a]===`;`){let r=e.slice(n,a);r&&(a++,i=String.fromCodePoint(parseInt(r,t)))}}else for(;a<e.length&&r++<10;){let t=e[a];if(a++,t===`;`){i=$e.get(n);break}n+=t}return i?{entity:i,newI:a}:{entity:`&`,newI:t}}function ct(e){return e>=u.digit0&&e<=u.digit9}function lt(e){return e>=u.digit0&&e<=u.digit9||e>=u.lowercaseA&&e<=u.lowercaseF||e>=u.uppercaseA&&e<=u.uppercaseF}function ut(e,t){let n=et(t),r=new Set;for(let t=0;t<e.tokens.length;t++){let i=e.tokens[t];i.type===a.name&&!i.isType&&(i.identifierRole===O.Access||i.identifierRole===O.ObjectShorthand||i.identifierRole===O.ExportAccess)&&!i.shadowsGlobal&&r.add(e.identifierNameForToken(i)),i.type===a.jsxTagStart&&r.add(n.base),i.type===a.jsxTagStart&&t+1<e.tokens.length&&e.tokens[t+1].type===a.jsxTagEnd&&(r.add(n.base),r.add(n.fragmentBase)),i.type===a.jsxName&&i.identifierRole===O.Access&&(!rt(e.identifierNameForToken(i))||e.tokens[t+1].type===a.dot)&&r.add(e.identifierNameForToken(i))}return r}var dt=class e{__init(){this.nonTypeIdentifiers=new Set}__init2(){this.importInfoByPath=new Map}__init3(){this.importsToReplace=new Map}__init4(){this.identifierReplacements=new Map}__init5(){this.exportBindingsByLocalName=new Map}constructor(t,n,r,i,a,o,s){this.nameManager=t,this.tokens=n,this.enableLegacyTypeScriptModuleInterop=r,this.options=i,this.isTypeScriptTransformEnabled=a,this.keepUnusedImports=o,this.helperManager=s,e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this),e.prototype.__init4.call(this),e.prototype.__init5.call(this)}preprocessTokens(){for(let e=0;e<this.tokens.tokens.length;e++)this.tokens.matches1AtIndex(e,a._import)&&!this.tokens.matches3AtIndex(e,a._import,a.name,a.eq)&&this.preprocessImportAtIndex(e),this.tokens.matches1AtIndex(e,a._export)&&!this.tokens.matches2AtIndex(e,a._export,a.eq)&&this.preprocessExportAtIndex(e);this.generateImportReplacements()}pruneTypeOnlyImports(){this.nonTypeIdentifiers=ut(this.tokens,this.options);for(let[e,t]of this.importInfoByPath.entries())t.hasBareImport||t.hasStarExport||t.exportStarNames.length>0||t.namedExports.length>0||[...t.defaultNames,...t.wildcardNames,...t.namedImports.map(({localName:e})=>e)].every(e=>this.shouldAutomaticallyElideImportedName(e))&&this.importsToReplace.set(e,``)}shouldAutomaticallyElideImportedName(e){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&!this.nonTypeIdentifiers.has(e)}generateImportReplacements(){for(let[e,t]of this.importInfoByPath.entries()){let{defaultNames:n,wildcardNames:r,namedImports:i,namedExports:a,exportStarNames:o,hasStarExport:s}=t;if(n.length===0&&r.length===0&&i.length===0&&a.length===0&&o.length===0&&!s){this.importsToReplace.set(e,`require('${e}');`);continue}let c=this.getFreeIdentifierForPath(e),l;l=this.enableLegacyTypeScriptModuleInterop?c:r.length>0?r[0]:this.getFreeIdentifierForPath(e);let u=`var ${c} = require('${e}');`;if(r.length>0)for(let e of r){let t=this.enableLegacyTypeScriptModuleInterop?c:`${this.helperManager.getHelperName(`interopRequireWildcard`)}(${c})`;u+=` var ${e} = ${t};`}else o.length>0&&l!==c?u+=` var ${l} = ${this.helperManager.getHelperName(`interopRequireWildcard`)}(${c});`:n.length>0&&l!==c&&(u+=` var ${l} = ${this.helperManager.getHelperName(`interopRequireDefault`)}(${c});`);for(let{importedName:e,localName:t}of a)u+=` ${this.helperManager.getHelperName(`createNamedExportFrom`)}(${c}, '${t}', '${e}');`;for(let e of o)u+=` exports.${e} = ${l};`;s&&(u+=` ${this.helperManager.getHelperName(`createStarExport`)}(${c});`),this.importsToReplace.set(e,u);for(let e of n)this.identifierReplacements.set(e,`${l}.default`);for(let{importedName:e,localName:t}of i)this.identifierReplacements.set(t,`${c}.${e}`)}}getFreeIdentifierForPath(e){let t=e.split(`/`),n=t[t.length-1].replace(/\W/g,``);return this.nameManager.claimFreeName(`_${n}`)}preprocessImportAtIndex(e){let t=[],n=[],r=[];if(e++,(this.tokens.matchesContextualAtIndex(e,i._type)||this.tokens.matches1AtIndex(e,a._typeof))&&!this.tokens.matches1AtIndex(e+1,a.comma)&&!this.tokens.matchesContextualAtIndex(e+1,i._from)||this.tokens.matches1AtIndex(e,a.parenL))return;if(this.tokens.matches1AtIndex(e,a.name)&&(t.push(this.tokens.identifierNameAtIndex(e)),e++,this.tokens.matches1AtIndex(e,a.comma)&&e++),this.tokens.matches1AtIndex(e,a.star)&&(e+=2,n.push(this.tokens.identifierNameAtIndex(e)),e++),this.tokens.matches1AtIndex(e,a.braceL)){let n=this.getNamedImports(e+1);e=n.newIndex;for(let e of n.namedImports)e.importedName==="default"?t.push(e.localName):r.push(e)}if(this.tokens.matchesContextualAtIndex(e,i._from)&&e++,!this.tokens.matches1AtIndex(e,a.string))throw Error(`Expected string token at the end of import statement.`);let o=this.tokens.stringValueAtIndex(e),s=this.getImportInfo(o);s.defaultNames.push(...t),s.wildcardNames.push(...n),s.namedImports.push(...r),t.length===0&&n.length===0&&r.length===0&&(s.hasBareImport=!0)}preprocessExportAtIndex(e){if(this.tokens.matches2AtIndex(e,a._export,a._var)||this.tokens.matches2AtIndex(e,a._export,a._let)||this.tokens.matches2AtIndex(e,a._export,a._const))this.preprocessVarExportAtIndex(e);else if(this.tokens.matches2AtIndex(e,a._export,a._function)||this.tokens.matches2AtIndex(e,a._export,a._class)){let t=this.tokens.identifierNameAtIndex(e+2);this.addExportBinding(t,t)}else if(this.tokens.matches3AtIndex(e,a._export,a.name,a._function)){let t=this.tokens.identifierNameAtIndex(e+3);this.addExportBinding(t,t)}else this.tokens.matches2AtIndex(e,a._export,a.braceL)?this.preprocessNamedExportAtIndex(e):this.tokens.matches2AtIndex(e,a._export,a.star)&&this.preprocessExportStarAtIndex(e)}preprocessVarExportAtIndex(e){let t=0;for(let n=e+2;;n++)if(this.tokens.matches1AtIndex(n,a.braceL)||this.tokens.matches1AtIndex(n,a.dollarBraceL)||this.tokens.matches1AtIndex(n,a.bracketL))t++;else if(this.tokens.matches1AtIndex(n,a.braceR)||this.tokens.matches1AtIndex(n,a.bracketR))t--;else if(t===0&&!this.tokens.matches1AtIndex(n,a.name))break;else if(this.tokens.matches1AtIndex(1,a.eq)){let e=this.tokens.currentToken().rhsEndIndex;if(e==null)throw Error(`Expected = token with an end index.`);n=e-1}else{let e=this.tokens.tokens[n];if(pe(e)){let e=this.tokens.identifierNameAtIndex(n);this.identifierReplacements.set(e,`exports.${e}`)}}}preprocessNamedExportAtIndex(e){e+=2;let{newIndex:t,namedImports:n}=this.getNamedImports(e);if(e=t,this.tokens.matchesContextualAtIndex(e,i._from))e++;else{for(let{importedName:e,localName:t}of n)this.addExportBinding(e,t);return}if(!this.tokens.matches1AtIndex(e,a.string))throw Error(`Expected string token at the end of import statement.`);let r=this.tokens.stringValueAtIndex(e);this.getImportInfo(r).namedExports.push(...n)}preprocessExportStarAtIndex(e){let t=null;if(this.tokens.matches3AtIndex(e,a._export,a.star,a._as)?(e+=3,t=this.tokens.identifierNameAtIndex(e),e+=2):e+=3,!this.tokens.matches1AtIndex(e,a.string))throw Error(`Expected string token at the end of star export statement.`);let n=this.tokens.stringValueAtIndex(e),r=this.getImportInfo(n);t===null?r.hasStarExport=!0:r.exportStarNames.push(t)}getNamedImports(e){let t=[];for(;;){if(this.tokens.matches1AtIndex(e,a.braceR)){e++;break}let n=Ze(this.tokens,e);if(e=n.endIndex,n.isType||t.push({importedName:n.leftName,localName:n.rightName}),this.tokens.matches2AtIndex(e,a.comma,a.braceR)){e+=2;break}else if(this.tokens.matches1AtIndex(e,a.braceR)){e++;break}else if(this.tokens.matches1AtIndex(e,a.comma))e++;else throw Error(`Unexpected token: ${JSON.stringify(this.tokens.tokens[e])}`)}return{newIndex:e,namedImports:t}}getImportInfo(e){let t=this.importInfoByPath.get(e);if(t)return t;let n={defaultNames:[],wildcardNames:[],namedImports:[],namedExports:[],hasBareImport:!1,exportStarNames:[],hasStarExport:!1};return this.importInfoByPath.set(e,n),n}addExportBinding(e,t){this.exportBindingsByLocalName.has(e)||this.exportBindingsByLocalName.set(e,[]),this.exportBindingsByLocalName.get(e).push(t)}claimImportCode(e){let t=this.importsToReplace.get(e);return this.importsToReplace.set(e,``),t||``}getIdentifierReplacement(e){return this.identifierReplacements.get(e)||null}resolveExportBinding(e){let t=this.exportBindingsByLocalName.get(e);return!t||t.length===0?null:t.map(e=>`exports.${e}`).join(` = `)}getGlobalNames(){return new Set([...this.identifierReplacements.keys(),...this.exportBindingsByLocalName.keys()])}},ft=44,pt=59,mt=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,ht=new Uint8Array(64),gt=new Uint8Array(128);for(let e=0;e<mt.length;e++){let t=mt.charCodeAt(e);ht[e]=t,gt[t]=e}function _t(e,t,n){let r=t-n;r=r<0?-r<<1|1:r<<1;do{let t=r&31;r>>>=5,r>0&&(t|=32),e.write(ht[t])}while(r>0);return t}var vt=1024*16,yt=typeof TextDecoder<`u`?new TextDecoder:typeof Buffer<`u`?{decode(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString()}}:{decode(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}},bt=class{constructor(){this.pos=0,this.out=``,this.buffer=new Uint8Array(vt)}write(e){let{buffer:t}=this;t[this.pos++]=e,this.pos===vt&&(this.out+=yt.decode(t),this.pos=0)}flush(){let{buffer:e,out:t,pos:n}=this;return n>0?t+yt.decode(e.subarray(0,n)):t}};function xt(e){let t=new bt,n=0,r=0,i=0,a=0;for(let o=0;o<e.length;o++){let s=e[o];if(o>0&&t.write(pt),s.length===0)continue;let c=0;for(let e=0;e<s.length;e++){let o=s[e];e>0&&t.write(ft),c=_t(t,o[0],c),o.length!==1&&(n=_t(t,o[1],n),r=_t(t,o[2],r),i=_t(t,o[3],i),o.length!==4&&(a=_t(t,o[4],a)))}}return t.flush()}t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.resolveURI=r())})(e,(function(){let e=/^[\w+.-]+:\/\//,t=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,n=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function r(t){return e.test(t)}function i(e){return e.startsWith(`//`)}function a(e){return e.startsWith(`/`)}function o(e){return e.startsWith(`file:`)}function s(e){return/^[.?#]/.test(e)}function c(e){let n=t.exec(e);return u(n[1],n[2]||``,n[3],n[4]||``,n[5]||`/`,n[6]||``,n[7]||``)}function l(e){let t=n.exec(e),r=t[2];return u(`file:`,``,t[1]||``,``,a(r)?r:`/`+r,t[3]||``,t[4]||``)}function u(e,t,n,r,i,a,o){return{scheme:e,user:t,host:n,port:r,path:i,query:a,hash:o,type:7}}function d(e){if(i(e)){let t=c(`http:`+e);return t.scheme=``,t.type=6,t}if(a(e)){let t=c(`http://foo.com`+e);return t.scheme=``,t.host=``,t.type=5,t}if(o(e))return l(e);if(r(e))return c(e);let t=c(`http://foo.com/`+e);return t.scheme=``,t.host=``,t.type=e?e.startsWith(`?`)?3:e.startsWith(`#`)?2:4:1,t}function f(e){if(e.endsWith(`/..`))return e;let t=e.lastIndexOf(`/`);return e.slice(0,t+1)}function p(e,t){m(t,t.type),e.path===`/`?e.path=t.path:e.path=f(t.path)+e.path}function m(e,t){let n=t<=4,r=e.path.split(`/`),i=1,a=0,o=!1;for(let e=1;e<r.length;e++){let t=r[e];if(!t){o=!0;continue}if(o=!1,t!==`.`){if(t===`..`){a?(o=!0,a--,i--):n&&(r[i++]=t);continue}r[i++]=t,a++}}let s=``;for(let e=1;e<i;e++)s+=`/`+r[e];(!s||o&&!s.endsWith(`/..`))&&(s+=`/`),e.path=s}function h(e,t){if(!e&&!t)return``;let n=d(e),r=n.type;if(t&&r!==7){let e=d(t),i=e.type;switch(r){case 1:n.hash=e.hash;case 2:n.query=e.query;case 3:case 4:p(n,e);case 5:n.user=e.user,n.host=e.host,n.port=e.port;case 6:n.scheme=e.scheme}i>r&&(r=i)}m(n,r);let i=n.query+n.hash;switch(r){case 2:case 3:return i;case 4:{let r=n.path.slice(1);return r?s(t||e)&&!s(r)?`./`+r+i:r+i:i||`.`}case 5:return n.path+i;default:return n.scheme+`//`+n.user+n.host+n.port+n.path+i}}return h}))}))();var St=class{constructor(){this._indexes={__proto__:null},this.array=[]}};function Ct(e){return e}function wt(e,t){return Ct(e)._indexes[t]}function Tt(e,t){let n=wt(e,t);if(n!==void 0)return n;let{array:r,_indexes:i}=Ct(e);return i[t]=r.push(t)-1}var Et=0,Dt=1,Ot=2,kt=3,At=4,jt=-1,Mt=class{constructor({file:e,sourceRoot:t}={}){this._names=new St,this._sources=new St,this._sourcesContent=[],this._mappings=[],this.file=e,this.sourceRoot=t,this._ignoreList=new St}};function Nt(e){return e}var Pt=(e,t,n,r,i,a,o,s)=>Lt(!0,e,t,n,r,i,a,o,s);function Ft(e){let{_mappings:t,_sources:n,_sourcesContent:r,_names:i,_ignoreList:a}=Nt(e);return Vt(t),{version:3,file:e.file||void 0,names:i.array,sourceRoot:e.sourceRoot||void 0,sources:n.array,sourcesContent:r,mappings:t,ignoreList:a.array}}function It(e){let t=Ft(e);return Object.assign({},t,{mappings:xt(t.mappings)})}function Lt(e,t,n,r,i,a,o,s,c){let{_mappings:l,_sources:u,_sourcesContent:d,_names:f}=Nt(t),p=Rt(l,n),m=zt(p,r);if(!i)return e&&Ht(p,m)?void 0:Bt(p,m,[r]);let h=Tt(u,i),ee=s?Tt(f,s):jt;if(h===d.length&&(d[h]=c??null),!(e&&Ut(p,m,h,a,o,ee)))return Bt(p,m,s?[r,h,a,o,ee]:[r,h,a,o])}function Rt(e,t){for(let n=e.length;n<=t;n++)e[n]=[];return e[t]}function zt(e,t){let n=e.length;for(let r=n-1;r>=0&&!(t>=e[r][Et]);n=r--);return n}function Bt(e,t,n){for(let n=e.length;n>t;n--)e[n]=e[n-1];e[t]=n}function Vt(e){let{length:t}=e,n=t;for(let t=n-1;t>=0&&!(e[t].length>0);n=t,t--);n<t&&(e.length=n)}function Ht(e,t){return t===0?!0:e[t-1].length===1}function Ut(e,t,n,r,i,a){if(t===0)return!1;let o=e[t-1];return o.length===1?!1:n===o[Dt]&&r===o[Ot]&&i===o[kt]&&a===(o.length===5?o[At]:jt)}function Wt({code:e,mappings:t},n,r,i,a){let o=Gt(i,a),s=new Mt({file:r.compiledFilename}),c=0,l=t[0];for(;l===void 0&&c<t.length-1;)c++,l=t[c];let d=0,f=0;l!==f&&Pt(s,d,0,n,d,0);for(let r=0;r<e.length;r++){if(r===l){let e=l-f,i=o[c];for(Pt(s,d,e,n,d,i);(l===r||l===void 0)&&c<t.length-1;)c++,l=t[c]}e.charCodeAt(r)===u.lineFeed&&(d++,f=r+1,l!==f&&Pt(s,d,0,n,d,0))}let{sourceRoot:p,sourcesContent:m,...h}=It(s);return h}function Gt(e,t){let n=Array(t.length),r=0,i=t[r].start,a=0;for(let o=0;o<e.length;o++)o===i&&(n[r]=i-a,r++,i=t[r].start),e.charCodeAt(o)===u.lineFeed&&(a=o+1);return n}var Kt={require:`
7
+ `;else if(r===`&`){let{entity:r,newI:i}=st(e,n+1);t+=r,n=i-1}else t+=r}return JSON.stringify(t)}function st(e,t){let n=``,r=0,i,a=t;if(e[a]===`#`){let t=10;a++;let n;if(e[a]===`x`)for(t=16,a++,n=a;a<e.length&&lt(e.charCodeAt(a));)a++;else for(n=a;a<e.length&&ct(e.charCodeAt(a));)a++;if(e[a]===`;`){let r=e.slice(n,a);r&&(a++,i=String.fromCodePoint(parseInt(r,t)))}}else for(;a<e.length&&r++<10;){let t=e[a];if(a++,t===`;`){i=$e.get(n);break}n+=t}return i?{entity:i,newI:a}:{entity:`&`,newI:t}}function ct(e){return e>=u.digit0&&e<=u.digit9}function lt(e){return e>=u.digit0&&e<=u.digit9||e>=u.lowercaseA&&e<=u.lowercaseF||e>=u.uppercaseA&&e<=u.uppercaseF}function ut(e,t){let n=et(t),r=new Set;for(let t=0;t<e.tokens.length;t++){let i=e.tokens[t];i.type===a.name&&!i.isType&&(i.identifierRole===O.Access||i.identifierRole===O.ObjectShorthand||i.identifierRole===O.ExportAccess)&&!i.shadowsGlobal&&r.add(e.identifierNameForToken(i)),i.type===a.jsxTagStart&&r.add(n.base),i.type===a.jsxTagStart&&t+1<e.tokens.length&&e.tokens[t+1].type===a.jsxTagEnd&&(r.add(n.base),r.add(n.fragmentBase)),i.type===a.jsxName&&i.identifierRole===O.Access&&(!rt(e.identifierNameForToken(i))||e.tokens[t+1].type===a.dot)&&r.add(e.identifierNameForToken(i))}return r}var dt=class e{__init(){this.nonTypeIdentifiers=new Set}__init2(){this.importInfoByPath=new Map}__init3(){this.importsToReplace=new Map}__init4(){this.identifierReplacements=new Map}__init5(){this.exportBindingsByLocalName=new Map}constructor(t,n,r,i,a,o,s){this.nameManager=t,this.tokens=n,this.enableLegacyTypeScriptModuleInterop=r,this.options=i,this.isTypeScriptTransformEnabled=a,this.keepUnusedImports=o,this.helperManager=s,e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this),e.prototype.__init4.call(this),e.prototype.__init5.call(this)}preprocessTokens(){for(let e=0;e<this.tokens.tokens.length;e++)this.tokens.matches1AtIndex(e,a._import)&&!this.tokens.matches3AtIndex(e,a._import,a.name,a.eq)&&this.preprocessImportAtIndex(e),this.tokens.matches1AtIndex(e,a._export)&&!this.tokens.matches2AtIndex(e,a._export,a.eq)&&this.preprocessExportAtIndex(e);this.generateImportReplacements()}pruneTypeOnlyImports(){this.nonTypeIdentifiers=ut(this.tokens,this.options);for(let[e,t]of this.importInfoByPath.entries())t.hasBareImport||t.hasStarExport||t.exportStarNames.length>0||t.namedExports.length>0||[...t.defaultNames,...t.wildcardNames,...t.namedImports.map(({localName:e})=>e)].every(e=>this.shouldAutomaticallyElideImportedName(e))&&this.importsToReplace.set(e,``)}shouldAutomaticallyElideImportedName(e){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&!this.nonTypeIdentifiers.has(e)}generateImportReplacements(){for(let[e,t]of this.importInfoByPath.entries()){let{defaultNames:n,wildcardNames:r,namedImports:i,namedExports:a,exportStarNames:o,hasStarExport:s}=t;if(n.length===0&&r.length===0&&i.length===0&&a.length===0&&o.length===0&&!s){this.importsToReplace.set(e,`require('${e}');`);continue}let c=this.getFreeIdentifierForPath(e),l;l=this.enableLegacyTypeScriptModuleInterop?c:r.length>0?r[0]:this.getFreeIdentifierForPath(e);let u=`var ${c} = require('${e}');`;if(r.length>0)for(let e of r){let t=this.enableLegacyTypeScriptModuleInterop?c:`${this.helperManager.getHelperName(`interopRequireWildcard`)}(${c})`;u+=` var ${e} = ${t};`}else o.length>0&&l!==c?u+=` var ${l} = ${this.helperManager.getHelperName(`interopRequireWildcard`)}(${c});`:n.length>0&&l!==c&&(u+=` var ${l} = ${this.helperManager.getHelperName(`interopRequireDefault`)}(${c});`);for(let{importedName:e,localName:t}of a)u+=` ${this.helperManager.getHelperName(`createNamedExportFrom`)}(${c}, '${t}', '${e}');`;for(let e of o)u+=` exports.${e} = ${l};`;s&&(u+=` ${this.helperManager.getHelperName(`createStarExport`)}(${c});`),this.importsToReplace.set(e,u);for(let e of n)this.identifierReplacements.set(e,`${l}.default`);for(let{importedName:e,localName:t}of i)this.identifierReplacements.set(t,`${c}.${e}`)}}getFreeIdentifierForPath(e){let t=e.split(`/`),n=t[t.length-1].replace(/\W/g,``);return this.nameManager.claimFreeName(`_${n}`)}preprocessImportAtIndex(e){let t=[],n=[],r=[];if(e++,(this.tokens.matchesContextualAtIndex(e,i._type)||this.tokens.matches1AtIndex(e,a._typeof))&&!this.tokens.matches1AtIndex(e+1,a.comma)&&!this.tokens.matchesContextualAtIndex(e+1,i._from)||this.tokens.matches1AtIndex(e,a.parenL))return;if(this.tokens.matches1AtIndex(e,a.name)&&(t.push(this.tokens.identifierNameAtIndex(e)),e++,this.tokens.matches1AtIndex(e,a.comma)&&e++),this.tokens.matches1AtIndex(e,a.star)&&(e+=2,n.push(this.tokens.identifierNameAtIndex(e)),e++),this.tokens.matches1AtIndex(e,a.braceL)){let n=this.getNamedImports(e+1);e=n.newIndex;for(let e of n.namedImports)e.importedName==="default"?t.push(e.localName):r.push(e)}if(this.tokens.matchesContextualAtIndex(e,i._from)&&e++,!this.tokens.matches1AtIndex(e,a.string))throw Error(`Expected string token at the end of import statement.`);let o=this.tokens.stringValueAtIndex(e),s=this.getImportInfo(o);s.defaultNames.push(...t),s.wildcardNames.push(...n),s.namedImports.push(...r),t.length===0&&n.length===0&&r.length===0&&(s.hasBareImport=!0)}preprocessExportAtIndex(e){if(this.tokens.matches2AtIndex(e,a._export,a._var)||this.tokens.matches2AtIndex(e,a._export,a._let)||this.tokens.matches2AtIndex(e,a._export,a._const))this.preprocessVarExportAtIndex(e);else if(this.tokens.matches2AtIndex(e,a._export,a._function)||this.tokens.matches2AtIndex(e,a._export,a._class)){let t=this.tokens.identifierNameAtIndex(e+2);this.addExportBinding(t,t)}else if(this.tokens.matches3AtIndex(e,a._export,a.name,a._function)){let t=this.tokens.identifierNameAtIndex(e+3);this.addExportBinding(t,t)}else this.tokens.matches2AtIndex(e,a._export,a.braceL)?this.preprocessNamedExportAtIndex(e):this.tokens.matches2AtIndex(e,a._export,a.star)&&this.preprocessExportStarAtIndex(e)}preprocessVarExportAtIndex(e){let t=0;for(let n=e+2;;n++)if(this.tokens.matches1AtIndex(n,a.braceL)||this.tokens.matches1AtIndex(n,a.dollarBraceL)||this.tokens.matches1AtIndex(n,a.bracketL))t++;else if(this.tokens.matches1AtIndex(n,a.braceR)||this.tokens.matches1AtIndex(n,a.bracketR))t--;else if(t===0&&!this.tokens.matches1AtIndex(n,a.name))break;else if(this.tokens.matches1AtIndex(1,a.eq)){let e=this.tokens.currentToken().rhsEndIndex;if(e==null)throw Error(`Expected = token with an end index.`);n=e-1}else{let e=this.tokens.tokens[n];if(pe(e)){let e=this.tokens.identifierNameAtIndex(n);this.identifierReplacements.set(e,`exports.${e}`)}}}preprocessNamedExportAtIndex(e){e+=2;let{newIndex:t,namedImports:n}=this.getNamedImports(e);if(e=t,this.tokens.matchesContextualAtIndex(e,i._from))e++;else{for(let{importedName:e,localName:t}of n)this.addExportBinding(e,t);return}if(!this.tokens.matches1AtIndex(e,a.string))throw Error(`Expected string token at the end of import statement.`);let r=this.tokens.stringValueAtIndex(e);this.getImportInfo(r).namedExports.push(...n)}preprocessExportStarAtIndex(e){let t=null;if(this.tokens.matches3AtIndex(e,a._export,a.star,a._as)?(e+=3,t=this.tokens.identifierNameAtIndex(e),e+=2):e+=3,!this.tokens.matches1AtIndex(e,a.string))throw Error(`Expected string token at the end of star export statement.`);let n=this.tokens.stringValueAtIndex(e),r=this.getImportInfo(n);t===null?r.hasStarExport=!0:r.exportStarNames.push(t)}getNamedImports(e){let t=[];for(;;){if(this.tokens.matches1AtIndex(e,a.braceR)){e++;break}let n=Ze(this.tokens,e);if(e=n.endIndex,n.isType||t.push({importedName:n.leftName,localName:n.rightName}),this.tokens.matches2AtIndex(e,a.comma,a.braceR)){e+=2;break}else if(this.tokens.matches1AtIndex(e,a.braceR)){e++;break}else if(this.tokens.matches1AtIndex(e,a.comma))e++;else throw Error(`Unexpected token: ${JSON.stringify(this.tokens.tokens[e])}`)}return{newIndex:e,namedImports:t}}getImportInfo(e){let t=this.importInfoByPath.get(e);if(t)return t;let n={defaultNames:[],wildcardNames:[],namedImports:[],namedExports:[],hasBareImport:!1,exportStarNames:[],hasStarExport:!1};return this.importInfoByPath.set(e,n),n}addExportBinding(e,t){this.exportBindingsByLocalName.has(e)||this.exportBindingsByLocalName.set(e,[]),this.exportBindingsByLocalName.get(e).push(t)}claimImportCode(e){let t=this.importsToReplace.get(e);return this.importsToReplace.set(e,``),t||``}getIdentifierReplacement(e){return this.identifierReplacements.get(e)||null}resolveExportBinding(e){let t=this.exportBindingsByLocalName.get(e);return!t||t.length===0?null:t.map(e=>`exports.${e}`).join(` = `)}getGlobalNames(){return new Set([...this.identifierReplacements.keys(),...this.exportBindingsByLocalName.keys()])}},ft=44,pt=59,mt=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,ht=new Uint8Array(64),gt=new Uint8Array(128);for(let e=0;e<mt.length;e++){let t=mt.charCodeAt(e);ht[e]=t,gt[t]=e}function _t(e,t,n){let r=t-n;r=r<0?-r<<1|1:r<<1;do{let t=r&31;r>>>=5,r>0&&(t|=32),e.write(ht[t])}while(r>0);return t}var vt=1024*16,yt=typeof TextDecoder<`u`?new TextDecoder:typeof Buffer<`u`?{decode(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString()}}:{decode(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}},bt=class{constructor(){this.pos=0,this.out=``,this.buffer=new Uint8Array(vt)}write(e){let{buffer:t}=this;t[this.pos++]=e,this.pos===vt&&(this.out+=yt.decode(t),this.pos=0)}flush(){let{buffer:e,out:t,pos:n}=this;return n>0?t+yt.decode(e.subarray(0,n)):t}};function xt(e){let t=new bt,n=0,r=0,i=0,a=0;for(let o=0;o<e.length;o++){let s=e[o];if(o>0&&t.write(pt),s.length===0)continue;let c=0;for(let e=0;e<s.length;e++){let o=s[e];e>0&&t.write(ft),c=_t(t,o[0],c),o.length!==1&&(n=_t(t,o[1],n),r=_t(t,o[2],r),i=_t(t,o[3],i),o.length!==4&&(a=_t(t,o[4],a)))}}return t.flush()}t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.resolveURI=r())})(e,(function(){let e=/^[\w+.-]+:\/\//,t=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,n=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function r(t){return e.test(t)}function i(e){return e.startsWith(`//`)}function a(e){return e.startsWith(`/`)}function o(e){return e.startsWith(`file:`)}function s(e){return/^[.?#]/.test(e)}function c(e){let n=t.exec(e);return u(n[1],n[2]||``,n[3],n[4]||``,n[5]||`/`,n[6]||``,n[7]||``)}function l(e){let t=n.exec(e),r=t[2];return u(`file:`,``,t[1]||``,``,a(r)?r:`/`+r,t[3]||``,t[4]||``)}function u(e,t,n,r,i,a,o){return{scheme:e,user:t,host:n,port:r,path:i,query:a,hash:o,type:7}}function d(e){if(i(e)){let t=c(`http:`+e);return t.scheme=``,t.type=6,t}if(a(e)){let t=c(`http://foo.com`+e);return t.scheme=``,t.host=``,t.type=5,t}if(o(e))return l(e);if(r(e))return c(e);let t=c(`http://foo.com/`+e);return t.scheme=``,t.host=``,t.type=e?e.startsWith(`?`)?3:e.startsWith(`#`)?2:4:1,t}function f(e){if(e.endsWith(`/..`))return e;let t=e.lastIndexOf(`/`);return e.slice(0,t+1)}function p(e,t){m(t,t.type),e.path===`/`?e.path=t.path:e.path=f(t.path)+e.path}function m(e,t){let n=t<=4,r=e.path.split(`/`),i=1,a=0,o=!1;for(let e=1;e<r.length;e++){let t=r[e];if(!t){o=!0;continue}if(o=!1,t!==`.`){if(t===`..`){a?(o=!0,a--,i--):n&&(r[i++]=t);continue}r[i++]=t,a++}}let s=``;for(let e=1;e<i;e++)s+=`/`+r[e];(!s||o&&!s.endsWith(`/..`))&&(s+=`/`),e.path=s}function h(e,t){if(!e&&!t)return``;let n=d(e),r=n.type;if(t&&r!==7){let e=d(t),i=e.type;switch(r){case 1:n.hash=e.hash;case 2:n.query=e.query;case 3:case 4:p(n,e);case 5:n.user=e.user,n.host=e.host,n.port=e.port;case 6:n.scheme=e.scheme}i>r&&(r=i)}m(n,r);let i=n.query+n.hash;switch(r){case 2:case 3:return i;case 4:{let r=n.path.slice(1);return r?s(t||e)&&!s(r)?`./`+r+i:r+i:i||`.`}case 5:return n.path+i;default:return n.scheme+`//`+n.user+n.host+n.port+n.path+i}}return h}))}))();var St=class{constructor(){this._indexes={__proto__:null},this.array=[]}};function Ct(e){return e}function wt(e,t){return Ct(e)._indexes[t]}function Tt(e,t){let n=wt(e,t);if(n!==void 0)return n;let{array:r,_indexes:i}=Ct(e);return i[t]=r.push(t)-1}var Et=0,Dt=1,Ot=2,kt=3,At=4,jt=-1,Mt=class{constructor({file:e,sourceRoot:t}={}){this._names=new St,this._sources=new St,this._sourcesContent=[],this._mappings=[],this.file=e,this.sourceRoot=t,this._ignoreList=new St}};function Nt(e){return e}var Pt=(e,t,n,r,i,a,o,s)=>Lt(!0,e,t,n,r,i,a,o,s);function Ft(e){let{_mappings:t,_sources:n,_sourcesContent:r,_names:i,_ignoreList:a}=Nt(e);return Vt(t),{version:3,file:e.file||void 0,names:i.array,sourceRoot:e.sourceRoot||void 0,sources:n.array,sourcesContent:r,mappings:t,ignoreList:a.array}}function It(e){let t=Ft(e);return Object.assign({},t,{mappings:xt(t.mappings)})}function Lt(e,t,n,r,i,a,o,s,c){let{_mappings:l,_sources:u,_sourcesContent:d,_names:f}=Nt(t),p=Rt(l,n),m=zt(p,r);if(!i)return e&&Ht(p,m)?void 0:Bt(p,m,[r]);let h=Tt(u,i),ee=s?Tt(f,s):jt;if(h===d.length&&(d[h]=c??null),!(e&&Ut(p,m,h,a,o,ee)))return Bt(p,m,s?[r,h,a,o,ee]:[r,h,a,o])}function Rt(e,t){for(let n=e.length;n<=t;n++)e[n]=[];return e[t]}function zt(e,t){let n=e.length;for(let r=n-1;r>=0&&!(t>=e[r][Et]);n=r--);return n}function Bt(e,t,n){for(let n=e.length;n>t;n--)e[n]=e[n-1];e[t]=n}function Vt(e){let{length:t}=e,n=t;for(let t=n-1;t>=0&&!(e[t].length>0);n=t,t--);n<t&&(e.length=n)}function Ht(e,t){return t===0||e[t-1].length===1}function Ut(e,t,n,r,i,a){if(t===0)return!1;let o=e[t-1];return o.length!==1&&n===o[Dt]&&r===o[Ot]&&i===o[kt]&&a===(o.length===5?o[At]:jt)}function Wt({code:e,mappings:t},n,r,i,a){let o=Gt(i,a),s=new Mt({file:r.compiledFilename}),c=0,l=t[0];for(;l===void 0&&c<t.length-1;)c++,l=t[c];let d=0,f=0;l!==f&&Pt(s,d,0,n,d,0);for(let r=0;r<e.length;r++){if(r===l){let e=l-f,i=o[c];for(Pt(s,d,e,n,d,i);(l===r||l===void 0)&&c<t.length-1;)c++,l=t[c]}e.charCodeAt(r)===u.lineFeed&&(d++,f=r+1,l!==f&&Pt(s,d,0,n,d,0))}let{sourceRoot:p,sourcesContent:m,...h}=It(s);return h}function Gt(e,t){let n=Array(t.length),r=0,i=t[r].start,a=0;for(let o=0;o<e.length;o++)o===i&&(n[r]=i-a,r++,i=t[r].start),e.charCodeAt(o)===u.lineFeed&&(a=o+1);return n}var Kt={require:`
8
8
  import {createRequire as CREATE_REQUIRE_NAME} from "module";
9
9
  const require = CREATE_REQUIRE_NAME(import.meta.url);
10
10
  `,interopRequireWildcard:`
@@ -113,9 +113,9 @@ import{i as e,n as t,t as n}from"./react-B8IZ02wI.js";var r=e(n(),1),i;(function
113
113
  const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops);
114
114
  return result == null ? true : result;
115
115
  }
116
- `},qt=class e{__init(){this.helperNames={}}__init2(){this.createRequireName=null}constructor(t){this.nameManager=t,e.prototype.__init.call(this),e.prototype.__init2.call(this)}getHelperName(e){let t=this.helperNames[e];return t||(t=this.nameManager.claimFreeName(`_${e}`),this.helperNames[e]=t,t)}emitHelpers(){let e=``;this.helperNames.optionalChainDelete&&this.getHelperName(`optionalChain`),this.helperNames.asyncOptionalChainDelete&&this.getHelperName(`asyncOptionalChain`);for(let[t,n]of Object.entries(Kt)){let r=this.helperNames[t],i=n;t===`optionalChainDelete`?i=i.replace(`OPTIONAL_CHAIN_NAME`,this.helperNames.optionalChain):t===`asyncOptionalChainDelete`?i=i.replace(`ASYNC_OPTIONAL_CHAIN_NAME`,this.helperNames.asyncOptionalChain):t===`require`&&(this.createRequireName===null&&(this.createRequireName=this.nameManager.claimFreeName(`_createRequire`)),i=i.replace(/CREATE_REQUIRE_NAME/g,this.createRequireName)),r&&(e+=` `,e+=i.replace(t,r).replace(/\s+/g,` `).trim())}return e}};function Jt(e,t,n){Yt(e,n)&&Xt(e,t,n)}function Yt(e,t){for(let n of e.tokens)if(n.type===a.name&&!n.isType&&me(n)&&t.has(e.identifierNameForToken(n)))return!0;return!1}function Xt(e,t,n){let r=[],i=t.length-1;for(let o=e.tokens.length-1;;o--){for(;r.length>0&&r[r.length-1].startTokenIndex===o+1;)r.pop();for(;i>=0&&t[i].endTokenIndex===o+1;)r.push(t[i]),i--;if(o<0)break;let s=e.tokens[o],c=e.identifierNameForToken(s);if(r.length>1&&!s.isType&&s.type===a.name&&n.has(c)){if(ge(s))Zt(r[r.length-1],e,c);else if(_e(s)){let t=r.length-1;for(;t>0&&!r[t].isFunctionScope;)t--;if(t<0)throw Error(`Did not find parent function scope.`);Zt(r[t],e,c)}}}if(r.length>0)throw Error(`Expected empty scope stack after processing file.`)}function Zt(e,t,n){for(let r=e.startTokenIndex;r<e.endTokenIndex;r++){let e=t.tokens[r];(e.type===a.name||e.type===a.jsxName)&&t.identifierNameForToken(e)===n&&(e.shadowsGlobal=!0)}}function Qt(e,t){let n=[];for(let r of t)r.type===a.name&&n.push(e.slice(r.start,r.end));return n}var $t=class e{__init(){this.usedNames=new Set}constructor(t,n){e.prototype.__init.call(this),this.usedNames=new Set(Qt(t,n))}claimFreeName(e){let t=this.findFreeName(e);return this.usedNames.add(t),t}findFreeName(e){if(!this.usedNames.has(e))return e;let t=2;for(;this.usedNames.has(e+String(t));)t++;return e+String(t)}},en=t((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.DetailContext=e.NoopContext=e.VError=void 0;var n=function(e){t(n,e);function n(t,r){var i=e.call(this,r)||this;return i.path=t,Object.setPrototypeOf(i,n.prototype),i}return n}(Error);e.VError=n,e.NoopContext=function(){function e(){}return e.prototype.fail=function(e,t,n){return!1},e.prototype.unionResolver=function(){return this},e.prototype.createContext=function(){return this},e.prototype.resolveUnion=function(e){},e}();var r=function(){function e(){this._propNames=[``],this._messages=[null],this._score=0}return e.prototype.fail=function(e,t,n){return this._propNames.push(e),this._messages.push(t),this._score+=n,!1},e.prototype.unionResolver=function(){return new i},e.prototype.resolveUnion=function(e){for(var t,n,r=e,i=null,a=0,o=r.contexts;a<o.length;a++){var s=o[a];(!i||s._score>=i._score)&&(i=s)}i&&i._score>0&&((t=this._propNames).push.apply(t,i._propNames),(n=this._messages).push.apply(n,i._messages))},e.prototype.getError=function(e){for(var t=[],r=this._propNames.length-1;r>=0;r--){var i=this._propNames[r];e+=typeof i==`number`?`[`+i+`]`:i?`.`+i:``;var a=this._messages[r];a&&t.push(e+` `+a)}return new n(e,t.join(`; `))},e.prototype.getErrorDetail=function(e){for(var t=[],n=this._propNames.length-1;n>=0;n--){var r=this._propNames[n];e+=typeof r==`number`?`[`+r+`]`:r?`.`+r:``;var i=this._messages[n];i&&t.push({path:e,message:i})}for(var a=null,n=t.length-1;n>=0;n--)a&&(t[n].nested=[a]),a=t[n];return a},e}();e.DetailContext=r;var i=function(){function e(){this.contexts=[]}return e.prototype.createContext=function(){var e=new r;return this.contexts.push(e),e},e}()})),tn=t((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.basicTypes=e.BasicType=e.TParamList=e.TParam=e.param=e.TFunc=e.func=e.TProp=e.TOptional=e.opt=e.TIface=e.iface=e.TEnumLiteral=e.enumlit=e.TEnumType=e.enumtype=e.TIntersection=e.intersection=e.TUnion=e.union=e.TTuple=e.tuple=e.TArray=e.array=e.TLiteral=e.lit=e.TName=e.name=e.TType=void 0;var n=en(),r=function(){function e(){}return e}();e.TType=r;function i(e){return typeof e==`string`?o(e):e}function a(e,t){var n=e[t];if(!n)throw Error(`Unknown type `+t);return n}function o(e){return new s(e)}e.name=o;var s=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.name=t,n._failMsg=`is not a `+t,n}return n.prototype.getChecker=function(e,t,r){var i=this,o=a(e,this.name),s=o.getChecker(e,t,r);return o instanceof T||o instanceof n?s:function(e,t){return s(e,t)?!0:t.fail(null,i._failMsg,0)}},n}(r);e.TName=s;function c(e){return new l(e)}e.lit=c;var l=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.value=t,n.name=JSON.stringify(t),n._failMsg=`is not `+n.name,n}return n.prototype.getChecker=function(e,t){var n=this;return function(e,t){return e===n.value?!0:t.fail(null,n._failMsg,-1)}},n}(r);e.TLiteral=l;function u(e){return new d(i(e))}e.array=u;var d=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.ttype=t,n}return n.prototype.getChecker=function(e,t){var n=this.ttype.getChecker(e,t);return function(e,t){if(!Array.isArray(e))return t.fail(null,`is not an array`,0);for(var r=0;r<e.length;r++)if(!n(e[r],t))return t.fail(r,null,1);return!0}},n}(r);e.TArray=d;function f(){return new p([...arguments].map(function(e){return i(e)}))}e.tuple=f;var p=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.ttypes=t,n}return n.prototype.getChecker=function(e,t){var n=this.ttypes.map(function(n){return n.getChecker(e,t)}),r=function(e,t){if(!Array.isArray(e))return t.fail(null,`is not an array`,0);for(var r=0;r<n.length;r++)if(!n[r](e[r],t))return t.fail(r,null,1);return!0};return t?function(e,t){return r(e,t)?e.length<=n.length?!0:t.fail(n.length,`is extraneous`,2):!1}:r},n}(r);e.TTuple=p;function m(){return new h([...arguments].map(function(e){return i(e)}))}e.union=m;var h=function(e){t(n,e);function n(t){var n=e.call(this)||this;n.ttypes=t;var r=t.map(function(e){return e instanceof s||e instanceof l?e.name:null}).filter(function(e){return e}),i=t.length-r.length;return r.length?(i>0&&r.push(i+` more`),n._failMsg=`is none of `+r.join(`, `)):n._failMsg=`is none of `+i+` types`,n}return n.prototype.getChecker=function(e,t){var n=this,r=this.ttypes.map(function(n){return n.getChecker(e,t)});return function(e,t){for(var i=t.unionResolver(),a=0;a<r.length;a++)if(r[a](e,i.createContext()))return!0;return t.resolveUnion(i),t.fail(null,n._failMsg,0)}},n}(r);e.TUnion=h;function ee(){return new te([...arguments].map(function(e){return i(e)}))}e.intersection=ee;var te=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.ttypes=t,n}return n.prototype.getChecker=function(e,t){var n=new Set,r=this.ttypes.map(function(r){return r.getChecker(e,t,n)});return function(e,t){return r.every(function(n){return n(e,t)})?!0:t.fail(null,null,0)}},n}(r);e.TIntersection=te;function ne(e){return new re(e)}e.enumtype=ne;var re=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.members=t,n.validValues=new Set,n._failMsg=`is not a valid enum value`,n.validValues=new Set(Object.keys(t).map(function(e){return t[e]})),n}return n.prototype.getChecker=function(e,t){var n=this;return function(e,t){return n.validValues.has(e)?!0:t.fail(null,n._failMsg,0)}},n}(r);e.TEnumType=re;function ie(e,t){return new ae(e,t)}e.enumlit=ie;var ae=function(e){t(n,e);function n(t,n){var r=e.call(this)||this;return r.enumName=t,r.prop=n,r._failMsg=`is not `+t+`.`+n,r}return n.prototype.getChecker=function(e,t){var n=this,r=a(e,this.enumName);if(!(r instanceof re))throw Error(`Type `+this.enumName+` used in enumlit is not an enum type`);var i=r.members[this.prop];if(!r.members.hasOwnProperty(this.prop))throw Error(`Unknown value `+this.enumName+`.`+this.prop+` used in enumlit`);return function(e,t){return e===i?!0:t.fail(null,n._failMsg,-1)}},n}(r);e.TEnumLiteral=ae;function g(e){return Object.keys(e).map(function(t){return oe(t,e[t])})}function oe(e,t){return t instanceof b?new se(e,t.ttype,!0):new se(e,i(t),!1)}function _(e,t){return new v(e,g(t))}e.iface=_;var v=function(e){t(r,e);function r(t,n){var r=e.call(this)||this;return r.bases=t,r.props=n,r.propSet=new Set(n.map(function(e){return e.name})),r}return r.prototype.getChecker=function(e,t,r){var i=this,o=this.bases.map(function(n){return a(e,n).getChecker(e,t)}),s=this.props.map(function(n){return n.ttype.getChecker(e,t)}),c=new n.NoopContext,l=this.props.map(function(e,t){return!e.isOpt&&!s[t](void 0,c)}),u=function(e,t){if(typeof e!=`object`||!e)return t.fail(null,`is not an object`,0);for(var n=0;n<o.length;n++)if(!o[n](e,t))return!1;for(var n=0;n<s.length;n++){var r=i.props[n].name,a=e[r];if(a===void 0){if(l[n])return t.fail(r,`is missing`,1)}else if(!s[n](a,t))return t.fail(r,null,1)}return!0};if(!t)return u;var d=this.propSet;return r&&(this.propSet.forEach(function(e){return r.add(e)}),d=r),function(e,t){if(!u(e,t))return!1;for(var n in e)if(!d.has(n))return t.fail(n,`is extraneous`,2);return!0}},r}(r);e.TIface=v;function y(e){return new b(i(e))}e.opt=y;var b=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.ttype=t,n}return n.prototype.getChecker=function(e,t){var n=this.ttype.getChecker(e,t);return function(e,t){return e===void 0||n(e,t)}},n}(r);e.TOptional=b;var se=function(){function e(e,t,n){this.name=e,this.ttype=t,this.isOpt=n}return e}();e.TProp=se;function x(e){return new S(new ce([...arguments].slice(1)),i(e))}e.func=x;var S=function(e){t(n,e);function n(t,n){var r=e.call(this)||this;return r.paramList=t,r.result=n,r}return n.prototype.getChecker=function(e,t){return function(e,t){return typeof e==`function`?!0:t.fail(null,`is not a function`,0)}},n}(r);e.TFunc=S;function C(e,t,n){return new w(e,i(t),!!n)}e.param=C;var w=function(){function e(e,t,n){this.name=e,this.ttype=t,this.isOpt=n}return e}();e.TParam=w;var ce=function(e){t(r,e);function r(t){var n=e.call(this)||this;return n.params=t,n}return r.prototype.getChecker=function(e,t){var r=this,i=this.params.map(function(n){return n.ttype.getChecker(e,t)}),a=new n.NoopContext,o=this.params.map(function(e,t){return!e.isOpt&&!i[t](void 0,a)}),s=function(e,t){if(!Array.isArray(e))return t.fail(null,`is not an array`,0);for(var n=0;n<i.length;n++){var a=r.params[n];if(e[n]===void 0){if(o[n])return t.fail(a.name,`is missing`,1)}else if(!i[n](e[n],t))return t.fail(a.name,null,1)}return!0};return t?function(e,t){return s(e,t)?e.length<=i.length?!0:t.fail(i.length,`is extraneous`,2):!1}:s},r}(r);e.TParamList=ce;var T=function(e){t(n,e);function n(t,n){var r=e.call(this)||this;return r.validator=t,r.message=n,r}return n.prototype.getChecker=function(e,t){var n=this;return function(e,t){return n.validator(e)?!0:t.fail(null,n.message,0)}},n}(r);e.BasicType=T,e.basicTypes={any:new T(function(e){return!0},`is invalid`),number:new T(function(e){return typeof e==`number`},`is not a number`),object:new T(function(e){return typeof e==`object`&&e},`is not an object`),boolean:new T(function(e){return typeof e==`boolean`},`is not a boolean`),string:new T(function(e){return typeof e==`string`},`is not a string`),symbol:new T(function(e){return typeof e==`symbol`},`is not a symbol`),void:new T(function(e){return e==null},`is not void`),undefined:new T(function(e){return e===void 0},`is not undefined`),null:new T(function(e){return e===null},`is not null`),never:new T(function(e){return!1},`is unexpected`),Date:new T(ue(`[object Date]`),`is not a Date`),RegExp:new T(ue(`[object RegExp]`),`is not a RegExp`)};var le=Object.prototype.toString;function ue(e){return function(t){return typeof t==`object`&&t&&le.call(t)===e}}typeof Buffer<`u`&&(e.basicTypes.Buffer=new T(function(e){return Buffer.isBuffer(e)},`is not a Buffer`));for(var E=function(t){e.basicTypes[t.name]=new T(function(e){return e instanceof t},`is not a `+t.name)},D=0,de=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,ArrayBuffer];D<de.length;D++){var fe=de[D];E(fe)}})),B=e(t((e=>{var t=e&&e.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r};Object.defineProperty(e,"__esModule",{value:!0}),e.Checker=e.createCheckers=void 0;var n=tn(),r=en(),i=tn();Object.defineProperty(e,"TArray",{enumerable:!0,get:function(){return i.TArray}}),Object.defineProperty(e,"TEnumType",{enumerable:!0,get:function(){return i.TEnumType}}),Object.defineProperty(e,"TEnumLiteral",{enumerable:!0,get:function(){return i.TEnumLiteral}}),Object.defineProperty(e,"TFunc",{enumerable:!0,get:function(){return i.TFunc}}),Object.defineProperty(e,"TIface",{enumerable:!0,get:function(){return i.TIface}}),Object.defineProperty(e,"TLiteral",{enumerable:!0,get:function(){return i.TLiteral}}),Object.defineProperty(e,"TName",{enumerable:!0,get:function(){return i.TName}}),Object.defineProperty(e,"TOptional",{enumerable:!0,get:function(){return i.TOptional}}),Object.defineProperty(e,"TParam",{enumerable:!0,get:function(){return i.TParam}}),Object.defineProperty(e,"TParamList",{enumerable:!0,get:function(){return i.TParamList}}),Object.defineProperty(e,"TProp",{enumerable:!0,get:function(){return i.TProp}}),Object.defineProperty(e,"TTuple",{enumerable:!0,get:function(){return i.TTuple}}),Object.defineProperty(e,"TType",{enumerable:!0,get:function(){return i.TType}}),Object.defineProperty(e,"TUnion",{enumerable:!0,get:function(){return i.TUnion}}),Object.defineProperty(e,"TIntersection",{enumerable:!0,get:function(){return i.TIntersection}}),Object.defineProperty(e,"array",{enumerable:!0,get:function(){return i.array}}),Object.defineProperty(e,"enumlit",{enumerable:!0,get:function(){return i.enumlit}}),Object.defineProperty(e,"enumtype",{enumerable:!0,get:function(){return i.enumtype}}),Object.defineProperty(e,"func",{enumerable:!0,get:function(){return i.func}}),Object.defineProperty(e,"iface",{enumerable:!0,get:function(){return i.iface}}),Object.defineProperty(e,"lit",{enumerable:!0,get:function(){return i.lit}}),Object.defineProperty(e,"name",{enumerable:!0,get:function(){return i.name}}),Object.defineProperty(e,"opt",{enumerable:!0,get:function(){return i.opt}}),Object.defineProperty(e,"param",{enumerable:!0,get:function(){return i.param}}),Object.defineProperty(e,"tuple",{enumerable:!0,get:function(){return i.tuple}}),Object.defineProperty(e,"union",{enumerable:!0,get:function(){return i.union}}),Object.defineProperty(e,"intersection",{enumerable:!0,get:function(){return i.intersection}}),Object.defineProperty(e,"BasicType",{enumerable:!0,get:function(){return i.BasicType}});var a=en();Object.defineProperty(e,"VError",{enumerable:!0,get:function(){return a.VError}});function o(){for(var e=[...arguments],r=Object.assign.apply(Object,t([{},n.basicTypes],e)),i={},a=0,o=e;a<o.length;a++)for(var c=o[a],l=0,u=Object.keys(c);l<u.length;l++){var d=u[l];i[d]=new s(r,c[d])}return i}e.createCheckers=o;var s=function(){function e(e,t,r){if(r===void 0&&(r=`value`),this.suite=e,this.ttype=t,this._path=r,this.props=new Map,t instanceof n.TIface)for(var i=0,a=t.props;i<a.length;i++){var o=a[i];this.props.set(o.name,o.ttype)}this.checkerPlain=this.ttype.getChecker(e,!1),this.checkerStrict=this.ttype.getChecker(e,!0)}return e.prototype.setReportedPath=function(e){this._path=e},e.prototype.check=function(e){return this._doCheck(this.checkerPlain,e)},e.prototype.test=function(e){return this.checkerPlain(e,new r.NoopContext)},e.prototype.validate=function(e){return this._doValidate(this.checkerPlain,e)},e.prototype.strictCheck=function(e){return this._doCheck(this.checkerStrict,e)},e.prototype.strictTest=function(e){return this.checkerStrict(e,new r.NoopContext)},e.prototype.strictValidate=function(e){return this._doValidate(this.checkerStrict,e)},e.prototype.getProp=function(t){var n=this.props.get(t);if(!n)throw Error(`Type has no property `+t);return new e(this.suite,n,this._path+`.`+t)},e.prototype.methodArgs=function(t){var n=this._getMethod(t);return new e(this.suite,n.paramList)},e.prototype.methodResult=function(t){var n=this._getMethod(t);return new e(this.suite,n.result)},e.prototype.getArgs=function(){if(!(this.ttype instanceof n.TFunc))throw Error(`getArgs() applied to non-function`);return new e(this.suite,this.ttype.paramList)},e.prototype.getResult=function(){if(!(this.ttype instanceof n.TFunc))throw Error(`getResult() applied to non-function`);return new e(this.suite,this.ttype.result)},e.prototype.getType=function(){return this.ttype},e.prototype._doCheck=function(e,t){if(!e(t,new r.NoopContext)){var n=new r.DetailContext;throw e(t,n),n.getError(this._path)}},e.prototype._doValidate=function(e,t){if(e(t,new r.NoopContext))return null;var n=new r.DetailContext;return e(t,n),n.getErrorDetail(this._path)},e.prototype._getMethod=function(e){var t=this.props.get(e);if(!t)throw Error(`Type has no property `+e);if(!(t instanceof n.TFunc))throw Error(`Property `+e+` is not a method`);return t},e}();e.Checker=s}))()),nn={Transform:B.union(B.lit(`jsx`),B.lit(`typescript`),B.lit(`flow`),B.lit(`imports`),B.lit(`react-hot-loader`),B.lit(`jest`)),SourceMapOptions:B.iface([],{compiledFilename:`string`}),Options:B.iface([],{transforms:B.array(`Transform`),disableESTransforms:B.opt(`boolean`),jsxRuntime:B.opt(B.union(B.lit(`classic`),B.lit(`automatic`),B.lit(`preserve`))),production:B.opt(`boolean`),jsxImportSource:B.opt(`string`),jsxPragma:B.opt(`string`),jsxFragmentPragma:B.opt(`string`),keepUnusedImports:B.opt(`boolean`),preserveDynamicImport:B.opt(`boolean`),injectCreateRequireForImportRequire:B.opt(`boolean`),enableLegacyTypeScriptModuleInterop:B.opt(`boolean`),enableLegacyBabel5ModuleInterop:B.opt(`boolean`),sourceMapOptions:B.opt(`SourceMapOptions`),filePath:B.opt(`string`)})},{Options:rn}=(0,B.createCheckers)(nn);function an(e){rn.strictCheck(e)}function on(){A(),G(!1)}function sn(e){A(),un(e)}function V(e){Y(),ln(e)}function cn(){Y(),m.tokens[m.tokens.length-1].identifierRole=O.ImportDeclaration}function ln(e){let t;t=m.scopeDepth===0?O.TopLevelDeclaration:e?O.BlockScopedDeclaration:O.FunctionScopedDeclaration,m.tokens[m.tokens.length-1].identifierRole=t}function un(e){switch(m.type){case a._this:{let e=M(0);A(),N(e);return}case a._yield:case a.name:m.type=a.name,V(e);return;case a.bracketL:A(),dn(a.bracketR,e,!0);return;case a.braceL:Ki(!0,e);return;default:w()}}function dn(e,t,n=!1,r=!1,i=0){let o=!0,s=!1,c=m.tokens.length;for(;!P(e)&&!m.error;)if(o?o=!1:(C(a.comma),m.tokens[m.tokens.length-1].contextId=i,!s&&m.tokens[c].isType&&(m.tokens[m.tokens.length-1].isType=!0,s=!0)),!(n&&F(a.comma))){if(P(e))break;if(F(a.ellipsis)){sn(t),pn(),P(a.comma),C(e);break}else fn(r,t)}}function fn(e,t){e&&vn([i._public,i._protected,i._private,i._readonly,i._override]),mn(t),pn(),mn(t,!0)}function pn(){p?fo():f&&ni()}function mn(e,t=!1){if(t||un(e),!P(a.eq))return;let n=m.tokens.length-1;G(),m.tokens[n].rhsEndIndex=m.tokens.length}function hn(){return F(a.name)}function gn(){return F(a.name)||!!(m.type&a.IS_KEYWORD)||F(a.string)||F(a.num)||F(a.bigint)||F(a.decimal)}function _n(){let e=m.snapshot();return A(),(F(a.bracketL)||F(a.braceL)||F(a.star)||F(a.ellipsis)||F(a.hash)||gn())&&!b()?!0:(m.restoreFromSnapshot(e),!1)}function vn(e){for(;yn(e)!==null;);}function yn(e){if(!F(a.name))return null;let t=m.contextualKeyword;if(e.indexOf(t)!==-1&&_n()){switch(t){case i._readonly:m.tokens[m.tokens.length-1].type=a._readonly;break;case i._abstract:m.tokens[m.tokens.length-1].type=a._abstract;break;case i._static:m.tokens[m.tokens.length-1].type=a._static;break;case i._public:m.tokens[m.tokens.length-1].type=a._public;break;case i._private:m.tokens[m.tokens.length-1].type=a._private;break;case i._protected:m.tokens[m.tokens.length-1].type=a._protected;break;case i._override:m.tokens[m.tokens.length-1].type=a._override;break;case i._declare:m.tokens[m.tokens.length-1].type=a._declare;break;default:break}return t}return null}function bn(){for(Y();P(a.dot);)Y()}function xn(){bn(),!b()&&F(a.lessThan)&&Fr()}function Sn(){A(),ur()}function Cn(){A()}function wn(){C(a._typeof),F(a._import)?Tn():bn(),!b()&&F(a.lessThan)&&Fr()}function Tn(){C(a._import),C(a.parenL),C(a.string),C(a.parenR),P(a.dot)&&bn(),F(a.lessThan)&&Fr()}function En(){P(a._const);let e=P(a._in),t=_(i._out);P(a._const),(e||t)&&!F(a.name)?m.tokens[m.tokens.length-1].type=a.name:Y(),P(a._extends)&&H(),P(a.eq)&&H()}function Dn(){F(a.lessThan)&&On()}function On(){let e=M(0);for(F(a.lessThan)||F(a.typeParameterStart)?A():w();!P(a.greaterThan)&&!m.error;)En(),P(a.comma);N(e)}function kn(e){let t=e===a.arrow;Dn(),C(a.parenL),m.scopeDepth++,An(!1),m.scopeDepth--,(t||F(e))&&ar(e)}function An(e){dn(a.parenR,e)}function jn(){P(a.comma)||S()}function Mn(){kn(a.colon),jn()}function Nn(){let e=m.snapshot();A();let t=P(a.name)&&F(a.colon);return m.restoreFromSnapshot(e),t}function Pn(){if(!(F(a.bracketL)&&Nn()))return!1;let e=M(0);return C(a.bracketL),Y(),ur(),C(a.bracketR),sr(),jn(),N(e),!0}function Fn(e){P(a.question),!e&&(F(a.parenL)||F(a.lessThan))?(kn(a.colon),jn()):(sr(),jn())}function In(){if(F(a.parenL)||F(a.lessThan)){Mn();return}if(F(a._new)){A(),F(a.parenL)||F(a.lessThan)?Mn():Fn(!1);return}let e=!!yn([i._readonly]);Pn()||((g(i._get)||g(i._set))&&_n(),Zi(-1),Fn(e))}function Ln(){Rn()}function Rn(){for(C(a.braceL);!P(a.braceR)&&!m.error;)In()}function zn(){let e=m.snapshot(),t=Bn();return m.restoreFromSnapshot(e),t}function Bn(){return A(),P(a.plus)||P(a.minus)?g(i._readonly):(g(i._readonly)&&A(),!F(a.bracketL)||(A(),!hn())?!1:(A(),F(a._in)))}function Vn(){Y(),C(a._in),H()}function Hn(){C(a.braceL),F(a.plus)||F(a.minus)?(A(),v(i._readonly)):_(i._readonly),C(a.bracketL),Vn(),_(i._as)&&H(),C(a.bracketR),F(a.plus)||F(a.minus)?(A(),C(a.question)):P(a.question),cr(),S(),C(a.braceR)}function Un(){for(C(a.bracketL);!P(a.bracketR)&&!m.error;)Wn(),P(a.comma)}function Wn(){P(a.ellipsis)?H():(H(),P(a.question)),P(a.colon)&&H()}function Gn(){C(a.parenL),H(),C(a.parenR)}function Kn(){for(j(),j();!F(a.backQuote)&&!m.error;)C(a.dollarBraceL),H(),j(),j();A()}var qn;(function(e){e[e.TSFunctionType=0]=`TSFunctionType`,e[e.TSConstructorType=1]=`TSConstructorType`,e[e.TSAbstractConstructorType=2]=`TSAbstractConstructorType`})(qn||={});function Jn(e){e===qn.TSAbstractConstructorType&&v(i._abstract),(e===qn.TSConstructorType||e===qn.TSAbstractConstructorType)&&C(a._new);let t=m.inDisallowConditionalTypesContext;m.inDisallowConditionalTypesContext=!1,kn(a.arrow),m.inDisallowConditionalTypesContext=t}function Yn(){switch(m.type){case a.name:xn();return;case a._void:case a._null:A();return;case a.string:case a.num:case a.bigint:case a.decimal:case a._true:case a._false:Li();return;case a.minus:A(),Li();return;case a._this:Cn(),g(i._is)&&!b()&&Sn();return;case a._typeof:wn();return;case a._import:Tn();return;case a.braceL:zn()?Hn():Ln();return;case a.bracketL:Un();return;case a.parenL:Gn();return;case a.backQuote:Kn();return;default:if(m.type&a.IS_KEYWORD){A(),m.tokens[m.tokens.length-1].type=a.name;return}break}w()}function Xn(){for(Yn();!b()&&P(a.bracketL);)P(a.bracketR)||(H(),C(a.bracketR))}function Zn(){if(v(i._infer),Y(),F(a._extends)){let e=m.snapshot();C(a._extends);let t=m.inDisallowConditionalTypesContext;m.inDisallowConditionalTypesContext=!0,H(),m.inDisallowConditionalTypesContext=t,(m.error||!m.inDisallowConditionalTypesContext&&F(a.question))&&m.restoreFromSnapshot(e)}}function Qn(){if(g(i._keyof)||g(i._unique)||g(i._readonly))A(),Qn();else if(g(i._infer))Zn();else{let e=m.inDisallowConditionalTypesContext;m.inDisallowConditionalTypesContext=!1,Xn(),m.inDisallowConditionalTypesContext=e}}function $n(){if(P(a.bitwiseAND),Qn(),F(a.bitwiseAND))for(;P(a.bitwiseAND);)Qn()}function er(){if(P(a.bitwiseOR),$n(),F(a.bitwiseOR))for(;P(a.bitwiseOR);)$n()}function tr(){return F(a.lessThan)?!0:F(a.parenL)&&rr()}function nr(){if(F(a.name)||F(a._this))return A(),!0;if(F(a.braceL)||F(a.bracketL)){let e=1;for(A();e>0&&!m.error;)F(a.braceL)||F(a.bracketL)?e++:(F(a.braceR)||F(a.bracketR))&&e--,A();return!0}return!1}function rr(){let e=m.snapshot(),t=ir();return m.restoreFromSnapshot(e),t}function ir(){return A(),!!(F(a.parenR)||F(a.ellipsis)||nr()&&(F(a.colon)||F(a.comma)||F(a.question)||F(a.eq)||F(a.parenR)&&(A(),F(a.arrow))))}function ar(e){let t=M(0);C(e),lr()||H(),N(t)}function or(){F(a.colon)&&ar(a.colon)}function sr(){F(a.colon)&&ur()}function cr(){P(a.colon)&&H()}function lr(){let e=m.snapshot();return g(i._asserts)?(A(),_(i._is)?(H(),!0):hn()||F(a._this)?(A(),_(i._is)&&H(),!0):(m.restoreFromSnapshot(e),!1)):hn()||F(a._this)?(A(),g(i._is)&&!b()?(A(),H(),!0):(m.restoreFromSnapshot(e),!1)):!1}function ur(){let e=M(0);C(a.colon),H(),N(e)}function H(){if(fr(),m.inDisallowConditionalTypesContext||b()||!P(a._extends))return;let e=m.inDisallowConditionalTypesContext;m.inDisallowConditionalTypesContext=!0,fr(),m.inDisallowConditionalTypesContext=e,C(a.question),H(),C(a.colon),H()}function dr(){return g(i._abstract)&&I()===a._new}function fr(){if(tr()){Jn(qn.TSFunctionType);return}if(F(a._new)){Jn(qn.TSConstructorType);return}else if(dr()){Jn(qn.TSAbstractConstructorType);return}er()}function pr(){let e=M(1);H(),C(a.greaterThan),N(e),Ti()}function mr(){if(P(a.jsxTagStart)){m.tokens[m.tokens.length-1].type=a.typeParameterStart;let e=M(1);for(;!F(a.greaterThan)&&!m.error;)H(),P(a.comma);U(),N(e)}}function hr(){for(;!F(a.braceL)&&!m.error;)gr(),P(a.comma)}function gr(){bn(),F(a.lessThan)&&Fr()}function _r(){V(!1),Dn(),P(a._extends)&&hr(),Rn()}function vr(){V(!1),Dn(),C(a.eq),H(),S()}function yr(){if(F(a.string)?Li():Y(),P(a.eq)){let e=m.tokens.length-1;G(),m.tokens[e].rhsEndIndex=m.tokens.length}}function br(){for(V(!1),C(a.braceL);!P(a.braceR)&&!m.error;)yr(),P(a.comma)}function xr(){C(a.braceL),Qo(a.braceR)}function Sr(){V(!1),P(a.dot)?Sr():xr()}function Cr(){g(i._global)?Y():F(a.string)?J():w(),F(a.braceL)?xr():S()}function wr(){cn(),C(a.eq),Er(),S()}function Tr(){return g(i._require)&&I()===a.parenL}function Er(){Tr()?Dr():bn()}function Dr(){v(i._require),C(a.parenL),F(a.string)||w(),Li(),C(a.parenR)}function Or(){if(x())return!1;switch(m.type){case a._function:{let e=M(1);A();let t=m.start;return rs(t,!0),N(e),!0}case a._class:{let e=M(1);return as(!0,!1),N(e),!0}case a._const:if(F(a._const)&&oe(i._enum)){let e=M(1);return C(a._const),v(i._enum),m.tokens[m.tokens.length-1].type=a._enum,br(),N(e),!0}case a._var:case a._let:{let e=M(1);return Ko(m.type!==a._var),N(e),!0}case a.name:{let e=M(1),t=m.contextualKeyword,n=!1;return t===i._global?(Cr(),n=!0):n=jr(t,!0),N(e),n}default:return!1}}function kr(){return jr(m.contextualKeyword,!0)}function Ar(e){switch(e){case i._declare:{let e=m.tokens.length-1;if(Or())return m.tokens[e].type=a._declare,!0;break}case i._global:if(F(a.braceL))return xr(),!0;break;default:return jr(e,!1)}return!1}function jr(e,t){switch(e){case i._abstract:if(Mr(t)&&F(a._class))return m.tokens[m.tokens.length-1].type=a._abstract,as(!0,!1),!0;break;case i._enum:if(Mr(t)&&F(a.name))return m.tokens[m.tokens.length-1].type=a._enum,br(),!0;break;case i._interface:if(Mr(t)&&F(a.name)){let e=M(t?2:1);return _r(),N(e),!0}break;case i._module:if(Mr(t)){if(F(a.string)){let e=M(t?2:1);return Cr(),N(e),!0}else if(F(a.name)){let e=M(t?2:1);return Sr(),N(e),!0}}break;case i._namespace:if(Mr(t)&&F(a.name)){let e=M(t?2:1);return Sr(),N(e),!0}break;case i._type:if(Mr(t)&&F(a.name)){let e=M(t?2:1);return vr(),N(e),!0}break;default:break}return!1}function Mr(e){return e?(A(),!0):!x()}function Nr(){let e=m.snapshot();return On(),is(),or(),C(a.arrow),m.error?(m.restoreFromSnapshot(e),!1):(ta(!0),!0)}function Pr(){m.type===a.bitShiftL&&(--m.pos,L(a.lessThan)),Fr()}function Fr(){let e=M(0);for(C(a.lessThan);!F(a.greaterThan)&&!m.error;)H(),P(a.comma);e?(C(a.greaterThan),N(e)):(N(e),Be(),C(a.greaterThan),m.tokens[m.tokens.length-1].isType=!0)}function Ir(){if(F(a.name))switch(m.contextualKeyword){case i._abstract:case i._declare:case i._enum:case i._interface:case i._module:case i._namespace:case i._type:return!0;default:break}return!1}function Lr(e,t){if(F(a.colon)&&ar(a.colon),!F(a.braceL)&&x()){let t=m.tokens.length-1;for(;t>=0&&(m.tokens[t].start>=e||m.tokens[t].type===a._default||m.tokens[t].type===a._export);)m.tokens[t].isType=!0,t--;return}ta(!1,t)}function Rr(e,t,n){if(!b()&&P(a.bang)){m.tokens[m.tokens.length-1].type=a.nonNullAssertion;return}if(F(a.lessThan)||F(a.bitShiftL)){let n=m.snapshot();if(!t&&ji()&&Nr())return;if(Pr(),!t&&P(a.parenL)?(m.tokens[m.tokens.length-1].subscriptStartIndex=e,q()):F(a.backQuote)?Gi():(m.type===a.greaterThan||m.type!==a.parenL&&m.type&a.IS_EXPRESSION_START&&!b())&&w(),m.error)m.restoreFromSnapshot(n);else return}else!t&&F(a.questionDot)&&I()===a.lessThan&&(A(),m.tokens[e].isOptionalChainStart=!0,m.tokens[m.tokens.length-1].subscriptStartIndex=e,Fr(),C(a.parenL),q());Ai(e,t,n)}function zr(){if(P(a._import))return g(i._type)&&I()!==a.eq&&v(i._type),wr(),!0;if(P(a.eq))return W(),S(),!0;if(_(i._as))return v(i._namespace),Y(),S(),!0;if(g(i._type)){let e=I();(e===a.braceL||e===a.star)&&A()}return!1}function Br(){if(Y(),F(a.comma)||F(a.braceR)){m.tokens[m.tokens.length-1].identifierRole=O.ImportDeclaration;return}if(Y(),F(a.comma)||F(a.braceR)){m.tokens[m.tokens.length-1].identifierRole=O.ImportDeclaration,m.tokens[m.tokens.length-2].isType=!0,m.tokens[m.tokens.length-1].isType=!0;return}if(Y(),F(a.comma)||F(a.braceR)){m.tokens[m.tokens.length-3].identifierRole=O.ImportAccess,m.tokens[m.tokens.length-1].identifierRole=O.ImportDeclaration;return}Y(),m.tokens[m.tokens.length-3].identifierRole=O.ImportAccess,m.tokens[m.tokens.length-1].identifierRole=O.ImportDeclaration,m.tokens[m.tokens.length-4].isType=!0,m.tokens[m.tokens.length-3].isType=!0,m.tokens[m.tokens.length-2].isType=!0,m.tokens[m.tokens.length-1].isType=!0}function Vr(){if(Y(),F(a.comma)||F(a.braceR)){m.tokens[m.tokens.length-1].identifierRole=O.ExportAccess;return}if(Y(),F(a.comma)||F(a.braceR)){m.tokens[m.tokens.length-1].identifierRole=O.ExportAccess,m.tokens[m.tokens.length-2].isType=!0,m.tokens[m.tokens.length-1].isType=!0;return}if(Y(),F(a.comma)||F(a.braceR)){m.tokens[m.tokens.length-3].identifierRole=O.ExportAccess;return}Y(),m.tokens[m.tokens.length-3].identifierRole=O.ExportAccess,m.tokens[m.tokens.length-4].isType=!0,m.tokens[m.tokens.length-3].isType=!0,m.tokens[m.tokens.length-2].isType=!0,m.tokens[m.tokens.length-1].isType=!0}function Hr(){if(g(i._abstract)&&I()===a._class)return m.type=a._abstract,A(),as(!0,!0),!0;if(g(i._interface)){let e=M(2);return jr(i._interface,!0),N(e),!0}return!1}function Ur(){if(m.type===a._const){let e=Ce();if(e.type===a.name&&e.contextualKeyword===i._enum)return C(a._const),v(i._enum),m.tokens[m.tokens.length-1].type=a._enum,br(),!0}return!1}function Wr(e){let t=m.tokens.length;vn([i._abstract,i._readonly,i._declare,i._static,i._override]);let n=m.tokens.length;if(Pn()){let r=e?t-1:t;for(let e=r;e<n;e++)m.tokens[e].isType=!0;return!0}return!1}function Gr(e){Ar(e)||S()}function Kr(){let e=_(i._declare);e&&(m.tokens[m.tokens.length-1].type=a._declare);let t=!1;if(F(a.name))if(e){let e=M(2);t=kr(),N(e)}else t=kr();if(!t)if(e){let e=M(2);$(!0),N(e)}else $(!0)}function qr(e){if(e&&(F(a.lessThan)||F(a.bitShiftL))&&Pr(),_(i._implements)){m.tokens[m.tokens.length-1].type=a._implements;let e=M(1);hr(),N(e)}}function Jr(){Dn()}function Yr(){Dn()}function Xr(){let e=M(0);b()||P(a.bang),sr(),N(e)}function Zr(){F(a.colon)&&ur()}function Qr(e,t){return d?$r(e,t):ei(e,t)}function $r(e,t){if(!F(a.lessThan))return K(e,t);let n=m.snapshot(),r=K(e,t);if(m.error)m.restoreFromSnapshot(n);else return r;return m.type=a.typeParameterStart,On(),r=K(e,t),r||w(),r}function ei(e,t){if(!F(a.lessThan))return K(e,t);let n=m.snapshot();On();let r=K(e,t);if(r||w(),m.error)m.restoreFromSnapshot(n);else return r;return K(e,t)}function ti(){if(F(a.colon)){let e=m.snapshot();ar(a.colon),y()&&w(),F(a.arrow)||w(),m.error&&m.restoreFromSnapshot(e)}return P(a.arrow)}function ni(){let e=M(0);P(a.question),sr(),N(e)}function ri(){(F(a.lessThan)||F(a.bitShiftL))&&Pr(),Mo()}function ii(){let e=!1,t=!1;for(;;){if(m.pos>=h.length){w(`Unterminated JSX contents`);return}let n=h.charCodeAt(m.pos);if(n===u.lessThan||n===u.leftCurlyBrace){if(m.pos===m.start){if(n===u.lessThan){m.pos++,L(a.jsxTagStart);return}Ue(n);return}L(e&&!t?a.jsxEmptyText:a.jsxText);return}n===u.lineFeed?e=!0:n!==u.space&&n!==u.carriageReturn&&n!==u.tab&&(t=!0),m.pos++}}function ai(e){for(m.pos++;;){if(m.pos>=h.length){w(`Unterminated string constant`);return}if(h.charCodeAt(m.pos)===e){m.pos++;break}m.pos++}L(a.string)}function oi(){let e;do{if(m.pos>h.length){w(`Unexpectedly reached the end of input.`);return}e=h.charCodeAt(++m.pos)}while(E[e]||e===u.dash);L(a.jsxName)}function si(){U()}function ci(e){if(si(),!P(a.colon)){m.tokens[m.tokens.length-1].identifierRole=e;return}si()}function li(){let e=m.tokens.length;ci(O.Access);let t=!1;for(;F(a.dot);)t=!0,U(),si();if(!t){let t=m.tokens[e],n=h.charCodeAt(t.start);n>=u.lowercaseA&&n<=u.lowercaseZ&&(t.identifierRole=null)}}function ui(){switch(m.type){case a.braceL:A(),W(),U();return;case a.jsxTagStart:hi(),U();return;case a.string:U();return;default:w(`JSX value should be either an expression or a quoted JSX text`)}}function di(){C(a.ellipsis),W()}function fi(e){if(F(a.jsxTagEnd))return!1;li(),f&&mr();let t=!1;for(;!F(a.slash)&&!F(a.jsxTagEnd)&&!m.error;){if(P(a.braceL)){t=!0,C(a.ellipsis),G(),U();continue}t&&m.end-m.start===3&&h.charCodeAt(m.start)===u.lowercaseK&&h.charCodeAt(m.start+1)===u.lowercaseE&&h.charCodeAt(m.start+2)===u.lowercaseY&&(m.tokens[e].jsxRole=k.KeyAfterPropSpread),ci(O.ObjectKey),F(a.eq)&&(U(),ui())}let n=F(a.slash);return n&&U(),n}function pi(){F(a.jsxTagEnd)||li()}function mi(){let e=m.tokens.length-1;m.tokens[e].jsxRole=k.NoChildren;let t=0;if(!fi(e))for(gi();;)switch(m.type){case a.jsxTagStart:if(U(),F(a.slash)){U(),pi(),m.tokens[e].jsxRole!==k.KeyAfterPropSpread&&(t===1?m.tokens[e].jsxRole=k.OneChild:t>1&&(m.tokens[e].jsxRole=k.StaticChildren));return}t++,mi(),gi();break;case a.jsxText:t++,gi();break;case a.jsxEmptyText:gi();break;case a.braceL:A(),F(a.ellipsis)?(di(),gi(),t+=2):(F(a.braceR)||(t++,W()),gi());break;default:w();return}}function hi(){U(),mi()}function U(){m.tokens.push(new ye),je(),m.start=m.pos;let e=h.charCodeAt(m.pos);if(D[e])oi();else if(e===u.quotationMark||e===u.apostrophe)ai(e);else switch(++m.pos,e){case u.greaterThan:L(a.jsxTagEnd);break;case u.lessThan:L(a.jsxTagStart);break;case u.slash:L(a.slash);break;case u.equalsTo:L(a.eq);break;case u.leftCurlyBrace:L(a.braceL);break;case u.dot:L(a.dot);break;case u.colon:L(a.colon);break;default:w()}}function gi(){m.tokens.push(new ye),m.start=m.pos,ii()}function _i(e){if(F(a.question)){let e=I();if(e===a.colon||e===a.comma||e===a.parenR)return}Si(e)}function vi(){xe(a.question),F(a.colon)&&(f?ur():p&&Ya())}var yi=class{constructor(e){this.stop=e}};function W(e=!1){if(G(e),F(a.comma))for(;P(a.comma);)G(e)}function G(e=!1,t=!1){return f?Qr(e,t):p?vo(e,t):K(e,t)}function K(e,t){if(F(a._yield))return aa(),!1;(F(a.parenL)||F(a.name)||F(a._yield))&&(m.potentialArrowAt=m.start);let n=bi(e);return t&&Hi(),m.type&a.IS_ASSIGN?(A(),G(e),!1):n}function bi(e){return Ci(e)?!0:(xi(e),!1)}function xi(e){f||p?_i(e):Si(e)}function Si(e){P(a.question)&&(G(),C(a.colon),G(e))}function Ci(e){let t=m.tokens.length;return Ti()?!0:(wi(t,-1,e),!1)}function wi(e,t,n){if(f&&(a._in&a.PRECEDENCE_MASK)>t&&!b()&&(_(i._as)||_(i._satisfies))){let r=M(1);H(),N(r),Be(),wi(e,t,n);return}let r=m.type&a.PRECEDENCE_MASK;if(r>0&&(!n||!F(a._in))&&r>t){let i=m.type;A(),i===a.nullishCoalescing&&(m.tokens[m.tokens.length-1].nullishStartIndex=e);let o=m.tokens.length;Ti(),wi(o,i&a.IS_RIGHT_ASSOCIATIVE?r-1:r,n),i===a.nullishCoalescing&&(m.tokens[e].numNullishCoalesceStarts++,m.tokens[m.tokens.length-1].numNullishCoalesceEnds++),wi(e,t,n)}}function Ti(){if(f&&!d&&P(a.lessThan))return pr(),!1;if(g(i._module)&&Ee()===u.leftCurlyBrace&&!se())return oa(),!1;if(m.type&a.IS_PREFIX)return A(),Ti(),!1;if(Ei())return!0;for(;m.type&a.IS_POSTFIX&&!y();)m.type===a.preIncDec&&(m.type=a.postIncDec),A();return!1}function Ei(){let e=m.tokens.length;return J()?!0:(Di(e),m.tokens.length>e&&m.tokens[e].isOptionalChainStart&&(m.tokens[m.tokens.length-1].isOptionalChainEnd=!0),!1)}function Di(e,t=!1){p?bo(e,t):Oi(e,t)}function Oi(e,t=!1){let n=new yi(!1);do ki(e,t,n);while(!n.stop&&!m.error)}function ki(e,t,n){f?Rr(e,t,n):p?$a(e,t,n):Ai(e,t,n)}function Ai(e,t,n){if(!t&&P(a.doubleColon))Pi(),n.stop=!0,Di(e,t);else if(F(a.questionDot)){if(m.tokens[e].isOptionalChainStart=!0,t&&I()===a.parenL){n.stop=!0;return}A(),m.tokens[m.tokens.length-1].subscriptStartIndex=e,P(a.bracketL)?(W(),C(a.bracketR)):P(a.parenL)?q():Fi()}else if(P(a.dot))m.tokens[m.tokens.length-1].subscriptStartIndex=e,Fi();else if(P(a.bracketL))m.tokens[m.tokens.length-1].subscriptStartIndex=e,W(),C(a.bracketR);else if(!t&&F(a.parenL))if(ji()){let t=m.snapshot(),r=m.tokens.length;A(),m.tokens[m.tokens.length-1].subscriptStartIndex=e;let i=te();m.tokens[m.tokens.length-1].contextId=i,q(),m.tokens[m.tokens.length-1].contextId=i,Mi()&&(m.restoreFromSnapshot(t),n.stop=!0,m.scopeDepth++,is(),Ni(r))}else{A(),m.tokens[m.tokens.length-1].subscriptStartIndex=e;let t=te();m.tokens[m.tokens.length-1].contextId=t,q(),m.tokens[m.tokens.length-1].contextId=t}else F(a.backQuote)?Gi():n.stop=!0}function ji(){return m.tokens[m.tokens.length-1].contextualKeyword===i._async&&!y()}function q(){let e=!0;for(;!P(a.parenR)&&!m.error;){if(e)e=!1;else if(C(a.comma),P(a.parenR))break;ra(!1)}}function Mi(){return F(a.colon)||F(a.arrow)}function Ni(e){f?Zr():p&&_o(),C(a.arrow),$i(e)}function Pi(){let e=m.tokens.length;J(),Di(e,!0)}function J(){if(P(a.modulo))return Y(),!1;if(F(a.jsxText)||F(a.jsxEmptyText))return Li(),!1;if(F(a.lessThan)&&d)return m.type=a.jsxTagStart,hi(),A(),!1;let e=m.potentialArrowAt===m.start;switch(m.type){case a.slash:case a.assign:be();case a._super:case a._this:case a.regexp:case a.num:case a.bigint:case a.decimal:case a.string:case a._null:case a._true:case a._false:return A(),!1;case a._import:return A(),F(a.dot)&&(m.tokens[m.tokens.length-1].type=a.name,A(),Y()),!1;case a.name:{let t=m.tokens.length,n=m.start,r=m.contextualKeyword;return Y(),r===i._await?(ia(),!1):r===i._async&&F(a._function)&&!y()?(A(),rs(n,!1),!1):e&&r===i._async&&!y()&&F(a.name)?(m.scopeDepth++,V(!1),C(a.arrow),$i(t),!0):F(a._do)&&!y()?(A(),Zo(),!1):e&&!y()&&F(a.arrow)?(m.scopeDepth++,ln(!1),C(a.arrow),$i(t),!0):(m.tokens[m.tokens.length-1].identifierRole=O.Access,!1)}case a._do:return A(),Zo(),!1;case a.parenL:return zi(e);case a.bracketL:return A(),na(a.bracketR,!0),!1;case a.braceL:return Ki(!1,!1),!1;case a._function:return Ii(),!1;case a.at:ko();case a._class:return as(!1),!1;case a._new:return Ui(),!1;case a.backQuote:return Gi(),!1;case a.doubleColon:return A(),Pi(),!1;case a.hash:{let e=Ee();return D[e]||e===u.backslash?Fi():A(),!1}default:return w(),!1}}function Fi(){P(a.hash),Y()}function Ii(){let e=m.start;Y(),P(a.dot)&&Y(),rs(e,!1)}function Li(){A()}function Ri(){C(a.parenL),W(),C(a.parenR)}function zi(e){let t=m.snapshot(),n=m.tokens.length;C(a.parenL);let r=!0;for(;!F(a.parenR)&&!m.error;){if(r)r=!1;else if(C(a.comma),F(a.parenR))break;if(F(a.ellipsis)){sn(!1),Hi();break}else G(!1,!0)}return C(a.parenR),e&&Bi()&&Vi()?(m.restoreFromSnapshot(t),m.scopeDepth++,is(),Vi(),$i(n),m.error?(m.restoreFromSnapshot(t),zi(!1),!1):!0):!1}function Bi(){return F(a.colon)||!y()}function Vi(){return f?ti():p?yo():P(a.arrow)}function Hi(){(f||p)&&vi()}function Ui(){if(C(a._new),P(a.dot)){Y();return}Wi(),p&&eo(),P(a.parenL)&&na(a.parenR)}function Wi(){Pi(),P(a.questionDot)}function Gi(){for(j(),j();!F(a.backQuote)&&!m.error;)C(a.dollarBraceL),W(),j(),j();A()}function Ki(e,t){let n=te(),r=!0;for(A(),m.tokens[m.tokens.length-1].contextId=n;!P(a.braceR)&&!m.error;){if(r)r=!1;else if(C(a.comma),P(a.braceR))break;let o=!1;if(F(a.ellipsis)){let n=m.tokens.length;if(on(),e&&(m.tokens.length===n+2&&ln(t),P(a.braceR)))break;continue}e||(o=P(a.star)),!e&&g(i._async)?(o&&w(),Y(),F(a.colon)||F(a.parenL)||F(a.braceR)||F(a.eq)||F(a.comma)||(F(a.star)&&(A(),o=!0),Zi(n))):Zi(n),Xi(e,t,n)}m.tokens[m.tokens.length-1].contextId=n}function qi(e){return!e&&(F(a.string)||F(a.num)||F(a.bracketL)||F(a.name)||!!(m.type&a.IS_KEYWORD))}function Ji(e,t){let n=m.start;return F(a.parenL)?(e&&w(),Qi(n,!1),!0):qi(e)?(Zi(t),Qi(n,!1),!0):!1}function Yi(e,t){if(P(a.colon)){e?mn(t):G(!1);return}let n;n=e?m.scopeDepth===0?O.ObjectShorthandTopLevelDeclaration:t?O.ObjectShorthandBlockScopedDeclaration:O.ObjectShorthandFunctionScopedDeclaration:O.ObjectShorthand,m.tokens[m.tokens.length-1].identifierRole=n,mn(t,!0)}function Xi(e,t,n){f?Jr():p&&uo(),Ji(e,n)||Yi(e,t)}function Zi(e){p&&Za(),P(a.bracketL)?(m.tokens[m.tokens.length-1].contextId=e,G(),C(a.bracketR),m.tokens[m.tokens.length-1].contextId=e):(F(a.num)||F(a.string)||F(a.bigint)||F(a.decimal)?J():Fi(),m.tokens[m.tokens.length-1].identifierRole=O.ObjectKey,m.tokens[m.tokens.length-1].contextId=e)}function Qi(e,t){let n=te();m.scopeDepth++;let r=m.tokens.length;is(t,n),ea(e,n);let i=m.tokens.length;m.scopes.push(new s(r,i,!0)),m.scopeDepth--}function $i(e){ta(!0);let t=m.tokens.length;m.scopes.push(new s(e,t,!0)),m.scopeDepth--}function ea(e,t=0){f?Lr(e,t):p?Qa(t):ta(!1,t)}function ta(e,t=0){e&&!F(a.braceL)?G():Zo(!0,t)}function na(e,t=!1){let n=!0;for(;!P(e)&&!m.error;){if(n)n=!1;else if(C(a.comma),P(e))break;ra(t)}}function ra(e){e&&F(a.comma)||(F(a.ellipsis)?(on(),Hi()):F(a.question)?A():G(!1,!0))}function Y(){A(),m.tokens[m.tokens.length-1].type=a.name}function ia(){Ti()}function aa(){A(),!F(a.semi)&&!y()&&(P(a.star),G())}function oa(){v(i._module),C(a.braceL),Qo(a.braceR)}function sa(e){return(e.type===a.name||!!(e.type&a.IS_KEYWORD))&&e.contextualKeyword!==i._from}function X(e){let t=M(0);C(e||a.colon),Q(),N(t)}function ca(){C(a.modulo),v(i._checks),P(a.parenL)&&(W(),C(a.parenR))}function la(){let e=M(0);C(a.colon),F(a.modulo)?ca():(Q(),F(a.modulo)&&ca()),N(e)}function ua(){A(),ba(!0)}function da(){A(),Y(),F(a.lessThan)&&Z(),C(a.parenL),Ha(),C(a.parenR),la(),S()}function fa(){F(a._class)?ua():F(a._function)?da():F(a._var)?pa():_(i._module)?P(a.dot)?ga():ma():g(i._type)?_a():g(i._opaque)?va():g(i._interface)?ya():F(a._export)?ha():w()}function pa(){A(),Xa(),S()}function ma(){for(F(a.string)?J():Y(),C(a.braceL);!F(a.braceR)&&!m.error;)F(a._import)?(A(),Ms()):w();C(a.braceR)}function ha(){C(a._export),P(a._default)?F(a._function)||F(a._class)?fa():(Q(),S()):F(a._var)||F(a._function)||F(a._class)||g(i._opaque)?fa():F(a.star)||F(a.braceL)||g(i._interface)||g(i._type)||g(i._opaque)?_s():w()}function ga(){v(i._exports),Ya(),S()}function _a(){A(),wa()}function va(){A(),Ta(!0)}function ya(){A(),ba()}function ba(e=!1){if(Ca(),F(a.lessThan)&&Z(),P(a._extends))do xa();while(!e&&P(a.comma));if(g(i._mixins)){A();do xa();while(P(a.comma))}if(g(i._implements)){A();do xa();while(P(a.comma))}Pa(e,!1,e)}function xa(){La(!1),F(a.lessThan)&&Da()}function Sa(){ba()}function Ca(){Y()}function wa(){Ca(),F(a.lessThan)&&Z(),X(a.eq),S()}function Ta(e){v(i._type),Ca(),F(a.lessThan)&&Z(),F(a.colon)&&X(a.colon),e||X(a.eq),S()}function Ea(){Za(),Xa(),P(a.eq)&&Q()}function Z(){let e=M(0);F(a.lessThan)||F(a.typeParameterStart)?A():w();do Ea(),F(a.greaterThan)||C(a.comma);while(!F(a.greaterThan)&&!m.error);C(a.greaterThan),N(e)}function Da(){let e=M(0);for(C(a.lessThan);!F(a.greaterThan)&&!m.error;)Q(),F(a.greaterThan)||C(a.comma);C(a.greaterThan),N(e)}function Oa(){if(v(i._interface),P(a._extends))do xa();while(P(a.comma));Pa(!1,!1,!1)}function ka(){F(a.num)||F(a.string)?J():Y()}function Aa(){I()===a.colon?(ka(),X()):Q(),C(a.bracketR),X()}function ja(){ka(),C(a.bracketR),C(a.bracketR),F(a.lessThan)||F(a.parenL)?Ma():(P(a.question),X())}function Ma(){for(F(a.lessThan)&&Z(),C(a.parenL);!F(a.parenR)&&!F(a.ellipsis)&&!m.error;)Va(),F(a.parenR)||C(a.comma);P(a.ellipsis)&&Va(),C(a.parenR),X()}function Na(){Ma()}function Pa(e,t,n){let r;for(t&&F(a.braceBarL)?(C(a.braceBarL),r=a.braceBarR):(C(a.braceL),r=a.braceR);!F(r)&&!m.error;){if(n&&g(i._proto)){let t=I();t!==a.colon&&t!==a.question&&(A(),e=!1)}if(e&&g(i._static)){let e=I();e!==a.colon&&e!==a.question&&A()}if(Za(),P(a.bracketL))P(a.bracketL)?ja():Aa();else if(F(a.parenL)||F(a.lessThan))Na();else{if(g(i._get)||g(i._set)){let e=I();(e===a.name||e===a.string||e===a.num)&&A()}Fa()}Ia()}C(r)}function Fa(){if(F(a.ellipsis)){if(C(a.ellipsis),P(a.comma)||P(a.semi),F(a.braceR))return;Q()}else ka(),F(a.lessThan)||F(a.parenL)?Ma():(P(a.question),X())}function Ia(){!P(a.semi)&&!P(a.comma)&&!F(a.braceR)&&!F(a.braceBarR)&&w()}function La(e){for(e||Y();P(a.dot);)Y()}function Ra(){La(!0),F(a.lessThan)&&Da()}function za(){C(a._typeof),Ua()}function Ba(){for(C(a.bracketL);m.pos<h.length&&!F(a.bracketR)&&(Q(),!F(a.bracketR));)C(a.comma);C(a.bracketR)}function Va(){let e=I();e===a.colon||e===a.question?(Y(),P(a.question),X()):Q()}function Ha(){for(;!F(a.parenR)&&!F(a.ellipsis)&&!m.error;)Va(),F(a.parenR)||C(a.comma);P(a.ellipsis)&&Va()}function Ua(){let e=!1,t=m.noAnonFunctionType;switch(m.type){case a.name:if(g(i._interface)){Oa();return}Y(),Ra();return;case a.braceL:Pa(!1,!1,!1);return;case a.braceBarL:Pa(!1,!0,!1);return;case a.bracketL:Ba();return;case a.lessThan:Z(),C(a.parenL),Ha(),C(a.parenR),C(a.arrow),Q();return;case a.parenL:if(A(),!F(a.parenR)&&!F(a.ellipsis))if(F(a.name)){let t=I();e=t!==a.question&&t!==a.colon}else e=!0;if(e)if(m.noAnonFunctionType=!1,Q(),m.noAnonFunctionType=t,m.noAnonFunctionType||!(F(a.comma)||F(a.parenR)&&I()===a.arrow)){C(a.parenR);return}else P(a.comma);Ha(),C(a.parenR),C(a.arrow),Q();return;case a.minus:A(),Li();return;case a.string:case a.num:case a._true:case a._false:case a._null:case a._this:case a._void:case a.star:A();return;default:if(m.type===a._typeof){za();return}else if(m.type&a.IS_KEYWORD){A(),m.tokens[m.tokens.length-1].type=a.name;return}}w()}function Wa(){for(Ua();!y()&&(F(a.bracketL)||F(a.questionDot));)P(a.questionDot),C(a.bracketL),P(a.bracketR)||(Q(),C(a.bracketR))}function Ga(){P(a.question)?Ga():Wa()}function Ka(){Ga(),!m.noAnonFunctionType&&P(a.arrow)&&Q()}function qa(){for(P(a.bitwiseAND),Ka();P(a.bitwiseAND);)Ka()}function Ja(){for(P(a.bitwiseOR),qa();P(a.bitwiseOR);)qa()}function Q(){Ja()}function Ya(){X()}function Xa(){Y(),F(a.colon)&&Ya()}function Za(){(F(a.plus)||F(a.minus))&&(A(),m.tokens[m.tokens.length-1].isType=!0)}function Qa(e){F(a.colon)&&la(),ta(!1,e)}function $a(e,t,n){if(F(a.questionDot)&&I()===a.lessThan){if(t){n.stop=!0;return}A(),Da(),C(a.parenL),q();return}else if(!t&&F(a.lessThan)){let e=m.snapshot();if(Da(),C(a.parenL),q(),m.error)m.restoreFromSnapshot(e);else return}Ai(e,t,n)}function eo(){if(F(a.lessThan)){let e=m.snapshot();Da(),m.error&&m.restoreFromSnapshot(e)}}function to(){if(F(a.name)&&m.contextualKeyword===i._interface){let e=M(0);return A(),Sa(),N(e),!0}else if(g(i._enum))return So(),!0;return!1}function no(){return g(i._enum)?(So(),!0):!1}function ro(e){if(e===i._declare){if(F(a._class)||F(a.name)||F(a._function)||F(a._var)||F(a._export)){let e=M(1);fa(),N(e)}}else if(F(a.name)){if(e===i._interface){let e=M(1);Sa(),N(e)}else if(e===i._type){let e=M(1);wa(),N(e)}else if(e===i._opaque){let e=M(1);Ta(!1),N(e)}}S()}function io(){return g(i._type)||g(i._interface)||g(i._opaque)||g(i._enum)}function ao(){return F(a.name)&&(m.contextualKeyword===i._type||m.contextualKeyword===i._interface||m.contextualKeyword===i._opaque||m.contextualKeyword===i._enum)}function oo(){if(g(i._type)){let e=M(1);A(),F(a.braceL)?(Os(),Ss()):wa(),N(e)}else if(g(i._opaque)){let e=M(1);A(),Ta(!1),N(e)}else if(g(i._interface)){let e=M(1);A(),Sa(),N(e)}else $(!0)}function so(){return F(a.star)||g(i._type)&&I()===a.star}function co(){if(_(i._type)){let e=M(2);Ts(),N(e)}else Ts()}function lo(e){if(e&&F(a.lessThan)&&Da(),g(i._implements)){let e=M(0);A(),m.tokens[m.tokens.length-1].type=a._implements;do Ca(),F(a.lessThan)&&Da();while(P(a.comma));N(e)}}function uo(){F(a.lessThan)&&(Z(),F(a.parenL)||w())}function fo(){let e=M(0);P(a.question),F(a.colon)&&Ya(),N(e)}function po(){if(F(a._typeof)||g(i._type)){let e=Ce();(sa(e)||e.type===a.braceL||e.type===a.star)&&A()}}function mo(){let e=m.contextualKeyword===i._type||m.type===a._typeof;e?A():Y(),g(i._as)&&!oe(i._as)?(Y(),e&&!F(a.name)&&!(m.type&a.IS_KEYWORD)||Y()):(e&&(F(a.name)||m.type&a.IS_KEYWORD)&&Y(),_(i._as)&&Y())}function ho(){if(F(a.lessThan)){let e=M(0);Z(),N(e)}}function go(){F(a.colon)&&Ya()}function _o(){if(F(a.colon)){let e=m.noAnonFunctionType;m.noAnonFunctionType=!0,Ya(),m.noAnonFunctionType=e}}function vo(e,t){if(F(a.lessThan)){let n=m.snapshot(),r=K(e,t);if(m.error)m.restoreFromSnapshot(n),m.type=a.typeParameterStart;else return r;let i=M(0);if(Z(),N(i),r=K(e,t),r)return!0;w()}return K(e,t)}function yo(){if(F(a.colon)){let e=M(0),t=m.snapshot(),n=m.noAnonFunctionType;m.noAnonFunctionType=!0,la(),m.noAnonFunctionType=n,y()&&w(),F(a.arrow)||w(),m.error&&m.restoreFromSnapshot(t),N(e)}return P(a.arrow)}function bo(e,t=!1){if(m.tokens[m.tokens.length-1].contextualKeyword===i._async&&F(a.lessThan)){let e=m.snapshot();if(xo()&&!m.error)return;m.restoreFromSnapshot(e)}Oi(e,t)}function xo(){m.scopeDepth++;let e=m.tokens.length;return is(),Vi()?($i(e),!0):!1}function So(){v(i._enum),m.tokens[m.tokens.length-1].type=a._enum,Y(),Co()}function Co(){_(i._of)&&A(),C(a.braceL),wo(),C(a.braceR)}function wo(){for(;!F(a.braceR)&&!m.error&&!P(a.ellipsis);)To(),F(a.braceR)||C(a.comma)}function To(){Y(),P(a.eq)&&A()}function Eo(){if(Qo(a.eof),m.scopes.push(new s(0,m.tokens.length,!0)),m.scopeDepth!==0)throw Error(`Invalid scope depth at end of file: ${m.scopeDepth}`);return new zs(m.tokens,m.scopes)}function $(e){p&&to()||(F(a.at)&&ko(),Do(e))}function Do(e){if(f&&Ur())return;let t=m.type;switch(t){case a._break:case a._continue:No();return;case a._debugger:Po();return;case a._do:Fo();return;case a._for:Io();return;case a._function:if(I()===a.dot)break;e||w(),zo();return;case a._class:e||w(),as(!0);return;case a._if:Bo();return;case a._return:Vo();return;case a._switch:Ho();return;case a._throw:Uo();return;case a._try:Go();return;case a._let:case a._const:e||w();case a._var:Ko(t!==a._var);return;case a._while:qo();return;case a.braceL:Zo();return;case a.semi:Jo();return;case a._export:case a._import:{let e=I();if(e===a.parenL||e===a.dot)break;A(),t===a._import?Ms():_s();return}case a.name:if(m.contextualKeyword===i._async){let e=m.start,t=m.snapshot();if(A(),F(a._function)&&!y()){C(a._function),rs(e,!0);return}else m.restoreFromSnapshot(t)}else if(m.contextualKeyword===i._using&&!se()&&I()===a.name){Ko(!0);return}else if(Oo()){v(i._await),Ko(!0);return}default:break}let n=m.tokens.length;W();let r=null;if(m.tokens.length===n+1){let e=m.tokens[m.tokens.length-1];e.type===a.name&&(r=e.contextualKeyword)}if(r==null){S();return}P(a.colon)?Yo():Xo(r)}function Oo(){if(!g(i._await))return!1;let e=m.snapshot();return A(),!g(i._using)||b()||(A(),!F(a.name)||b())?(m.restoreFromSnapshot(e),!1):(m.restoreFromSnapshot(e),!0)}function ko(){for(;F(a.at);)Ao()}function Ao(){if(A(),P(a.parenL))W(),C(a.parenR);else{for(Y();P(a.dot);)Y();jo()}}function jo(){f?ri():Mo()}function Mo(){P(a.parenL)&&q()}function No(){A(),x()||(Y(),S())}function Po(){A(),S()}function Fo(){A(),$(!1),C(a._while),Ri(),P(a.semi)}function Io(){m.scopeDepth++;let e=m.tokens.length;Ro();let t=m.tokens.length;m.scopes.push(new s(e,t,!1)),m.scopeDepth--}function Lo(){return!(!g(i._using)||oe(i._of))}function Ro(){A();let e=!1;if(g(i._await)&&(e=!0,A()),C(a.parenL),F(a.semi)){e&&w(),$o();return}let t=Oo();if(t||F(a._var)||F(a._let)||F(a._const)||Lo()){if(t&&v(i._await),A(),ts(!0,m.type!==a._var),F(a._in)||g(i._of)){es(e);return}$o();return}if(W(!0),F(a._in)||g(i._of)){es(e);return}e&&w(),$o()}function zo(){let e=m.start;A(),rs(e,!0)}function Bo(){A(),Ri(),$(!1),P(a._else)&&$(!1)}function Vo(){A(),x()||(W(),S())}function Ho(){A(),Ri(),m.scopeDepth++;let e=m.tokens.length;for(C(a.braceL);!F(a.braceR)&&!m.error;)if(F(a._case)||F(a._default)){let e=F(a._case);A(),e&&W(),C(a.colon)}else $(!0);A();let t=m.tokens.length;m.scopes.push(new s(e,t,!1)),m.scopeDepth--}function Uo(){A(),W(),S()}function Wo(){un(!0),f&&sr()}function Go(){if(A(),Zo(),F(a._catch)){A();let e=null;if(F(a.parenL)&&(m.scopeDepth++,e=m.tokens.length,C(a.parenL),Wo(),C(a.parenR)),Zo(),e!=null){let t=m.tokens.length;m.scopes.push(new s(e,t,!1)),m.scopeDepth--}}P(a._finally)&&Zo()}function Ko(e){A(),ts(!1,e),S()}function qo(){A(),Ri(),$(!1)}function Jo(){A()}function Yo(){$(!0)}function Xo(e){f?Gr(e):p?ro(e):S()}function Zo(e=!1,t=0){let n=m.tokens.length;m.scopeDepth++,C(a.braceL),t&&(m.tokens[m.tokens.length-1].contextId=t),Qo(a.braceR),t&&(m.tokens[m.tokens.length-1].contextId=t);let r=m.tokens.length;m.scopes.push(new s(n,r,e)),m.scopeDepth--}function Qo(e){for(;!P(e)&&!m.error;)$(!0)}function $o(){C(a.semi),F(a.semi)||W(),C(a.semi),F(a.parenR)||W(),C(a.parenR),$(!1)}function es(e){e?_(i._of):A(),W(),C(a.parenR),$(!1)}function ts(e,t){for(;;){if(ns(t),P(a.eq)){let t=m.tokens.length-1;G(e),m.tokens[t].rhsEndIndex=m.tokens.length}if(!P(a.comma))break}}function ns(e){un(e),f?Xr():p&&go()}function rs(e,t,n=!1){F(a.star)&&A(),t&&!n&&!F(a.name)&&!F(a._yield)&&w();let r=null;F(a.name)&&(t||(r=m.tokens.length,m.scopeDepth++),V(!1));let i=m.tokens.length;m.scopeDepth++,is(),ea(e);let o=m.tokens.length;m.scopes.push(new s(i,o,!0)),m.scopeDepth--,r!==null&&(m.scopes.push(new s(r,o,!0)),m.scopeDepth--)}function is(e=!1,t=0){f?Yr():p&&ho(),C(a.parenL),t&&(m.tokens[m.tokens.length-1].contextId=t),dn(a.parenR,!1,!1,e,t),t&&(m.tokens[m.tokens.length-1].contextId=t)}function as(e,t=!1){let n=te();A(),m.tokens[m.tokens.length-1].contextId=n,m.tokens[m.tokens.length-1].isExpression=!e;let r=null;e||(r=m.tokens.length,m.scopeDepth++),hs(e,t),gs();let i=m.tokens.length;if(cs(n),!m.error&&(m.tokens[i].contextId=n,m.tokens[m.tokens.length-1].contextId=n,r!==null)){let e=m.tokens.length;m.scopes.push(new s(r,e,!1)),m.scopeDepth--}}function os(){return F(a.eq)||F(a.semi)||F(a.braceR)||F(a.bang)||F(a.colon)}function ss(){return F(a.parenL)||F(a.lessThan)}function cs(e){for(C(a.braceL);!P(a.braceR)&&!m.error;){if(P(a.semi))continue;if(F(a.at)){Ao();continue}let t=m.start;ls(t,e)}}function ls(e,t){f&&vn([i._declare,i._public,i._protected,i._private,i._override]);let n=!1;if(F(a.name)&&m.contextualKeyword===i._static){if(Y(),ss()){ds(e,!1);return}else if(os()){ms();return}if(m.tokens[m.tokens.length-1].type=a._static,n=!0,F(a.braceL)){m.tokens[m.tokens.length-1].contextId=t,Zo();return}}us(e,n,t)}function us(e,t,n){if(f&&Wr(t))return;if(P(a.star)){fs(n),ds(e,!1);return}fs(n);let r=!1,o=m.tokens[m.tokens.length-1];o.contextualKeyword===i._constructor&&(r=!0),ps(),ss()?ds(e,r):os()?ms():o.contextualKeyword===i._async&&!x()?(m.tokens[m.tokens.length-1].type=a._async,F(a.star)&&A(),fs(n),ps(),ds(e,!1)):(o.contextualKeyword===i._get||o.contextualKeyword===i._set)&&!(x()&&F(a.star))?(o.contextualKeyword===i._get?m.tokens[m.tokens.length-1].type=a._get:m.tokens[m.tokens.length-1].type=a._set,fs(n),ds(e,!1)):o.contextualKeyword===i._accessor&&!x()?(fs(n),ms()):x()?ms():w()}function ds(e,t){f?Dn():p&&F(a.lessThan)&&Z(),Qi(e,t)}function fs(e){Zi(e)}function ps(){if(f){let e=M(0);P(a.question),N(e)}}function ms(){if(f?(xe(a.bang),sr()):p&&F(a.colon)&&Ya(),F(a.eq)){let e=m.tokens.length;A(),G(),m.tokens[e].rhsEndIndex=m.tokens.length}S()}function hs(e,t=!1){f&&(!e||t)&&g(i._implements)||(F(a.name)&&V(!0),f?Dn():p&&F(a.lessThan)&&Z())}function gs(){let e=!1;P(a._extends)?(Ei(),e=!0):e=!1,f?qr(e):p&&lo(e)}function _s(){let e=m.tokens.length-1;f&&zr()||(Cs()?ws():bs()?(Y(),F(a.comma)&&I()===a.star?(C(a.comma),C(a.star),v(i._as),Y()):xs(),Ss()):P(a._default)?vs():Ds()?ys():(Os(),Ss()),m.tokens[e].rhsEndIndex=m.tokens.length)}function vs(){if(f&&Hr()||p&&no())return;let e=m.start;P(a._function)?rs(e,!0,!0):g(i._async)&&I()===a._function?(_(i._async),P(a._function),rs(e,!0,!0)):F(a._class)?as(!0,!0):F(a.at)?(ko(),as(!0,!0)):(G(),S())}function ys(){f?Kr():p?oo():$(!0)}function bs(){if(f&&Ir()||p&&ao())return!1;if(F(a.name))return m.contextualKeyword!==i._async;if(!F(a._default))return!1;let e=we(),t=Ce(),n=t.type===a.name&&t.contextualKeyword===i._from;if(t.type===a.comma)return!0;if(n){let t=h.charCodeAt(Te(e+4));return t===u.quotationMark||t===u.apostrophe}return!1}function xs(){P(a.comma)&&Os()}function Ss(){_(i._from)&&(J(),Ls()),S()}function Cs(){return p?so():F(a.star)}function ws(){p?co():Ts()}function Ts(){C(a.star),g(i._as)?Es():Ss()}function Es(){A(),m.tokens[m.tokens.length-1].type=a._as,Y(),xs(),Ss()}function Ds(){return f&&Ir()||p&&io()||m.type===a._var||m.type===a._const||m.type===a._let||m.type===a._function||m.type===a._class||g(i._async)||F(a.at)}function Os(){let e=!0;for(C(a.braceL);!P(a.braceR)&&!m.error;){if(e)e=!1;else if(C(a.comma),P(a.braceR))break;ks()}}function ks(){if(f){Vr();return}Y(),m.tokens[m.tokens.length-1].identifierRole=O.ExportAccess,_(i._as)&&Y()}function As(){let e=m.snapshot();return v(i._module),_(i._from)?g(i._from)?(m.restoreFromSnapshot(e),!0):(m.restoreFromSnapshot(e),!1):F(a.comma)?(m.restoreFromSnapshot(e),!1):(m.restoreFromSnapshot(e),!0)}function js(){g(i._module)&&As()&&A()}function Ms(){if(f&&F(a.name)&&I()===a.eq){wr();return}if(f&&g(i._type)){let e=Ce();if(e.type===a.name&&e.contextualKeyword!==i._from){if(v(i._type),I()===a.eq){wr();return}}else(e.type===a.star||e.type===a.braceL)&&v(i._type)}F(a.string)?J():(js(),Fs(),v(i._from),J()),Ls(),S()}function Ns(){return F(a.name)}function Ps(){cn()}function Fs(){p&&po();let e=!0;if(!(Ns()&&(Ps(),!P(a.comma)))){if(F(a.star)){A(),v(i._as),Ps();return}for(C(a.braceL);!P(a.braceR)&&!m.error;){if(e)e=!1;else if(P(a.colon)&&w(`ES2015 named imports do not destructure. Use another statement for destructuring after the import.`),C(a.comma),P(a.braceR))break;Is()}}}function Is(){if(f){Br();return}if(p){mo();return}cn(),g(i._as)&&(m.tokens[m.tokens.length-1].identifierRole=O.ImportAccess,A(),cn())}function Ls(){(F(a._with)||g(i._assert)&&!b())&&(A(),Ki(!1,!1))}function Rs(){return m.pos===0&&h.charCodeAt(0)===u.numberSign&&h.charCodeAt(1)===u.exclamationMark&&Ae(2),De(),Eo()}var zs=class{constructor(e,t){this.tokens=e,this.scopes=t}};function Bs(e,t,n,r){if(r&&n)throw Error(`Cannot combine flow and typescript plugins.`);ae(e,t,n,r);let i=Rs();if(m.error)throw ne(m.error);return i}function Vs(e){let t=e.currentIndex(),n=0,r=e.currentToken();do{let a=e.tokens[t];if(a.isOptionalChainStart&&n++,a.isOptionalChainEnd&&n--,n+=a.numNullishCoalesceStarts,n-=a.numNullishCoalesceEnds,a.contextualKeyword===i._await&&a.identifierRole==null&&a.scopeDepth===r.scopeDepth)return!0;t+=1}while(n>0&&t<e.tokens.length);return!1}var Hs=class e{__init(){this.resultCode=``}__init2(){this.resultMappings=Array(this.tokens.length)}__init3(){this.tokenIndex=0}constructor(t,n,r,i,a){this.code=t,this.tokens=n,this.isFlowEnabled=r,this.disableESTransforms=i,this.helperManager=a,e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this)}snapshot(){return{resultCode:this.resultCode,tokenIndex:this.tokenIndex}}restoreToSnapshot(e){this.resultCode=e.resultCode,this.tokenIndex=e.tokenIndex}dangerouslyGetAndRemoveCodeSinceSnapshot(e){let t=this.resultCode.slice(e.resultCode.length);return this.resultCode=e.resultCode,t}reset(){this.resultCode=``,this.resultMappings=Array(this.tokens.length),this.tokenIndex=0}matchesContextualAtIndex(e,t){return this.matches1AtIndex(e,a.name)&&this.tokens[e].contextualKeyword===t}identifierNameAtIndex(e){return this.identifierNameForToken(this.tokens[e])}identifierNameAtRelativeIndex(e){return this.identifierNameForToken(this.tokenAtRelativeIndex(e))}identifierName(){return this.identifierNameForToken(this.currentToken())}identifierNameForToken(e){return this.code.slice(e.start,e.end)}rawCodeForToken(e){return this.code.slice(e.start,e.end)}stringValueAtIndex(e){return this.stringValueForToken(this.tokens[e])}stringValue(){return this.stringValueForToken(this.currentToken())}stringValueForToken(e){return this.code.slice(e.start+1,e.end-1)}matches1AtIndex(e,t){return this.tokens[e].type===t}matches2AtIndex(e,t,n){return this.tokens[e].type===t&&this.tokens[e+1].type===n}matches3AtIndex(e,t,n,r){return this.tokens[e].type===t&&this.tokens[e+1].type===n&&this.tokens[e+2].type===r}matches1(e){return this.tokens[this.tokenIndex].type===e}matches2(e,t){return this.tokens[this.tokenIndex].type===e&&this.tokens[this.tokenIndex+1].type===t}matches3(e,t,n){return this.tokens[this.tokenIndex].type===e&&this.tokens[this.tokenIndex+1].type===t&&this.tokens[this.tokenIndex+2].type===n}matches4(e,t,n,r){return this.tokens[this.tokenIndex].type===e&&this.tokens[this.tokenIndex+1].type===t&&this.tokens[this.tokenIndex+2].type===n&&this.tokens[this.tokenIndex+3].type===r}matches5(e,t,n,r,i){return this.tokens[this.tokenIndex].type===e&&this.tokens[this.tokenIndex+1].type===t&&this.tokens[this.tokenIndex+2].type===n&&this.tokens[this.tokenIndex+3].type===r&&this.tokens[this.tokenIndex+4].type===i}matchesContextual(e){return this.matchesContextualAtIndex(this.tokenIndex,e)}matchesContextIdAndLabel(e,t){return this.matches1(e)&&this.currentToken().contextId===t}previousWhitespaceAndComments(){let e=this.code.slice(this.tokenIndex>0?this.tokens[this.tokenIndex-1].end:0,this.tokenIndex<this.tokens.length?this.tokens[this.tokenIndex].start:this.code.length);return this.isFlowEnabled&&(e=e.replace(/@flow/g,``)),e}replaceToken(e){this.resultCode+=this.previousWhitespaceAndComments(),this.appendTokenPrefix(),this.resultMappings[this.tokenIndex]=this.resultCode.length,this.resultCode+=e,this.appendTokenSuffix(),this.tokenIndex++}replaceTokenTrimmingLeftWhitespace(e){this.resultCode+=this.previousWhitespaceAndComments().replace(/[^\r\n]/g,``),this.appendTokenPrefix(),this.resultMappings[this.tokenIndex]=this.resultCode.length,this.resultCode+=e,this.appendTokenSuffix(),this.tokenIndex++}removeInitialToken(){this.replaceToken(``)}removeToken(){this.replaceTokenTrimmingLeftWhitespace(``)}removeBalancedCode(){let e=0;for(;!this.isAtEnd();){if(this.matches1(a.braceL))e++;else if(this.matches1(a.braceR)){if(e===0)return;e--}this.removeToken()}}copyExpectedToken(e){if(this.tokens[this.tokenIndex].type!==e)throw Error(`Expected token ${e}`);this.copyToken()}copyToken(){this.resultCode+=this.previousWhitespaceAndComments(),this.appendTokenPrefix(),this.resultMappings[this.tokenIndex]=this.resultCode.length,this.resultCode+=this.code.slice(this.tokens[this.tokenIndex].start,this.tokens[this.tokenIndex].end),this.appendTokenSuffix(),this.tokenIndex++}copyTokenWithPrefix(e){this.resultCode+=this.previousWhitespaceAndComments(),this.appendTokenPrefix(),this.resultCode+=e,this.resultMappings[this.tokenIndex]=this.resultCode.length,this.resultCode+=this.code.slice(this.tokens[this.tokenIndex].start,this.tokens[this.tokenIndex].end),this.appendTokenSuffix(),this.tokenIndex++}appendTokenPrefix(){let e=this.currentToken();if((e.numNullishCoalesceStarts||e.isOptionalChainStart)&&(e.isAsyncOperation=Vs(this)),!this.disableESTransforms){if(e.numNullishCoalesceStarts)for(let t=0;t<e.numNullishCoalesceStarts;t++)e.isAsyncOperation?(this.resultCode+=`await `,this.resultCode+=this.helperManager.getHelperName(`asyncNullishCoalesce`)):this.resultCode+=this.helperManager.getHelperName(`nullishCoalesce`),this.resultCode+=`(`;e.isOptionalChainStart&&(e.isAsyncOperation&&(this.resultCode+=`await `),this.tokenIndex>0&&this.tokenAtRelativeIndex(-1).type===a._delete?e.isAsyncOperation?this.resultCode+=this.helperManager.getHelperName(`asyncOptionalChainDelete`):this.resultCode+=this.helperManager.getHelperName(`optionalChainDelete`):e.isAsyncOperation?this.resultCode+=this.helperManager.getHelperName(`asyncOptionalChain`):this.resultCode+=this.helperManager.getHelperName(`optionalChain`),this.resultCode+=`([`)}}appendTokenSuffix(){let e=this.currentToken();if(e.isOptionalChainEnd&&!this.disableESTransforms&&(this.resultCode+=`])`),e.numNullishCoalesceEnds&&!this.disableESTransforms)for(let t=0;t<e.numNullishCoalesceEnds;t++)this.resultCode+=`))`}appendCode(e){this.resultCode+=e}currentToken(){return this.tokens[this.tokenIndex]}currentTokenCode(){let e=this.currentToken();return this.code.slice(e.start,e.end)}tokenAtRelativeIndex(e){return this.tokens[this.tokenIndex+e]}currentIndex(){return this.tokenIndex}nextToken(){if(this.tokenIndex===this.tokens.length)throw Error(`Unexpectedly reached end of input.`);this.tokenIndex++}previousToken(){this.tokenIndex--}finish(){if(this.tokenIndex!==this.tokens.length)throw Error(`Tried to finish processing tokens before reaching the end.`);return this.resultCode+=this.previousWhitespaceAndComments(),{code:this.resultCode,mappings:this.resultMappings}}isAtEnd(){return this.tokenIndex===this.tokens.length}};function Us(e,t,n,r){let o=t.snapshot(),s=Gs(t),c=[],l=[],u=[],d=null,f=[],p=[],m=t.currentToken().contextId;if(m==null)throw Error(`Expected non-null class context ID on class open-brace.`);for(t.nextToken();!t.matchesContextIdAndLabel(a.braceR,m);)if(t.matchesContextual(i._constructor)&&!t.currentToken().isType)({constructorInitializerStatements:c,constructorInsertPos:d}=Ks(t));else if(t.matches1(a.semi))r||p.push({start:t.currentIndex(),end:t.currentIndex()+1}),t.nextToken();else if(t.currentToken().isType)t.nextToken();else{let o=t.currentIndex(),s=!1,h=!1,ee=!1;for(;qs(t.currentToken());)t.matches1(a._static)&&(s=!0),t.matches1(a.hash)&&(h=!0),(t.matches1(a._declare)||t.matches1(a._abstract))&&(ee=!0),t.nextToken();if(s&&t.matches1(a.braceL)){Ws(t,m);continue}if(h){Ws(t,m);continue}if(t.matchesContextual(i._constructor)&&!t.currentToken().isType){({constructorInitializerStatements:c,constructorInsertPos:d}=Ks(t));continue}let te=t.currentIndex();if(Js(t),t.matches1(a.lessThan)||t.matches1(a.parenL)){Ws(t,m);continue}for(;t.currentToken().isType;)t.nextToken();if(t.matches1(a.eq)){let r=t.currentIndex(),i=t.currentToken().rhsEndIndex;if(i==null)throw Error(`Expected rhsEndIndex on class field assignment.`);for(t.nextToken();t.currentIndex()<i;)e.processToken();let a;s?(a=n.claimFreeName(`__initStatic`),u.push(a)):(a=n.claimFreeName(`__init`),l.push(a)),f.push({initializerName:a,equalsIndex:r,start:te,end:t.currentIndex()})}else(!r||ee)&&p.push({start:o,end:t.currentIndex()})}return t.restoreToSnapshot(o),r?{headerInfo:s,constructorInitializerStatements:c,instanceInitializerNames:[],staticInitializerNames:[],constructorInsertPos:d,fields:[],rangesToRemove:p}:{headerInfo:s,constructorInitializerStatements:c,instanceInitializerNames:l,staticInitializerNames:u,constructorInsertPos:d,fields:f,rangesToRemove:p}}function Ws(e,t){for(e.nextToken();e.currentToken().contextId!==t;)e.nextToken();for(;qs(e.tokenAtRelativeIndex(-1));)e.previousToken()}function Gs(e){let t=e.currentToken(),n=t.contextId;if(n==null)throw Error(`Expected context ID on class token.`);let r=t.isExpression;if(r==null)throw Error(`Expected isExpression on class token.`);let i=null,o=!1;for(e.nextToken(),e.matches1(a.name)&&(i=e.identifierName());!e.matchesContextIdAndLabel(a.braceL,n);)e.matches1(a._extends)&&!e.currentToken().isType&&(o=!0),e.nextToken();return{isExpression:r,className:i,hasSuperclass:o}}function Ks(e){let t=[];e.nextToken();let n=e.currentToken().contextId;if(n==null)throw Error(`Expected context ID on open-paren starting constructor params.`);for(;!e.matchesContextIdAndLabel(a.parenR,n);)if(e.currentToken().contextId===n){if(e.nextToken(),qs(e.currentToken())){for(e.nextToken();qs(e.currentToken());)e.nextToken();let n=e.currentToken();if(n.type!==a.name)throw Error(`Expected identifier after access modifiers in constructor arg.`);let r=e.identifierNameForToken(n);t.push(`this.${r} = ${r}`)}}else e.nextToken();for(e.nextToken();e.currentToken().isType;)e.nextToken();let r=e.currentIndex(),i=!1;for(;!e.matchesContextIdAndLabel(a.braceR,n);){if(!i&&e.matches2(a._super,a.parenL)){e.nextToken();let t=e.currentToken().contextId;if(t==null)throw Error(`Expected a context ID on the super call`);for(;!e.matchesContextIdAndLabel(a.parenR,t);)e.nextToken();r=e.currentIndex(),i=!0}e.nextToken()}return e.nextToken(),{constructorInitializerStatements:t,constructorInsertPos:r}}function qs(e){return[a._async,a._get,a._set,a.plus,a.minus,a._readonly,a._static,a._public,a._private,a._protected,a._override,a._abstract,a.star,a._declare,a.hash].includes(e.type)}function Js(e){if(e.matches1(a.bracketL)){let t=e.currentToken().contextId;if(t==null)throw Error(`Expected class context ID on computed name open bracket.`);for(;!e.matchesContextIdAndLabel(a.bracketR,t);)e.nextToken();e.nextToken()}else e.nextToken()}function Ys(e){if(e.removeInitialToken(),e.removeToken(),e.removeToken(),e.removeToken(),e.matches1(a.parenL))e.removeToken(),e.removeToken(),e.removeToken();else for(;e.matches1(a.dot);)e.removeToken(),e.removeToken()}var Xs={typeDeclarations:new Set,valueDeclarations:new Set};function Zs(e){let t=new Set,n=new Set;for(let r=0;r<e.tokens.length;r++){let i=e.tokens[r];i.type===a.name&&he(i)&&(i.isType?t.add(e.identifierNameForToken(i)):n.add(e.identifierNameForToken(i)))}return{typeDeclarations:t,valueDeclarations:n}}function Qs(e){let t=e.currentIndex();for(;!e.matches1AtIndex(t,a.braceR);)t++;return e.matchesContextualAtIndex(t+1,i._from)&&e.matches1AtIndex(t+2,a.string)}function $s(e){(e.matches2(a._with,a.braceL)||e.matches2(a.name,a.braceL)&&e.matchesContextual(i._assert))&&(e.removeToken(),e.removeToken(),e.removeBalancedCode(),e.removeToken())}function ec(e,t,n,r){if(!e||t)return!1;let i=n.currentToken();if(i.rhsEndIndex==null)throw Error(`Expected non-null rhsEndIndex on export token.`);let o=i.rhsEndIndex-n.currentIndex();if(o!==3&&!(o===4&&n.matches1AtIndex(i.rhsEndIndex-1,a.semi)))return!1;let s=n.tokenAtRelativeIndex(2);if(s.type!==a.name)return!1;let c=n.identifierNameForToken(s);return r.typeDeclarations.has(c)&&!r.valueDeclarations.has(c)}var tc=class e extends z{__init(){this.hadExport=!1}__init2(){this.hadNamedExport=!1}__init3(){this.hadDefaultExport=!1}constructor(t,n,r,i,a,o,s,c,l,u,d,f){super(),this.rootTransformer=t,this.tokens=n,this.importProcessor=r,this.nameManager=i,this.helperManager=a,this.reactHotLoaderTransformer=o,this.enableLegacyBabel5ModuleInterop=s,this.enableLegacyTypeScriptModuleInterop=c,this.isTypeScriptTransformEnabled=l,this.isFlowTransformEnabled=u,this.preserveDynamicImport=d,this.keepUnusedImports=f,e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this),this.declarationInfo=l?Zs(n):Xs}getPrefixCode(){let e=``;return this.hadExport&&(e+=`Object.defineProperty(exports, "__esModule", {value: true});`),e}getSuffixCode(){return this.enableLegacyBabel5ModuleInterop&&this.hadDefaultExport&&!this.hadNamedExport?`
116
+ `},qt=class e{__init(){this.helperNames={}}__init2(){this.createRequireName=null}constructor(t){this.nameManager=t,e.prototype.__init.call(this),e.prototype.__init2.call(this)}getHelperName(e){let t=this.helperNames[e];return t||(t=this.nameManager.claimFreeName(`_${e}`),this.helperNames[e]=t,t)}emitHelpers(){let e=``;this.helperNames.optionalChainDelete&&this.getHelperName(`optionalChain`),this.helperNames.asyncOptionalChainDelete&&this.getHelperName(`asyncOptionalChain`);for(let[t,n]of Object.entries(Kt)){let r=this.helperNames[t],i=n;t===`optionalChainDelete`?i=i.replace(`OPTIONAL_CHAIN_NAME`,this.helperNames.optionalChain):t===`asyncOptionalChainDelete`?i=i.replace(`ASYNC_OPTIONAL_CHAIN_NAME`,this.helperNames.asyncOptionalChain):t===`require`&&(this.createRequireName===null&&(this.createRequireName=this.nameManager.claimFreeName(`_createRequire`)),i=i.replace(/CREATE_REQUIRE_NAME/g,this.createRequireName)),r&&(e+=` `,e+=i.replace(t,r).replace(/\s+/g,` `).trim())}return e}};function Jt(e,t,n){Yt(e,n)&&Xt(e,t,n)}function Yt(e,t){for(let n of e.tokens)if(n.type===a.name&&!n.isType&&me(n)&&t.has(e.identifierNameForToken(n)))return!0;return!1}function Xt(e,t,n){let r=[],i=t.length-1;for(let o=e.tokens.length-1;;o--){for(;r.length>0&&r[r.length-1].startTokenIndex===o+1;)r.pop();for(;i>=0&&t[i].endTokenIndex===o+1;)r.push(t[i]),i--;if(o<0)break;let s=e.tokens[o],c=e.identifierNameForToken(s);if(r.length>1&&!s.isType&&s.type===a.name&&n.has(c)){if(ge(s))Zt(r[r.length-1],e,c);else if(_e(s)){let t=r.length-1;for(;t>0&&!r[t].isFunctionScope;)t--;if(t<0)throw Error(`Did not find parent function scope.`);Zt(r[t],e,c)}}}if(r.length>0)throw Error(`Expected empty scope stack after processing file.`)}function Zt(e,t,n){for(let r=e.startTokenIndex;r<e.endTokenIndex;r++){let e=t.tokens[r];(e.type===a.name||e.type===a.jsxName)&&t.identifierNameForToken(e)===n&&(e.shadowsGlobal=!0)}}function Qt(e,t){let n=[];for(let r of t)r.type===a.name&&n.push(e.slice(r.start,r.end));return n}var $t=class e{__init(){this.usedNames=new Set}constructor(t,n){e.prototype.__init.call(this),this.usedNames=new Set(Qt(t,n))}claimFreeName(e){let t=this.findFreeName(e);return this.usedNames.add(t),t}findFreeName(e){if(!this.usedNames.has(e))return e;let t=2;for(;this.usedNames.has(e+String(t));)t++;return e+String(t)}},en=t((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.DetailContext=e.NoopContext=e.VError=void 0;var n=function(e){t(n,e);function n(t,r){var i=e.call(this,r)||this;return i.path=t,Object.setPrototypeOf(i,n.prototype),i}return n}(Error);e.VError=n,e.NoopContext=function(){function e(){}return e.prototype.fail=function(e,t,n){return!1},e.prototype.unionResolver=function(){return this},e.prototype.createContext=function(){return this},e.prototype.resolveUnion=function(e){},e}();var r=function(){function e(){this._propNames=[``],this._messages=[null],this._score=0}return e.prototype.fail=function(e,t,n){return this._propNames.push(e),this._messages.push(t),this._score+=n,!1},e.prototype.unionResolver=function(){return new i},e.prototype.resolveUnion=function(e){for(var t,n,r=e,i=null,a=0,o=r.contexts;a<o.length;a++){var s=o[a];(!i||s._score>=i._score)&&(i=s)}i&&i._score>0&&((t=this._propNames).push.apply(t,i._propNames),(n=this._messages).push.apply(n,i._messages))},e.prototype.getError=function(e){for(var t=[],r=this._propNames.length-1;r>=0;r--){var i=this._propNames[r];e+=typeof i==`number`?`[`+i+`]`:i?`.`+i:``;var a=this._messages[r];a&&t.push(e+` `+a)}return new n(e,t.join(`; `))},e.prototype.getErrorDetail=function(e){for(var t=[],n=this._propNames.length-1;n>=0;n--){var r=this._propNames[n];e+=typeof r==`number`?`[`+r+`]`:r?`.`+r:``;var i=this._messages[n];i&&t.push({path:e,message:i})}for(var a=null,n=t.length-1;n>=0;n--)a&&(t[n].nested=[a]),a=t[n];return a},e}();e.DetailContext=r;var i=function(){function e(){this.contexts=[]}return e.prototype.createContext=function(){var e=new r;return this.contexts.push(e),e},e}()})),tn=t((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.basicTypes=e.BasicType=e.TParamList=e.TParam=e.param=e.TFunc=e.func=e.TProp=e.TOptional=e.opt=e.TIface=e.iface=e.TEnumLiteral=e.enumlit=e.TEnumType=e.enumtype=e.TIntersection=e.intersection=e.TUnion=e.union=e.TTuple=e.tuple=e.TArray=e.array=e.TLiteral=e.lit=e.TName=e.name=e.TType=void 0;var n=en(),r=function(){function e(){}return e}();e.TType=r;function i(e){return typeof e==`string`?o(e):e}function a(e,t){var n=e[t];if(!n)throw Error(`Unknown type `+t);return n}function o(e){return new s(e)}e.name=o;var s=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.name=t,n._failMsg=`is not a `+t,n}return n.prototype.getChecker=function(e,t,r){var i=this,o=a(e,this.name),s=o.getChecker(e,t,r);return o instanceof T||o instanceof n?s:function(e,t){return s(e,t)?!0:t.fail(null,i._failMsg,0)}},n}(r);e.TName=s;function c(e){return new l(e)}e.lit=c;var l=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.value=t,n.name=JSON.stringify(t),n._failMsg=`is not `+n.name,n}return n.prototype.getChecker=function(e,t){var n=this;return function(e,t){return e===n.value||t.fail(null,n._failMsg,-1)}},n}(r);e.TLiteral=l;function u(e){return new d(i(e))}e.array=u;var d=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.ttype=t,n}return n.prototype.getChecker=function(e,t){var n=this.ttype.getChecker(e,t);return function(e,t){if(!Array.isArray(e))return t.fail(null,`is not an array`,0);for(var r=0;r<e.length;r++)if(!n(e[r],t))return t.fail(r,null,1);return!0}},n}(r);e.TArray=d;function f(){return new p([...arguments].map(function(e){return i(e)}))}e.tuple=f;var p=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.ttypes=t,n}return n.prototype.getChecker=function(e,t){var n=this.ttypes.map(function(n){return n.getChecker(e,t)}),r=function(e,t){if(!Array.isArray(e))return t.fail(null,`is not an array`,0);for(var r=0;r<n.length;r++)if(!n[r](e[r],t))return t.fail(r,null,1);return!0};return t?function(e,t){return r(e,t)?e.length<=n.length||t.fail(n.length,`is extraneous`,2):!1}:r},n}(r);e.TTuple=p;function m(){return new h([...arguments].map(function(e){return i(e)}))}e.union=m;var h=function(e){t(n,e);function n(t){var n=e.call(this)||this;n.ttypes=t;var r=t.map(function(e){return e instanceof s||e instanceof l?e.name:null}).filter(function(e){return e}),i=t.length-r.length;return r.length?(i>0&&r.push(i+` more`),n._failMsg=`is none of `+r.join(`, `)):n._failMsg=`is none of `+i+` types`,n}return n.prototype.getChecker=function(e,t){var n=this,r=this.ttypes.map(function(n){return n.getChecker(e,t)});return function(e,t){for(var i=t.unionResolver(),a=0;a<r.length;a++)if(r[a](e,i.createContext()))return!0;return t.resolveUnion(i),t.fail(null,n._failMsg,0)}},n}(r);e.TUnion=h;function ee(){return new te([...arguments].map(function(e){return i(e)}))}e.intersection=ee;var te=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.ttypes=t,n}return n.prototype.getChecker=function(e,t){var n=new Set,r=this.ttypes.map(function(r){return r.getChecker(e,t,n)});return function(e,t){return r.every(function(n){return n(e,t)})?!0:t.fail(null,null,0)}},n}(r);e.TIntersection=te;function ne(e){return new re(e)}e.enumtype=ne;var re=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.members=t,n.validValues=new Set,n._failMsg=`is not a valid enum value`,n.validValues=new Set(Object.keys(t).map(function(e){return t[e]})),n}return n.prototype.getChecker=function(e,t){var n=this;return function(e,t){return n.validValues.has(e)?!0:t.fail(null,n._failMsg,0)}},n}(r);e.TEnumType=re;function ie(e,t){return new ae(e,t)}e.enumlit=ie;var ae=function(e){t(n,e);function n(t,n){var r=e.call(this)||this;return r.enumName=t,r.prop=n,r._failMsg=`is not `+t+`.`+n,r}return n.prototype.getChecker=function(e,t){var n=this,r=a(e,this.enumName);if(!(r instanceof re))throw Error(`Type `+this.enumName+` used in enumlit is not an enum type`);var i=r.members[this.prop];if(!r.members.hasOwnProperty(this.prop))throw Error(`Unknown value `+this.enumName+`.`+this.prop+` used in enumlit`);return function(e,t){return e===i||t.fail(null,n._failMsg,-1)}},n}(r);e.TEnumLiteral=ae;function g(e){return Object.keys(e).map(function(t){return oe(t,e[t])})}function oe(e,t){return t instanceof b?new se(e,t.ttype,!0):new se(e,i(t),!1)}function _(e,t){return new v(e,g(t))}e.iface=_;var v=function(e){t(r,e);function r(t,n){var r=e.call(this)||this;return r.bases=t,r.props=n,r.propSet=new Set(n.map(function(e){return e.name})),r}return r.prototype.getChecker=function(e,t,r){var i=this,o=this.bases.map(function(n){return a(e,n).getChecker(e,t)}),s=this.props.map(function(n){return n.ttype.getChecker(e,t)}),c=new n.NoopContext,l=this.props.map(function(e,t){return!e.isOpt&&!s[t](void 0,c)}),u=function(e,t){if(typeof e!=`object`||!e)return t.fail(null,`is not an object`,0);for(var n=0;n<o.length;n++)if(!o[n](e,t))return!1;for(var n=0;n<s.length;n++){var r=i.props[n].name,a=e[r];if(a===void 0){if(l[n])return t.fail(r,`is missing`,1)}else if(!s[n](a,t))return t.fail(r,null,1)}return!0};if(!t)return u;var d=this.propSet;return r&&(this.propSet.forEach(function(e){return r.add(e)}),d=r),function(e,t){if(!u(e,t))return!1;for(var n in e)if(!d.has(n))return t.fail(n,`is extraneous`,2);return!0}},r}(r);e.TIface=v;function y(e){return new b(i(e))}e.opt=y;var b=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.ttype=t,n}return n.prototype.getChecker=function(e,t){var n=this.ttype.getChecker(e,t);return function(e,t){return e===void 0||n(e,t)}},n}(r);e.TOptional=b;var se=function(){function e(e,t,n){this.name=e,this.ttype=t,this.isOpt=n}return e}();e.TProp=se;function x(e){return new S(new ce([...arguments].slice(1)),i(e))}e.func=x;var S=function(e){t(n,e);function n(t,n){var r=e.call(this)||this;return r.paramList=t,r.result=n,r}return n.prototype.getChecker=function(e,t){return function(e,t){return typeof e==`function`||t.fail(null,`is not a function`,0)}},n}(r);e.TFunc=S;function C(e,t,n){return new w(e,i(t),!!n)}e.param=C;var w=function(){function e(e,t,n){this.name=e,this.ttype=t,this.isOpt=n}return e}();e.TParam=w;var ce=function(e){t(r,e);function r(t){var n=e.call(this)||this;return n.params=t,n}return r.prototype.getChecker=function(e,t){var r=this,i=this.params.map(function(n){return n.ttype.getChecker(e,t)}),a=new n.NoopContext,o=this.params.map(function(e,t){return!e.isOpt&&!i[t](void 0,a)}),s=function(e,t){if(!Array.isArray(e))return t.fail(null,`is not an array`,0);for(var n=0;n<i.length;n++){var a=r.params[n];if(e[n]===void 0){if(o[n])return t.fail(a.name,`is missing`,1)}else if(!i[n](e[n],t))return t.fail(a.name,null,1)}return!0};return t?function(e,t){return s(e,t)?e.length<=i.length||t.fail(i.length,`is extraneous`,2):!1}:s},r}(r);e.TParamList=ce;var T=function(e){t(n,e);function n(t,n){var r=e.call(this)||this;return r.validator=t,r.message=n,r}return n.prototype.getChecker=function(e,t){var n=this;return function(e,t){return n.validator(e)?!0:t.fail(null,n.message,0)}},n}(r);e.BasicType=T,e.basicTypes={any:new T(function(e){return!0},`is invalid`),number:new T(function(e){return typeof e==`number`},`is not a number`),object:new T(function(e){return typeof e==`object`&&e},`is not an object`),boolean:new T(function(e){return typeof e==`boolean`},`is not a boolean`),string:new T(function(e){return typeof e==`string`},`is not a string`),symbol:new T(function(e){return typeof e==`symbol`},`is not a symbol`),void:new T(function(e){return e==null},`is not void`),undefined:new T(function(e){return e===void 0},`is not undefined`),null:new T(function(e){return e===null},`is not null`),never:new T(function(e){return!1},`is unexpected`),Date:new T(ue(`[object Date]`),`is not a Date`),RegExp:new T(ue(`[object RegExp]`),`is not a RegExp`)};var le=Object.prototype.toString;function ue(e){return function(t){return typeof t==`object`&&t&&le.call(t)===e}}typeof Buffer<`u`&&(e.basicTypes.Buffer=new T(function(e){return Buffer.isBuffer(e)},`is not a Buffer`));for(var E=function(t){e.basicTypes[t.name]=new T(function(e){return e instanceof t},`is not a `+t.name)},D=0,de=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,ArrayBuffer];D<de.length;D++){var fe=de[D];E(fe)}})),B=e(t((e=>{var t=e&&e.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r};Object.defineProperty(e,"__esModule",{value:!0}),e.Checker=e.createCheckers=void 0;var n=tn(),r=en(),i=tn();Object.defineProperty(e,"TArray",{enumerable:!0,get:function(){return i.TArray}}),Object.defineProperty(e,"TEnumType",{enumerable:!0,get:function(){return i.TEnumType}}),Object.defineProperty(e,"TEnumLiteral",{enumerable:!0,get:function(){return i.TEnumLiteral}}),Object.defineProperty(e,"TFunc",{enumerable:!0,get:function(){return i.TFunc}}),Object.defineProperty(e,"TIface",{enumerable:!0,get:function(){return i.TIface}}),Object.defineProperty(e,"TLiteral",{enumerable:!0,get:function(){return i.TLiteral}}),Object.defineProperty(e,"TName",{enumerable:!0,get:function(){return i.TName}}),Object.defineProperty(e,"TOptional",{enumerable:!0,get:function(){return i.TOptional}}),Object.defineProperty(e,"TParam",{enumerable:!0,get:function(){return i.TParam}}),Object.defineProperty(e,"TParamList",{enumerable:!0,get:function(){return i.TParamList}}),Object.defineProperty(e,"TProp",{enumerable:!0,get:function(){return i.TProp}}),Object.defineProperty(e,"TTuple",{enumerable:!0,get:function(){return i.TTuple}}),Object.defineProperty(e,"TType",{enumerable:!0,get:function(){return i.TType}}),Object.defineProperty(e,"TUnion",{enumerable:!0,get:function(){return i.TUnion}}),Object.defineProperty(e,"TIntersection",{enumerable:!0,get:function(){return i.TIntersection}}),Object.defineProperty(e,"array",{enumerable:!0,get:function(){return i.array}}),Object.defineProperty(e,"enumlit",{enumerable:!0,get:function(){return i.enumlit}}),Object.defineProperty(e,"enumtype",{enumerable:!0,get:function(){return i.enumtype}}),Object.defineProperty(e,"func",{enumerable:!0,get:function(){return i.func}}),Object.defineProperty(e,"iface",{enumerable:!0,get:function(){return i.iface}}),Object.defineProperty(e,"lit",{enumerable:!0,get:function(){return i.lit}}),Object.defineProperty(e,"name",{enumerable:!0,get:function(){return i.name}}),Object.defineProperty(e,"opt",{enumerable:!0,get:function(){return i.opt}}),Object.defineProperty(e,"param",{enumerable:!0,get:function(){return i.param}}),Object.defineProperty(e,"tuple",{enumerable:!0,get:function(){return i.tuple}}),Object.defineProperty(e,"union",{enumerable:!0,get:function(){return i.union}}),Object.defineProperty(e,"intersection",{enumerable:!0,get:function(){return i.intersection}}),Object.defineProperty(e,"BasicType",{enumerable:!0,get:function(){return i.BasicType}});var a=en();Object.defineProperty(e,"VError",{enumerable:!0,get:function(){return a.VError}});function o(){for(var e=[...arguments],r=Object.assign.apply(Object,t([{},n.basicTypes],e)),i={},a=0,o=e;a<o.length;a++)for(var c=o[a],l=0,u=Object.keys(c);l<u.length;l++){var d=u[l];i[d]=new s(r,c[d])}return i}e.createCheckers=o;var s=function(){function e(e,t,r){if(r===void 0&&(r=`value`),this.suite=e,this.ttype=t,this._path=r,this.props=new Map,t instanceof n.TIface)for(var i=0,a=t.props;i<a.length;i++){var o=a[i];this.props.set(o.name,o.ttype)}this.checkerPlain=this.ttype.getChecker(e,!1),this.checkerStrict=this.ttype.getChecker(e,!0)}return e.prototype.setReportedPath=function(e){this._path=e},e.prototype.check=function(e){return this._doCheck(this.checkerPlain,e)},e.prototype.test=function(e){return this.checkerPlain(e,new r.NoopContext)},e.prototype.validate=function(e){return this._doValidate(this.checkerPlain,e)},e.prototype.strictCheck=function(e){return this._doCheck(this.checkerStrict,e)},e.prototype.strictTest=function(e){return this.checkerStrict(e,new r.NoopContext)},e.prototype.strictValidate=function(e){return this._doValidate(this.checkerStrict,e)},e.prototype.getProp=function(t){var n=this.props.get(t);if(!n)throw Error(`Type has no property `+t);return new e(this.suite,n,this._path+`.`+t)},e.prototype.methodArgs=function(t){var n=this._getMethod(t);return new e(this.suite,n.paramList)},e.prototype.methodResult=function(t){var n=this._getMethod(t);return new e(this.suite,n.result)},e.prototype.getArgs=function(){if(!(this.ttype instanceof n.TFunc))throw Error(`getArgs() applied to non-function`);return new e(this.suite,this.ttype.paramList)},e.prototype.getResult=function(){if(!(this.ttype instanceof n.TFunc))throw Error(`getResult() applied to non-function`);return new e(this.suite,this.ttype.result)},e.prototype.getType=function(){return this.ttype},e.prototype._doCheck=function(e,t){if(!e(t,new r.NoopContext)){var n=new r.DetailContext;throw e(t,n),n.getError(this._path)}},e.prototype._doValidate=function(e,t){if(e(t,new r.NoopContext))return null;var n=new r.DetailContext;return e(t,n),n.getErrorDetail(this._path)},e.prototype._getMethod=function(e){var t=this.props.get(e);if(!t)throw Error(`Type has no property `+e);if(!(t instanceof n.TFunc))throw Error(`Property `+e+` is not a method`);return t},e}();e.Checker=s}))()),nn={Transform:B.union(B.lit(`jsx`),B.lit(`typescript`),B.lit(`flow`),B.lit(`imports`),B.lit(`react-hot-loader`),B.lit(`jest`)),SourceMapOptions:B.iface([],{compiledFilename:`string`}),Options:B.iface([],{transforms:B.array(`Transform`),disableESTransforms:B.opt(`boolean`),jsxRuntime:B.opt(B.union(B.lit(`classic`),B.lit(`automatic`),B.lit(`preserve`))),production:B.opt(`boolean`),jsxImportSource:B.opt(`string`),jsxPragma:B.opt(`string`),jsxFragmentPragma:B.opt(`string`),keepUnusedImports:B.opt(`boolean`),preserveDynamicImport:B.opt(`boolean`),injectCreateRequireForImportRequire:B.opt(`boolean`),enableLegacyTypeScriptModuleInterop:B.opt(`boolean`),enableLegacyBabel5ModuleInterop:B.opt(`boolean`),sourceMapOptions:B.opt(`SourceMapOptions`),filePath:B.opt(`string`)})},{Options:rn}=(0,B.createCheckers)(nn);function an(e){rn.strictCheck(e)}function on(){A(),G(!1)}function sn(e){A(),un(e)}function V(e){Y(),ln(e)}function cn(){Y(),m.tokens[m.tokens.length-1].identifierRole=O.ImportDeclaration}function ln(e){let t;t=m.scopeDepth===0?O.TopLevelDeclaration:e?O.BlockScopedDeclaration:O.FunctionScopedDeclaration,m.tokens[m.tokens.length-1].identifierRole=t}function un(e){switch(m.type){case a._this:{let e=M(0);A(),N(e);return}case a._yield:case a.name:m.type=a.name,V(e);return;case a.bracketL:A(),dn(a.bracketR,e,!0);return;case a.braceL:Ki(!0,e);return;default:w()}}function dn(e,t,n=!1,r=!1,i=0){let o=!0,s=!1,c=m.tokens.length;for(;!P(e)&&!m.error;)if(o?o=!1:(C(a.comma),m.tokens[m.tokens.length-1].contextId=i,!s&&m.tokens[c].isType&&(m.tokens[m.tokens.length-1].isType=!0,s=!0)),!(n&&F(a.comma))){if(P(e))break;if(F(a.ellipsis)){sn(t),pn(),P(a.comma),C(e);break}else fn(r,t)}}function fn(e,t){e&&vn([i._public,i._protected,i._private,i._readonly,i._override]),mn(t),pn(),mn(t,!0)}function pn(){p?fo():f&&ni()}function mn(e,t=!1){if(t||un(e),!P(a.eq))return;let n=m.tokens.length-1;G(),m.tokens[n].rhsEndIndex=m.tokens.length}function hn(){return F(a.name)}function gn(){return F(a.name)||!!(m.type&a.IS_KEYWORD)||F(a.string)||F(a.num)||F(a.bigint)||F(a.decimal)}function _n(){let e=m.snapshot();return A(),(F(a.bracketL)||F(a.braceL)||F(a.star)||F(a.ellipsis)||F(a.hash)||gn())&&!b()?!0:(m.restoreFromSnapshot(e),!1)}function vn(e){for(;yn(e)!==null;);}function yn(e){if(!F(a.name))return null;let t=m.contextualKeyword;if(e.indexOf(t)!==-1&&_n()){switch(t){case i._readonly:m.tokens[m.tokens.length-1].type=a._readonly;break;case i._abstract:m.tokens[m.tokens.length-1].type=a._abstract;break;case i._static:m.tokens[m.tokens.length-1].type=a._static;break;case i._public:m.tokens[m.tokens.length-1].type=a._public;break;case i._private:m.tokens[m.tokens.length-1].type=a._private;break;case i._protected:m.tokens[m.tokens.length-1].type=a._protected;break;case i._override:m.tokens[m.tokens.length-1].type=a._override;break;case i._declare:m.tokens[m.tokens.length-1].type=a._declare;break;default:break}return t}return null}function bn(){for(Y();P(a.dot);)Y()}function xn(){bn(),!b()&&F(a.lessThan)&&Fr()}function Sn(){A(),ur()}function Cn(){A()}function wn(){C(a._typeof),F(a._import)?Tn():bn(),!b()&&F(a.lessThan)&&Fr()}function Tn(){C(a._import),C(a.parenL),C(a.string),C(a.parenR),P(a.dot)&&bn(),F(a.lessThan)&&Fr()}function En(){P(a._const);let e=P(a._in),t=_(i._out);P(a._const),(e||t)&&!F(a.name)?m.tokens[m.tokens.length-1].type=a.name:Y(),P(a._extends)&&H(),P(a.eq)&&H()}function Dn(){F(a.lessThan)&&On()}function On(){let e=M(0);for(F(a.lessThan)||F(a.typeParameterStart)?A():w();!P(a.greaterThan)&&!m.error;)En(),P(a.comma);N(e)}function kn(e){let t=e===a.arrow;Dn(),C(a.parenL),m.scopeDepth++,An(!1),m.scopeDepth--,(t||F(e))&&ar(e)}function An(e){dn(a.parenR,e)}function jn(){P(a.comma)||S()}function Mn(){kn(a.colon),jn()}function Nn(){let e=m.snapshot();A();let t=P(a.name)&&F(a.colon);return m.restoreFromSnapshot(e),t}function Pn(){if(!(F(a.bracketL)&&Nn()))return!1;let e=M(0);return C(a.bracketL),Y(),ur(),C(a.bracketR),sr(),jn(),N(e),!0}function Fn(e){P(a.question),!e&&(F(a.parenL)||F(a.lessThan))?(kn(a.colon),jn()):(sr(),jn())}function In(){if(F(a.parenL)||F(a.lessThan)){Mn();return}if(F(a._new)){A(),F(a.parenL)||F(a.lessThan)?Mn():Fn(!1);return}let e=!!yn([i._readonly]);Pn()||((g(i._get)||g(i._set))&&_n(),Zi(-1),Fn(e))}function Ln(){Rn()}function Rn(){for(C(a.braceL);!P(a.braceR)&&!m.error;)In()}function zn(){let e=m.snapshot(),t=Bn();return m.restoreFromSnapshot(e),t}function Bn(){return A(),P(a.plus)||P(a.minus)?g(i._readonly):(g(i._readonly)&&A(),!F(a.bracketL)||(A(),!hn())?!1:(A(),F(a._in)))}function Vn(){Y(),C(a._in),H()}function Hn(){C(a.braceL),F(a.plus)||F(a.minus)?(A(),v(i._readonly)):_(i._readonly),C(a.bracketL),Vn(),_(i._as)&&H(),C(a.bracketR),F(a.plus)||F(a.minus)?(A(),C(a.question)):P(a.question),cr(),S(),C(a.braceR)}function Un(){for(C(a.bracketL);!P(a.bracketR)&&!m.error;)Wn(),P(a.comma)}function Wn(){P(a.ellipsis)?H():(H(),P(a.question)),P(a.colon)&&H()}function Gn(){C(a.parenL),H(),C(a.parenR)}function Kn(){for(j(),j();!F(a.backQuote)&&!m.error;)C(a.dollarBraceL),H(),j(),j();A()}var qn;(function(e){e[e.TSFunctionType=0]=`TSFunctionType`,e[e.TSConstructorType=1]=`TSConstructorType`,e[e.TSAbstractConstructorType=2]=`TSAbstractConstructorType`})(qn||={});function Jn(e){e===qn.TSAbstractConstructorType&&v(i._abstract),(e===qn.TSConstructorType||e===qn.TSAbstractConstructorType)&&C(a._new);let t=m.inDisallowConditionalTypesContext;m.inDisallowConditionalTypesContext=!1,kn(a.arrow),m.inDisallowConditionalTypesContext=t}function Yn(){switch(m.type){case a.name:xn();return;case a._void:case a._null:A();return;case a.string:case a.num:case a.bigint:case a.decimal:case a._true:case a._false:Li();return;case a.minus:A(),Li();return;case a._this:Cn(),g(i._is)&&!b()&&Sn();return;case a._typeof:wn();return;case a._import:Tn();return;case a.braceL:zn()?Hn():Ln();return;case a.bracketL:Un();return;case a.parenL:Gn();return;case a.backQuote:Kn();return;default:if(m.type&a.IS_KEYWORD){A(),m.tokens[m.tokens.length-1].type=a.name;return}break}w()}function Xn(){for(Yn();!b()&&P(a.bracketL);)P(a.bracketR)||(H(),C(a.bracketR))}function Zn(){if(v(i._infer),Y(),F(a._extends)){let e=m.snapshot();C(a._extends);let t=m.inDisallowConditionalTypesContext;m.inDisallowConditionalTypesContext=!0,H(),m.inDisallowConditionalTypesContext=t,(m.error||!m.inDisallowConditionalTypesContext&&F(a.question))&&m.restoreFromSnapshot(e)}}function Qn(){if(g(i._keyof)||g(i._unique)||g(i._readonly))A(),Qn();else if(g(i._infer))Zn();else{let e=m.inDisallowConditionalTypesContext;m.inDisallowConditionalTypesContext=!1,Xn(),m.inDisallowConditionalTypesContext=e}}function $n(){if(P(a.bitwiseAND),Qn(),F(a.bitwiseAND))for(;P(a.bitwiseAND);)Qn()}function er(){if(P(a.bitwiseOR),$n(),F(a.bitwiseOR))for(;P(a.bitwiseOR);)$n()}function tr(){return F(a.lessThan)?!0:F(a.parenL)&&rr()}function nr(){if(F(a.name)||F(a._this))return A(),!0;if(F(a.braceL)||F(a.bracketL)){let e=1;for(A();e>0&&!m.error;)F(a.braceL)||F(a.bracketL)?e++:(F(a.braceR)||F(a.bracketR))&&e--,A();return!0}return!1}function rr(){let e=m.snapshot(),t=ir();return m.restoreFromSnapshot(e),t}function ir(){return A(),!!(F(a.parenR)||F(a.ellipsis)||nr()&&(F(a.colon)||F(a.comma)||F(a.question)||F(a.eq)||F(a.parenR)&&(A(),F(a.arrow))))}function ar(e){let t=M(0);C(e),lr()||H(),N(t)}function or(){F(a.colon)&&ar(a.colon)}function sr(){F(a.colon)&&ur()}function cr(){P(a.colon)&&H()}function lr(){let e=m.snapshot();return g(i._asserts)?(A(),_(i._is)?(H(),!0):hn()||F(a._this)?(A(),_(i._is)&&H(),!0):(m.restoreFromSnapshot(e),!1)):hn()||F(a._this)?(A(),g(i._is)&&!b()?(A(),H(),!0):(m.restoreFromSnapshot(e),!1)):!1}function ur(){let e=M(0);C(a.colon),H(),N(e)}function H(){if(fr(),m.inDisallowConditionalTypesContext||b()||!P(a._extends))return;let e=m.inDisallowConditionalTypesContext;m.inDisallowConditionalTypesContext=!0,fr(),m.inDisallowConditionalTypesContext=e,C(a.question),H(),C(a.colon),H()}function dr(){return g(i._abstract)&&I()===a._new}function fr(){if(tr()){Jn(qn.TSFunctionType);return}if(F(a._new)){Jn(qn.TSConstructorType);return}else if(dr()){Jn(qn.TSAbstractConstructorType);return}er()}function pr(){let e=M(1);H(),C(a.greaterThan),N(e),Ti()}function mr(){if(P(a.jsxTagStart)){m.tokens[m.tokens.length-1].type=a.typeParameterStart;let e=M(1);for(;!F(a.greaterThan)&&!m.error;)H(),P(a.comma);U(),N(e)}}function hr(){for(;!F(a.braceL)&&!m.error;)gr(),P(a.comma)}function gr(){bn(),F(a.lessThan)&&Fr()}function _r(){V(!1),Dn(),P(a._extends)&&hr(),Rn()}function vr(){V(!1),Dn(),C(a.eq),H(),S()}function yr(){if(F(a.string)?Li():Y(),P(a.eq)){let e=m.tokens.length-1;G(),m.tokens[e].rhsEndIndex=m.tokens.length}}function br(){for(V(!1),C(a.braceL);!P(a.braceR)&&!m.error;)yr(),P(a.comma)}function xr(){C(a.braceL),Qo(a.braceR)}function Sr(){V(!1),P(a.dot)?Sr():xr()}function Cr(){g(i._global)?Y():F(a.string)?J():w(),F(a.braceL)?xr():S()}function wr(){cn(),C(a.eq),Er(),S()}function Tr(){return g(i._require)&&I()===a.parenL}function Er(){Tr()?Dr():bn()}function Dr(){v(i._require),C(a.parenL),F(a.string)||w(),Li(),C(a.parenR)}function Or(){if(x())return!1;switch(m.type){case a._function:{let e=M(1);A();let t=m.start;return rs(t,!0),N(e),!0}case a._class:{let e=M(1);return as(!0,!1),N(e),!0}case a._const:if(F(a._const)&&oe(i._enum)){let e=M(1);return C(a._const),v(i._enum),m.tokens[m.tokens.length-1].type=a._enum,br(),N(e),!0}case a._var:case a._let:{let e=M(1);return Ko(m.type!==a._var),N(e),!0}case a.name:{let e=M(1),t=m.contextualKeyword,n=!1;return t===i._global?(Cr(),n=!0):n=jr(t,!0),N(e),n}default:return!1}}function kr(){return jr(m.contextualKeyword,!0)}function Ar(e){switch(e){case i._declare:{let e=m.tokens.length-1;if(Or())return m.tokens[e].type=a._declare,!0;break}case i._global:if(F(a.braceL))return xr(),!0;break;default:return jr(e,!1)}return!1}function jr(e,t){switch(e){case i._abstract:if(Mr(t)&&F(a._class))return m.tokens[m.tokens.length-1].type=a._abstract,as(!0,!1),!0;break;case i._enum:if(Mr(t)&&F(a.name))return m.tokens[m.tokens.length-1].type=a._enum,br(),!0;break;case i._interface:if(Mr(t)&&F(a.name)){let e=M(t?2:1);return _r(),N(e),!0}break;case i._module:if(Mr(t)){if(F(a.string)){let e=M(t?2:1);return Cr(),N(e),!0}else if(F(a.name)){let e=M(t?2:1);return Sr(),N(e),!0}}break;case i._namespace:if(Mr(t)&&F(a.name)){let e=M(t?2:1);return Sr(),N(e),!0}break;case i._type:if(Mr(t)&&F(a.name)){let e=M(t?2:1);return vr(),N(e),!0}break;default:break}return!1}function Mr(e){return e?(A(),!0):!x()}function Nr(){let e=m.snapshot();return On(),is(),or(),C(a.arrow),m.error?(m.restoreFromSnapshot(e),!1):(ta(!0),!0)}function Pr(){m.type===a.bitShiftL&&(--m.pos,L(a.lessThan)),Fr()}function Fr(){let e=M(0);for(C(a.lessThan);!F(a.greaterThan)&&!m.error;)H(),P(a.comma);e?(C(a.greaterThan),N(e)):(N(e),Be(),C(a.greaterThan),m.tokens[m.tokens.length-1].isType=!0)}function Ir(){if(F(a.name))switch(m.contextualKeyword){case i._abstract:case i._declare:case i._enum:case i._interface:case i._module:case i._namespace:case i._type:return!0;default:break}return!1}function Lr(e,t){if(F(a.colon)&&ar(a.colon),!F(a.braceL)&&x()){let t=m.tokens.length-1;for(;t>=0&&(m.tokens[t].start>=e||m.tokens[t].type===a._default||m.tokens[t].type===a._export);)m.tokens[t].isType=!0,t--;return}ta(!1,t)}function Rr(e,t,n){if(!b()&&P(a.bang)){m.tokens[m.tokens.length-1].type=a.nonNullAssertion;return}if(F(a.lessThan)||F(a.bitShiftL)){let n=m.snapshot();if(!t&&ji()&&Nr())return;if(Pr(),!t&&P(a.parenL)?(m.tokens[m.tokens.length-1].subscriptStartIndex=e,q()):F(a.backQuote)?Gi():(m.type===a.greaterThan||m.type!==a.parenL&&m.type&a.IS_EXPRESSION_START&&!b())&&w(),m.error)m.restoreFromSnapshot(n);else return}else!t&&F(a.questionDot)&&I()===a.lessThan&&(A(),m.tokens[e].isOptionalChainStart=!0,m.tokens[m.tokens.length-1].subscriptStartIndex=e,Fr(),C(a.parenL),q());Ai(e,t,n)}function zr(){if(P(a._import))return g(i._type)&&I()!==a.eq&&v(i._type),wr(),!0;if(P(a.eq))return W(),S(),!0;if(_(i._as))return v(i._namespace),Y(),S(),!0;if(g(i._type)){let e=I();(e===a.braceL||e===a.star)&&A()}return!1}function Br(){if(Y(),F(a.comma)||F(a.braceR)){m.tokens[m.tokens.length-1].identifierRole=O.ImportDeclaration;return}if(Y(),F(a.comma)||F(a.braceR)){m.tokens[m.tokens.length-1].identifierRole=O.ImportDeclaration,m.tokens[m.tokens.length-2].isType=!0,m.tokens[m.tokens.length-1].isType=!0;return}if(Y(),F(a.comma)||F(a.braceR)){m.tokens[m.tokens.length-3].identifierRole=O.ImportAccess,m.tokens[m.tokens.length-1].identifierRole=O.ImportDeclaration;return}Y(),m.tokens[m.tokens.length-3].identifierRole=O.ImportAccess,m.tokens[m.tokens.length-1].identifierRole=O.ImportDeclaration,m.tokens[m.tokens.length-4].isType=!0,m.tokens[m.tokens.length-3].isType=!0,m.tokens[m.tokens.length-2].isType=!0,m.tokens[m.tokens.length-1].isType=!0}function Vr(){if(Y(),F(a.comma)||F(a.braceR)){m.tokens[m.tokens.length-1].identifierRole=O.ExportAccess;return}if(Y(),F(a.comma)||F(a.braceR)){m.tokens[m.tokens.length-1].identifierRole=O.ExportAccess,m.tokens[m.tokens.length-2].isType=!0,m.tokens[m.tokens.length-1].isType=!0;return}if(Y(),F(a.comma)||F(a.braceR)){m.tokens[m.tokens.length-3].identifierRole=O.ExportAccess;return}Y(),m.tokens[m.tokens.length-3].identifierRole=O.ExportAccess,m.tokens[m.tokens.length-4].isType=!0,m.tokens[m.tokens.length-3].isType=!0,m.tokens[m.tokens.length-2].isType=!0,m.tokens[m.tokens.length-1].isType=!0}function Hr(){if(g(i._abstract)&&I()===a._class)return m.type=a._abstract,A(),as(!0,!0),!0;if(g(i._interface)){let e=M(2);return jr(i._interface,!0),N(e),!0}return!1}function Ur(){if(m.type===a._const){let e=Ce();if(e.type===a.name&&e.contextualKeyword===i._enum)return C(a._const),v(i._enum),m.tokens[m.tokens.length-1].type=a._enum,br(),!0}return!1}function Wr(e){let t=m.tokens.length;vn([i._abstract,i._readonly,i._declare,i._static,i._override]);let n=m.tokens.length;if(Pn()){let r=e?t-1:t;for(let e=r;e<n;e++)m.tokens[e].isType=!0;return!0}return!1}function Gr(e){Ar(e)||S()}function Kr(){let e=_(i._declare);e&&(m.tokens[m.tokens.length-1].type=a._declare);let t=!1;if(F(a.name))if(e){let e=M(2);t=kr(),N(e)}else t=kr();if(!t)if(e){let e=M(2);$(!0),N(e)}else $(!0)}function qr(e){if(e&&(F(a.lessThan)||F(a.bitShiftL))&&Pr(),_(i._implements)){m.tokens[m.tokens.length-1].type=a._implements;let e=M(1);hr(),N(e)}}function Jr(){Dn()}function Yr(){Dn()}function Xr(){let e=M(0);b()||P(a.bang),sr(),N(e)}function Zr(){F(a.colon)&&ur()}function Qr(e,t){return d?$r(e,t):ei(e,t)}function $r(e,t){if(!F(a.lessThan))return K(e,t);let n=m.snapshot(),r=K(e,t);if(m.error)m.restoreFromSnapshot(n);else return r;return m.type=a.typeParameterStart,On(),r=K(e,t),r||w(),r}function ei(e,t){if(!F(a.lessThan))return K(e,t);let n=m.snapshot();On();let r=K(e,t);if(r||w(),m.error)m.restoreFromSnapshot(n);else return r;return K(e,t)}function ti(){if(F(a.colon)){let e=m.snapshot();ar(a.colon),y()&&w(),F(a.arrow)||w(),m.error&&m.restoreFromSnapshot(e)}return P(a.arrow)}function ni(){let e=M(0);P(a.question),sr(),N(e)}function ri(){(F(a.lessThan)||F(a.bitShiftL))&&Pr(),Mo()}function ii(){let e=!1,t=!1;for(;;){if(m.pos>=h.length){w(`Unterminated JSX contents`);return}let n=h.charCodeAt(m.pos);if(n===u.lessThan||n===u.leftCurlyBrace){if(m.pos===m.start){if(n===u.lessThan){m.pos++,L(a.jsxTagStart);return}Ue(n);return}L(e&&!t?a.jsxEmptyText:a.jsxText);return}n===u.lineFeed?e=!0:n!==u.space&&n!==u.carriageReturn&&n!==u.tab&&(t=!0),m.pos++}}function ai(e){for(m.pos++;;){if(m.pos>=h.length){w(`Unterminated string constant`);return}if(h.charCodeAt(m.pos)===e){m.pos++;break}m.pos++}L(a.string)}function oi(){let e;do{if(m.pos>h.length){w(`Unexpectedly reached the end of input.`);return}e=h.charCodeAt(++m.pos)}while(E[e]||e===u.dash);L(a.jsxName)}function si(){U()}function ci(e){if(si(),!P(a.colon)){m.tokens[m.tokens.length-1].identifierRole=e;return}si()}function li(){let e=m.tokens.length;ci(O.Access);let t=!1;for(;F(a.dot);)t=!0,U(),si();if(!t){let t=m.tokens[e],n=h.charCodeAt(t.start);n>=u.lowercaseA&&n<=u.lowercaseZ&&(t.identifierRole=null)}}function ui(){switch(m.type){case a.braceL:A(),W(),U();return;case a.jsxTagStart:hi(),U();return;case a.string:U();return;default:w(`JSX value should be either an expression or a quoted JSX text`)}}function di(){C(a.ellipsis),W()}function fi(e){if(F(a.jsxTagEnd))return!1;li(),f&&mr();let t=!1;for(;!F(a.slash)&&!F(a.jsxTagEnd)&&!m.error;){if(P(a.braceL)){t=!0,C(a.ellipsis),G(),U();continue}t&&m.end-m.start===3&&h.charCodeAt(m.start)===u.lowercaseK&&h.charCodeAt(m.start+1)===u.lowercaseE&&h.charCodeAt(m.start+2)===u.lowercaseY&&(m.tokens[e].jsxRole=k.KeyAfterPropSpread),ci(O.ObjectKey),F(a.eq)&&(U(),ui())}let n=F(a.slash);return n&&U(),n}function pi(){F(a.jsxTagEnd)||li()}function mi(){let e=m.tokens.length-1;m.tokens[e].jsxRole=k.NoChildren;let t=0;if(!fi(e))for(gi();;)switch(m.type){case a.jsxTagStart:if(U(),F(a.slash)){U(),pi(),m.tokens[e].jsxRole!==k.KeyAfterPropSpread&&(t===1?m.tokens[e].jsxRole=k.OneChild:t>1&&(m.tokens[e].jsxRole=k.StaticChildren));return}t++,mi(),gi();break;case a.jsxText:t++,gi();break;case a.jsxEmptyText:gi();break;case a.braceL:A(),F(a.ellipsis)?(di(),gi(),t+=2):(F(a.braceR)||(t++,W()),gi());break;default:w();return}}function hi(){U(),mi()}function U(){m.tokens.push(new ye),je(),m.start=m.pos;let e=h.charCodeAt(m.pos);if(D[e])oi();else if(e===u.quotationMark||e===u.apostrophe)ai(e);else switch(++m.pos,e){case u.greaterThan:L(a.jsxTagEnd);break;case u.lessThan:L(a.jsxTagStart);break;case u.slash:L(a.slash);break;case u.equalsTo:L(a.eq);break;case u.leftCurlyBrace:L(a.braceL);break;case u.dot:L(a.dot);break;case u.colon:L(a.colon);break;default:w()}}function gi(){m.tokens.push(new ye),m.start=m.pos,ii()}function _i(e){if(F(a.question)){let e=I();if(e===a.colon||e===a.comma||e===a.parenR)return}Si(e)}function vi(){xe(a.question),F(a.colon)&&(f?ur():p&&Ya())}var yi=class{constructor(e){this.stop=e}};function W(e=!1){if(G(e),F(a.comma))for(;P(a.comma);)G(e)}function G(e=!1,t=!1){return f?Qr(e,t):p?vo(e,t):K(e,t)}function K(e,t){if(F(a._yield))return aa(),!1;(F(a.parenL)||F(a.name)||F(a._yield))&&(m.potentialArrowAt=m.start);let n=bi(e);return t&&Hi(),m.type&a.IS_ASSIGN?(A(),G(e),!1):n}function bi(e){return Ci(e)?!0:(xi(e),!1)}function xi(e){f||p?_i(e):Si(e)}function Si(e){P(a.question)&&(G(),C(a.colon),G(e))}function Ci(e){let t=m.tokens.length;return Ti()?!0:(wi(t,-1,e),!1)}function wi(e,t,n){if(f&&(a._in&a.PRECEDENCE_MASK)>t&&!b()&&(_(i._as)||_(i._satisfies))){let r=M(1);H(),N(r),Be(),wi(e,t,n);return}let r=m.type&a.PRECEDENCE_MASK;if(r>0&&(!n||!F(a._in))&&r>t){let i=m.type;A(),i===a.nullishCoalescing&&(m.tokens[m.tokens.length-1].nullishStartIndex=e);let o=m.tokens.length;Ti(),wi(o,i&a.IS_RIGHT_ASSOCIATIVE?r-1:r,n),i===a.nullishCoalescing&&(m.tokens[e].numNullishCoalesceStarts++,m.tokens[m.tokens.length-1].numNullishCoalesceEnds++),wi(e,t,n)}}function Ti(){if(f&&!d&&P(a.lessThan))return pr(),!1;if(g(i._module)&&Ee()===u.leftCurlyBrace&&!se())return oa(),!1;if(m.type&a.IS_PREFIX)return A(),Ti(),!1;if(Ei())return!0;for(;m.type&a.IS_POSTFIX&&!y();)m.type===a.preIncDec&&(m.type=a.postIncDec),A();return!1}function Ei(){let e=m.tokens.length;return J()?!0:(Di(e),m.tokens.length>e&&m.tokens[e].isOptionalChainStart&&(m.tokens[m.tokens.length-1].isOptionalChainEnd=!0),!1)}function Di(e,t=!1){p?bo(e,t):Oi(e,t)}function Oi(e,t=!1){let n=new yi(!1);do ki(e,t,n);while(!n.stop&&!m.error)}function ki(e,t,n){f?Rr(e,t,n):p?$a(e,t,n):Ai(e,t,n)}function Ai(e,t,n){if(!t&&P(a.doubleColon))Pi(),n.stop=!0,Di(e,t);else if(F(a.questionDot)){if(m.tokens[e].isOptionalChainStart=!0,t&&I()===a.parenL){n.stop=!0;return}A(),m.tokens[m.tokens.length-1].subscriptStartIndex=e,P(a.bracketL)?(W(),C(a.bracketR)):P(a.parenL)?q():Fi()}else if(P(a.dot))m.tokens[m.tokens.length-1].subscriptStartIndex=e,Fi();else if(P(a.bracketL))m.tokens[m.tokens.length-1].subscriptStartIndex=e,W(),C(a.bracketR);else if(!t&&F(a.parenL))if(ji()){let t=m.snapshot(),r=m.tokens.length;A(),m.tokens[m.tokens.length-1].subscriptStartIndex=e;let i=te();m.tokens[m.tokens.length-1].contextId=i,q(),m.tokens[m.tokens.length-1].contextId=i,Mi()&&(m.restoreFromSnapshot(t),n.stop=!0,m.scopeDepth++,is(),Ni(r))}else{A(),m.tokens[m.tokens.length-1].subscriptStartIndex=e;let t=te();m.tokens[m.tokens.length-1].contextId=t,q(),m.tokens[m.tokens.length-1].contextId=t}else F(a.backQuote)?Gi():n.stop=!0}function ji(){return m.tokens[m.tokens.length-1].contextualKeyword===i._async&&!y()}function q(){let e=!0;for(;!P(a.parenR)&&!m.error;){if(e)e=!1;else if(C(a.comma),P(a.parenR))break;ra(!1)}}function Mi(){return F(a.colon)||F(a.arrow)}function Ni(e){f?Zr():p&&_o(),C(a.arrow),$i(e)}function Pi(){let e=m.tokens.length;J(),Di(e,!0)}function J(){if(P(a.modulo))return Y(),!1;if(F(a.jsxText)||F(a.jsxEmptyText))return Li(),!1;if(F(a.lessThan)&&d)return m.type=a.jsxTagStart,hi(),A(),!1;let e=m.potentialArrowAt===m.start;switch(m.type){case a.slash:case a.assign:be();case a._super:case a._this:case a.regexp:case a.num:case a.bigint:case a.decimal:case a.string:case a._null:case a._true:case a._false:return A(),!1;case a._import:return A(),F(a.dot)&&(m.tokens[m.tokens.length-1].type=a.name,A(),Y()),!1;case a.name:{let t=m.tokens.length,n=m.start,r=m.contextualKeyword;return Y(),r===i._await?(ia(),!1):r===i._async&&F(a._function)&&!y()?(A(),rs(n,!1),!1):e&&r===i._async&&!y()&&F(a.name)?(m.scopeDepth++,V(!1),C(a.arrow),$i(t),!0):F(a._do)&&!y()?(A(),Zo(),!1):e&&!y()&&F(a.arrow)?(m.scopeDepth++,ln(!1),C(a.arrow),$i(t),!0):(m.tokens[m.tokens.length-1].identifierRole=O.Access,!1)}case a._do:return A(),Zo(),!1;case a.parenL:return zi(e);case a.bracketL:return A(),na(a.bracketR,!0),!1;case a.braceL:return Ki(!1,!1),!1;case a._function:return Ii(),!1;case a.at:ko();case a._class:return as(!1),!1;case a._new:return Ui(),!1;case a.backQuote:return Gi(),!1;case a.doubleColon:return A(),Pi(),!1;case a.hash:{let e=Ee();return D[e]||e===u.backslash?Fi():A(),!1}default:return w(),!1}}function Fi(){P(a.hash),Y()}function Ii(){let e=m.start;Y(),P(a.dot)&&Y(),rs(e,!1)}function Li(){A()}function Ri(){C(a.parenL),W(),C(a.parenR)}function zi(e){let t=m.snapshot(),n=m.tokens.length;C(a.parenL);let r=!0;for(;!F(a.parenR)&&!m.error;){if(r)r=!1;else if(C(a.comma),F(a.parenR))break;if(F(a.ellipsis)){sn(!1),Hi();break}else G(!1,!0)}return C(a.parenR),e&&Bi()&&Vi()?(m.restoreFromSnapshot(t),m.scopeDepth++,is(),Vi(),$i(n),m.error?(m.restoreFromSnapshot(t),zi(!1),!1):!0):!1}function Bi(){return F(a.colon)||!y()}function Vi(){return f?ti():p?yo():P(a.arrow)}function Hi(){(f||p)&&vi()}function Ui(){if(C(a._new),P(a.dot)){Y();return}Wi(),p&&eo(),P(a.parenL)&&na(a.parenR)}function Wi(){Pi(),P(a.questionDot)}function Gi(){for(j(),j();!F(a.backQuote)&&!m.error;)C(a.dollarBraceL),W(),j(),j();A()}function Ki(e,t){let n=te(),r=!0;for(A(),m.tokens[m.tokens.length-1].contextId=n;!P(a.braceR)&&!m.error;){if(r)r=!1;else if(C(a.comma),P(a.braceR))break;let o=!1;if(F(a.ellipsis)){let n=m.tokens.length;if(on(),e&&(m.tokens.length===n+2&&ln(t),P(a.braceR)))break;continue}e||(o=P(a.star)),!e&&g(i._async)?(o&&w(),Y(),F(a.colon)||F(a.parenL)||F(a.braceR)||F(a.eq)||F(a.comma)||(F(a.star)&&(A(),o=!0),Zi(n))):Zi(n),Xi(e,t,n)}m.tokens[m.tokens.length-1].contextId=n}function qi(e){return!e&&(F(a.string)||F(a.num)||F(a.bracketL)||F(a.name)||!!(m.type&a.IS_KEYWORD))}function Ji(e,t){let n=m.start;return F(a.parenL)?(e&&w(),Qi(n,!1),!0):qi(e)?(Zi(t),Qi(n,!1),!0):!1}function Yi(e,t){if(P(a.colon)){e?mn(t):G(!1);return}let n;n=e?m.scopeDepth===0?O.ObjectShorthandTopLevelDeclaration:t?O.ObjectShorthandBlockScopedDeclaration:O.ObjectShorthandFunctionScopedDeclaration:O.ObjectShorthand,m.tokens[m.tokens.length-1].identifierRole=n,mn(t,!0)}function Xi(e,t,n){f?Jr():p&&uo(),Ji(e,n)||Yi(e,t)}function Zi(e){p&&Za(),P(a.bracketL)?(m.tokens[m.tokens.length-1].contextId=e,G(),C(a.bracketR),m.tokens[m.tokens.length-1].contextId=e):(F(a.num)||F(a.string)||F(a.bigint)||F(a.decimal)?J():Fi(),m.tokens[m.tokens.length-1].identifierRole=O.ObjectKey,m.tokens[m.tokens.length-1].contextId=e)}function Qi(e,t){let n=te();m.scopeDepth++;let r=m.tokens.length;is(t,n),ea(e,n);let i=m.tokens.length;m.scopes.push(new s(r,i,!0)),m.scopeDepth--}function $i(e){ta(!0);let t=m.tokens.length;m.scopes.push(new s(e,t,!0)),m.scopeDepth--}function ea(e,t=0){f?Lr(e,t):p?Qa(t):ta(!1,t)}function ta(e,t=0){e&&!F(a.braceL)?G():Zo(!0,t)}function na(e,t=!1){let n=!0;for(;!P(e)&&!m.error;){if(n)n=!1;else if(C(a.comma),P(e))break;ra(t)}}function ra(e){e&&F(a.comma)||(F(a.ellipsis)?(on(),Hi()):F(a.question)?A():G(!1,!0))}function Y(){A(),m.tokens[m.tokens.length-1].type=a.name}function ia(){Ti()}function aa(){A(),!F(a.semi)&&!y()&&(P(a.star),G())}function oa(){v(i._module),C(a.braceL),Qo(a.braceR)}function sa(e){return(e.type===a.name||!!(e.type&a.IS_KEYWORD))&&e.contextualKeyword!==i._from}function X(e){let t=M(0);C(e||a.colon),Q(),N(t)}function ca(){C(a.modulo),v(i._checks),P(a.parenL)&&(W(),C(a.parenR))}function la(){let e=M(0);C(a.colon),F(a.modulo)?ca():(Q(),F(a.modulo)&&ca()),N(e)}function ua(){A(),ba(!0)}function da(){A(),Y(),F(a.lessThan)&&Z(),C(a.parenL),Ha(),C(a.parenR),la(),S()}function fa(){F(a._class)?ua():F(a._function)?da():F(a._var)?pa():_(i._module)?P(a.dot)?ga():ma():g(i._type)?_a():g(i._opaque)?va():g(i._interface)?ya():F(a._export)?ha():w()}function pa(){A(),Xa(),S()}function ma(){for(F(a.string)?J():Y(),C(a.braceL);!F(a.braceR)&&!m.error;)F(a._import)?(A(),Ms()):w();C(a.braceR)}function ha(){C(a._export),P(a._default)?F(a._function)||F(a._class)?fa():(Q(),S()):F(a._var)||F(a._function)||F(a._class)||g(i._opaque)?fa():F(a.star)||F(a.braceL)||g(i._interface)||g(i._type)||g(i._opaque)?_s():w()}function ga(){v(i._exports),Ya(),S()}function _a(){A(),wa()}function va(){A(),Ta(!0)}function ya(){A(),ba()}function ba(e=!1){if(Ca(),F(a.lessThan)&&Z(),P(a._extends))do xa();while(!e&&P(a.comma));if(g(i._mixins)){A();do xa();while(P(a.comma))}if(g(i._implements)){A();do xa();while(P(a.comma))}Pa(e,!1,e)}function xa(){La(!1),F(a.lessThan)&&Da()}function Sa(){ba()}function Ca(){Y()}function wa(){Ca(),F(a.lessThan)&&Z(),X(a.eq),S()}function Ta(e){v(i._type),Ca(),F(a.lessThan)&&Z(),F(a.colon)&&X(a.colon),e||X(a.eq),S()}function Ea(){Za(),Xa(),P(a.eq)&&Q()}function Z(){let e=M(0);F(a.lessThan)||F(a.typeParameterStart)?A():w();do Ea(),F(a.greaterThan)||C(a.comma);while(!F(a.greaterThan)&&!m.error);C(a.greaterThan),N(e)}function Da(){let e=M(0);for(C(a.lessThan);!F(a.greaterThan)&&!m.error;)Q(),F(a.greaterThan)||C(a.comma);C(a.greaterThan),N(e)}function Oa(){if(v(i._interface),P(a._extends))do xa();while(P(a.comma));Pa(!1,!1,!1)}function ka(){F(a.num)||F(a.string)?J():Y()}function Aa(){I()===a.colon?(ka(),X()):Q(),C(a.bracketR),X()}function ja(){ka(),C(a.bracketR),C(a.bracketR),F(a.lessThan)||F(a.parenL)?Ma():(P(a.question),X())}function Ma(){for(F(a.lessThan)&&Z(),C(a.parenL);!F(a.parenR)&&!F(a.ellipsis)&&!m.error;)Va(),F(a.parenR)||C(a.comma);P(a.ellipsis)&&Va(),C(a.parenR),X()}function Na(){Ma()}function Pa(e,t,n){let r;for(t&&F(a.braceBarL)?(C(a.braceBarL),r=a.braceBarR):(C(a.braceL),r=a.braceR);!F(r)&&!m.error;){if(n&&g(i._proto)){let t=I();t!==a.colon&&t!==a.question&&(A(),e=!1)}if(e&&g(i._static)){let e=I();e!==a.colon&&e!==a.question&&A()}if(Za(),P(a.bracketL))P(a.bracketL)?ja():Aa();else if(F(a.parenL)||F(a.lessThan))Na();else{if(g(i._get)||g(i._set)){let e=I();(e===a.name||e===a.string||e===a.num)&&A()}Fa()}Ia()}C(r)}function Fa(){if(F(a.ellipsis)){if(C(a.ellipsis),P(a.comma)||P(a.semi),F(a.braceR))return;Q()}else ka(),F(a.lessThan)||F(a.parenL)?Ma():(P(a.question),X())}function Ia(){!P(a.semi)&&!P(a.comma)&&!F(a.braceR)&&!F(a.braceBarR)&&w()}function La(e){for(e||Y();P(a.dot);)Y()}function Ra(){La(!0),F(a.lessThan)&&Da()}function za(){C(a._typeof),Ua()}function Ba(){for(C(a.bracketL);m.pos<h.length&&!F(a.bracketR)&&(Q(),!F(a.bracketR));)C(a.comma);C(a.bracketR)}function Va(){let e=I();e===a.colon||e===a.question?(Y(),P(a.question),X()):Q()}function Ha(){for(;!F(a.parenR)&&!F(a.ellipsis)&&!m.error;)Va(),F(a.parenR)||C(a.comma);P(a.ellipsis)&&Va()}function Ua(){let e=!1,t=m.noAnonFunctionType;switch(m.type){case a.name:if(g(i._interface)){Oa();return}Y(),Ra();return;case a.braceL:Pa(!1,!1,!1);return;case a.braceBarL:Pa(!1,!0,!1);return;case a.bracketL:Ba();return;case a.lessThan:Z(),C(a.parenL),Ha(),C(a.parenR),C(a.arrow),Q();return;case a.parenL:if(A(),!F(a.parenR)&&!F(a.ellipsis))if(F(a.name)){let t=I();e=t!==a.question&&t!==a.colon}else e=!0;if(e)if(m.noAnonFunctionType=!1,Q(),m.noAnonFunctionType=t,m.noAnonFunctionType||!(F(a.comma)||F(a.parenR)&&I()===a.arrow)){C(a.parenR);return}else P(a.comma);Ha(),C(a.parenR),C(a.arrow),Q();return;case a.minus:A(),Li();return;case a.string:case a.num:case a._true:case a._false:case a._null:case a._this:case a._void:case a.star:A();return;default:if(m.type===a._typeof){za();return}else if(m.type&a.IS_KEYWORD){A(),m.tokens[m.tokens.length-1].type=a.name;return}}w()}function Wa(){for(Ua();!y()&&(F(a.bracketL)||F(a.questionDot));)P(a.questionDot),C(a.bracketL),P(a.bracketR)||(Q(),C(a.bracketR))}function Ga(){P(a.question)?Ga():Wa()}function Ka(){Ga(),!m.noAnonFunctionType&&P(a.arrow)&&Q()}function qa(){for(P(a.bitwiseAND),Ka();P(a.bitwiseAND);)Ka()}function Ja(){for(P(a.bitwiseOR),qa();P(a.bitwiseOR);)qa()}function Q(){Ja()}function Ya(){X()}function Xa(){Y(),F(a.colon)&&Ya()}function Za(){(F(a.plus)||F(a.minus))&&(A(),m.tokens[m.tokens.length-1].isType=!0)}function Qa(e){F(a.colon)&&la(),ta(!1,e)}function $a(e,t,n){if(F(a.questionDot)&&I()===a.lessThan){if(t){n.stop=!0;return}A(),Da(),C(a.parenL),q();return}else if(!t&&F(a.lessThan)){let e=m.snapshot();if(Da(),C(a.parenL),q(),m.error)m.restoreFromSnapshot(e);else return}Ai(e,t,n)}function eo(){if(F(a.lessThan)){let e=m.snapshot();Da(),m.error&&m.restoreFromSnapshot(e)}}function to(){if(F(a.name)&&m.contextualKeyword===i._interface){let e=M(0);return A(),Sa(),N(e),!0}else if(g(i._enum))return So(),!0;return!1}function no(){return g(i._enum)?(So(),!0):!1}function ro(e){if(e===i._declare){if(F(a._class)||F(a.name)||F(a._function)||F(a._var)||F(a._export)){let e=M(1);fa(),N(e)}}else if(F(a.name)){if(e===i._interface){let e=M(1);Sa(),N(e)}else if(e===i._type){let e=M(1);wa(),N(e)}else if(e===i._opaque){let e=M(1);Ta(!1),N(e)}}S()}function io(){return g(i._type)||g(i._interface)||g(i._opaque)||g(i._enum)}function ao(){return F(a.name)&&(m.contextualKeyword===i._type||m.contextualKeyword===i._interface||m.contextualKeyword===i._opaque||m.contextualKeyword===i._enum)}function oo(){if(g(i._type)){let e=M(1);A(),F(a.braceL)?(Os(),Ss()):wa(),N(e)}else if(g(i._opaque)){let e=M(1);A(),Ta(!1),N(e)}else if(g(i._interface)){let e=M(1);A(),Sa(),N(e)}else $(!0)}function so(){return F(a.star)||g(i._type)&&I()===a.star}function co(){if(_(i._type)){let e=M(2);Ts(),N(e)}else Ts()}function lo(e){if(e&&F(a.lessThan)&&Da(),g(i._implements)){let e=M(0);A(),m.tokens[m.tokens.length-1].type=a._implements;do Ca(),F(a.lessThan)&&Da();while(P(a.comma));N(e)}}function uo(){F(a.lessThan)&&(Z(),F(a.parenL)||w())}function fo(){let e=M(0);P(a.question),F(a.colon)&&Ya(),N(e)}function po(){if(F(a._typeof)||g(i._type)){let e=Ce();(sa(e)||e.type===a.braceL||e.type===a.star)&&A()}}function mo(){let e=m.contextualKeyword===i._type||m.type===a._typeof;e?A():Y(),g(i._as)&&!oe(i._as)?(Y(),e&&!F(a.name)&&!(m.type&a.IS_KEYWORD)||Y()):(e&&(F(a.name)||m.type&a.IS_KEYWORD)&&Y(),_(i._as)&&Y())}function ho(){if(F(a.lessThan)){let e=M(0);Z(),N(e)}}function go(){F(a.colon)&&Ya()}function _o(){if(F(a.colon)){let e=m.noAnonFunctionType;m.noAnonFunctionType=!0,Ya(),m.noAnonFunctionType=e}}function vo(e,t){if(F(a.lessThan)){let n=m.snapshot(),r=K(e,t);if(m.error)m.restoreFromSnapshot(n),m.type=a.typeParameterStart;else return r;let i=M(0);if(Z(),N(i),r=K(e,t),r)return!0;w()}return K(e,t)}function yo(){if(F(a.colon)){let e=M(0),t=m.snapshot(),n=m.noAnonFunctionType;m.noAnonFunctionType=!0,la(),m.noAnonFunctionType=n,y()&&w(),F(a.arrow)||w(),m.error&&m.restoreFromSnapshot(t),N(e)}return P(a.arrow)}function bo(e,t=!1){if(m.tokens[m.tokens.length-1].contextualKeyword===i._async&&F(a.lessThan)){let e=m.snapshot();if(xo()&&!m.error)return;m.restoreFromSnapshot(e)}Oi(e,t)}function xo(){m.scopeDepth++;let e=m.tokens.length;return is(),Vi()?($i(e),!0):!1}function So(){v(i._enum),m.tokens[m.tokens.length-1].type=a._enum,Y(),Co()}function Co(){_(i._of)&&A(),C(a.braceL),wo(),C(a.braceR)}function wo(){for(;!F(a.braceR)&&!m.error&&!P(a.ellipsis);)To(),F(a.braceR)||C(a.comma)}function To(){Y(),P(a.eq)&&A()}function Eo(){if(Qo(a.eof),m.scopes.push(new s(0,m.tokens.length,!0)),m.scopeDepth!==0)throw Error(`Invalid scope depth at end of file: ${m.scopeDepth}`);return new zs(m.tokens,m.scopes)}function $(e){p&&to()||(F(a.at)&&ko(),Do(e))}function Do(e){if(f&&Ur())return;let t=m.type;switch(t){case a._break:case a._continue:No();return;case a._debugger:Po();return;case a._do:Fo();return;case a._for:Io();return;case a._function:if(I()===a.dot)break;e||w(),zo();return;case a._class:e||w(),as(!0);return;case a._if:Bo();return;case a._return:Vo();return;case a._switch:Ho();return;case a._throw:Uo();return;case a._try:Go();return;case a._let:case a._const:e||w();case a._var:Ko(t!==a._var);return;case a._while:qo();return;case a.braceL:Zo();return;case a.semi:Jo();return;case a._export:case a._import:{let e=I();if(e===a.parenL||e===a.dot)break;A(),t===a._import?Ms():_s();return}case a.name:if(m.contextualKeyword===i._async){let e=m.start,t=m.snapshot();if(A(),F(a._function)&&!y()){C(a._function),rs(e,!0);return}else m.restoreFromSnapshot(t)}else if(m.contextualKeyword===i._using&&!se()&&I()===a.name){Ko(!0);return}else if(Oo()){v(i._await),Ko(!0);return}default:break}let n=m.tokens.length;W();let r=null;if(m.tokens.length===n+1){let e=m.tokens[m.tokens.length-1];e.type===a.name&&(r=e.contextualKeyword)}if(r==null){S();return}P(a.colon)?Yo():Xo(r)}function Oo(){if(!g(i._await))return!1;let e=m.snapshot();return A(),!g(i._using)||b()||(A(),!F(a.name)||b())?(m.restoreFromSnapshot(e),!1):(m.restoreFromSnapshot(e),!0)}function ko(){for(;F(a.at);)Ao()}function Ao(){if(A(),P(a.parenL))W(),C(a.parenR);else{for(Y();P(a.dot);)Y();jo()}}function jo(){f?ri():Mo()}function Mo(){P(a.parenL)&&q()}function No(){A(),x()||(Y(),S())}function Po(){A(),S()}function Fo(){A(),$(!1),C(a._while),Ri(),P(a.semi)}function Io(){m.scopeDepth++;let e=m.tokens.length;Ro();let t=m.tokens.length;m.scopes.push(new s(e,t,!1)),m.scopeDepth--}function Lo(){return!(!g(i._using)||oe(i._of))}function Ro(){A();let e=!1;if(g(i._await)&&(e=!0,A()),C(a.parenL),F(a.semi)){e&&w(),$o();return}let t=Oo();if(t||F(a._var)||F(a._let)||F(a._const)||Lo()){if(t&&v(i._await),A(),ts(!0,m.type!==a._var),F(a._in)||g(i._of)){es(e);return}$o();return}if(W(!0),F(a._in)||g(i._of)){es(e);return}e&&w(),$o()}function zo(){let e=m.start;A(),rs(e,!0)}function Bo(){A(),Ri(),$(!1),P(a._else)&&$(!1)}function Vo(){A(),x()||(W(),S())}function Ho(){A(),Ri(),m.scopeDepth++;let e=m.tokens.length;for(C(a.braceL);!F(a.braceR)&&!m.error;)if(F(a._case)||F(a._default)){let e=F(a._case);A(),e&&W(),C(a.colon)}else $(!0);A();let t=m.tokens.length;m.scopes.push(new s(e,t,!1)),m.scopeDepth--}function Uo(){A(),W(),S()}function Wo(){un(!0),f&&sr()}function Go(){if(A(),Zo(),F(a._catch)){A();let e=null;if(F(a.parenL)&&(m.scopeDepth++,e=m.tokens.length,C(a.parenL),Wo(),C(a.parenR)),Zo(),e!=null){let t=m.tokens.length;m.scopes.push(new s(e,t,!1)),m.scopeDepth--}}P(a._finally)&&Zo()}function Ko(e){A(),ts(!1,e),S()}function qo(){A(),Ri(),$(!1)}function Jo(){A()}function Yo(){$(!0)}function Xo(e){f?Gr(e):p?ro(e):S()}function Zo(e=!1,t=0){let n=m.tokens.length;m.scopeDepth++,C(a.braceL),t&&(m.tokens[m.tokens.length-1].contextId=t),Qo(a.braceR),t&&(m.tokens[m.tokens.length-1].contextId=t);let r=m.tokens.length;m.scopes.push(new s(n,r,e)),m.scopeDepth--}function Qo(e){for(;!P(e)&&!m.error;)$(!0)}function $o(){C(a.semi),F(a.semi)||W(),C(a.semi),F(a.parenR)||W(),C(a.parenR),$(!1)}function es(e){e?_(i._of):A(),W(),C(a.parenR),$(!1)}function ts(e,t){for(;;){if(ns(t),P(a.eq)){let t=m.tokens.length-1;G(e),m.tokens[t].rhsEndIndex=m.tokens.length}if(!P(a.comma))break}}function ns(e){un(e),f?Xr():p&&go()}function rs(e,t,n=!1){F(a.star)&&A(),t&&!n&&!F(a.name)&&!F(a._yield)&&w();let r=null;F(a.name)&&(t||(r=m.tokens.length,m.scopeDepth++),V(!1));let i=m.tokens.length;m.scopeDepth++,is(),ea(e);let o=m.tokens.length;m.scopes.push(new s(i,o,!0)),m.scopeDepth--,r!==null&&(m.scopes.push(new s(r,o,!0)),m.scopeDepth--)}function is(e=!1,t=0){f?Yr():p&&ho(),C(a.parenL),t&&(m.tokens[m.tokens.length-1].contextId=t),dn(a.parenR,!1,!1,e,t),t&&(m.tokens[m.tokens.length-1].contextId=t)}function as(e,t=!1){let n=te();A(),m.tokens[m.tokens.length-1].contextId=n,m.tokens[m.tokens.length-1].isExpression=!e;let r=null;e||(r=m.tokens.length,m.scopeDepth++),hs(e,t),gs();let i=m.tokens.length;if(cs(n),!m.error&&(m.tokens[i].contextId=n,m.tokens[m.tokens.length-1].contextId=n,r!==null)){let e=m.tokens.length;m.scopes.push(new s(r,e,!1)),m.scopeDepth--}}function os(){return F(a.eq)||F(a.semi)||F(a.braceR)||F(a.bang)||F(a.colon)}function ss(){return F(a.parenL)||F(a.lessThan)}function cs(e){for(C(a.braceL);!P(a.braceR)&&!m.error;){if(P(a.semi))continue;if(F(a.at)){Ao();continue}let t=m.start;ls(t,e)}}function ls(e,t){f&&vn([i._declare,i._public,i._protected,i._private,i._override]);let n=!1;if(F(a.name)&&m.contextualKeyword===i._static){if(Y(),ss()){ds(e,!1);return}else if(os()){ms();return}if(m.tokens[m.tokens.length-1].type=a._static,n=!0,F(a.braceL)){m.tokens[m.tokens.length-1].contextId=t,Zo();return}}us(e,n,t)}function us(e,t,n){if(f&&Wr(t))return;if(P(a.star)){fs(n),ds(e,!1);return}fs(n);let r=!1,o=m.tokens[m.tokens.length-1];o.contextualKeyword===i._constructor&&(r=!0),ps(),ss()?ds(e,r):os()?ms():o.contextualKeyword===i._async&&!x()?(m.tokens[m.tokens.length-1].type=a._async,F(a.star)&&A(),fs(n),ps(),ds(e,!1)):(o.contextualKeyword===i._get||o.contextualKeyword===i._set)&&!(x()&&F(a.star))?(o.contextualKeyword===i._get?m.tokens[m.tokens.length-1].type=a._get:m.tokens[m.tokens.length-1].type=a._set,fs(n),ds(e,!1)):o.contextualKeyword===i._accessor&&!x()?(fs(n),ms()):x()?ms():w()}function ds(e,t){f?Dn():p&&F(a.lessThan)&&Z(),Qi(e,t)}function fs(e){Zi(e)}function ps(){if(f){let e=M(0);P(a.question),N(e)}}function ms(){if(f?(xe(a.bang),sr()):p&&F(a.colon)&&Ya(),F(a.eq)){let e=m.tokens.length;A(),G(),m.tokens[e].rhsEndIndex=m.tokens.length}S()}function hs(e,t=!1){f&&(!e||t)&&g(i._implements)||(F(a.name)&&V(!0),f?Dn():p&&F(a.lessThan)&&Z())}function gs(){let e=!1;P(a._extends)?(Ei(),e=!0):e=!1,f?qr(e):p&&lo(e)}function _s(){let e=m.tokens.length-1;f&&zr()||(Cs()?ws():bs()?(Y(),F(a.comma)&&I()===a.star?(C(a.comma),C(a.star),v(i._as),Y()):xs(),Ss()):P(a._default)?vs():Ds()?ys():(Os(),Ss()),m.tokens[e].rhsEndIndex=m.tokens.length)}function vs(){if(f&&Hr()||p&&no())return;let e=m.start;P(a._function)?rs(e,!0,!0):g(i._async)&&I()===a._function?(_(i._async),P(a._function),rs(e,!0,!0)):F(a._class)?as(!0,!0):F(a.at)?(ko(),as(!0,!0)):(G(),S())}function ys(){f?Kr():p?oo():$(!0)}function bs(){if(f&&Ir()||p&&ao())return!1;if(F(a.name))return m.contextualKeyword!==i._async;if(!F(a._default))return!1;let e=we(),t=Ce(),n=t.type===a.name&&t.contextualKeyword===i._from;if(t.type===a.comma)return!0;if(n){let t=h.charCodeAt(Te(e+4));return t===u.quotationMark||t===u.apostrophe}return!1}function xs(){P(a.comma)&&Os()}function Ss(){_(i._from)&&(J(),Ls()),S()}function Cs(){return p?so():F(a.star)}function ws(){p?co():Ts()}function Ts(){C(a.star),g(i._as)?Es():Ss()}function Es(){A(),m.tokens[m.tokens.length-1].type=a._as,Y(),xs(),Ss()}function Ds(){return f&&Ir()||p&&io()||m.type===a._var||m.type===a._const||m.type===a._let||m.type===a._function||m.type===a._class||g(i._async)||F(a.at)}function Os(){let e=!0;for(C(a.braceL);!P(a.braceR)&&!m.error;){if(e)e=!1;else if(C(a.comma),P(a.braceR))break;ks()}}function ks(){if(f){Vr();return}Y(),m.tokens[m.tokens.length-1].identifierRole=O.ExportAccess,_(i._as)&&Y()}function As(){let e=m.snapshot();return v(i._module),_(i._from)?g(i._from)?(m.restoreFromSnapshot(e),!0):(m.restoreFromSnapshot(e),!1):F(a.comma)?(m.restoreFromSnapshot(e),!1):(m.restoreFromSnapshot(e),!0)}function js(){g(i._module)&&As()&&A()}function Ms(){if(f&&F(a.name)&&I()===a.eq){wr();return}if(f&&g(i._type)){let e=Ce();if(e.type===a.name&&e.contextualKeyword!==i._from){if(v(i._type),I()===a.eq){wr();return}}else(e.type===a.star||e.type===a.braceL)&&v(i._type)}F(a.string)?J():(js(),Fs(),v(i._from),J()),Ls(),S()}function Ns(){return F(a.name)}function Ps(){cn()}function Fs(){p&&po();let e=!0;if(!(Ns()&&(Ps(),!P(a.comma)))){if(F(a.star)){A(),v(i._as),Ps();return}for(C(a.braceL);!P(a.braceR)&&!m.error;){if(e)e=!1;else if(P(a.colon)&&w(`ES2015 named imports do not destructure. Use another statement for destructuring after the import.`),C(a.comma),P(a.braceR))break;Is()}}}function Is(){if(f){Br();return}if(p){mo();return}cn(),g(i._as)&&(m.tokens[m.tokens.length-1].identifierRole=O.ImportAccess,A(),cn())}function Ls(){(F(a._with)||g(i._assert)&&!b())&&(A(),Ki(!1,!1))}function Rs(){return m.pos===0&&h.charCodeAt(0)===u.numberSign&&h.charCodeAt(1)===u.exclamationMark&&Ae(2),De(),Eo()}var zs=class{constructor(e,t){this.tokens=e,this.scopes=t}};function Bs(e,t,n,r){if(r&&n)throw Error(`Cannot combine flow and typescript plugins.`);ae(e,t,n,r);let i=Rs();if(m.error)throw ne(m.error);return i}function Vs(e){let t=e.currentIndex(),n=0,r=e.currentToken();do{let a=e.tokens[t];if(a.isOptionalChainStart&&n++,a.isOptionalChainEnd&&n--,n+=a.numNullishCoalesceStarts,n-=a.numNullishCoalesceEnds,a.contextualKeyword===i._await&&a.identifierRole==null&&a.scopeDepth===r.scopeDepth)return!0;t+=1}while(n>0&&t<e.tokens.length);return!1}var Hs=class e{__init(){this.resultCode=``}__init2(){this.resultMappings=Array(this.tokens.length)}__init3(){this.tokenIndex=0}constructor(t,n,r,i,a){this.code=t,this.tokens=n,this.isFlowEnabled=r,this.disableESTransforms=i,this.helperManager=a,e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this)}snapshot(){return{resultCode:this.resultCode,tokenIndex:this.tokenIndex}}restoreToSnapshot(e){this.resultCode=e.resultCode,this.tokenIndex=e.tokenIndex}dangerouslyGetAndRemoveCodeSinceSnapshot(e){let t=this.resultCode.slice(e.resultCode.length);return this.resultCode=e.resultCode,t}reset(){this.resultCode=``,this.resultMappings=Array(this.tokens.length),this.tokenIndex=0}matchesContextualAtIndex(e,t){return this.matches1AtIndex(e,a.name)&&this.tokens[e].contextualKeyword===t}identifierNameAtIndex(e){return this.identifierNameForToken(this.tokens[e])}identifierNameAtRelativeIndex(e){return this.identifierNameForToken(this.tokenAtRelativeIndex(e))}identifierName(){return this.identifierNameForToken(this.currentToken())}identifierNameForToken(e){return this.code.slice(e.start,e.end)}rawCodeForToken(e){return this.code.slice(e.start,e.end)}stringValueAtIndex(e){return this.stringValueForToken(this.tokens[e])}stringValue(){return this.stringValueForToken(this.currentToken())}stringValueForToken(e){return this.code.slice(e.start+1,e.end-1)}matches1AtIndex(e,t){return this.tokens[e].type===t}matches2AtIndex(e,t,n){return this.tokens[e].type===t&&this.tokens[e+1].type===n}matches3AtIndex(e,t,n,r){return this.tokens[e].type===t&&this.tokens[e+1].type===n&&this.tokens[e+2].type===r}matches1(e){return this.tokens[this.tokenIndex].type===e}matches2(e,t){return this.tokens[this.tokenIndex].type===e&&this.tokens[this.tokenIndex+1].type===t}matches3(e,t,n){return this.tokens[this.tokenIndex].type===e&&this.tokens[this.tokenIndex+1].type===t&&this.tokens[this.tokenIndex+2].type===n}matches4(e,t,n,r){return this.tokens[this.tokenIndex].type===e&&this.tokens[this.tokenIndex+1].type===t&&this.tokens[this.tokenIndex+2].type===n&&this.tokens[this.tokenIndex+3].type===r}matches5(e,t,n,r,i){return this.tokens[this.tokenIndex].type===e&&this.tokens[this.tokenIndex+1].type===t&&this.tokens[this.tokenIndex+2].type===n&&this.tokens[this.tokenIndex+3].type===r&&this.tokens[this.tokenIndex+4].type===i}matchesContextual(e){return this.matchesContextualAtIndex(this.tokenIndex,e)}matchesContextIdAndLabel(e,t){return this.matches1(e)&&this.currentToken().contextId===t}previousWhitespaceAndComments(){let e=this.code.slice(this.tokenIndex>0?this.tokens[this.tokenIndex-1].end:0,this.tokenIndex<this.tokens.length?this.tokens[this.tokenIndex].start:this.code.length);return this.isFlowEnabled&&(e=e.replace(/@flow/g,``)),e}replaceToken(e){this.resultCode+=this.previousWhitespaceAndComments(),this.appendTokenPrefix(),this.resultMappings[this.tokenIndex]=this.resultCode.length,this.resultCode+=e,this.appendTokenSuffix(),this.tokenIndex++}replaceTokenTrimmingLeftWhitespace(e){this.resultCode+=this.previousWhitespaceAndComments().replace(/[^\r\n]/g,``),this.appendTokenPrefix(),this.resultMappings[this.tokenIndex]=this.resultCode.length,this.resultCode+=e,this.appendTokenSuffix(),this.tokenIndex++}removeInitialToken(){this.replaceToken(``)}removeToken(){this.replaceTokenTrimmingLeftWhitespace(``)}removeBalancedCode(){let e=0;for(;!this.isAtEnd();){if(this.matches1(a.braceL))e++;else if(this.matches1(a.braceR)){if(e===0)return;e--}this.removeToken()}}copyExpectedToken(e){if(this.tokens[this.tokenIndex].type!==e)throw Error(`Expected token ${e}`);this.copyToken()}copyToken(){this.resultCode+=this.previousWhitespaceAndComments(),this.appendTokenPrefix(),this.resultMappings[this.tokenIndex]=this.resultCode.length,this.resultCode+=this.code.slice(this.tokens[this.tokenIndex].start,this.tokens[this.tokenIndex].end),this.appendTokenSuffix(),this.tokenIndex++}copyTokenWithPrefix(e){this.resultCode+=this.previousWhitespaceAndComments(),this.appendTokenPrefix(),this.resultCode+=e,this.resultMappings[this.tokenIndex]=this.resultCode.length,this.resultCode+=this.code.slice(this.tokens[this.tokenIndex].start,this.tokens[this.tokenIndex].end),this.appendTokenSuffix(),this.tokenIndex++}appendTokenPrefix(){let e=this.currentToken();if((e.numNullishCoalesceStarts||e.isOptionalChainStart)&&(e.isAsyncOperation=Vs(this)),!this.disableESTransforms){if(e.numNullishCoalesceStarts)for(let t=0;t<e.numNullishCoalesceStarts;t++)e.isAsyncOperation?(this.resultCode+=`await `,this.resultCode+=this.helperManager.getHelperName(`asyncNullishCoalesce`)):this.resultCode+=this.helperManager.getHelperName(`nullishCoalesce`),this.resultCode+=`(`;e.isOptionalChainStart&&(e.isAsyncOperation&&(this.resultCode+=`await `),this.tokenIndex>0&&this.tokenAtRelativeIndex(-1).type===a._delete?e.isAsyncOperation?this.resultCode+=this.helperManager.getHelperName(`asyncOptionalChainDelete`):this.resultCode+=this.helperManager.getHelperName(`optionalChainDelete`):e.isAsyncOperation?this.resultCode+=this.helperManager.getHelperName(`asyncOptionalChain`):this.resultCode+=this.helperManager.getHelperName(`optionalChain`),this.resultCode+=`([`)}}appendTokenSuffix(){let e=this.currentToken();if(e.isOptionalChainEnd&&!this.disableESTransforms&&(this.resultCode+=`])`),e.numNullishCoalesceEnds&&!this.disableESTransforms)for(let t=0;t<e.numNullishCoalesceEnds;t++)this.resultCode+=`))`}appendCode(e){this.resultCode+=e}currentToken(){return this.tokens[this.tokenIndex]}currentTokenCode(){let e=this.currentToken();return this.code.slice(e.start,e.end)}tokenAtRelativeIndex(e){return this.tokens[this.tokenIndex+e]}currentIndex(){return this.tokenIndex}nextToken(){if(this.tokenIndex===this.tokens.length)throw Error(`Unexpectedly reached end of input.`);this.tokenIndex++}previousToken(){this.tokenIndex--}finish(){if(this.tokenIndex!==this.tokens.length)throw Error(`Tried to finish processing tokens before reaching the end.`);return this.resultCode+=this.previousWhitespaceAndComments(),{code:this.resultCode,mappings:this.resultMappings}}isAtEnd(){return this.tokenIndex===this.tokens.length}};function Us(e,t,n,r){let o=t.snapshot(),s=Gs(t),c=[],l=[],u=[],d=null,f=[],p=[],m=t.currentToken().contextId;if(m==null)throw Error(`Expected non-null class context ID on class open-brace.`);for(t.nextToken();!t.matchesContextIdAndLabel(a.braceR,m);)if(t.matchesContextual(i._constructor)&&!t.currentToken().isType)({constructorInitializerStatements:c,constructorInsertPos:d}=Ks(t));else if(t.matches1(a.semi))r||p.push({start:t.currentIndex(),end:t.currentIndex()+1}),t.nextToken();else if(t.currentToken().isType)t.nextToken();else{let o=t.currentIndex(),s=!1,h=!1,ee=!1;for(;qs(t.currentToken());)t.matches1(a._static)&&(s=!0),t.matches1(a.hash)&&(h=!0),(t.matches1(a._declare)||t.matches1(a._abstract))&&(ee=!0),t.nextToken();if(s&&t.matches1(a.braceL)){Ws(t,m);continue}if(h){Ws(t,m);continue}if(t.matchesContextual(i._constructor)&&!t.currentToken().isType){({constructorInitializerStatements:c,constructorInsertPos:d}=Ks(t));continue}let te=t.currentIndex();if(Js(t),t.matches1(a.lessThan)||t.matches1(a.parenL)){Ws(t,m);continue}for(;t.currentToken().isType;)t.nextToken();if(t.matches1(a.eq)){let r=t.currentIndex(),i=t.currentToken().rhsEndIndex;if(i==null)throw Error(`Expected rhsEndIndex on class field assignment.`);for(t.nextToken();t.currentIndex()<i;)e.processToken();let a;s?(a=n.claimFreeName(`__initStatic`),u.push(a)):(a=n.claimFreeName(`__init`),l.push(a)),f.push({initializerName:a,equalsIndex:r,start:te,end:t.currentIndex()})}else(!r||ee)&&p.push({start:o,end:t.currentIndex()})}return t.restoreToSnapshot(o),r?{headerInfo:s,constructorInitializerStatements:c,instanceInitializerNames:[],staticInitializerNames:[],constructorInsertPos:d,fields:[],rangesToRemove:p}:{headerInfo:s,constructorInitializerStatements:c,instanceInitializerNames:l,staticInitializerNames:u,constructorInsertPos:d,fields:f,rangesToRemove:p}}function Ws(e,t){for(e.nextToken();e.currentToken().contextId!==t;)e.nextToken();for(;qs(e.tokenAtRelativeIndex(-1));)e.previousToken()}function Gs(e){let t=e.currentToken(),n=t.contextId;if(n==null)throw Error(`Expected context ID on class token.`);let r=t.isExpression;if(r==null)throw Error(`Expected isExpression on class token.`);let i=null,o=!1;for(e.nextToken(),e.matches1(a.name)&&(i=e.identifierName());!e.matchesContextIdAndLabel(a.braceL,n);)e.matches1(a._extends)&&!e.currentToken().isType&&(o=!0),e.nextToken();return{isExpression:r,className:i,hasSuperclass:o}}function Ks(e){let t=[];e.nextToken();let n=e.currentToken().contextId;if(n==null)throw Error(`Expected context ID on open-paren starting constructor params.`);for(;!e.matchesContextIdAndLabel(a.parenR,n);)if(e.currentToken().contextId===n){if(e.nextToken(),qs(e.currentToken())){for(e.nextToken();qs(e.currentToken());)e.nextToken();let n=e.currentToken();if(n.type!==a.name)throw Error(`Expected identifier after access modifiers in constructor arg.`);let r=e.identifierNameForToken(n);t.push(`this.${r} = ${r}`)}}else e.nextToken();for(e.nextToken();e.currentToken().isType;)e.nextToken();let r=e.currentIndex(),i=!1;for(;!e.matchesContextIdAndLabel(a.braceR,n);){if(!i&&e.matches2(a._super,a.parenL)){e.nextToken();let t=e.currentToken().contextId;if(t==null)throw Error(`Expected a context ID on the super call`);for(;!e.matchesContextIdAndLabel(a.parenR,t);)e.nextToken();r=e.currentIndex(),i=!0}e.nextToken()}return e.nextToken(),{constructorInitializerStatements:t,constructorInsertPos:r}}function qs(e){return[a._async,a._get,a._set,a.plus,a.minus,a._readonly,a._static,a._public,a._private,a._protected,a._override,a._abstract,a.star,a._declare,a.hash].includes(e.type)}function Js(e){if(e.matches1(a.bracketL)){let t=e.currentToken().contextId;if(t==null)throw Error(`Expected class context ID on computed name open bracket.`);for(;!e.matchesContextIdAndLabel(a.bracketR,t);)e.nextToken();e.nextToken()}else e.nextToken()}function Ys(e){if(e.removeInitialToken(),e.removeToken(),e.removeToken(),e.removeToken(),e.matches1(a.parenL))e.removeToken(),e.removeToken(),e.removeToken();else for(;e.matches1(a.dot);)e.removeToken(),e.removeToken()}var Xs={typeDeclarations:new Set,valueDeclarations:new Set};function Zs(e){let t=new Set,n=new Set;for(let r=0;r<e.tokens.length;r++){let i=e.tokens[r];i.type===a.name&&he(i)&&(i.isType?t.add(e.identifierNameForToken(i)):n.add(e.identifierNameForToken(i)))}return{typeDeclarations:t,valueDeclarations:n}}function Qs(e){let t=e.currentIndex();for(;!e.matches1AtIndex(t,a.braceR);)t++;return e.matchesContextualAtIndex(t+1,i._from)&&e.matches1AtIndex(t+2,a.string)}function $s(e){(e.matches2(a._with,a.braceL)||e.matches2(a.name,a.braceL)&&e.matchesContextual(i._assert))&&(e.removeToken(),e.removeToken(),e.removeBalancedCode(),e.removeToken())}function ec(e,t,n,r){if(!e||t)return!1;let i=n.currentToken();if(i.rhsEndIndex==null)throw Error(`Expected non-null rhsEndIndex on export token.`);let o=i.rhsEndIndex-n.currentIndex();if(o!==3&&!(o===4&&n.matches1AtIndex(i.rhsEndIndex-1,a.semi)))return!1;let s=n.tokenAtRelativeIndex(2);if(s.type!==a.name)return!1;let c=n.identifierNameForToken(s);return r.typeDeclarations.has(c)&&!r.valueDeclarations.has(c)}var tc=class e extends z{__init(){this.hadExport=!1}__init2(){this.hadNamedExport=!1}__init3(){this.hadDefaultExport=!1}constructor(t,n,r,i,a,o,s,c,l,u,d,f){super(),this.rootTransformer=t,this.tokens=n,this.importProcessor=r,this.nameManager=i,this.helperManager=a,this.reactHotLoaderTransformer=o,this.enableLegacyBabel5ModuleInterop=s,this.enableLegacyTypeScriptModuleInterop=c,this.isTypeScriptTransformEnabled=l,this.isFlowTransformEnabled=u,this.preserveDynamicImport=d,this.keepUnusedImports=f,e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this),this.declarationInfo=l?Zs(n):Xs}getPrefixCode(){let e=``;return this.hadExport&&(e+=`Object.defineProperty(exports, "__esModule", {value: true});`),e}getSuffixCode(){return this.enableLegacyBabel5ModuleInterop&&this.hadDefaultExport&&!this.hadNamedExport?`
117
117
  module.exports = exports.default;
118
- `:``}process(){return this.tokens.matches3(a._import,a.name,a.eq)?this.processImportEquals():this.tokens.matches1(a._import)?(this.processImport(),!0):this.tokens.matches2(a._export,a.eq)?(this.tokens.replaceToken(`module.exports`),!0):this.tokens.matches1(a._export)&&!this.tokens.currentToken().isType?(this.hadExport=!0,this.processExport()):this.tokens.matches2(a.name,a.postIncDec)&&this.processPostIncDec()?!0:this.tokens.matches1(a.name)||this.tokens.matches1(a.jsxName)?this.processIdentifier():this.tokens.matches1(a.eq)?this.processAssignment():this.tokens.matches1(a.assign)?this.processComplexAssignment():this.tokens.matches1(a.preIncDec)?this.processPreIncDec():!1}processImportEquals(){let e=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);return this.importProcessor.shouldAutomaticallyElideImportedName(e)?Ys(this.tokens):this.tokens.replaceToken(`const`),!0}processImport(){if(this.tokens.matches2(a._import,a.parenL)){if(this.preserveDynamicImport){this.tokens.copyToken();return}let e=this.enableLegacyTypeScriptModuleInterop?``:`${this.helperManager.getHelperName(`interopRequireWildcard`)}(`;this.tokens.replaceToken(`Promise.resolve().then(() => ${e}require`);let t=this.tokens.currentToken().contextId;if(t==null)throw Error(`Expected context ID on dynamic import invocation.`);for(this.tokens.copyToken();!this.tokens.matchesContextIdAndLabel(a.parenR,t);)this.rootTransformer.processToken();this.tokens.replaceToken(e?`)))`:`))`);return}if(this.removeImportAndDetectIfShouldElide())this.tokens.removeToken();else{let e=this.tokens.stringValue();this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(e)),this.tokens.appendCode(this.importProcessor.claimImportCode(e))}$s(this.tokens),this.tokens.matches1(a.semi)&&this.tokens.removeToken()}removeImportAndDetectIfShouldElide(){if(this.tokens.removeInitialToken(),this.tokens.matchesContextual(i._type)&&!this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,a.comma)&&!this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,i._from))return this.removeRemainingImport(),!0;if(this.tokens.matches1(a.name)||this.tokens.matches1(a.star))return this.removeRemainingImport(),!1;if(this.tokens.matches1(a.string))return!1;let e=!1,t=!1;for(;!this.tokens.matches1(a.string);)(!e&&this.tokens.matches1(a.braceL)||this.tokens.matches1(a.comma))&&(this.tokens.removeToken(),this.tokens.matches1(a.braceR)||(t=!0),(this.tokens.matches2(a.name,a.comma)||this.tokens.matches2(a.name,a.braceR)||this.tokens.matches4(a.name,a.name,a.name,a.comma)||this.tokens.matches4(a.name,a.name,a.name,a.braceR))&&(e=!0)),this.tokens.removeToken();return this.keepUnusedImports?!1:this.isTypeScriptTransformEnabled?!e:this.isFlowTransformEnabled?t&&!e:!1}removeRemainingImport(){for(;!this.tokens.matches1(a.string);)this.tokens.removeToken()}processIdentifier(){let e=this.tokens.currentToken();if(e.shadowsGlobal)return!1;if(e.identifierRole===O.ObjectShorthand)return this.processObjectShorthand();if(e.identifierRole!==O.Access)return!1;let t=this.importProcessor.getIdentifierReplacement(this.tokens.identifierNameForToken(e));if(!t)return!1;let n=this.tokens.currentIndex()+1;for(;n<this.tokens.tokens.length&&this.tokens.tokens[n].type===a.parenR;)n++;return this.tokens.tokens[n].type===a.parenL?this.tokens.tokenAtRelativeIndex(1).type===a.parenL&&this.tokens.tokenAtRelativeIndex(-1).type!==a._new?(this.tokens.replaceToken(`${t}.call(void 0, `),this.tokens.removeToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(a.parenR)):this.tokens.replaceToken(`(0, ${t})`):this.tokens.replaceToken(t),!0}processObjectShorthand(){let e=this.tokens.identifierName(),t=this.importProcessor.getIdentifierReplacement(e);return t?(this.tokens.replaceToken(`${e}: ${t}`),!0):!1}processExport(){if(this.tokens.matches2(a._export,a._enum)||this.tokens.matches3(a._export,a._const,a._enum))return this.hadNamedExport=!0,!1;if(this.tokens.matches2(a._export,a._default))return this.tokens.matches3(a._export,a._default,a._enum)?(this.hadDefaultExport=!0,!1):(this.processExportDefault(),!0);if(this.tokens.matches2(a._export,a.braceL))return this.processExportBindings(),!0;if(this.tokens.matches2(a._export,a.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,i._type)){if(this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.matches1(a.braceL)){for(;!this.tokens.matches1(a.braceR);)this.tokens.removeToken();this.tokens.removeToken()}else this.tokens.removeToken(),this.tokens.matches1(a._as)&&(this.tokens.removeToken(),this.tokens.removeToken());return this.tokens.matchesContextual(i._from)&&this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,a.string)&&(this.tokens.removeToken(),this.tokens.removeToken(),$s(this.tokens)),!0}if(this.hadNamedExport=!0,this.tokens.matches2(a._export,a._var)||this.tokens.matches2(a._export,a._let)||this.tokens.matches2(a._export,a._const))return this.processExportVar(),!0;if(this.tokens.matches2(a._export,a._function)||this.tokens.matches3(a._export,a.name,a._function))return this.processExportFunction(),!0;if(this.tokens.matches2(a._export,a._class)||this.tokens.matches3(a._export,a._abstract,a._class)||this.tokens.matches2(a._export,a.at))return this.processExportClass(),!0;if(this.tokens.matches2(a._export,a.star))return this.processExportStar(),!0;throw Error(`Unrecognized export syntax.`)}processAssignment(){let e=this.tokens.currentIndex(),t=this.tokens.tokens[e-1];if(t.isType||t.type!==a.name||t.shadowsGlobal||e>=2&&this.tokens.matches1AtIndex(e-2,a.dot)||e>=2&&[a._var,a._let,a._const].includes(this.tokens.tokens[e-2].type))return!1;let n=this.importProcessor.resolveExportBinding(this.tokens.identifierNameForToken(t));return n?(this.tokens.copyToken(),this.tokens.appendCode(` ${n} =`),!0):!1}processComplexAssignment(){let e=this.tokens.currentIndex(),t=this.tokens.tokens[e-1];if(t.type!==a.name||t.shadowsGlobal||e>=2&&this.tokens.matches1AtIndex(e-2,a.dot))return!1;let n=this.importProcessor.resolveExportBinding(this.tokens.identifierNameForToken(t));return n?(this.tokens.appendCode(` = ${n}`),this.tokens.copyToken(),!0):!1}processPreIncDec(){let e=this.tokens.currentIndex(),t=this.tokens.tokens[e+1];if(t.type!==a.name||t.shadowsGlobal||e+2<this.tokens.tokens.length&&(this.tokens.matches1AtIndex(e+2,a.dot)||this.tokens.matches1AtIndex(e+2,a.bracketL)||this.tokens.matches1AtIndex(e+2,a.parenL)))return!1;let n=this.tokens.identifierNameForToken(t),r=this.importProcessor.resolveExportBinding(n);return r?(this.tokens.appendCode(`${r} = `),this.tokens.copyToken(),!0):!1}processPostIncDec(){let e=this.tokens.currentIndex(),t=this.tokens.tokens[e],n=this.tokens.tokens[e+1];if(t.type!==a.name||t.shadowsGlobal||e>=1&&this.tokens.matches1AtIndex(e-1,a.dot))return!1;let r=this.tokens.identifierNameForToken(t),i=this.importProcessor.resolveExportBinding(r);if(!i)return!1;let o=this.tokens.rawCodeForToken(n),s=this.importProcessor.getIdentifierReplacement(r)||r;if(o===`++`)this.tokens.replaceToken(`(${s} = ${i} = ${s} + 1, ${s} - 1)`);else if(o===`--`)this.tokens.replaceToken(`(${s} = ${i} = ${s} - 1, ${s} + 1)`);else throw Error(`Unexpected operator: ${o}`);return this.tokens.removeToken(),!0}processExportDefault(){let e=!0;if(this.tokens.matches4(a._export,a._default,a._function,a.name)||this.tokens.matches5(a._export,a._default,a.name,a._function,a.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,i._async)){this.tokens.removeInitialToken(),this.tokens.removeToken();let e=this.processNamedFunction();this.tokens.appendCode(` exports.default = ${e};`)}else if(this.tokens.matches4(a._export,a._default,a._class,a.name)||this.tokens.matches5(a._export,a._default,a._abstract,a._class,a.name)||this.tokens.matches3(a._export,a._default,a.at)){this.tokens.removeInitialToken(),this.tokens.removeToken(),this.copyDecorators(),this.tokens.matches1(a._abstract)&&this.tokens.removeToken();let e=this.rootTransformer.processNamedClass();this.tokens.appendCode(` exports.default = ${e};`)}else if(ec(this.isTypeScriptTransformEnabled,this.keepUnusedImports,this.tokens,this.declarationInfo))e=!1,this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.removeToken();else if(this.reactHotLoaderTransformer){let e=this.nameManager.claimFreeName(`_default`);this.tokens.replaceToken(`let ${e}; exports.`),this.tokens.copyToken(),this.tokens.appendCode(` = ${e} =`),this.reactHotLoaderTransformer.setExtractedDefaultExportName(e)}else this.tokens.replaceToken(`exports.`),this.tokens.copyToken(),this.tokens.appendCode(` =`);e&&(this.hadDefaultExport=!0)}copyDecorators(){for(;this.tokens.matches1(a.at);)if(this.tokens.copyToken(),this.tokens.matches1(a.parenL))this.tokens.copyExpectedToken(a.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(a.parenR);else{for(this.tokens.copyExpectedToken(a.name);this.tokens.matches1(a.dot);)this.tokens.copyExpectedToken(a.dot),this.tokens.copyExpectedToken(a.name);this.tokens.matches1(a.parenL)&&(this.tokens.copyExpectedToken(a.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(a.parenR))}}processExportVar(){this.isSimpleExportVar()?this.processSimpleExportVar():this.processComplexExportVar()}isSimpleExportVar(){let e=this.tokens.currentIndex();if(e++,e++,!this.tokens.matches1AtIndex(e,a.name))return!1;for(e++;e<this.tokens.tokens.length&&this.tokens.tokens[e].isType;)e++;return!!this.tokens.matches1AtIndex(e,a.eq)}processSimpleExportVar(){this.tokens.removeInitialToken(),this.tokens.copyToken();let e=this.tokens.identifierName();for(;!this.tokens.matches1(a.eq);)this.rootTransformer.processToken();let t=this.tokens.currentToken().rhsEndIndex;if(t==null)throw Error(`Expected = token with an end index.`);for(;this.tokens.currentIndex()<t;)this.rootTransformer.processToken();this.tokens.appendCode(`; exports.${e} = ${e}`)}processComplexExportVar(){this.tokens.removeInitialToken(),this.tokens.removeToken();let e=this.tokens.matches1(a.braceL);e&&this.tokens.appendCode(`(`);let t=0;for(;;)if(this.tokens.matches1(a.braceL)||this.tokens.matches1(a.dollarBraceL)||this.tokens.matches1(a.bracketL))t++,this.tokens.copyToken();else if(this.tokens.matches1(a.braceR)||this.tokens.matches1(a.bracketR))t--,this.tokens.copyToken();else if(t===0&&!this.tokens.matches1(a.name)&&!this.tokens.currentToken().isType)break;else if(this.tokens.matches1(a.eq)){let e=this.tokens.currentToken().rhsEndIndex;if(e==null)throw Error(`Expected = token with an end index.`);for(;this.tokens.currentIndex()<e;)this.rootTransformer.processToken()}else{let e=this.tokens.currentToken();if(pe(e)){let t=this.tokens.identifierName(),n=this.importProcessor.getIdentifierReplacement(t);if(n===null)throw Error(`Expected a replacement for ${t} in \`export var\` syntax.`);ve(e)&&(n=`${t}: ${n}`),this.tokens.replaceToken(n)}else this.rootTransformer.processToken()}if(e){let e=this.tokens.currentToken().rhsEndIndex;if(e==null)throw Error(`Expected = token with an end index.`);for(;this.tokens.currentIndex()<e;)this.rootTransformer.processToken();this.tokens.appendCode(`)`)}}processExportFunction(){this.tokens.replaceToken(``);let e=this.processNamedFunction();this.tokens.appendCode(` exports.${e} = ${e};`)}processNamedFunction(){if(this.tokens.matches1(a._function))this.tokens.copyToken();else if(this.tokens.matches2(a.name,a._function)){if(!this.tokens.matchesContextual(i._async))throw Error(`Expected async keyword in function export.`);this.tokens.copyToken(),this.tokens.copyToken()}if(this.tokens.matches1(a.star)&&this.tokens.copyToken(),!this.tokens.matches1(a.name))throw Error(`Expected identifier for exported function name.`);let e=this.tokens.identifierName();if(this.tokens.copyToken(),this.tokens.currentToken().isType)for(this.tokens.removeInitialToken();this.tokens.currentToken().isType;)this.tokens.removeToken();return this.tokens.copyExpectedToken(a.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(a.parenR),this.rootTransformer.processPossibleTypeRange(),this.tokens.copyExpectedToken(a.braceL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(a.braceR),e}processExportClass(){this.tokens.removeInitialToken(),this.copyDecorators(),this.tokens.matches1(a._abstract)&&this.tokens.removeToken();let e=this.rootTransformer.processNamedClass();this.tokens.appendCode(` exports.${e} = ${e};`)}processExportBindings(){this.tokens.removeInitialToken(),this.tokens.removeToken();let e=Qs(this.tokens),t=[];for(;;){if(this.tokens.matches1(a.braceR)){this.tokens.removeToken();break}let n=Ze(this.tokens);for(;this.tokens.currentIndex()<n.endIndex;)this.tokens.removeToken();if(!(n.isType||!e&&this.shouldElideExportedIdentifier(n.leftName))){let e=n.rightName;e==="default"?this.hadDefaultExport=!0:this.hadNamedExport=!0;let r=n.leftName,i=this.importProcessor.getIdentifierReplacement(r);t.push(`exports.${e} = ${i||r};`)}if(this.tokens.matches1(a.braceR)){this.tokens.removeToken();break}if(this.tokens.matches2(a.comma,a.braceR)){this.tokens.removeToken(),this.tokens.removeToken();break}else if(this.tokens.matches1(a.comma))this.tokens.removeToken();else throw Error(`Unexpected token: ${JSON.stringify(this.tokens.currentToken())}`)}if(this.tokens.matchesContextual(i._from)){this.tokens.removeToken();let e=this.tokens.stringValue();this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(e)),$s(this.tokens)}else this.tokens.appendCode(t.join(` `));this.tokens.matches1(a.semi)&&this.tokens.removeToken()}processExportStar(){for(this.tokens.removeInitialToken();!this.tokens.matches1(a.string);)this.tokens.removeToken();let e=this.tokens.stringValue();this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(e)),$s(this.tokens),this.tokens.matches1(a.semi)&&this.tokens.removeToken()}shouldElideExportedIdentifier(e){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&!this.declarationInfo.valueDeclarations.has(e)}},nc=class extends z{constructor(e,t,n,r,i,a,o,s){super(),this.tokens=e,this.nameManager=t,this.helperManager=n,this.reactHotLoaderTransformer=r,this.isTypeScriptTransformEnabled=i,this.isFlowTransformEnabled=a,this.keepUnusedImports=o,this.nonTypeIdentifiers=i&&!o?ut(e,s):new Set,this.declarationInfo=i&&!o?Zs(e):Xs,this.injectCreateRequireForImportRequire=!!s.injectCreateRequireForImportRequire}process(){if(this.tokens.matches3(a._import,a.name,a.eq))return this.processImportEquals();if(this.tokens.matches4(a._import,a.name,a.name,a.eq)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,i._type)){this.tokens.removeInitialToken();for(let e=0;e<7;e++)this.tokens.removeToken();return!0}if(this.tokens.matches2(a._export,a.eq))return this.tokens.replaceToken(`module.exports`),!0;if(this.tokens.matches5(a._export,a._import,a.name,a.name,a.eq)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,i._type)){this.tokens.removeInitialToken();for(let e=0;e<8;e++)this.tokens.removeToken();return!0}if(this.tokens.matches1(a._import))return this.processImport();if(this.tokens.matches2(a._export,a._default))return this.processExportDefault();if(this.tokens.matches2(a._export,a.braceL))return this.processNamedExports();if(this.tokens.matches2(a._export,a.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,i._type)){if(this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.matches1(a.braceL)){for(;!this.tokens.matches1(a.braceR);)this.tokens.removeToken();this.tokens.removeToken()}else this.tokens.removeToken(),this.tokens.matches1(a._as)&&(this.tokens.removeToken(),this.tokens.removeToken());return this.tokens.matchesContextual(i._from)&&this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,a.string)&&(this.tokens.removeToken(),this.tokens.removeToken(),$s(this.tokens)),!0}return!1}processImportEquals(){let e=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);return this.shouldAutomaticallyElideImportedName(e)?Ys(this.tokens):this.injectCreateRequireForImportRequire?(this.tokens.replaceToken(`const`),this.tokens.copyToken(),this.tokens.copyToken(),this.tokens.replaceToken(this.helperManager.getHelperName(`require`))):this.tokens.replaceToken(`const`),!0}processImport(){if(this.tokens.matches2(a._import,a.parenL))return!1;let e=this.tokens.snapshot();if(this.removeImportTypeBindings()){for(this.tokens.restoreToSnapshot(e);!this.tokens.matches1(a.string);)this.tokens.removeToken();this.tokens.removeToken(),$s(this.tokens),this.tokens.matches1(a.semi)&&this.tokens.removeToken()}return!0}removeImportTypeBindings(){if(this.tokens.copyExpectedToken(a._import),this.tokens.matchesContextual(i._type)&&!this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,a.comma)&&!this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,i._from))return!0;if(this.tokens.matches1(a.string))return this.tokens.copyToken(),!1;this.tokens.matchesContextual(i._module)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,i._from)&&this.tokens.copyToken();let e=!1,t=!1,n=!1;if(this.tokens.matches1(a.name)&&(this.shouldAutomaticallyElideImportedName(this.tokens.identifierName())?(this.tokens.removeToken(),this.tokens.matches1(a.comma)&&this.tokens.removeToken()):(e=!0,this.tokens.copyToken(),this.tokens.matches1(a.comma)&&(n=!0,this.tokens.removeToken()))),this.tokens.matches1(a.star))this.shouldAutomaticallyElideImportedName(this.tokens.identifierNameAtRelativeIndex(2))?(this.tokens.removeToken(),this.tokens.removeToken(),this.tokens.removeToken()):(n&&this.tokens.appendCode(`,`),e=!0,this.tokens.copyExpectedToken(a.star),this.tokens.copyExpectedToken(a.name),this.tokens.copyExpectedToken(a.name));else if(this.tokens.matches1(a.braceL)){for(n&&this.tokens.appendCode(`,`),this.tokens.copyToken();!this.tokens.matches1(a.braceR);){t=!0;let n=Ze(this.tokens);if(n.isType||this.shouldAutomaticallyElideImportedName(n.rightName)){for(;this.tokens.currentIndex()<n.endIndex;)this.tokens.removeToken();this.tokens.matches1(a.comma)&&this.tokens.removeToken()}else{for(e=!0;this.tokens.currentIndex()<n.endIndex;)this.tokens.copyToken();this.tokens.matches1(a.comma)&&this.tokens.copyToken()}}this.tokens.copyExpectedToken(a.braceR)}return this.keepUnusedImports?!1:this.isTypeScriptTransformEnabled?!e:this.isFlowTransformEnabled?t&&!e:!1}shouldAutomaticallyElideImportedName(e){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&!this.nonTypeIdentifiers.has(e)}processExportDefault(){if(ec(this.isTypeScriptTransformEnabled,this.keepUnusedImports,this.tokens,this.declarationInfo))return this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.removeToken(),!0;if(!(this.tokens.matches4(a._export,a._default,a._function,a.name)||this.tokens.matches5(a._export,a._default,a.name,a._function,a.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,i._async)||this.tokens.matches4(a._export,a._default,a._class,a.name)||this.tokens.matches5(a._export,a._default,a._abstract,a._class,a.name))&&this.reactHotLoaderTransformer){let e=this.nameManager.claimFreeName(`_default`);return this.tokens.replaceToken(`let ${e}; export`),this.tokens.copyToken(),this.tokens.appendCode(` ${e} =`),this.reactHotLoaderTransformer.setExtractedDefaultExportName(e),!0}return!1}processNamedExports(){if(!this.isTypeScriptTransformEnabled)return!1;this.tokens.copyExpectedToken(a._export),this.tokens.copyExpectedToken(a.braceL);let e=Qs(this.tokens),t=!1;for(;!this.tokens.matches1(a.braceR);){let n=Ze(this.tokens);if(n.isType||!e&&this.shouldElideExportedName(n.leftName)){for(;this.tokens.currentIndex()<n.endIndex;)this.tokens.removeToken();this.tokens.matches1(a.comma)&&this.tokens.removeToken()}else{for(t=!0;this.tokens.currentIndex()<n.endIndex;)this.tokens.copyToken();this.tokens.matches1(a.comma)&&this.tokens.copyToken()}}return this.tokens.copyExpectedToken(a.braceR),!this.keepUnusedImports&&e&&!t&&(this.tokens.removeToken(),this.tokens.removeToken(),$s(this.tokens)),!0}shouldElideExportedName(e){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&this.declarationInfo.typeDeclarations.has(e)&&!this.declarationInfo.valueDeclarations.has(e)}},rc=class extends z{constructor(e,t,n){super(),this.rootTransformer=e,this.tokens=t,this.isImportsTransformEnabled=n}process(){return this.rootTransformer.processPossibleArrowParamEnd()||this.rootTransformer.processPossibleAsyncArrowWithTypeParams()||this.rootTransformer.processPossibleTypeRange()?!0:this.tokens.matches1(a._enum)?(this.processEnum(),!0):this.tokens.matches2(a._export,a._enum)?(this.processNamedExportEnum(),!0):this.tokens.matches3(a._export,a._default,a._enum)?(this.processDefaultExportEnum(),!0):!1}processNamedExportEnum(){if(this.isImportsTransformEnabled){this.tokens.removeInitialToken();let e=this.tokens.identifierNameAtRelativeIndex(1);this.processEnum(),this.tokens.appendCode(` exports.${e} = ${e};`)}else this.tokens.copyToken(),this.processEnum()}processDefaultExportEnum(){this.tokens.removeInitialToken(),this.tokens.removeToken();let e=this.tokens.identifierNameAtRelativeIndex(1);this.processEnum(),this.isImportsTransformEnabled?this.tokens.appendCode(` exports.default = ${e};`):this.tokens.appendCode(` export default ${e};`)}processEnum(){this.tokens.replaceToken(`const`),this.tokens.copyExpectedToken(a.name);let e=!1;this.tokens.matchesContextual(i._of)&&(this.tokens.removeToken(),e=this.tokens.matchesContextual(i._symbol),this.tokens.removeToken());let t=this.tokens.matches3(a.braceL,a.name,a.eq);this.tokens.appendCode(` = require("flow-enums-runtime")`);let n=!e&&!t;for(this.tokens.replaceTokenTrimmingLeftWhitespace(n?`.Mirrored([`:`({`);!this.tokens.matches1(a.braceR);){if(this.tokens.matches1(a.ellipsis)){this.tokens.removeToken();break}this.processEnumElement(e,t),this.tokens.matches1(a.comma)&&this.tokens.copyToken()}this.tokens.replaceToken(n?`]);`:`});`)}processEnumElement(e,t){if(e){let e=this.tokens.identifierName();this.tokens.copyToken(),this.tokens.appendCode(`: Symbol("${e}")`)}else t?(this.tokens.copyToken(),this.tokens.replaceTokenTrimmingLeftWhitespace(`:`),this.tokens.copyToken()):this.tokens.replaceToken(`"${this.tokens.identifierName()}"`)}};function ic(e){let t,n=e[0],r=1;for(;r<e.length;){let i=e[r],a=e[r+1];if(r+=2,(i===`optionalAccess`||i===`optionalCall`)&&n==null)return;i===`access`||i===`optionalAccess`?(t=n,n=a(n)):(i===`call`||i===`optionalCall`)&&(n=a((...e)=>n.call(t,...e)),t=void 0)}return n}var ac=`jest`,oc=[`mock`,`unmock`,`enableAutomock`,`disableAutomock`],sc=class e extends z{__init(){this.hoistedFunctionNames=[]}constructor(t,n,r,i){super(),this.rootTransformer=t,this.tokens=n,this.nameManager=r,this.importProcessor=i,e.prototype.__init.call(this)}process(){return this.tokens.currentToken().scopeDepth===0&&this.tokens.matches4(a.name,a.dot,a.name,a.parenL)&&this.tokens.identifierName()===ac?ic([this,`access`,e=>e.importProcessor,`optionalAccess`,e=>e.getGlobalNames,`call`,e=>e(),`optionalAccess`,e=>e.has,`call`,e=>e(ac)])?!1:this.extractHoistedCalls():!1}getHoistedCode(){return this.hoistedFunctionNames.length>0?this.hoistedFunctionNames.map(e=>`${e}();`).join(``):``}extractHoistedCalls(){this.tokens.removeToken();let e=!1;for(;this.tokens.matches3(a.dot,a.name,a.parenL);){let t=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);if(oc.includes(t)){let t=this.nameManager.claimFreeName(`__jestHoist`);this.hoistedFunctionNames.push(t),this.tokens.replaceToken(`function ${t}(){${ac}.`),this.tokens.copyToken(),this.tokens.copyToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(a.parenR),this.tokens.appendCode(`;}`),e=!1}else e?this.tokens.copyToken():this.tokens.replaceToken(`${ac}.`),this.tokens.copyToken(),this.tokens.copyToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(a.parenR),e=!0}return!0}},cc=class extends z{constructor(e){super(),this.tokens=e}process(){if(this.tokens.matches1(a.num)){let e=this.tokens.currentTokenCode();if(e.includes(`_`))return this.tokens.replaceToken(e.replace(/_/g,``)),!0}return!1}},lc=class extends z{constructor(e,t){super(),this.tokens=e,this.nameManager=t}process(){return this.tokens.matches2(a._catch,a.braceL)?(this.tokens.copyToken(),this.tokens.appendCode(` (${this.nameManager.claimFreeName(`e`)})`),!0):!1}},uc=class extends z{constructor(e,t){super(),this.tokens=e,this.nameManager=t}process(){if(this.tokens.matches1(a.nullishCoalescing)){let e=this.tokens.currentToken();return this.tokens.tokens[e.nullishStartIndex].isAsyncOperation?this.tokens.replaceTokenTrimmingLeftWhitespace(`, async () => (`):this.tokens.replaceTokenTrimmingLeftWhitespace(`, () => (`),!0}if(this.tokens.matches1(a._delete)&&this.tokens.tokenAtRelativeIndex(1).isOptionalChainStart)return this.tokens.removeInitialToken(),!0;let e=this.tokens.currentToken().subscriptStartIndex;if(e!=null&&this.tokens.tokens[e].isOptionalChainStart&&this.tokens.tokenAtRelativeIndex(-1).type!==a._super){let t=this.nameManager.claimFreeName(`_`),n;if(n=e>0&&this.tokens.matches1AtIndex(e-1,a._delete)&&this.isLastSubscriptInChain()?`${t} => delete ${t}`:`${t} => ${t}`,this.tokens.tokens[e].isAsyncOperation&&(n=`async ${n}`),this.tokens.matches2(a.questionDot,a.parenL)||this.tokens.matches2(a.questionDot,a.lessThan))this.justSkippedSuper()&&this.tokens.appendCode(`.bind(this)`),this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalCall', ${n}`);else if(this.tokens.matches2(a.questionDot,a.bracketL))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${n}`);else if(this.tokens.matches1(a.questionDot))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${n}.`);else if(this.tokens.matches1(a.dot))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${n}.`);else if(this.tokens.matches1(a.bracketL))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${n}[`);else if(this.tokens.matches1(a.parenL))this.justSkippedSuper()&&this.tokens.appendCode(`.bind(this)`),this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'call', ${n}(`);else throw Error(`Unexpected subscript operator in optional chain.`);return!0}return!1}isLastSubscriptInChain(){let e=0;for(let t=this.tokens.currentIndex()+1;;t++){if(t>=this.tokens.tokens.length)throw Error(`Reached the end of the code while finding the end of the access chain.`);if(this.tokens.tokens[t].isOptionalChainStart?e++:this.tokens.tokens[t].isOptionalChainEnd&&e--,e<0)return!0;if(e===0&&this.tokens.tokens[t].subscriptStartIndex!=null)return!1}}justSkippedSuper(){let e=0,t=this.tokens.currentIndex()-1;for(;;){if(t<0)throw Error(`Reached the start of the code while finding the start of the access chain.`);if(this.tokens.tokens[t].isOptionalChainStart?e--:this.tokens.tokens[t].isOptionalChainEnd&&e++,e<0)return!1;if(e===0&&this.tokens.tokens[t].subscriptStartIndex!=null)return this.tokens.tokens[t-1].type===a._super;t--}}},dc=class extends z{constructor(e,t,n,r){super(),this.rootTransformer=e,this.tokens=t,this.importProcessor=n,this.options=r}process(){let e=this.tokens.currentIndex();if(this.tokens.identifierName()===`createReactClass`){let t=this.importProcessor&&this.importProcessor.getIdentifierReplacement(`createReactClass`);return t?this.tokens.replaceToken(`(0, ${t})`):this.tokens.copyToken(),this.tryProcessCreateClassCall(e),!0}if(this.tokens.matches3(a.name,a.dot,a.name)&&this.tokens.identifierName()===`React`&&this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+2)===`createClass`){let t=this.importProcessor&&this.importProcessor.getIdentifierReplacement(`React`)||`React`;return t?(this.tokens.replaceToken(t),this.tokens.copyToken(),this.tokens.copyToken()):(this.tokens.copyToken(),this.tokens.copyToken(),this.tokens.copyToken()),this.tryProcessCreateClassCall(e),!0}return!1}tryProcessCreateClassCall(e){let t=this.findDisplayName(e);t&&this.classNeedsDisplayName()&&(this.tokens.copyExpectedToken(a.parenL),this.tokens.copyExpectedToken(a.braceL),this.tokens.appendCode(`displayName: '${t}',`),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(a.braceR),this.tokens.copyExpectedToken(a.parenR))}findDisplayName(e){return e<2?null:this.tokens.matches2AtIndex(e-2,a.name,a.eq)||e>=2&&this.tokens.tokens[e-2].identifierRole===O.ObjectKey?this.tokens.identifierNameAtIndex(e-2):this.tokens.matches2AtIndex(e-2,a._export,a._default)?this.getDisplayNameFromFilename():null}getDisplayNameFromFilename(){let e=(this.options.filePath||`unknown`).split(`/`),t=e[e.length-1],n=t.lastIndexOf(`.`),r=n===-1?t:t.slice(0,n);return r===`index`&&e[e.length-2]?e[e.length-2]:r}classNeedsDisplayName(){let e=this.tokens.currentIndex();if(!this.tokens.matches2(a.parenL,a.braceL))return!1;let t=e+1,n=this.tokens.tokens[t].contextId;if(n==null)throw Error(`Expected non-null context ID on object open-brace.`);for(;e<this.tokens.tokens.length;e++){let t=this.tokens.tokens[e];if(t.type===a.braceR&&t.contextId===n){e++;break}if(this.tokens.identifierNameAtIndex(e)===`displayName`&&this.tokens.tokens[e].identifierRole===O.ObjectKey&&t.contextId===n)return!1}if(e===this.tokens.tokens.length)throw Error(`Unexpected end of input when processing React class.`);return this.tokens.matches1AtIndex(e,a.parenR)||this.tokens.matches2AtIndex(e,a.comma,a.parenR)}},fc=class e extends z{__init(){this.extractedDefaultExportName=null}constructor(t,n){super(),this.tokens=t,this.filePath=n,e.prototype.__init.call(this)}setExtractedDefaultExportName(e){this.extractedDefaultExportName=e}getPrefixCode(){return`
118
+ `:``}process(){return this.tokens.matches3(a._import,a.name,a.eq)?this.processImportEquals():this.tokens.matches1(a._import)?(this.processImport(),!0):this.tokens.matches2(a._export,a.eq)?(this.tokens.replaceToken(`module.exports`),!0):this.tokens.matches1(a._export)&&!this.tokens.currentToken().isType?(this.hadExport=!0,this.processExport()):this.tokens.matches2(a.name,a.postIncDec)&&this.processPostIncDec()?!0:this.tokens.matches1(a.name)||this.tokens.matches1(a.jsxName)?this.processIdentifier():this.tokens.matches1(a.eq)?this.processAssignment():this.tokens.matches1(a.assign)?this.processComplexAssignment():this.tokens.matches1(a.preIncDec)?this.processPreIncDec():!1}processImportEquals(){let e=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);return this.importProcessor.shouldAutomaticallyElideImportedName(e)?Ys(this.tokens):this.tokens.replaceToken(`const`),!0}processImport(){if(this.tokens.matches2(a._import,a.parenL)){if(this.preserveDynamicImport){this.tokens.copyToken();return}let e=this.enableLegacyTypeScriptModuleInterop?``:`${this.helperManager.getHelperName(`interopRequireWildcard`)}(`;this.tokens.replaceToken(`Promise.resolve().then(() => ${e}require`);let t=this.tokens.currentToken().contextId;if(t==null)throw Error(`Expected context ID on dynamic import invocation.`);for(this.tokens.copyToken();!this.tokens.matchesContextIdAndLabel(a.parenR,t);)this.rootTransformer.processToken();this.tokens.replaceToken(e?`)))`:`))`);return}if(this.removeImportAndDetectIfShouldElide())this.tokens.removeToken();else{let e=this.tokens.stringValue();this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(e)),this.tokens.appendCode(this.importProcessor.claimImportCode(e))}$s(this.tokens),this.tokens.matches1(a.semi)&&this.tokens.removeToken()}removeImportAndDetectIfShouldElide(){if(this.tokens.removeInitialToken(),this.tokens.matchesContextual(i._type)&&!this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,a.comma)&&!this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,i._from))return this.removeRemainingImport(),!0;if(this.tokens.matches1(a.name)||this.tokens.matches1(a.star))return this.removeRemainingImport(),!1;if(this.tokens.matches1(a.string))return!1;let e=!1,t=!1;for(;!this.tokens.matches1(a.string);)(!e&&this.tokens.matches1(a.braceL)||this.tokens.matches1(a.comma))&&(this.tokens.removeToken(),this.tokens.matches1(a.braceR)||(t=!0),(this.tokens.matches2(a.name,a.comma)||this.tokens.matches2(a.name,a.braceR)||this.tokens.matches4(a.name,a.name,a.name,a.comma)||this.tokens.matches4(a.name,a.name,a.name,a.braceR))&&(e=!0)),this.tokens.removeToken();return this.keepUnusedImports?!1:this.isTypeScriptTransformEnabled?!e:this.isFlowTransformEnabled?t&&!e:!1}removeRemainingImport(){for(;!this.tokens.matches1(a.string);)this.tokens.removeToken()}processIdentifier(){let e=this.tokens.currentToken();if(e.shadowsGlobal)return!1;if(e.identifierRole===O.ObjectShorthand)return this.processObjectShorthand();if(e.identifierRole!==O.Access)return!1;let t=this.importProcessor.getIdentifierReplacement(this.tokens.identifierNameForToken(e));if(!t)return!1;let n=this.tokens.currentIndex()+1;for(;n<this.tokens.tokens.length&&this.tokens.tokens[n].type===a.parenR;)n++;return this.tokens.tokens[n].type===a.parenL?this.tokens.tokenAtRelativeIndex(1).type===a.parenL&&this.tokens.tokenAtRelativeIndex(-1).type!==a._new?(this.tokens.replaceToken(`${t}.call(void 0, `),this.tokens.removeToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(a.parenR)):this.tokens.replaceToken(`(0, ${t})`):this.tokens.replaceToken(t),!0}processObjectShorthand(){let e=this.tokens.identifierName(),t=this.importProcessor.getIdentifierReplacement(e);return t?(this.tokens.replaceToken(`${e}: ${t}`),!0):!1}processExport(){if(this.tokens.matches2(a._export,a._enum)||this.tokens.matches3(a._export,a._const,a._enum))return this.hadNamedExport=!0,!1;if(this.tokens.matches2(a._export,a._default))return this.tokens.matches3(a._export,a._default,a._enum)?(this.hadDefaultExport=!0,!1):(this.processExportDefault(),!0);if(this.tokens.matches2(a._export,a.braceL))return this.processExportBindings(),!0;if(this.tokens.matches2(a._export,a.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,i._type)){if(this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.matches1(a.braceL)){for(;!this.tokens.matches1(a.braceR);)this.tokens.removeToken();this.tokens.removeToken()}else this.tokens.removeToken(),this.tokens.matches1(a._as)&&(this.tokens.removeToken(),this.tokens.removeToken());return this.tokens.matchesContextual(i._from)&&this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,a.string)&&(this.tokens.removeToken(),this.tokens.removeToken(),$s(this.tokens)),!0}if(this.hadNamedExport=!0,this.tokens.matches2(a._export,a._var)||this.tokens.matches2(a._export,a._let)||this.tokens.matches2(a._export,a._const))return this.processExportVar(),!0;if(this.tokens.matches2(a._export,a._function)||this.tokens.matches3(a._export,a.name,a._function))return this.processExportFunction(),!0;if(this.tokens.matches2(a._export,a._class)||this.tokens.matches3(a._export,a._abstract,a._class)||this.tokens.matches2(a._export,a.at))return this.processExportClass(),!0;if(this.tokens.matches2(a._export,a.star))return this.processExportStar(),!0;throw Error(`Unrecognized export syntax.`)}processAssignment(){let e=this.tokens.currentIndex(),t=this.tokens.tokens[e-1];if(t.isType||t.type!==a.name||t.shadowsGlobal||e>=2&&this.tokens.matches1AtIndex(e-2,a.dot)||e>=2&&[a._var,a._let,a._const].includes(this.tokens.tokens[e-2].type))return!1;let n=this.importProcessor.resolveExportBinding(this.tokens.identifierNameForToken(t));return n?(this.tokens.copyToken(),this.tokens.appendCode(` ${n} =`),!0):!1}processComplexAssignment(){let e=this.tokens.currentIndex(),t=this.tokens.tokens[e-1];if(t.type!==a.name||t.shadowsGlobal||e>=2&&this.tokens.matches1AtIndex(e-2,a.dot))return!1;let n=this.importProcessor.resolveExportBinding(this.tokens.identifierNameForToken(t));return n?(this.tokens.appendCode(` = ${n}`),this.tokens.copyToken(),!0):!1}processPreIncDec(){let e=this.tokens.currentIndex(),t=this.tokens.tokens[e+1];if(t.type!==a.name||t.shadowsGlobal||e+2<this.tokens.tokens.length&&(this.tokens.matches1AtIndex(e+2,a.dot)||this.tokens.matches1AtIndex(e+2,a.bracketL)||this.tokens.matches1AtIndex(e+2,a.parenL)))return!1;let n=this.tokens.identifierNameForToken(t),r=this.importProcessor.resolveExportBinding(n);return r?(this.tokens.appendCode(`${r} = `),this.tokens.copyToken(),!0):!1}processPostIncDec(){let e=this.tokens.currentIndex(),t=this.tokens.tokens[e],n=this.tokens.tokens[e+1];if(t.type!==a.name||t.shadowsGlobal||e>=1&&this.tokens.matches1AtIndex(e-1,a.dot))return!1;let r=this.tokens.identifierNameForToken(t),i=this.importProcessor.resolveExportBinding(r);if(!i)return!1;let o=this.tokens.rawCodeForToken(n),s=this.importProcessor.getIdentifierReplacement(r)||r;if(o===`++`)this.tokens.replaceToken(`(${s} = ${i} = ${s} + 1, ${s} - 1)`);else if(o===`--`)this.tokens.replaceToken(`(${s} = ${i} = ${s} - 1, ${s} + 1)`);else throw Error(`Unexpected operator: ${o}`);return this.tokens.removeToken(),!0}processExportDefault(){let e=!0;if(this.tokens.matches4(a._export,a._default,a._function,a.name)||this.tokens.matches5(a._export,a._default,a.name,a._function,a.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,i._async)){this.tokens.removeInitialToken(),this.tokens.removeToken();let e=this.processNamedFunction();this.tokens.appendCode(` exports.default = ${e};`)}else if(this.tokens.matches4(a._export,a._default,a._class,a.name)||this.tokens.matches5(a._export,a._default,a._abstract,a._class,a.name)||this.tokens.matches3(a._export,a._default,a.at)){this.tokens.removeInitialToken(),this.tokens.removeToken(),this.copyDecorators(),this.tokens.matches1(a._abstract)&&this.tokens.removeToken();let e=this.rootTransformer.processNamedClass();this.tokens.appendCode(` exports.default = ${e};`)}else if(ec(this.isTypeScriptTransformEnabled,this.keepUnusedImports,this.tokens,this.declarationInfo))e=!1,this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.removeToken();else if(this.reactHotLoaderTransformer){let e=this.nameManager.claimFreeName(`_default`);this.tokens.replaceToken(`let ${e}; exports.`),this.tokens.copyToken(),this.tokens.appendCode(` = ${e} =`),this.reactHotLoaderTransformer.setExtractedDefaultExportName(e)}else this.tokens.replaceToken(`exports.`),this.tokens.copyToken(),this.tokens.appendCode(` =`);e&&(this.hadDefaultExport=!0)}copyDecorators(){for(;this.tokens.matches1(a.at);)if(this.tokens.copyToken(),this.tokens.matches1(a.parenL))this.tokens.copyExpectedToken(a.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(a.parenR);else{for(this.tokens.copyExpectedToken(a.name);this.tokens.matches1(a.dot);)this.tokens.copyExpectedToken(a.dot),this.tokens.copyExpectedToken(a.name);this.tokens.matches1(a.parenL)&&(this.tokens.copyExpectedToken(a.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(a.parenR))}}processExportVar(){this.isSimpleExportVar()?this.processSimpleExportVar():this.processComplexExportVar()}isSimpleExportVar(){let e=this.tokens.currentIndex();if(e++,e++,!this.tokens.matches1AtIndex(e,a.name))return!1;for(e++;e<this.tokens.tokens.length&&this.tokens.tokens[e].isType;)e++;return!!this.tokens.matches1AtIndex(e,a.eq)}processSimpleExportVar(){this.tokens.removeInitialToken(),this.tokens.copyToken();let e=this.tokens.identifierName();for(;!this.tokens.matches1(a.eq);)this.rootTransformer.processToken();let t=this.tokens.currentToken().rhsEndIndex;if(t==null)throw Error(`Expected = token with an end index.`);for(;this.tokens.currentIndex()<t;)this.rootTransformer.processToken();this.tokens.appendCode(`; exports.${e} = ${e}`)}processComplexExportVar(){this.tokens.removeInitialToken(),this.tokens.removeToken();let e=this.tokens.matches1(a.braceL);e&&this.tokens.appendCode(`(`);let t=0;for(;;)if(this.tokens.matches1(a.braceL)||this.tokens.matches1(a.dollarBraceL)||this.tokens.matches1(a.bracketL))t++,this.tokens.copyToken();else if(this.tokens.matches1(a.braceR)||this.tokens.matches1(a.bracketR))t--,this.tokens.copyToken();else if(t===0&&!this.tokens.matches1(a.name)&&!this.tokens.currentToken().isType)break;else if(this.tokens.matches1(a.eq)){let e=this.tokens.currentToken().rhsEndIndex;if(e==null)throw Error(`Expected = token with an end index.`);for(;this.tokens.currentIndex()<e;)this.rootTransformer.processToken()}else{let e=this.tokens.currentToken();if(pe(e)){let t=this.tokens.identifierName(),n=this.importProcessor.getIdentifierReplacement(t);if(n===null)throw Error(`Expected a replacement for ${t} in \`export var\` syntax.`);ve(e)&&(n=`${t}: ${n}`),this.tokens.replaceToken(n)}else this.rootTransformer.processToken()}if(e){let e=this.tokens.currentToken().rhsEndIndex;if(e==null)throw Error(`Expected = token with an end index.`);for(;this.tokens.currentIndex()<e;)this.rootTransformer.processToken();this.tokens.appendCode(`)`)}}processExportFunction(){this.tokens.replaceToken(``);let e=this.processNamedFunction();this.tokens.appendCode(` exports.${e} = ${e};`)}processNamedFunction(){if(this.tokens.matches1(a._function))this.tokens.copyToken();else if(this.tokens.matches2(a.name,a._function)){if(!this.tokens.matchesContextual(i._async))throw Error(`Expected async keyword in function export.`);this.tokens.copyToken(),this.tokens.copyToken()}if(this.tokens.matches1(a.star)&&this.tokens.copyToken(),!this.tokens.matches1(a.name))throw Error(`Expected identifier for exported function name.`);let e=this.tokens.identifierName();if(this.tokens.copyToken(),this.tokens.currentToken().isType)for(this.tokens.removeInitialToken();this.tokens.currentToken().isType;)this.tokens.removeToken();return this.tokens.copyExpectedToken(a.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(a.parenR),this.rootTransformer.processPossibleTypeRange(),this.tokens.copyExpectedToken(a.braceL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(a.braceR),e}processExportClass(){this.tokens.removeInitialToken(),this.copyDecorators(),this.tokens.matches1(a._abstract)&&this.tokens.removeToken();let e=this.rootTransformer.processNamedClass();this.tokens.appendCode(` exports.${e} = ${e};`)}processExportBindings(){this.tokens.removeInitialToken(),this.tokens.removeToken();let e=Qs(this.tokens),t=[];for(;;){if(this.tokens.matches1(a.braceR)){this.tokens.removeToken();break}let n=Ze(this.tokens);for(;this.tokens.currentIndex()<n.endIndex;)this.tokens.removeToken();if(!(n.isType||!e&&this.shouldElideExportedIdentifier(n.leftName))){let e=n.rightName;e==="default"?this.hadDefaultExport=!0:this.hadNamedExport=!0;let r=n.leftName,i=this.importProcessor.getIdentifierReplacement(r);t.push(`exports.${e} = ${i||r};`)}if(this.tokens.matches1(a.braceR)){this.tokens.removeToken();break}if(this.tokens.matches2(a.comma,a.braceR)){this.tokens.removeToken(),this.tokens.removeToken();break}else if(this.tokens.matches1(a.comma))this.tokens.removeToken();else throw Error(`Unexpected token: ${JSON.stringify(this.tokens.currentToken())}`)}if(this.tokens.matchesContextual(i._from)){this.tokens.removeToken();let e=this.tokens.stringValue();this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(e)),$s(this.tokens)}else this.tokens.appendCode(t.join(` `));this.tokens.matches1(a.semi)&&this.tokens.removeToken()}processExportStar(){for(this.tokens.removeInitialToken();!this.tokens.matches1(a.string);)this.tokens.removeToken();let e=this.tokens.stringValue();this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(e)),$s(this.tokens),this.tokens.matches1(a.semi)&&this.tokens.removeToken()}shouldElideExportedIdentifier(e){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&!this.declarationInfo.valueDeclarations.has(e)}},nc=class extends z{constructor(e,t,n,r,i,a,o,s){super(),this.tokens=e,this.nameManager=t,this.helperManager=n,this.reactHotLoaderTransformer=r,this.isTypeScriptTransformEnabled=i,this.isFlowTransformEnabled=a,this.keepUnusedImports=o,this.nonTypeIdentifiers=i&&!o?ut(e,s):new Set,this.declarationInfo=i&&!o?Zs(e):Xs,this.injectCreateRequireForImportRequire=!!s.injectCreateRequireForImportRequire}process(){if(this.tokens.matches3(a._import,a.name,a.eq))return this.processImportEquals();if(this.tokens.matches4(a._import,a.name,a.name,a.eq)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,i._type)){this.tokens.removeInitialToken();for(let e=0;e<7;e++)this.tokens.removeToken();return!0}if(this.tokens.matches2(a._export,a.eq))return this.tokens.replaceToken(`module.exports`),!0;if(this.tokens.matches5(a._export,a._import,a.name,a.name,a.eq)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,i._type)){this.tokens.removeInitialToken();for(let e=0;e<8;e++)this.tokens.removeToken();return!0}if(this.tokens.matches1(a._import))return this.processImport();if(this.tokens.matches2(a._export,a._default))return this.processExportDefault();if(this.tokens.matches2(a._export,a.braceL))return this.processNamedExports();if(this.tokens.matches2(a._export,a.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,i._type)){if(this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.matches1(a.braceL)){for(;!this.tokens.matches1(a.braceR);)this.tokens.removeToken();this.tokens.removeToken()}else this.tokens.removeToken(),this.tokens.matches1(a._as)&&(this.tokens.removeToken(),this.tokens.removeToken());return this.tokens.matchesContextual(i._from)&&this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,a.string)&&(this.tokens.removeToken(),this.tokens.removeToken(),$s(this.tokens)),!0}return!1}processImportEquals(){let e=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);return this.shouldAutomaticallyElideImportedName(e)?Ys(this.tokens):this.injectCreateRequireForImportRequire?(this.tokens.replaceToken(`const`),this.tokens.copyToken(),this.tokens.copyToken(),this.tokens.replaceToken(this.helperManager.getHelperName(`require`))):this.tokens.replaceToken(`const`),!0}processImport(){if(this.tokens.matches2(a._import,a.parenL))return!1;let e=this.tokens.snapshot();if(this.removeImportTypeBindings()){for(this.tokens.restoreToSnapshot(e);!this.tokens.matches1(a.string);)this.tokens.removeToken();this.tokens.removeToken(),$s(this.tokens),this.tokens.matches1(a.semi)&&this.tokens.removeToken()}return!0}removeImportTypeBindings(){if(this.tokens.copyExpectedToken(a._import),this.tokens.matchesContextual(i._type)&&!this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,a.comma)&&!this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,i._from))return!0;if(this.tokens.matches1(a.string))return this.tokens.copyToken(),!1;this.tokens.matchesContextual(i._module)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,i._from)&&this.tokens.copyToken();let e=!1,t=!1,n=!1;if(this.tokens.matches1(a.name)&&(this.shouldAutomaticallyElideImportedName(this.tokens.identifierName())?(this.tokens.removeToken(),this.tokens.matches1(a.comma)&&this.tokens.removeToken()):(e=!0,this.tokens.copyToken(),this.tokens.matches1(a.comma)&&(n=!0,this.tokens.removeToken()))),this.tokens.matches1(a.star))this.shouldAutomaticallyElideImportedName(this.tokens.identifierNameAtRelativeIndex(2))?(this.tokens.removeToken(),this.tokens.removeToken(),this.tokens.removeToken()):(n&&this.tokens.appendCode(`,`),e=!0,this.tokens.copyExpectedToken(a.star),this.tokens.copyExpectedToken(a.name),this.tokens.copyExpectedToken(a.name));else if(this.tokens.matches1(a.braceL)){for(n&&this.tokens.appendCode(`,`),this.tokens.copyToken();!this.tokens.matches1(a.braceR);){t=!0;let n=Ze(this.tokens);if(n.isType||this.shouldAutomaticallyElideImportedName(n.rightName)){for(;this.tokens.currentIndex()<n.endIndex;)this.tokens.removeToken();this.tokens.matches1(a.comma)&&this.tokens.removeToken()}else{for(e=!0;this.tokens.currentIndex()<n.endIndex;)this.tokens.copyToken();this.tokens.matches1(a.comma)&&this.tokens.copyToken()}}this.tokens.copyExpectedToken(a.braceR)}return this.keepUnusedImports?!1:this.isTypeScriptTransformEnabled?!e:this.isFlowTransformEnabled?t&&!e:!1}shouldAutomaticallyElideImportedName(e){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&!this.nonTypeIdentifiers.has(e)}processExportDefault(){if(ec(this.isTypeScriptTransformEnabled,this.keepUnusedImports,this.tokens,this.declarationInfo))return this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.removeToken(),!0;if(!(this.tokens.matches4(a._export,a._default,a._function,a.name)||this.tokens.matches5(a._export,a._default,a.name,a._function,a.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,i._async)||this.tokens.matches4(a._export,a._default,a._class,a.name)||this.tokens.matches5(a._export,a._default,a._abstract,a._class,a.name))&&this.reactHotLoaderTransformer){let e=this.nameManager.claimFreeName(`_default`);return this.tokens.replaceToken(`let ${e}; export`),this.tokens.copyToken(),this.tokens.appendCode(` ${e} =`),this.reactHotLoaderTransformer.setExtractedDefaultExportName(e),!0}return!1}processNamedExports(){if(!this.isTypeScriptTransformEnabled)return!1;this.tokens.copyExpectedToken(a._export),this.tokens.copyExpectedToken(a.braceL);let e=Qs(this.tokens),t=!1;for(;!this.tokens.matches1(a.braceR);){let n=Ze(this.tokens);if(n.isType||!e&&this.shouldElideExportedName(n.leftName)){for(;this.tokens.currentIndex()<n.endIndex;)this.tokens.removeToken();this.tokens.matches1(a.comma)&&this.tokens.removeToken()}else{for(t=!0;this.tokens.currentIndex()<n.endIndex;)this.tokens.copyToken();this.tokens.matches1(a.comma)&&this.tokens.copyToken()}}return this.tokens.copyExpectedToken(a.braceR),!this.keepUnusedImports&&e&&!t&&(this.tokens.removeToken(),this.tokens.removeToken(),$s(this.tokens)),!0}shouldElideExportedName(e){return this.isTypeScriptTransformEnabled&&!this.keepUnusedImports&&this.declarationInfo.typeDeclarations.has(e)&&!this.declarationInfo.valueDeclarations.has(e)}},rc=class extends z{constructor(e,t,n){super(),this.rootTransformer=e,this.tokens=t,this.isImportsTransformEnabled=n}process(){return this.rootTransformer.processPossibleArrowParamEnd()||this.rootTransformer.processPossibleAsyncArrowWithTypeParams()||this.rootTransformer.processPossibleTypeRange()?!0:this.tokens.matches1(a._enum)?(this.processEnum(),!0):this.tokens.matches2(a._export,a._enum)?(this.processNamedExportEnum(),!0):this.tokens.matches3(a._export,a._default,a._enum)?(this.processDefaultExportEnum(),!0):!1}processNamedExportEnum(){if(this.isImportsTransformEnabled){this.tokens.removeInitialToken();let e=this.tokens.identifierNameAtRelativeIndex(1);this.processEnum(),this.tokens.appendCode(` exports.${e} = ${e};`)}else this.tokens.copyToken(),this.processEnum()}processDefaultExportEnum(){this.tokens.removeInitialToken(),this.tokens.removeToken();let e=this.tokens.identifierNameAtRelativeIndex(1);this.processEnum(),this.isImportsTransformEnabled?this.tokens.appendCode(` exports.default = ${e};`):this.tokens.appendCode(` export default ${e};`)}processEnum(){this.tokens.replaceToken(`const`),this.tokens.copyExpectedToken(a.name);let e=!1;this.tokens.matchesContextual(i._of)&&(this.tokens.removeToken(),e=this.tokens.matchesContextual(i._symbol),this.tokens.removeToken());let t=this.tokens.matches3(a.braceL,a.name,a.eq);this.tokens.appendCode(` = require("flow-enums-runtime")`);let n=!e&&!t;for(this.tokens.replaceTokenTrimmingLeftWhitespace(n?`.Mirrored([`:`({`);!this.tokens.matches1(a.braceR);){if(this.tokens.matches1(a.ellipsis)){this.tokens.removeToken();break}this.processEnumElement(e,t),this.tokens.matches1(a.comma)&&this.tokens.copyToken()}this.tokens.replaceToken(n?`]);`:`});`)}processEnumElement(e,t){if(e){let e=this.tokens.identifierName();this.tokens.copyToken(),this.tokens.appendCode(`: Symbol("${e}")`)}else t?(this.tokens.copyToken(),this.tokens.replaceTokenTrimmingLeftWhitespace(`:`),this.tokens.copyToken()):this.tokens.replaceToken(`"${this.tokens.identifierName()}"`)}};function ic(e){let t,n=e[0],r=1;for(;r<e.length;){let i=e[r],a=e[r+1];if(r+=2,(i===`optionalAccess`||i===`optionalCall`)&&n==null)return;i===`access`||i===`optionalAccess`?(t=n,n=a(n)):(i===`call`||i===`optionalCall`)&&(n=a((...e)=>n.call(t,...e)),t=void 0)}return n}var ac=`jest`,oc=[`mock`,`unmock`,`enableAutomock`,`disableAutomock`],sc=class e extends z{__init(){this.hoistedFunctionNames=[]}constructor(t,n,r,i){super(),this.rootTransformer=t,this.tokens=n,this.nameManager=r,this.importProcessor=i,e.prototype.__init.call(this)}process(){return this.tokens.currentToken().scopeDepth===0&&this.tokens.matches4(a.name,a.dot,a.name,a.parenL)&&this.tokens.identifierName()===ac?!ic([this,`access`,e=>e.importProcessor,`optionalAccess`,e=>e.getGlobalNames,`call`,e=>e(),`optionalAccess`,e=>e.has,`call`,e=>e(ac)])&&this.extractHoistedCalls():!1}getHoistedCode(){return this.hoistedFunctionNames.length>0?this.hoistedFunctionNames.map(e=>`${e}();`).join(``):``}extractHoistedCalls(){this.tokens.removeToken();let e=!1;for(;this.tokens.matches3(a.dot,a.name,a.parenL);){let t=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);if(oc.includes(t)){let t=this.nameManager.claimFreeName(`__jestHoist`);this.hoistedFunctionNames.push(t),this.tokens.replaceToken(`function ${t}(){${ac}.`),this.tokens.copyToken(),this.tokens.copyToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(a.parenR),this.tokens.appendCode(`;}`),e=!1}else e?this.tokens.copyToken():this.tokens.replaceToken(`${ac}.`),this.tokens.copyToken(),this.tokens.copyToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(a.parenR),e=!0}return!0}},cc=class extends z{constructor(e){super(),this.tokens=e}process(){if(this.tokens.matches1(a.num)){let e=this.tokens.currentTokenCode();if(e.includes(`_`))return this.tokens.replaceToken(e.replace(/_/g,``)),!0}return!1}},lc=class extends z{constructor(e,t){super(),this.tokens=e,this.nameManager=t}process(){return this.tokens.matches2(a._catch,a.braceL)?(this.tokens.copyToken(),this.tokens.appendCode(` (${this.nameManager.claimFreeName(`e`)})`),!0):!1}},uc=class extends z{constructor(e,t){super(),this.tokens=e,this.nameManager=t}process(){if(this.tokens.matches1(a.nullishCoalescing)){let e=this.tokens.currentToken();return this.tokens.tokens[e.nullishStartIndex].isAsyncOperation?this.tokens.replaceTokenTrimmingLeftWhitespace(`, async () => (`):this.tokens.replaceTokenTrimmingLeftWhitespace(`, () => (`),!0}if(this.tokens.matches1(a._delete)&&this.tokens.tokenAtRelativeIndex(1).isOptionalChainStart)return this.tokens.removeInitialToken(),!0;let e=this.tokens.currentToken().subscriptStartIndex;if(e!=null&&this.tokens.tokens[e].isOptionalChainStart&&this.tokens.tokenAtRelativeIndex(-1).type!==a._super){let t=this.nameManager.claimFreeName(`_`),n;if(n=e>0&&this.tokens.matches1AtIndex(e-1,a._delete)&&this.isLastSubscriptInChain()?`${t} => delete ${t}`:`${t} => ${t}`,this.tokens.tokens[e].isAsyncOperation&&(n=`async ${n}`),this.tokens.matches2(a.questionDot,a.parenL)||this.tokens.matches2(a.questionDot,a.lessThan))this.justSkippedSuper()&&this.tokens.appendCode(`.bind(this)`),this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalCall', ${n}`);else if(this.tokens.matches2(a.questionDot,a.bracketL))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${n}`);else if(this.tokens.matches1(a.questionDot))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${n}.`);else if(this.tokens.matches1(a.dot))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${n}.`);else if(this.tokens.matches1(a.bracketL))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${n}[`);else if(this.tokens.matches1(a.parenL))this.justSkippedSuper()&&this.tokens.appendCode(`.bind(this)`),this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'call', ${n}(`);else throw Error(`Unexpected subscript operator in optional chain.`);return!0}return!1}isLastSubscriptInChain(){let e=0;for(let t=this.tokens.currentIndex()+1;;t++){if(t>=this.tokens.tokens.length)throw Error(`Reached the end of the code while finding the end of the access chain.`);if(this.tokens.tokens[t].isOptionalChainStart?e++:this.tokens.tokens[t].isOptionalChainEnd&&e--,e<0)return!0;if(e===0&&this.tokens.tokens[t].subscriptStartIndex!=null)return!1}}justSkippedSuper(){let e=0,t=this.tokens.currentIndex()-1;for(;;){if(t<0)throw Error(`Reached the start of the code while finding the start of the access chain.`);if(this.tokens.tokens[t].isOptionalChainStart?e--:this.tokens.tokens[t].isOptionalChainEnd&&e++,e<0)return!1;if(e===0&&this.tokens.tokens[t].subscriptStartIndex!=null)return this.tokens.tokens[t-1].type===a._super;t--}}},dc=class extends z{constructor(e,t,n,r){super(),this.rootTransformer=e,this.tokens=t,this.importProcessor=n,this.options=r}process(){let e=this.tokens.currentIndex();if(this.tokens.identifierName()===`createReactClass`){let t=this.importProcessor&&this.importProcessor.getIdentifierReplacement(`createReactClass`);return t?this.tokens.replaceToken(`(0, ${t})`):this.tokens.copyToken(),this.tryProcessCreateClassCall(e),!0}if(this.tokens.matches3(a.name,a.dot,a.name)&&this.tokens.identifierName()===`React`&&this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+2)===`createClass`){let t=this.importProcessor&&this.importProcessor.getIdentifierReplacement(`React`)||`React`;return t?(this.tokens.replaceToken(t),this.tokens.copyToken(),this.tokens.copyToken()):(this.tokens.copyToken(),this.tokens.copyToken(),this.tokens.copyToken()),this.tryProcessCreateClassCall(e),!0}return!1}tryProcessCreateClassCall(e){let t=this.findDisplayName(e);t&&this.classNeedsDisplayName()&&(this.tokens.copyExpectedToken(a.parenL),this.tokens.copyExpectedToken(a.braceL),this.tokens.appendCode(`displayName: '${t}',`),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(a.braceR),this.tokens.copyExpectedToken(a.parenR))}findDisplayName(e){return e<2?null:this.tokens.matches2AtIndex(e-2,a.name,a.eq)||e>=2&&this.tokens.tokens[e-2].identifierRole===O.ObjectKey?this.tokens.identifierNameAtIndex(e-2):this.tokens.matches2AtIndex(e-2,a._export,a._default)?this.getDisplayNameFromFilename():null}getDisplayNameFromFilename(){let e=(this.options.filePath||`unknown`).split(`/`),t=e[e.length-1],n=t.lastIndexOf(`.`),r=n===-1?t:t.slice(0,n);return r===`index`&&e[e.length-2]?e[e.length-2]:r}classNeedsDisplayName(){let e=this.tokens.currentIndex();if(!this.tokens.matches2(a.parenL,a.braceL))return!1;let t=e+1,n=this.tokens.tokens[t].contextId;if(n==null)throw Error(`Expected non-null context ID on object open-brace.`);for(;e<this.tokens.tokens.length;e++){let t=this.tokens.tokens[e];if(t.type===a.braceR&&t.contextId===n){e++;break}if(this.tokens.identifierNameAtIndex(e)===`displayName`&&this.tokens.tokens[e].identifierRole===O.ObjectKey&&t.contextId===n)return!1}if(e===this.tokens.tokens.length)throw Error(`Unexpected end of input when processing React class.`);return this.tokens.matches1AtIndex(e,a.parenR)||this.tokens.matches2AtIndex(e,a.comma,a.parenR)}},fc=class e extends z{__init(){this.extractedDefaultExportName=null}constructor(t,n){super(),this.tokens=t,this.filePath=n,e.prototype.__init.call(this)}setExtractedDefaultExportName(e){this.extractedDefaultExportName=e}getPrefixCode(){return`
119
119
  (function () {
120
120
  var enterModule = require('react-hot-loader').enterModule;
121
121
  enterModule && enterModule(module);