#!/usr/bin/env node "use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var path$n=require("path"),path$n__default=_interopDefault(path$n),crypto$3=require("crypto"),fs$n=require("fs"),fs$n__default=_interopDefault(fs$n),events$1=require("events"),events$1__default=_interopDefault(events$1),https$2=require("https"),https$2__default=_interopDefault(https$2),Stream=_interopDefault(require("stream")),http$3=require("http"),http$3__default=_interopDefault(http$3),http2$1=require("http2"),zlib$4=_interopDefault(require("zlib")),Url=_interopDefault(require("url")),net$3=_interopDefault(require("net")),os$4=require("os"),os$4__default=_interopDefault(os$4),util$6=_interopDefault(require("util"));function toArr(e){return null==e?[]:Array.isArray(e)?e:[e]}function toVal(e,t,n,r){var i,s=e[t],o=~r.string.indexOf(t)?null==n||!0===n?"":String(n):"boolean"==typeof n?n:~r.boolean.indexOf(t)?"false"!==n&&("true"===n||(e._.push(0*(i=+n)==0?i:n),!!n)):0*(i=+n)==0?i:n;e[t]=null==s?o:Array.isArray(s)?s.concat(o):[s,o]}var lib=function(e,t){t=t||{};var n,r,i,s,o,a={_:[]},c=0,l=0,u=0,p=(e=e||[]).length;const h=void 0!==t.alias,d=void 0!==t.unknown,f=void 0!==t.default;if(t.alias=t.alias||{},t.string=toArr(t.string),t.boolean=toArr(t.boolean),h)for(n in t.alias)for(r=t.alias[n]=toArr(t.alias[n]),c=0;c0;)for(l=(r=t.alias[t.boolean[c]]||[]).length;l-- >0;)t.boolean.push(r[l]);for(c=t.string.length;c-- >0;)for(l=(r=t.alias[t.string[c]]||[]).length;l-- >0;)t.string.push(r[l]);if(f)for(n in t.default)if(s=typeof t.default[n],r=t.alias[n]=t.alias[n]||[],void 0!==t[s])for(t[s].push(n),c=0;c0;)a[r.shift()]=a[n];return a};const GAP=4,__=" ",ALL="__all__",DEF="__default__",NL="\n";function format(e){if(!e.length)return"";let t=maxLen(e.map(e=>e[0]))+4;return e.map(e=>e[0]+" ".repeat(t-e[0].length)+e[1]+(null==e[2]?"":` (default ${e[2]})`))}function maxLen(e){let t=0,n=0,r=0,i=e.length;if(i)for(;i--;)n=e[i].length,n>t&&(r=i,t=n);return e[r].length}function noop(e){return e}function section(e,t,n){if(!t||!t.length)return"";let r=0,i="";for(i+="\n "+e;r`${o} ${e}`.replace(/\s+/g," "),l=[["-h, --help","Displays this message"]];if(n===DEF&&l.unshift(["-v, --version","Displays current version"]),s.options=(s.options||[]).concat(a.options,l),s.options.length>0&&(s.usage+=" [options]"),i+=section("Description",s.describe,noop),i+=section("Usage",[s.usage],c),r||n!==DEF)r||n===DEF||(i+=section("Aliases",s.alibi,c));else{let e=Object.keys(t).filter(e=>!/__/.test(e)),n=e.map(e=>[e,(t[e].describe||[""])[0]]);i+=section("Available Commands",format(n),noop),i+="\n For more info, run any command with the `--help` flag",e.slice(0,2).forEach(e=>{i+=`\n ${o} ${e} --help`}),i+=NL}return i+=section("Options",format(s.options),noop),i+=section("Examples",s.examples.map(c),noop),i},error=function(e,t,n=1){let r=section("ERROR",[t],noop);r+=`\n Run \`$ ${e} --help\` for more info.\n`,console.error(r),process.exit(n)},parse=function(e){return(e||"").split(/^-{1,2}|,|\s+-{1,2}|\s+/).filter(Boolean)},sentences=function(e){return(e||"").replace(/([.?!])\s*(?=[A-Z])/g,"$1|").split("|")},utils={help,error,parse,sentences};const ALL$1="__all__",DEF$1="__default__";class Sade{constructor(e,t){let[n,...r]=e.split(/\s+/);t=t||r.length>0,this.bin=n,this.ver="0.0.0",this.default="",this.tree={},this.command(ALL$1),this.command([DEF$1].concat(t?r:"").join(" ")),this.single=t,this.curr=""}command(e,t,n={}){if(this.single)throw new Error('Disable "single" mode to add commands');let r=[],i=[],s=/(\[|<)/;if(e.split(/\s+/).forEach(e=>{(s.test(e.charAt(0))?i:r).push(e)}),r=r.join(" "),r in this.tree)throw new Error("Command already exists: "+r);return r.includes("__")||i.unshift(r),i=i.join(" "),this.curr=r,n.default&&(this.default=r),this.tree[r]={usage:i,alibi:[],options:[],alias:{},default:{},examples:[]},n.alias&&this.alias(n.alias),t&&this.describe(t),this}describe(e){return this.tree[this.curr||DEF$1].describe=Array.isArray(e)?e:utils.sentences(e),this}alias(...e){if(this.single)throw new Error('Cannot call `alias()` in "single" mode');if(!this.curr)throw new Error("Cannot call `alias()` before defining a command");return this.tree[this.curr].alibi=this.tree[this.curr].alibi.concat(...e),this}option(e,t,n){let r=this.tree[this.curr||ALL$1],[i,s]=utils.parse(e);if(s&&s.length>1&&([i,s]=[s,i]),e="--"+i,s&&s.length>0){e=`-${s}, ${e}`;let t=r.alias[s];r.alias[s]=(t||[]).concat(i)}let o=[e,t||""];return void 0!==n?(o.push(n),r.default[i]=n):s||(r.default[i]=void 0),r.options.push(o),this}action(e){return this.tree[this.curr||DEF$1].handler=e,this}example(e){return this.tree[this.curr||DEF$1].examples.push(e),this}version(e){return this.ver=e,this}parse(e,t={}){e=e.slice();let n,r,i,s,o=2,a=lib(e.slice(o),{alias:{h:"help",v:"version"}}),c=this.single,l=this.bin,u="";if(c)s=this.tree[DEF$1];else{let t,c=1,p=a._.length+1;for(;c"<"===e.charAt(0)),m=h._.splice(0,f.length);if(m.length"["===e.charAt(0)).forEach(e=>{m.push(h._.shift())}),m.push(h);let g=s.handler;return t.lazy?{args:m,name:u,handler:g}:g.apply(null,m)}help(e){console.log(utils.help(this.bin,this.tree,e||DEF$1,this.single))}_version(){console.log(`${this.bin}, ${this.ver}`)}}var lib$1=(e,t)=>new Sade(e,t),version="2.17.0";function getLocator(e,t){void 0===t&&(t={});var n=t.offsetLine||0,r=t.offsetColumn||0,i=e.split("\n"),s=0,o=i.map((function(e,t){var n=s+e.length+1,r={start:s,end:n,line:t};return s=n,r})),a=0;function c(e,t){return e.start<=t&&t=r.end?1:-1;r;){if(c(r,t))return l(r,t);r=o[a+=i]}}}function locate(e,t,n){if("number"==typeof n)throw new Error("locate takes a { startIndex, offsetLine, offsetColumn } object as the third argument");return getLocator(e,n)(t,n&&n.startIndex)}function spaces(e){let t="";for(;e--;)t+=" ";return t}function tabsToSpaces(e){return e.replace(/^\t+/,e=>e.split("\t").join(" "))}function getCodeFrame(e,t,n){let r=e.split("\n");const i=Math.max(0,t-3);let s=Math.min(t+2,r.length);for(r=r.slice(i,s);!/\S/.test(r[r.length-1]);)r.pop(),s-=1;const o=String(s).length;return r.map((e,r)=>{const s=i+r+1===t;let a=String(r+i+1);for(;a.lengthrelativeId(e.id)).sort();return{code:Errors.MISSING_IMPLICIT_DEPENDANT,message:`Module "${relativeId(e.id)}" that should be implicitly loaded before "${1===t.length?t[0]:`${t.slice(0,-1).join('", "')}" and "${t.slice(-1)[0]}`}" is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`}}function errMixedExport(e,t){return{code:Errors.MIXED_EXPORTS,id:e,message:`Entry module "${relativeId(e)}" is using named and default exports together. Consumers of your bundle will have to use \`${t||"chunk"}["default"]\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning`,url:"https://rollupjs.org/guide/en/#output-exports"}}function errNamespaceConflict(e,t,n){return{code:Errors.NAMESPACE_CONFLICT,message:`Conflicting namespaces: ${relativeId(t.id)} re-exports '${e}' from both ${relativeId(t.exportsAll[e])} and ${relativeId(n.exportsAll[e])} (will be ignored)`,name:e,reexporter:t.id,sources:[t.exportsAll[e],n.exportsAll[e]]}}function errEntryCannotBeExternal(e){return{code:Errors.UNRESOLVED_ENTRY,message:`Entry module cannot be external (${relativeId(e)}).`}}function errUnresolvedEntry(e){return{code:Errors.UNRESOLVED_ENTRY,message:`Could not resolve entry module (${relativeId(e)}).`}}function errUnresolvedImport(e,t){return{code:Errors.UNRESOLVED_IMPORT,message:`Could not resolve '${e}' from ${relativeId(t)}`}}function errUnresolvedImportTreatedAsExternal(e,t){return{code:Errors.UNRESOLVED_IMPORT,importer:relativeId(t),message:`'${e}' is imported by ${relativeId(t)}, but could not be resolved – treating it as an external dependency`,source:e,url:"https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency"}}function errExternalSyntheticExports(e,t){return{code:Errors.EXTERNAL_SYNTHETIC_EXPORTS,importer:relativeId(t),message:`External '${e}' can not have 'syntheticNamedExports' enabled.`,source:e}}function errFailedValidation(e){return{code:Errors.VALIDATION_ERROR,message:e}}function warnDeprecation(e,t,n){warnDeprecationWithOptions(e,t,n.onwarn,n.strictDeprecations)}function warnDeprecationWithOptions(e,t,n,r){if(t||r){const t=errDeprecation(e);if(r)return error$1(t);n(t)}}!function(e){e.ASSET_NOT_FINALISED="ASSET_NOT_FINALISED",e.ASSET_NOT_FOUND="ASSET_NOT_FOUND",e.ASSET_SOURCE_ALREADY_SET="ASSET_SOURCE_ALREADY_SET",e.ASSET_SOURCE_MISSING="ASSET_SOURCE_MISSING",e.BAD_LOADER="BAD_LOADER",e.CANNOT_EMIT_FROM_OPTIONS_HOOK="CANNOT_EMIT_FROM_OPTIONS_HOOK",e.CHUNK_NOT_GENERATED="CHUNK_NOT_GENERATED",e.DEPRECATED_FEATURE="DEPRECATED_FEATURE",e.FILE_NOT_FOUND="FILE_NOT_FOUND",e.FILE_NAME_CONFLICT="FILE_NAME_CONFLICT",e.INPUT_HOOK_IN_OUTPUT_PLUGIN="INPUT_HOOK_IN_OUTPUT_PLUGIN",e.INVALID_CHUNK="INVALID_CHUNK",e.INVALID_EXPORT_OPTION="INVALID_EXPORT_OPTION",e.INVALID_EXTERNAL_ID="INVALID_EXTERNAL_ID",e.INVALID_OPTION="INVALID_OPTION",e.INVALID_PLUGIN_HOOK="INVALID_PLUGIN_HOOK",e.INVALID_ROLLUP_PHASE="INVALID_ROLLUP_PHASE",e.MISSING_IMPLICIT_DEPENDANT="MISSING_IMPLICIT_DEPENDANT",e.MIXED_EXPORTS="MIXED_EXPORTS",e.NAMESPACE_CONFLICT="NAMESPACE_CONFLICT",e.PLUGIN_ERROR="PLUGIN_ERROR",e.UNRESOLVED_ENTRY="UNRESOLVED_ENTRY",e.UNRESOLVED_IMPORT="UNRESOLVED_IMPORT",e.VALIDATION_ERROR="VALIDATION_ERROR",e.EXTERNAL_SYNTHETIC_EXPORTS="EXTERNAL_SYNTHETIC_EXPORTS",e.SYNTHETIC_NAMED_EXPORTS_NEED_DEFAULT="SYNTHETIC_NAMED_EXPORTS_NEED_DEFAULT"}(Errors||(Errors={}));const concatSep=(e,t)=>t?`${e}\n${t}`:e,concatDblSep=(e,t)=>t?`${e}\n\n${t}`:e;async function createAddons(e,t){try{let[n,r,i,s]=await Promise.all([t.hookReduceValue("banner",e.banner(),[],concatSep),t.hookReduceValue("footer",e.footer(),[],concatSep),t.hookReduceValue("intro",e.intro(),[],concatDblSep),t.hookReduceValue("outro",e.outro(),[],concatDblSep)]);return i&&(i+="\n\n"),s&&(s="\n\n"+s),n.length&&(n+="\n"),r.length&&(r="\n"+r),{intro:i,outro:s,banner:n,footer:r}}catch(e){return error$1({code:"ADDON_ERROR",message:`Could not retrieve ${e.hook}. Check configuration of plugin ${e.plugin}.\n\tError Message: ${e.message}`})}}function commondir(e){if(0===e.length)return"/";if(1===e.length)return path$n.dirname(e[0]);const t=e.slice(1).reduce((e,t)=>{const n=t.split(/\/+|\\+/);let r;for(r=0;e[r]===n[r]&&r1?t.join("/"):"/"}var BuildPhase;!function(e){e[e.LOAD_AND_PARSE=0]="LOAD_AND_PARSE",e[e.ANALYSE=1]="ANALYSE",e[e.GENERATE=2]="GENERATE"}(BuildPhase||(BuildPhase={}));const createHash=()=>crypto$3.createHash("sha256");function renderNamePattern(e,t,n){return isPlainPathFragment(e)?e.replace(/\[(\w+)\]/g,(e,r)=>{if(!n.hasOwnProperty(r))return error$1(errFailedValidation(`"[${r}]" is not a valid placeholder in "${t}" pattern.`));const i=n[r]();return isPlainPathFragment(i)?i:error$1(errFailedValidation(`Invalid substitution "${i}" for placeholder "[${r}]" in "${t}" pattern, can be neither absolute nor relative path.`))}):error$1(errFailedValidation(`Invalid pattern "${e}" for "${t}", patterns can be neither absolute nor relative paths and must not contain invalid characters.`))}function makeUnique(e,t){const n=new Set(Object.keys(t).map(e=>e.toLowerCase()));if(!n.has(e.toLocaleLowerCase()))return e;const r=path$n.extname(e);e=e.substr(0,e.length-r.length);let i,s=1;for(;n.has((i=e+ ++s+r).toLowerCase()););return i}function generateAssetFileName(e,t,n){const r=e||"asset";return makeUnique(renderNamePattern(n.assetFileNames,"output.assetFileNames",{hash(){const e=createHash();return e.update(r),e.update(":"),e.update(t),e.digest("hex").substr(0,8)},ext:()=>path$n.extname(r).substr(1),extname:()=>path$n.extname(r),name:()=>r.substr(0,r.length-path$n.extname(r).length)}),n.bundle)}function reserveFileNameInBundle(e,t,n){e in t&&n(errFileNameConflict(e)),t[e]=FILE_PLACEHOLDER}const FILE_PLACEHOLDER={type:"placeholder"};function hasValidType(e){return e&&("asset"===e.type||"chunk"===e.type)}function hasValidName(e){const t=e.fileName||e.name;return!t||"string"==typeof t&&isPlainPathFragment(t)}function getValidSource(e,t,n){if(!("string"==typeof e||e instanceof Uint8Array)){const e=t.fileName||t.name||n;return error$1(errFailedValidation(`Could not set source for ${"string"==typeof e?`asset "${e}"`:"unnamed asset"}, asset source needs to be a string, Uint8Array or Buffer.`))}return e}function getAssetFileName(e,t){return"string"!=typeof e.fileName?error$1(errAssetNotFinalisedForFileName(e.name||t)):e.fileName}function getChunkFileName(e){const t=e.fileName||e.module&&e.module.facadeChunk.id;return t||error$1(errChunkNotGeneratedForFileName(e.fileName||e.name))}class FileEmitter{constructor(e,t,n){this.graph=e,this.options=t,this.output=null,this.assertAssetsFinalized=()=>{for(const[e,t]of this.filesByReferenceId.entries())if("asset"===t.type&&"string"!=typeof t.fileName)return error$1(errNoAssetSourceSet(t.name||e))},this.emitFile=e=>hasValidType(e)?hasValidName(e)?"chunk"===e.type?this.emitChunk(e):this.emitAsset(e):error$1(errFailedValidation(`The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths and do not contain invalid characters, received "${e.fileName||e.name}".`)):error$1(errFailedValidation(`Emitted files must be of type "asset" or "chunk", received "${e&&e.type}".`)),this.getFileName=e=>{const t=this.filesByReferenceId.get(e);return t?"chunk"===t.type?getChunkFileName(t):getAssetFileName(t,e):error$1(errFileReferenceIdNotFoundForFilename(e))},this.setAssetSource=(e,t)=>{const n=this.filesByReferenceId.get(e);if(!n)return error$1(errAssetReferenceIdNotFoundForSetSource(e));if("asset"!==n.type)return error$1(errFailedValidation(`Asset sources can only be set for emitted assets but "${e}" is an emitted chunk.`));if(void 0!==n.source)return error$1(errAssetSourceAlreadySet(n.name||e));const r=getValidSource(t,n,e);this.output?this.finalizeAsset(n,r,e,this.output):n.source=r},this.setOutputBundle=(e,t)=>{this.output={assetFileNames:t,bundle:e};for(const e of this.filesByReferenceId.values())e.fileName&&reserveFileNameInBundle(e.fileName,this.output.bundle,this.options.onwarn);for(const[e,t]of this.filesByReferenceId.entries())"asset"===t.type&&void 0!==t.source&&this.finalizeAsset(t,t.source,e,this.output)},this.filesByReferenceId=n?new Map(n.filesByReferenceId):new Map}assignReferenceId(e,t){let n;do{const e=createHash();n?e.update(n):e.update(t),n=e.digest("hex").substr(0,8)}while(this.filesByReferenceId.has(n));return this.filesByReferenceId.set(n,e),n}emitAsset(e){const t=void 0!==e.source?getValidSource(e.source,e,null):void 0,n={fileName:e.fileName,name:e.name,source:t,type:"asset"},r=this.assignReferenceId(n,e.fileName||e.name||e.type);return this.output&&(e.fileName&&reserveFileNameInBundle(e.fileName,this.output.bundle,this.options.onwarn),void 0!==t&&this.finalizeAsset(n,t,r,this.output)),r}emitChunk(e){if(this.graph.phase>BuildPhase.LOAD_AND_PARSE)return error$1(errInvalidRollupPhaseForChunkEmission());if("string"!=typeof e.id)return error$1(errFailedValidation(`Emitted chunks need to have a valid string id, received "${e.id}"`));const t={fileName:e.fileName,module:null,name:e.name||e.id,type:"chunk"};return this.graph.moduleLoader.emitChunk(e).then(e=>t.module=e).catch(()=>{}),this.assignReferenceId(t,e.id)}finalizeAsset(e,t,n,r){const i=e.fileName||findExistingAssetFileNameWithSource(r.bundle,t)||generateAssetFileName(e.name,t,r),s={...e,source:t,fileName:i};this.filesByReferenceId.set(n,s);const o=this.options;r.bundle[i]={fileName:i,get isAsset(){return warnDeprecation('Accessing "isAsset" on files in the bundle is deprecated, please use "type === \'asset\'" instead',!0,o),!0},source:t,type:"asset"}}}function findExistingAssetFileNameWithSource(e,t){for(const n of Object.keys(e)){const r=e[n];if("asset"===r.type&&areSourcesEqual(t,r.source))return n}return null}function areSourcesEqual(e,t){if("string"==typeof e)return e===t;if("string"==typeof t)return!1;if("equals"in e)return e.equals(t);if(e.length!==t.length)return!1;for(let n=0;n{};let getStartTime=()=>[0,0],getElapsedTime=()=>0,getMemory=()=>0,timers={};const normalizeHrTime=e=>1e3*e[0]+e[1]/1e6;function setTimeHelpers(){"undefined"!=typeof process&&"function"==typeof process.hrtime?(getStartTime=process.hrtime.bind(process),getElapsedTime=e=>{return 1e3*(t=process.hrtime(e))[0]+t[1]/1e6;var t}):"undefined"!=typeof performance&&"function"==typeof performance.now&&(getStartTime=()=>[performance.now(),0],getElapsedTime=e=>performance.now()-e[0]),"undefined"!=typeof process&&"function"==typeof process.memoryUsage&&(getMemory=()=>process.memoryUsage().heapUsed)}function getPersistedLabel(e,t){switch(t){case 1:return"# "+e;case 2:return"## "+e;case 3:return e;default:return`${" ".repeat(t-4)}- ${e}`}}function timeStartImpl(e,t=3){e=getPersistedLabel(e,t),timers.hasOwnProperty(e)||(timers[e]={memory:0,startMemory:void 0,startTime:void 0,time:0,totalMemory:0});const n=getMemory();timers[e].startTime=getStartTime(),timers[e].startMemory=n}function timeEndImpl(e,t=3){if(e=getPersistedLabel(e,t),timers.hasOwnProperty(e)){const t=getMemory();timers[e].time+=getElapsedTime(timers[e].startTime),timers[e].totalMemory=Math.max(timers[e].totalMemory,t),timers[e].memory+=t-timers[e].startMemory}}function getTimings(){const e={};for(const t of Object.keys(timers))e[t]=[timers[t].time,timers[t].memory,timers[t].totalMemory];return e}let timeStart=NOOP,timeEnd=NOOP;const TIMED_PLUGIN_HOOKS={load:!0,resolveDynamicImport:!0,resolveId:!0,transform:!0};function getPluginWithTimers(e,t){const n={};for(const r of Object.keys(e))if(!0===TIMED_PLUGIN_HOOKS[r]){let i="plugin "+t;e.name&&(i+=` (${e.name})`),i+=" - "+r,n[r]=function(){timeStart(i,4);const t=e[r].apply(this===n?e:this,arguments);return timeEnd(i,4),t&&"function"==typeof t.then&&(timeStart(i+" (async)",4),t.then(()=>timeEnd(i+" (async)",4))),t}}else n[r]=e[r];return n}function initialiseTimers(e){e.perf?(timers={},setTimeHelpers(),timeStart=timeStartImpl,timeEnd=timeEndImpl,e.plugins=e.plugins.map(getPluginWithTimers)):(timeStart=NOOP,timeEnd=NOOP)}class Bundle{constructor(e,t,n,r,i){this.outputOptions=e,this.unsetOptions=t,this.inputOptions=n,this.pluginDriver=r,this.chunks=i}async generate(e){timeStart("GENERATE",1);const t=commondir(getAbsoluteEntryModulePaths(this.chunks)),n=Object.create(null);this.pluginDriver.setOutputBundle(n,this.outputOptions.assetFileNames);try{await this.pluginDriver.hookParallel("renderStart",[this.outputOptions,this.inputOptions]),this.chunks.length>1&&validateOptionsForMultiChunkOutput(this.outputOptions);const e=await createAddons(this.outputOptions,this.pluginDriver);for(const e of this.chunks)e.generateExports(this.outputOptions);for(const e of this.chunks)e.preRender(this.outputOptions,t,this.pluginDriver);this.assignChunkIds(t,e,n),assignChunksToBundle(this.chunks,n),await Promise.all(this.chunks.map(t=>{const r=n[t.id];return t.render(this.outputOptions,e,r,this.pluginDriver).then(e=>{r.code=e.code,r.map=e.map})}))}catch(e){throw await this.pluginDriver.hookParallel("renderError",[e]),e}await this.pluginDriver.hookSeq("generateBundle",[this.outputOptions,n,e]);for(const e of Object.keys(n)){const t=n[e];t.type||(warnDeprecation('A plugin is directly adding properties to the bundle object in the "generateBundle" hook. This is deprecated and will be removed in a future Rollup version, please use "this.emitFile" instead.',!0,this.inputOptions),t.type="asset")}return this.pluginDriver.finaliseAssets(),timeEnd("GENERATE",1),n}assignChunkIds(e,t,n){const r=[],i=[];for(const e of this.chunks)(e.facadeModule&&e.facadeModule.isUserDefinedEntryPoint?r:i).push(e);const s=r.concat(i);for(const r of s)this.outputOptions.file?r.id=path$n.basename(this.outputOptions.file):this.inputOptions.preserveModules?r.id=r.generateIdPreserveModules(e,this.outputOptions,n,this.unsetOptions):r.id=r.generateId(t,this.outputOptions,n,!0,this.pluginDriver),n[r.id]=FILE_PLACEHOLDER}}function getAbsoluteEntryModulePaths(e){const t=[];for(const n of e)for(const e of n.entryModules)isAbsolute(e.id)&&t.push(e.id);return t}function validateOptionsForMultiChunkOutput(e){return"umd"===e.format||"iife"===e.format?error$1({code:"INVALID_OPTION",message:"UMD and IIFE output formats are not supported for code-splitting builds."}):"string"==typeof e.file?error$1({code:"INVALID_OPTION",message:'When building multiple chunks, the "output.dir" option must be used, not "output.file". To inline dynamic imports, set the "inlineDynamicImports" option.'}):e.sourcemapFile?error$1({code:"INVALID_OPTION",message:'"output.sourcemapFile" is only supported for single-file builds.'}):void 0}function assignChunksToBundle(e,t){for(const n of e){(t[n.id]=n.getPrerenderedChunk()).fileName=n.id}return t}var reservedWords={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},ecma5AndLessKeywords="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",keywords={5:ecma5AndLessKeywords,"5module":ecma5AndLessKeywords+" export import",6:ecma5AndLessKeywords+" const class extends export import super"},keywordRelationalOperator=/^in(stanceof)?$/,nonASCIIidentifierStartChars="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",nonASCIIidentifierChars="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",nonASCIIidentifierStart=new RegExp("["+nonASCIIidentifierStartChars+"]"),nonASCIIidentifier=new RegExp("["+nonASCIIidentifierStartChars+nonASCIIidentifierChars+"]");nonASCIIidentifierStartChars=nonASCIIidentifierChars=null;var astralIdentifierStartCodes=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],astralIdentifierCodes=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function isInAstralSet(e,t){for(var n=65536,r=0;re)return!1;if((n+=t[r+1])>=e)return!0}}function isIdentifierStart(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&nonASCIIidentifierStart.test(String.fromCharCode(e)):!1!==t&&isInAstralSet(e,astralIdentifierStartCodes)))}function isIdentifierChar(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&nonASCIIidentifier.test(String.fromCharCode(e)):!1!==t&&(isInAstralSet(e,astralIdentifierStartCodes)||isInAstralSet(e,astralIdentifierCodes)))))}var TokenType=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function binop(e,t){return new TokenType(e,{beforeExpr:!0,binop:t})}var beforeExpr={beforeExpr:!0},startsExpr={startsExpr:!0},keywords$1={};function kw(e,t){return void 0===t&&(t={}),t.keyword=e,keywords$1[e]=new TokenType(e,t)}var types={num:new TokenType("num",startsExpr),regexp:new TokenType("regexp",startsExpr),string:new TokenType("string",startsExpr),name:new TokenType("name",startsExpr),eof:new TokenType("eof"),bracketL:new TokenType("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new TokenType("]"),braceL:new TokenType("{",{beforeExpr:!0,startsExpr:!0}),braceR:new TokenType("}"),parenL:new TokenType("(",{beforeExpr:!0,startsExpr:!0}),parenR:new TokenType(")"),comma:new TokenType(",",beforeExpr),semi:new TokenType(";",beforeExpr),colon:new TokenType(":",beforeExpr),dot:new TokenType("."),question:new TokenType("?",beforeExpr),questionDot:new TokenType("?."),arrow:new TokenType("=>",beforeExpr),template:new TokenType("template"),invalidTemplate:new TokenType("invalidTemplate"),ellipsis:new TokenType("...",beforeExpr),backQuote:new TokenType("`",startsExpr),dollarBraceL:new TokenType("${",{beforeExpr:!0,startsExpr:!0}),eq:new TokenType("=",{beforeExpr:!0,isAssign:!0}),assign:new TokenType("_=",{beforeExpr:!0,isAssign:!0}),incDec:new TokenType("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new TokenType("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:binop("||",1),logicalAND:binop("&&",2),bitwiseOR:binop("|",3),bitwiseXOR:binop("^",4),bitwiseAND:binop("&",5),equality:binop("==/!=/===/!==",6),relational:binop("/<=/>=",7),bitShift:binop("<>/>>>",8),plusMin:new TokenType("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:binop("%",10),star:binop("*",10),slash:binop("/",10),starstar:new TokenType("**",{beforeExpr:!0}),coalesce:binop("??",1),_break:kw("break"),_case:kw("case",beforeExpr),_catch:kw("catch"),_continue:kw("continue"),_debugger:kw("debugger"),_default:kw("default",beforeExpr),_do:kw("do",{isLoop:!0,beforeExpr:!0}),_else:kw("else",beforeExpr),_finally:kw("finally"),_for:kw("for",{isLoop:!0}),_function:kw("function",startsExpr),_if:kw("if"),_return:kw("return",beforeExpr),_switch:kw("switch"),_throw:kw("throw",beforeExpr),_try:kw("try"),_var:kw("var"),_const:kw("const"),_while:kw("while",{isLoop:!0}),_with:kw("with"),_new:kw("new",{beforeExpr:!0,startsExpr:!0}),_this:kw("this",startsExpr),_super:kw("super",startsExpr),_class:kw("class",startsExpr),_extends:kw("extends",beforeExpr),_export:kw("export"),_import:kw("import",startsExpr),_null:kw("null",startsExpr),_true:kw("true",startsExpr),_false:kw("false",startsExpr),_in:kw("in",{beforeExpr:!0,binop:7}),_instanceof:kw("instanceof",{beforeExpr:!0,binop:7}),_typeof:kw("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:kw("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:kw("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},lineBreak=/\r\n?|\n|\u2028|\u2029/,lineBreakG=new RegExp(lineBreak.source,"g");function isNewLine(e,t){return 10===e||13===e||!t&&(8232===e||8233===e)}var nonASCIIwhitespace=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,skipWhiteSpace=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ref=Object.prototype,hasOwnProperty=ref.hasOwnProperty,toString=ref.toString;function has(e,t){return hasOwnProperty.call(e,t)}var isArray=Array.isArray||function(e){return"[object Array]"===toString.call(e)};function wordsRegexp(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}var Position=function(e,t){this.line=e,this.column=t};Position.prototype.offset=function(e){return new Position(this.line,this.column+e)};var SourceLocation=function(e,t,n){this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile)};function getLineInfo(e,t){for(var n=1,r=0;;){lineBreakG.lastIndex=r;var i=lineBreakG.exec(e);if(!(i&&i.index=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),isArray(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}return isArray(t.onComment)&&(t.onComment=pushComment(t,t.onComment)),t}function pushComment(e,t){return function(n,r,i,s,o,a){var c={type:n?"Block":"Line",value:r,start:i,end:s};e.locations&&(c.loc=new SourceLocation(this,o,a)),e.ranges&&(c.range=[i,s]),t.push(c)}}var SCOPE_TOP=1,SCOPE_FUNCTION=2,SCOPE_VAR=SCOPE_TOP|SCOPE_FUNCTION,SCOPE_ASYNC=4,SCOPE_GENERATOR=8,SCOPE_ARROW=16,SCOPE_SIMPLE_CATCH=32,SCOPE_SUPER=64,SCOPE_DIRECT_SUPER=128;function functionFlags(e,t){return SCOPE_FUNCTION|(e?SCOPE_ASYNC:0)|(t?SCOPE_GENERATOR:0)}var BIND_NONE=0,BIND_VAR=1,BIND_LEXICAL=2,BIND_FUNCTION=3,BIND_SIMPLE_CATCH=4,BIND_OUTSIDE=5,Parser=function(e,t,n){this.options=e=getOptions(e),this.sourceFile=e.sourceFile,this.keywords=wordsRegexp(keywords[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var r="";if(!0!==e.allowReserved){for(var i=e.ecmaVersion;!(r=reservedWords[i]);i--);"module"===e.sourceType&&(r+=" await")}this.reservedWords=wordsRegexp(r);var s=(r?r+" ":"")+reservedWords.strict;this.reservedWordsStrict=wordsRegexp(s),this.reservedWordsStrictBind=wordsRegexp(s+" "+reservedWords.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf("\n",n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(lineBreak).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=types.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(SCOPE_TOP),this.regexpState=null},prototypeAccessors={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};Parser.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},prototypeAccessors.inFunction.get=function(){return(this.currentVarScope().flags&SCOPE_FUNCTION)>0},prototypeAccessors.inGenerator.get=function(){return(this.currentVarScope().flags&SCOPE_GENERATOR)>0},prototypeAccessors.inAsync.get=function(){return(this.currentVarScope().flags&SCOPE_ASYNC)>0},prototypeAccessors.allowSuper.get=function(){return(this.currentThisScope().flags&SCOPE_SUPER)>0},prototypeAccessors.allowDirectSuper.get=function(){return(this.currentThisScope().flags&SCOPE_DIRECT_SUPER)>0},prototypeAccessors.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Parser.prototype.inNonArrowFunction=function(){return(this.currentThisScope().flags&SCOPE_FUNCTION)>0},Parser.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r=,?^&]/.test(i)||"!"===i&&"="===this.input.charAt(r+1))}e+=t[0].length,skipWhiteSpace.lastIndex=e,e+=skipWhiteSpace.exec(this.input)[0].length,";"===this.input[e]&&e++}},pp.eat=function(e){return this.type===e&&(this.next(),!0)},pp.isContextual=function(e){return this.type===types.name&&this.value===e&&!this.containsEsc},pp.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},pp.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},pp.canInsertSemicolon=function(){return this.type===types.eof||this.type===types.braceR||lineBreak.test(this.input.slice(this.lastTokEnd,this.start))},pp.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},pp.semicolon=function(){this.eat(types.semi)||this.insertSemicolon()||this.unexpected()},pp.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},pp.expect=function(e){this.eat(e)||this.unexpected()},pp.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")},pp.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,"Parenthesized pattern")}},pp.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")},pp.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case types._class:return e&&this.unexpected(),this.parseClass(s,!0);case types._if:return this.parseIfStatement(s);case types._return:return this.parseReturnStatement(s);case types._switch:return this.parseSwitchStatement(s);case types._throw:return this.parseThrowStatement(s);case types._try:return this.parseTryStatement(s);case types._const:case types._var:return r=r||this.value,e&&"var"!==r&&this.unexpected(),this.parseVarStatement(s,r);case types._while:return this.parseWhileStatement(s);case types._with:return this.parseWithStatement(s);case types.braceL:return this.parseBlock(!0,s);case types.semi:return this.parseEmptyStatement(s);case types._export:case types._import:if(this.options.ecmaVersion>10&&i===types._import){skipWhiteSpace.lastIndex=this.pos;var o=skipWhiteSpace.exec(this.input),a=this.pos+o[0].length,c=this.input.charCodeAt(a);if(40===c||46===c)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),i===types._import?this.parseImport(s):this.parseExport(s,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var l=this.value,u=this.parseExpression();return i===types.name&&"Identifier"===u.type&&this.eat(types.colon)?this.parseLabeledStatement(s,l,u,e):this.parseExpressionStatement(s,u)}},pp$1.parseBreakContinueStatement=function(e,t){var n="break"===t;this.next(),this.eat(types.semi)||this.insertSemicolon()?e.label=null:this.type!==types.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r=6?this.eat(types.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},pp$1.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(loopLabel),this.enterScope(0),this.expect(types.parenL),this.type===types.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===types._var||this.type===types._const||n){var r=this.startNode(),i=n?"let":this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,"VariableDeclaration"),(this.type===types._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===r.declarations.length?(this.options.ecmaVersion>=9&&(this.type===types._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var s=new DestructuringErrors,o=this.parseExpression(!0,s);return this.type===types._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===types._in?t>-1&&this.unexpected(t):e.await=t>-1),this.toAssignable(o,!1,s),this.checkLVal(o),this.parseForIn(e,o)):(this.checkExpressionErrors(s,!0),t>-1&&this.unexpected(t),this.parseFor(e,o))},pp$1.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,FUNC_STATEMENT|(n?0:FUNC_HANGING_STATEMENT),!1,t)},pp$1.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(types._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},pp$1.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(types.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},pp$1.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(types.braceL),this.labels.push(switchLabel),this.enterScope(0);for(var n=!1;this.type!==types.braceR;)if(this.type===types._case||this.type===types._default){var r=this.type===types._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!0,t.test=null),this.expect(types.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},pp$1.parseThrowStatement=function(e){return this.next(),lineBreak.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var empty=[];pp$1.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===types._catch){var t=this.startNode();if(this.next(),this.eat(types.parenL)){t.param=this.parseBindingAtom();var n="Identifier"===t.param.type;this.enterScope(n?SCOPE_SIMPLE_CATCH:0),this.checkLVal(t.param,n?BIND_SIMPLE_CATCH:BIND_LEXICAL),this.expect(types.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(types._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},pp$1.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},pp$1.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(loopLabel),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},pp$1.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},pp$1.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},pp$1.parseLabeledStatement=function(e,t,n,r){for(var i=0,s=this.labels;i=0;a--){var c=this.labels[a];if(c.statementStart!==e.start)break;c.statementStart=this.start,c.kind=o}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?-1===r.indexOf("label")?r+"label":r:"label"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},pp$1.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},pp$1.parseBlock=function(e,t,n){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(types.braceL),e&&this.enterScope(0);this.type!==types.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},pp$1.parseFor=function(e,t){return e.init=t,this.expect(types.semi),e.test=this.type===types.semi?null:this.parseExpression(),this.expect(types.semi),e.update=this.type===types.parenR?null:this.parseExpression(),this.expect(types.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},pp$1.parseForIn=function(e,t){var n=this.type===types._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!n||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)?this.raise(t.start,(n?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===t.type&&this.raise(t.start,"Invalid left-hand side in for-loop"),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(types.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n?"ForInStatement":"ForOfStatement")},pp$1.parseVar=function(e,t,n){for(e.declarations=[],e.kind=n;;){var r=this.startNode();if(this.parseVarId(r,n),this.eat(types.eq)?r.init=this.parseMaybeAssign(t):"const"!==n||this.type===types._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===r.id.type||t&&(this.type===types._in||this.isContextual("of"))?r.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(types.comma))break}return e},pp$1.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?BIND_VAR:BIND_LEXICAL,!1)};var FUNC_STATEMENT=1,FUNC_HANGING_STATEMENT=2,FUNC_NULLABLE_ID=4;pp$1.parseFunction=function(e,t,n,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===types.star&&t&FUNC_HANGING_STATEMENT&&this.unexpected(),e.generator=this.eat(types.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&FUNC_STATEMENT&&(e.id=t&FUNC_NULLABLE_ID&&this.type!==types.name?null:this.parseIdent(),!e.id||t&FUNC_HANGING_STATEMENT||this.checkLVal(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?BIND_VAR:BIND_LEXICAL:BIND_FUNCTION));var i=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(functionFlags(e.async,e.generator)),t&FUNC_STATEMENT||(e.id=this.type===types.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(e,t&FUNC_STATEMENT?"FunctionDeclaration":"FunctionExpression")},pp$1.parseFunctionParams=function(e){this.expect(types.parenL),e.params=this.parseBindingList(types.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},pp$1.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.startNode(),i=!1;for(r.body=[],this.expect(types.braceL);this.type!==types.braceR;){var s=this.parseClassElement(null!==e.superClass);s&&(r.body.push(s),"MethodDefinition"===s.type&&"constructor"===s.kind&&(i&&this.raise(s.start,"Duplicate constructor in the same class"),i=!0))}return this.strict=n,this.next(),e.body=this.finishNode(r,"ClassBody"),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},pp$1.parseClassElement=function(e){var t=this;if(this.eat(types.semi))return null;var n=this.startNode(),r=function(e,r){void 0===r&&(r=!1);var i=t.start,s=t.startLoc;return!!t.eatContextual(e)&&(!(t.type===types.parenL||r&&t.canInsertSemicolon())||(n.key&&t.unexpected(),n.computed=!1,n.key=t.startNodeAt(i,s),n.key.name=e,t.finishNode(n.key,"Identifier"),!1))};n.kind="method",n.static=r("static");var i=this.eat(types.star),s=!1;i||(this.options.ecmaVersion>=8&&r("async",!0)?(s=!0,i=this.options.ecmaVersion>=9&&this.eat(types.star)):r("get")?n.kind="get":r("set")&&(n.kind="set")),n.key||this.parsePropertyName(n);var o=n.key,a=!1;return n.computed||n.static||!("Identifier"===o.type&&"constructor"===o.name||"Literal"===o.type&&"constructor"===o.value)?n.static&&"Identifier"===o.type&&"prototype"===o.name&&this.raise(o.start,"Classes may not have a static property named prototype"):("method"!==n.kind&&this.raise(o.start,"Constructor can't have get/set modifier"),i&&this.raise(o.start,"Constructor can't be a generator"),s&&this.raise(o.start,"Constructor can't be an async method"),n.kind="constructor",a=e),this.parseClassMethod(n,i,s,a),"get"===n.kind&&0!==n.value.params.length&&this.raiseRecoverable(n.value.start,"getter should have no params"),"set"===n.kind&&1!==n.value.params.length&&this.raiseRecoverable(n.value.start,"setter should have exactly one param"),"set"===n.kind&&"RestElement"===n.value.params[0].type&&this.raiseRecoverable(n.value.params[0].start,"Setter cannot use rest params"),n},pp$1.parseClassMethod=function(e,t,n,r){return e.value=this.parseMethod(t,n,r),this.finishNode(e,"MethodDefinition")},pp$1.parseClassId=function(e,t){this.type===types.name?(e.id=this.parseIdent(),t&&this.checkLVal(e.id,BIND_LEXICAL,!1)):(!0===t&&this.unexpected(),e.id=null)},pp$1.parseClassSuper=function(e){e.superClass=this.eat(types._extends)?this.parseExprSubscripts():null},pp$1.parseExport=function(e,t){if(this.next(),this.eat(types.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseIdent(!0),this.checkExport(t,e.exported.name,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==types.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(types._default)){var n;if(this.checkExport(t,"default",this.lastTokStart),this.type===types._function||(n=this.isAsyncFunction())){var r=this.startNode();this.next(),n&&this.next(),e.declaration=this.parseFunction(r,FUNC_STATEMENT|FUNC_NULLABLE_ID,!1,n)}else if(this.type===types._class){var i=this.startNode();e.declaration=this.parseClass(i,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==types.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var s=0,o=e.specifiers;s=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r=8&&!s&&"async"===o.name&&!this.canInsertSemicolon()&&this.eat(types._function))return this.parseFunction(this.startNodeAt(r,i),0,!1,!0);if(n&&!this.canInsertSemicolon()){if(this.eat(types.arrow))return this.parseArrowExpression(this.startNodeAt(r,i),[o],!1);if(this.options.ecmaVersion>=8&&"async"===o.name&&this.type===types.name&&!s)return o=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(types.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(r,i),[o],!0)}return o;case types.regexp:var a=this.value;return(t=this.parseLiteral(a.value)).regex={pattern:a.pattern,flags:a.flags},t;case types.num:case types.string:return this.parseLiteral(this.value);case types._null:case types._true:case types._false:return(t=this.startNode()).value=this.type===types._null?null:this.type===types._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case types.parenL:var c=this.start,l=this.parseParenAndDistinguishExpression(n);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(e.parenthesizedAssign=c),e.parenthesizedBind<0&&(e.parenthesizedBind=c)),l;case types.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(types.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case types.braceL:return this.parseObj(!1,e);case types._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case types._class:return this.parseClass(this.startNode(),!1);case types._new:return this.parseNew();case types.backQuote:return this.parseTemplate();case types._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},pp$3.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var t=this.parseIdent(!0);switch(this.type){case types.parenL:return this.parseDynamicImport(e);case types.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}},pp$3.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(types.parenR)){var t=this.start;this.eat(types.comma)&&this.eat(types.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},pp$3.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},pp$3.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1)),this.next(),this.finishNode(t,"Literal")},pp$3.parseParenExpression=function(){this.expect(types.parenL);var e=this.parseExpression();return this.expect(types.parenR),e},pp$3.parseParenAndDistinguishExpression=function(e){var t,n=this.start,r=this.startLoc,i=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s,o=this.start,a=this.startLoc,c=[],l=!0,u=!1,p=new DestructuringErrors,h=this.yieldPos,d=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==types.parenR;){if(l?l=!1:this.expect(types.comma),i&&this.afterTrailingComma(types.parenR,!0)){u=!0;break}if(this.type===types.ellipsis){s=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===types.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}c.push(this.parseMaybeAssign(!1,p,this.parseParenItem))}var f=this.start,m=this.startLoc;if(this.expect(types.parenR),e&&!this.canInsertSemicolon()&&this.eat(types.arrow))return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=h,this.awaitPos=d,this.parseParenArrowList(n,r,c);c.length&&!u||this.unexpected(this.lastTokStart),s&&this.unexpected(s),this.checkExpressionErrors(p,!0),this.yieldPos=h||this.yieldPos,this.awaitPos=d||this.awaitPos,c.length>1?((t=this.startNodeAt(o,a)).expressions=c,this.finishNodeAt(t,"SequenceExpression",f,m)):t=c[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(n,r);return g.expression=t,this.finishNode(g,"ParenthesizedExpression")}return t},pp$3.parseParenItem=function(e){return e},pp$3.parseParenArrowList=function(e,t,n){return this.parseArrowExpression(this.startNodeAt(e,t),n)};var empty$1=[];pp$3.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(types.dot)){e.meta=t;var n=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),n&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.inNonArrowFunction()||this.raiseRecoverable(e.start,"'new.target' can only be used in functions"),this.finishNode(e,"MetaProperty")}var r=this.start,i=this.startLoc,s=this.type===types._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),r,i,!0),s&&"ImportExpression"===e.callee.type&&this.raise(r,"Cannot use new with import()"),this.eat(types.parenL)?e.arguments=this.parseExprList(types.parenR,this.options.ecmaVersion>=8,!1):e.arguments=empty$1,this.finishNode(e,"NewExpression")},pp$3.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===types.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value,cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),n.tail=this.type===types.backQuote,this.finishNode(n,"TemplateElement")},pp$3.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===types.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(types.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(types.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,"TemplateLiteral")},pp$3.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===types.name||this.type===types.num||this.type===types.string||this.type===types.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===types.star)&&!lineBreak.test(this.input.slice(this.lastTokEnd,this.start))},pp$3.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(types.braceR);){if(r)r=!1;else if(this.expect(types.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(types.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,i,t),n.properties.push(s)}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")},pp$3.parseProperty=function(e,t){var n,r,i,s,o=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(types.ellipsis))return e?(o.argument=this.parseIdent(!1),this.type===types.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(o,"RestElement")):(this.type===types.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),o.argument=this.parseMaybeAssign(!1,t),this.type===types.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(o,"SpreadElement"));this.options.ecmaVersion>=6&&(o.method=!1,o.shorthand=!1,(e||t)&&(i=this.start,s=this.startLoc),e||(n=this.eat(types.star)));var a=this.containsEsc;return this.parsePropertyName(o),!e&&!a&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(o)?(r=!0,n=this.options.ecmaVersion>=9&&this.eat(types.star),this.parsePropertyName(o,t)):r=!1,this.parsePropertyValue(o,e,n,r,i,s,t,a),this.finishNode(o,"Property")},pp$3.parsePropertyValue=function(e,t,n,r,i,s,o,a){if((n||r)&&this.type===types.colon&&this.unexpected(),this.eat(types.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===types.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(n,r);else if(t||a||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===types.comma||this.type===types.braceR||this.type===types.eq)this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=i),e.kind="init",t?e.value=this.parseMaybeDefault(i,s,e.key):this.type===types.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,s,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected();else{(n||r)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var c="get"===e.kind?0:1;if(e.value.params.length!==c){var l=e.value.start;"get"===e.kind?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}},pp$3.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(types.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(types.bracketR),e.key;e.computed=!1}return e.key=this.type===types.num||this.type===types.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},pp$3.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},pp$3.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(functionFlags(t,r.generator)|SCOPE_SUPER|(n?SCOPE_DIRECT_SUPER:0)),this.expect(types.parenL),r.params=this.parseBindingList(types.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(r,"FunctionExpression")},pp$3.parseArrowExpression=function(e,t,n){var r=this.yieldPos,i=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(functionFlags(n,!1)|SCOPE_ARROW),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=r,this.awaitPos=i,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")},pp$3.parseFunctionBody=function(e,t,n){var r=t&&this.type!==types.braceL,i=this.strict,s=!1;if(r)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);i&&!o||(s=this.strictDirective(this.end))&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var a=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(e,!i&&!s&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLVal(e.id,BIND_OUTSIDE),e.body=this.parseBlock(!1,void 0,s&&!i),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=a}this.exitScope()},pp$3.isSimpleParamList=function(e){for(var t=0,n=e;t-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&SCOPE_TOP&&delete this.undefinedExports[e]}else if(t===BIND_SIMPLE_CATCH){this.currentScope().lexical.push(e)}else if(t===BIND_FUNCTION){var s=this.currentScope();r=this.treatFunctionsAsVar?s.lexical.indexOf(e)>-1:s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var a=this.scopeStack[o];if(a.lexical.indexOf(e)>-1&&!(a.flags&SCOPE_SIMPLE_CATCH&&a.lexical[0]===e)||!this.treatFunctionsAsVarInScope(a)&&a.functions.indexOf(e)>-1){r=!0;break}if(a.var.push(e),this.inModule&&a.flags&SCOPE_TOP&&delete this.undefinedExports[e],a.flags&SCOPE_VAR)break}r&&this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared")},pp$5.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},pp$5.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},pp$5.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&SCOPE_VAR)return t}},pp$5.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&SCOPE_VAR&&!(t.flags&SCOPE_ARROW))return t}};var Node=function(e,t,n){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new SourceLocation(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},pp$6=Parser.prototype;function finishNodeAt(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}pp$6.startNode=function(){return new Node(this,this.start,this.startLoc)},pp$6.startNodeAt=function(e,t){return new Node(this,e,t)},pp$6.finishNode=function(e,t){return finishNodeAt.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},pp$6.finishNodeAt=function(e,t,n,r){return finishNodeAt.call(this,e,t,n,r)};var TokContext=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},types$1={b_stat:new TokContext("{",!1),b_expr:new TokContext("{",!0),b_tmpl:new TokContext("${",!1),p_stat:new TokContext("(",!1),p_expr:new TokContext("(",!0),q_tmpl:new TokContext("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new TokContext("function",!1),f_expr:new TokContext("function",!0),f_expr_gen:new TokContext("function",!0,!1,null,!0),f_gen:new TokContext("function",!1,!1,null,!0)},pp$7=Parser.prototype;pp$7.initialContext=function(){return[types$1.b_stat]},pp$7.braceIsBlock=function(e){var t=this.curContext();return t===types$1.f_expr||t===types$1.f_stat||(e!==types.colon||t!==types$1.b_stat&&t!==types$1.b_expr?e===types._return||e===types.name&&this.exprAllowed?lineBreak.test(this.input.slice(this.lastTokEnd,this.start)):e===types._else||e===types.semi||e===types.eof||e===types.parenR||e===types.arrow||(e===types.braceL?t===types$1.b_stat:e!==types._var&&e!==types._const&&e!==types.name&&!this.exprAllowed):!t.isExpr)},pp$7.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},pp$7.updateContext=function(e){var t,n=this.type;n.keyword&&e===types.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},types.parenR.updateContext=types.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===types$1.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},types.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?types$1.b_stat:types$1.b_expr),this.exprAllowed=!0},types.dollarBraceL.updateContext=function(){this.context.push(types$1.b_tmpl),this.exprAllowed=!0},types.parenL.updateContext=function(e){var t=e===types._if||e===types._for||e===types._with||e===types._while;this.context.push(t?types$1.p_stat:types$1.p_expr),this.exprAllowed=!0},types.incDec.updateContext=function(){},types._function.updateContext=types._class.updateContext=function(e){!e.beforeExpr||e===types.semi||e===types._else||e===types._return&&lineBreak.test(this.input.slice(this.lastTokEnd,this.start))||(e===types.colon||e===types.braceL)&&this.curContext()===types$1.b_stat?this.context.push(types$1.f_stat):this.context.push(types$1.f_expr),this.exprAllowed=!1},types.backQuote.updateContext=function(){this.curContext()===types$1.q_tmpl?this.context.pop():this.context.push(types$1.q_tmpl),this.exprAllowed=!1},types.star.updateContext=function(e){if(e===types._function){var t=this.context.length-1;this.context[t]===types$1.f_expr?this.context[t]=types$1.f_expr_gen:this.context[t]=types$1.f_gen}this.exprAllowed=!0},types.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==types.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var ecma9BinaryProperties="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",ecma10BinaryProperties=ecma9BinaryProperties+" Extended_Pictographic",ecma11BinaryProperties=ecma10BinaryProperties,unicodeBinaryProperties={9:ecma9BinaryProperties,10:ecma10BinaryProperties,11:ecma11BinaryProperties},unicodeGeneralCategoryValues="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",ecma9ScriptValues="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",ecma10ScriptValues=ecma9ScriptValues+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ecma11ScriptValues=ecma10ScriptValues+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",unicodeScriptValues={9:ecma9ScriptValues,10:ecma10ScriptValues,11:ecma11ScriptValues},data={};function buildUnicodeData(e){var t=data[e]={binary:wordsRegexp(unicodeBinaryProperties[e]+" "+unicodeGeneralCategoryValues),nonBinary:{General_Category:wordsRegexp(unicodeGeneralCategoryValues),Script:wordsRegexp(unicodeScriptValues[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}buildUnicodeData(9),buildUnicodeData(10),buildUnicodeData(11);var pp$8=Parser.prototype,RegExpValidationState=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=data[e.options.ecmaVersion>=11?11:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function isSyntaxCharacter(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function isRegExpIdentifierStart(e){return isIdentifierStart(e,!0)||36===e||95===e}function isRegExpIdentifierPart(e){return isIdentifierChar(e,!0)||36===e||95===e||8204===e||8205===e}function isControlLetter(e){return e>=65&&e<=90||e>=97&&e<=122}function isValidUnicode(e){return e>=0&&e<=1114111}function isCharacterClassEscape(e){return 100===e||68===e||115===e||83===e||119===e||87===e}function isUnicodePropertyNameCharacter(e){return isControlLetter(e)||95===e}function isUnicodePropertyValueCharacter(e){return isUnicodePropertyNameCharacter(e)||isDecimalDigit(e)}function isDecimalDigit(e){return e>=48&&e<=57}function isHexDigit(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function hexToInt(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function isOctalDigit(e){return e>=48&&e<=55}RegExpValidationState.prototype.reset=function(e,t,n){var r=-1!==n.indexOf("u");this.start=0|e,this.source=t+"",this.flags=n,this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchN=r&&this.parser.options.ecmaVersion>=9},RegExpValidationState.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},RegExpValidationState.prototype.at=function(e,t){void 0===t&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!t&&!this.switchU||i<=55295||i>=57344||e+1>=r)return i;var s=n.charCodeAt(e+1);return s>=56320&&s<=57343?(i<<10)+s-56613888:i},RegExpValidationState.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i,s=n.charCodeAt(e);return!t&&!this.switchU||s<=55295||s>=57344||e+1>=r||(i=n.charCodeAt(e+1))<56320||i>57343?e+1:e+2},RegExpValidationState.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},RegExpValidationState.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},RegExpValidationState.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},RegExpValidationState.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},pp$8.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=0;r-1&&this.raise(e.start,"Duplicate regular expression flag")}},pp$8.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},pp$8.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,n=e.backReferenceNames;t=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},pp$8.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},pp$8.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},pp$8.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return-1!==i&&i=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},pp$8.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},pp$8.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},pp$8.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!isSyntaxCharacter(t)&&(e.lastIntValue=t,e.advance(),!0)},pp$8.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;-1!==(n=e.current())&&!isSyntaxCharacter(n);)e.advance();return e.pos!==t},pp$8.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},pp$8.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e))return-1!==e.groupNames.indexOf(e.lastStringValue)&&e.raise("Duplicate capture group name"),void e.groupNames.push(e.lastStringValue);e.raise("Invalid group")}},pp$8.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},pp$8.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=codePointToString(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=codePointToString(e.lastIntValue);return!0}return!1},pp$8.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),92===r&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),isRegExpIdentifierStart(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)},pp$8.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),92===r&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),isRegExpIdentifierPart(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)},pp$8.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},pp$8.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},pp$8.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},pp$8.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},pp$8.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},pp$8.regexp_eatZero=function(e){return 48===e.current()&&!isDecimalDigit(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},pp$8.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},pp$8.regexp_eatControlLetter=function(e){var t=e.current();return!!isControlLetter(t)&&(e.lastIntValue=t%32,e.advance(),!0)},pp$8.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var s=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=1024*(i-55296)+(o-56320)+65536,!0}e.pos=s,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&isValidUnicode(e.lastIntValue))return!0;r&&e.raise("Invalid unicode escape"),e.pos=n}return!1},pp$8.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},pp$8.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1},pp$8.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(isCharacterClassEscape(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(80===t||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1},pp$8.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i),!0}return!1},pp$8.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){has(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(n)||e.raise("Invalid property value")},pp$8.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},pp$8.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";isUnicodePropertyNameCharacter(t=e.current());)e.lastStringValue+=codePointToString(t),e.advance();return""!==e.lastStringValue},pp$8.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";isUnicodePropertyValueCharacter(t=e.current());)e.lastStringValue+=codePointToString(t),e.advance();return""!==e.lastStringValue},pp$8.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},pp$8.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1},pp$8.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;!e.switchU||-1!==t&&-1!==n||e.raise("Invalid character class"),-1!==t&&-1!==n&&t>n&&e.raise("Range out of order in character class")}}},pp$8.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(99===n||isOctalDigit(n))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var r=e.current();return 93!==r&&(e.lastIntValue=r,e.advance(),!0)},pp$8.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},pp$8.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!isDecimalDigit(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},pp$8.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},pp$8.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;isDecimalDigit(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t},pp$8.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;isHexDigit(n=e.current());)e.lastIntValue=16*e.lastIntValue+hexToInt(n),e.advance();return e.pos!==t},pp$8.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*n+e.lastIntValue:e.lastIntValue=8*t+n}else e.lastIntValue=t;return!0}return!1},pp$8.regexp_eatOctalDigit=function(e){var t=e.current();return isOctalDigit(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},pp$8.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r>10),56320+(1023&e)))}pp$9.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Token(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},pp$9.getToken=function(){return this.next(),new Token(this)},"undefined"!=typeof Symbol&&(pp$9[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===types.eof,value:t}}}}),pp$9.curContext=function(){return this.context[this.context.length-1]},pp$9.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(types.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},pp$9.readToken=function(e){return isIdentifierStart(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},pp$9.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},pp$9.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),n=this.pos,r=this.input.indexOf("*/",this.pos+=2);if(-1===r&&this.raise(this.pos-2,"Unterminated comment"),this.pos=r+2,this.options.locations)for(lineBreakG.lastIndex=n;(e=lineBreakG.exec(this.input))&&e.index8&&e<14||e>=5760&&nonASCIIwhitespace.test(String.fromCharCode(e))))break e;++this.pos}}},pp$9.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},pp$9.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(types.ellipsis)):(++this.pos,this.finishToken(types.dot))},pp$9.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(types.assign,2):this.finishOp(types.slash,1)},pp$9.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=42===e?types.star:types.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++n,r=types.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(types.assign,n+1):this.finishOp(r,n)},pp$9.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.finishOp(124===e?types.logicalOR:types.logicalAND,2):61===t?this.finishOp(types.assign,2):this.finishOp(124===e?types.bitwiseOR:types.bitwiseAND,1)},pp$9.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(types.assign,2):this.finishOp(types.bitwiseXOR,1)},pp$9.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!lineBreak.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(types.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(types.assign,2):this.finishOp(types.plusMin,1)},pp$9.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+n)?this.finishOp(types.assign,n+1):this.finishOp(types.bitShift,n)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(n=2),this.finishOp(types.relational,n)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},pp$9.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(types.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(types.arrow)):this.finishOp(61===e?types.eq:types.prefix,1)},pp$9.readToken_question=function(){if(this.options.ecmaVersion>=11){var e=this.input.charCodeAt(this.pos+1);if(46===e){var t=this.input.charCodeAt(this.pos+2);if(t<48||t>57)return this.finishOp(types.questionDot,2)}if(63===e)return this.finishOp(types.coalesce,2)}return this.finishOp(types.question,1)},pp$9.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(types.parenL);case 41:return++this.pos,this.finishToken(types.parenR);case 59:return++this.pos,this.finishToken(types.semi);case 44:return++this.pos,this.finishToken(types.comma);case 91:return++this.pos,this.finishToken(types.bracketL);case 93:return++this.pos,this.finishToken(types.bracketR);case 123:return++this.pos,this.finishToken(types.braceL);case 125:return++this.pos,this.finishToken(types.braceR);case 58:return++this.pos,this.finishToken(types.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(types.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(types.prefix,1)}this.raise(this.pos,"Unexpected character '"+codePointToString$1(e)+"'")},pp$9.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},pp$9.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(lineBreak.test(r)&&this.raise(n,"Unterminated regular expression"),e)e=!1;else{if("["===r)t=!0;else if("]"===r&&t)t=!1;else if("/"===r&&!t)break;e="\\"===r}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var s=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(s);var a=this.regexpState||(this.regexpState=new RegExpValidationState(this));a.reset(n,i,o),this.validateRegExpFlags(a),this.validateRegExpPattern(a);var c=null;try{c=new RegExp(i,o)}catch(e){}return this.finishToken(types.regexp,{pattern:i,flags:o,value:c})},pp$9.readInt=function(e,t){for(var n=this.pos,r=0,i=0,s=null==t?1/0:t;i=97?o-97+10:o>=65?o-65+10:o>=48&&o<=57?o-48:1/0)>=e)break;++this.pos,r=r*e+a}return this.pos===n||null!=t&&this.pos-n!==t?null:r},pp$9.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return null==n&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(n="undefined"!=typeof BigInt?BigInt(this.input.slice(t,this.pos)):null,++this.pos):isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(types.num,n)},pp$9.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10)||this.raise(t,"Invalid number");var n=this.pos-t>=2&&48===this.input.charCodeAt(t);n&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&110===r){var i=this.input.slice(t,this.pos),s="undefined"!=typeof BigInt?BigInt(i):null;return++this.pos,isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(types.num,s)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),46!==r||n||(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),69!==r&&101!==r||n||(43!==(r=this.input.charCodeAt(++this.pos))&&45!==r||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var o=this.input.slice(t,this.pos),a=n?parseInt(o,8):parseFloat(o);return this.finishToken(types.num,a)},pp$9.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},pp$9.readString=function(e){for(var t="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;92===r?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):(isNewLine(r,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(types.string,t)};var INVALID_TEMPLATE_ESCAPE_ERROR={};pp$9.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==INVALID_TEMPLATE_ESCAPE_ERROR)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},pp$9.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw INVALID_TEMPLATE_ESCAPE_ERROR;this.raise(e,t)},pp$9.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(96===n||36===n&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==types.template&&this.type!==types.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(types.template,e)):36===n?(this.pos+=2,this.finishToken(types.dollarBraceL)):(++this.pos,this.finishToken(types.backQuote));if(92===n)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(isNewLine(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},pp$9.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),"0"===r&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return isNewLine(t)?"":String.fromCharCode(t)}},pp$9.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return null===n&&this.invalidStringToken(t,"Bad character escape sequence"),n},pp$9.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos{},getLiteralValueAtPath:()=>UnknownValue,getReturnExpressionWhenCalledAtPath:()=>UNKNOWN_EXPRESSION,hasEffectsWhenAccessedAtPath:e=>e.length>0,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:()=>!0,include:()=>{},includeCallArguments(e,t){for(const n of t)n.include(e,!1)},included:!0,toString:()=>"[[UNKNOWN]]"},UNDEFINED_EXPRESSION={deoptimizePath:()=>{},getLiteralValueAtPath:()=>{},getReturnExpressionWhenCalledAtPath:()=>UNKNOWN_EXPRESSION,hasEffectsWhenAccessedAtPath:e=>e.length>0,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:()=>!0,include:()=>{},includeCallArguments(){},included:!0,toString:()=>"undefined"},returnsUnknown={value:{callsArgs:null,mutatesSelf:!1,returns:null,returnsPrimitive:UNKNOWN_EXPRESSION}},mutatesSelfReturnsUnknown={value:{returns:null,returnsPrimitive:UNKNOWN_EXPRESSION,callsArgs:null,mutatesSelf:!0}},callsArgReturnsUnknown={value:{returns:null,returnsPrimitive:UNKNOWN_EXPRESSION,callsArgs:[0],mutatesSelf:!1}};class UnknownArrayExpression{constructor(){this.included=!1}deoptimizePath(){}getLiteralValueAtPath(){return UnknownValue}getReturnExpressionWhenCalledAtPath(e){return 1===e.length?getMemberReturnExpressionWhenCalled(arrayMembers,e[0]):UNKNOWN_EXPRESSION}hasEffectsWhenAccessedAtPath(e){return e.length>1}hasEffectsWhenAssignedAtPath(e){return e.length>1}hasEffectsWhenCalledAtPath(e,t,n){return 1!==e.length||hasMemberEffectWhenCalled(arrayMembers,e[0],this.included,t,n)}include(){this.included=!0}includeCallArguments(e,t){for(const n of t)n.include(e,!1)}toString(){return"[[UNKNOWN ARRAY]]"}}const returnsArray={value:{callsArgs:null,mutatesSelf:!1,returns:UnknownArrayExpression,returnsPrimitive:null}},mutatesSelfReturnsArray={value:{callsArgs:null,mutatesSelf:!0,returns:UnknownArrayExpression,returnsPrimitive:null}},callsArgReturnsArray={value:{callsArgs:[0],mutatesSelf:!1,returns:UnknownArrayExpression,returnsPrimitive:null}},callsArgMutatesSelfReturnsArray={value:{callsArgs:[0],mutatesSelf:!0,returns:UnknownArrayExpression,returnsPrimitive:null}},UNKNOWN_LITERAL_BOOLEAN={deoptimizePath:()=>{},getLiteralValueAtPath:()=>UnknownValue,getReturnExpressionWhenCalledAtPath:e=>1===e.length?getMemberReturnExpressionWhenCalled(literalBooleanMembers,e[0]):UNKNOWN_EXPRESSION,hasEffectsWhenAccessedAtPath:e=>e.length>1,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:e=>{if(1===e.length){const t=e[0];return"string"!=typeof t||!literalBooleanMembers[t]}return!0},include:()=>{},includeCallArguments(e,t){for(const n of t)n.include(e,!1)},included:!0,toString:()=>"[[UNKNOWN BOOLEAN]]"},returnsBoolean={value:{callsArgs:null,mutatesSelf:!1,returns:null,returnsPrimitive:UNKNOWN_LITERAL_BOOLEAN}},callsArgReturnsBoolean={value:{callsArgs:[0],mutatesSelf:!1,returns:null,returnsPrimitive:UNKNOWN_LITERAL_BOOLEAN}},UNKNOWN_LITERAL_NUMBER={deoptimizePath:()=>{},getLiteralValueAtPath:()=>UnknownValue,getReturnExpressionWhenCalledAtPath:e=>1===e.length?getMemberReturnExpressionWhenCalled(literalNumberMembers,e[0]):UNKNOWN_EXPRESSION,hasEffectsWhenAccessedAtPath:e=>e.length>1,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:e=>{if(1===e.length){const t=e[0];return"string"!=typeof t||!literalNumberMembers[t]}return!0},include:()=>{},includeCallArguments(e,t){for(const n of t)n.include(e,!1)},included:!0,toString:()=>"[[UNKNOWN NUMBER]]"},returnsNumber={value:{callsArgs:null,mutatesSelf:!1,returns:null,returnsPrimitive:UNKNOWN_LITERAL_NUMBER}},mutatesSelfReturnsNumber={value:{callsArgs:null,mutatesSelf:!0,returns:null,returnsPrimitive:UNKNOWN_LITERAL_NUMBER}},callsArgReturnsNumber={value:{callsArgs:[0],mutatesSelf:!1,returns:null,returnsPrimitive:UNKNOWN_LITERAL_NUMBER}},UNKNOWN_LITERAL_STRING={deoptimizePath:()=>{},getLiteralValueAtPath:()=>UnknownValue,getReturnExpressionWhenCalledAtPath:e=>1===e.length?getMemberReturnExpressionWhenCalled(literalStringMembers,e[0]):UNKNOWN_EXPRESSION,hasEffectsWhenAccessedAtPath:e=>e.length>1,hasEffectsWhenAssignedAtPath:e=>e.length>0,hasEffectsWhenCalledAtPath:(e,t,n)=>1!==e.length||hasMemberEffectWhenCalled(literalStringMembers,e[0],!0,t,n),include:()=>{},includeCallArguments(e,t){for(const n of t)n.include(e,!1)},included:!0,toString:()=>"[[UNKNOWN STRING]]"},returnsString={value:{callsArgs:null,mutatesSelf:!1,returns:null,returnsPrimitive:UNKNOWN_LITERAL_STRING}};class UnknownObjectExpression{constructor(){this.included=!1}deoptimizePath(){}getLiteralValueAtPath(){return UnknownValue}getReturnExpressionWhenCalledAtPath(e){return 1===e.length?getMemberReturnExpressionWhenCalled(objectMembers,e[0]):UNKNOWN_EXPRESSION}hasEffectsWhenAccessedAtPath(e){return e.length>1}hasEffectsWhenAssignedAtPath(e){return e.length>1}hasEffectsWhenCalledAtPath(e,t,n){return 1!==e.length||hasMemberEffectWhenCalled(objectMembers,e[0],this.included,t,n)}include(){this.included=!0}includeCallArguments(e,t){for(const n of t)n.include(e,!1)}toString(){return"[[UNKNOWN OBJECT]]"}}const objectMembers=assembleMemberDescriptions({hasOwnProperty:returnsBoolean,isPrototypeOf:returnsBoolean,propertyIsEnumerable:returnsBoolean,toLocaleString:returnsString,toString:returnsString,valueOf:returnsUnknown}),arrayMembers=assembleMemberDescriptions({concat:returnsArray,copyWithin:mutatesSelfReturnsArray,every:callsArgReturnsBoolean,fill:mutatesSelfReturnsArray,filter:callsArgReturnsArray,find:callsArgReturnsUnknown,findIndex:callsArgReturnsNumber,forEach:callsArgReturnsUnknown,includes:returnsBoolean,indexOf:returnsNumber,join:returnsString,lastIndexOf:returnsNumber,map:callsArgReturnsArray,pop:mutatesSelfReturnsUnknown,push:mutatesSelfReturnsNumber,reduce:callsArgReturnsUnknown,reduceRight:callsArgReturnsUnknown,reverse:mutatesSelfReturnsArray,shift:mutatesSelfReturnsUnknown,slice:returnsArray,some:callsArgReturnsBoolean,sort:callsArgMutatesSelfReturnsArray,splice:mutatesSelfReturnsArray,unshift:mutatesSelfReturnsNumber},objectMembers),literalBooleanMembers=assembleMemberDescriptions({valueOf:returnsBoolean},objectMembers),literalNumberMembers=assembleMemberDescriptions({toExponential:returnsString,toFixed:returnsString,toLocaleString:returnsString,toPrecision:returnsString,valueOf:returnsNumber},objectMembers),literalStringMembers=assembleMemberDescriptions({charAt:returnsString,charCodeAt:returnsNumber,codePointAt:returnsNumber,concat:returnsString,endsWith:returnsBoolean,includes:returnsBoolean,indexOf:returnsNumber,lastIndexOf:returnsNumber,localeCompare:returnsNumber,match:returnsBoolean,normalize:returnsString,padEnd:returnsString,padStart:returnsString,repeat:returnsString,replace:{value:{callsArgs:[1],mutatesSelf:!1,returns:null,returnsPrimitive:UNKNOWN_LITERAL_STRING}},search:returnsNumber,slice:returnsString,split:returnsArray,startsWith:returnsBoolean,substr:returnsString,substring:returnsString,toLocaleLowerCase:returnsString,toLocaleUpperCase:returnsString,toLowerCase:returnsString,toUpperCase:returnsString,trim:returnsString,valueOf:returnsString},objectMembers);function getLiteralMembersForValue(e){switch(typeof e){case"boolean":return literalBooleanMembers;case"number":return literalNumberMembers;case"string":return literalStringMembers;default:return Object.create(null)}}function hasMemberEffectWhenCalled(e,t,n,r,i){if("string"!=typeof t||!e[t]||e[t].mutatesSelf&&n)return!0;if(!e[t].callsArgs)return!1;for(const n of e[t].callsArgs)if(r.args[n]&&r.args[n].hasEffectsWhenCalledAtPath(EMPTY_PATH,{args:NO_ARGS,withNew:!1},i))return!0;return!1}function getMemberReturnExpressionWhenCalled(e,t){return"string"==typeof t&&e[t]?null!==e[t].returnsPrimitive?e[t].returnsPrimitive:new e[t].returns:UNKNOWN_EXPRESSION}class Variable{constructor(e){this.alwaysRendered=!1,this.included=!1,this.isId=!1,this.isReassigned=!1,this.renderBaseName=null,this.renderName=null,this.name=e}addReference(e){}deoptimizePath(e){}getBaseVariableName(){return this.renderBaseName||this.renderName||this.name}getLiteralValueAtPath(e,t,n){return UnknownValue}getName(){const e=this.renderName||this.name;return this.renderBaseName?`${this.renderBaseName}.${e}`:e}getReturnExpressionWhenCalledAtPath(e,t,n){return UNKNOWN_EXPRESSION}hasEffectsWhenAccessedAtPath(e,t){return e.length>0}hasEffectsWhenAssignedAtPath(e,t){return!0}hasEffectsWhenCalledAtPath(e,t,n){return!0}include(){this.included=!0}includeCallArguments(e,t){for(const n of t)n.include(e,!1)}markCalledFromTryStatement(){}setRenderNames(e,t){this.renderBaseName=e,this.renderName=t}setSafeName(e){this.renderName=e}}class GlobalVariable extends Variable{constructor(){super(...arguments),this.isReassigned=!0}hasEffectsWhenAccessedAtPath(e){return!isGlobalMember([this.name,...e])}hasEffectsWhenCalledAtPath(e){return!isPureGlobal([this.name,...e])}}class UndefinedVariable extends Variable{constructor(){super("undefined")}getLiteralValueAtPath(){}}class ExternalVariable extends Variable{constructor(e,t){super(t),this.module=e,this.isNamespace="*"===t,this.referenced=!1}addReference(e){this.referenced=!0,"default"!==this.name&&"*"!==this.name||this.module.suggestName(e.name)}include(){this.included||(this.included=!0,this.module.used=!0)}}const reservedWords$1="break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public".split(" "),builtins="Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl".split(" "),blacklisted=new Set(reservedWords$1.concat(builtins)),illegalCharacters=/[^$_a-zA-Z0-9]/g,startsWithDigit=e=>/\d/.test(e[0]);function isLegal(e){return!startsWithDigit(e)&&!blacklisted.has(e)&&!illegalCharacters.test(e)}function makeLegal(e){return e=e.replace(/-(\w)/g,(e,t)=>t.toUpperCase()).replace(illegalCharacters,"_"),(startsWithDigit(e)||blacklisted.has(e))&&(e="_"+e),e||"_"}class ExternalModule{constructor(e,t,n){this.options=e,this.dynamicImporters=[],this.exportsNames=!1,this.exportsNamespace=!1,this.importers=[],this.mostCommonSuggestion=0,this.reexported=!1,this.renderPath=void 0,this.renormalizeRenderPath=!1,this.used=!1,this.id=t,this.execIndex=1/0,this.moduleSideEffects=n;const r=t.split(/[\\/]/);this.variableName=makeLegal(r.pop()),this.nameSuggestions=Object.create(null),this.declarations=Object.create(null),this.exportedVariables=new Map}getVariableForExportName(e){"*"===e?this.exportsNamespace=!0:"default"!==e&&(this.exportsNames=!0);let t=this.declarations[e];return t||(this.declarations[e]=t=new ExternalVariable(this,e),this.exportedVariables.set(t,e),t)}setRenderPath(e,t){return this.renderPath="function"==typeof e.paths?e.paths(this.id):e.paths[this.id],this.renderPath||(isAbsolute(this.id)?(this.renderPath=normalize(path$n.relative(t,this.id)),this.renormalizeRenderPath=!0):this.renderPath=this.id),this.renderPath}suggestName(e){this.nameSuggestions[e]||(this.nameSuggestions[e]=0),this.nameSuggestions[e]+=1,this.nameSuggestions[e]>this.mostCommonSuggestion&&(this.mostCommonSuggestion=this.nameSuggestions[e],this.variableName=e)}warnUnusedImports(){const e=Object.keys(this.declarations).filter(e=>{if("*"===e)return!1;const t=this.declarations[e];return!t.included&&!this.reexported&&!t.referenced});if(0===e.length)return;const t=1===e.length?`'${e[0]}' is`:`${e.slice(0,-1).map(e=>`'${e}'`).join(", ")} and '${e.slice(-1)}' are`;this.options.onwarn({code:"UNUSED_EXTERNAL_IMPORT",message:`${t} imported from external module '${this.id}' but never used`,names:e,source:this.id})}}function markModuleAndImpureDependenciesAsExecuted(e){e.isExecuted=!0;const t=[e],n=new Set;for(const e of t)for(const r of[...e.dependencies,...e.implicitlyLoadedBefore])r instanceof ExternalModule||r.isExecuted||!r.moduleSideEffects&&!e.implicitlyLoadedBefore.has(r)||n.has(r.id)||(r.isExecuted=!0,n.add(r.id),t.push(r))}const BROKEN_FLOW_NONE=0,BROKEN_FLOW_BREAK_CONTINUE=1,BROKEN_FLOW_ERROR_RETURN_LABEL=2;function createInclusionContext(){return{brokenFlow:0,includedCallArguments:new Set,includedLabels:new Set}}function createHasEffectsContext(){return{accessed:new PathTracker,assigned:new PathTracker,brokenFlow:0,called:new DiscriminatedPathTracker,ignore:{breaks:!1,continues:!1,labels:new Set,returnAwaitYield:!1},includedLabels:new Set,instantiated:new DiscriminatedPathTracker,replacedVariableInits:new Map}}const ArrowFunctionExpression="ArrowFunctionExpression",BlockStatement="BlockStatement",CallExpression="CallExpression",ExpressionStatement="ExpressionStatement",FunctionExpression="FunctionExpression",Identifier="Identifier",ImportDefaultSpecifier="ImportDefaultSpecifier",ImportNamespaceSpecifier="ImportNamespaceSpecifier",Program="Program",Property="Property",ReturnStatement="ReturnStatement",MAX_PATH_DEPTH=7;class LocalVariable extends Variable{constructor(e,t,n,r){super(e),this.additionalInitializers=null,this.calledFromTryStatement=!1,this.expressionsToBeDeoptimized=[],this.declarations=t?[t]:[],this.init=n,this.deoptimizationTracker=r.deoptimizationTracker,this.module=r.module}addDeclaration(e,t){this.declarations.push(e),null===this.additionalInitializers&&(this.additionalInitializers=null===this.init?[]:[this.init],this.init=UNKNOWN_EXPRESSION,this.isReassigned=!0),null!==t&&this.additionalInitializers.push(t)}consolidateInitializers(){if(null!==this.additionalInitializers){for(const e of this.additionalInitializers)e.deoptimizePath(UNKNOWN_PATH);this.additionalInitializers=null}}deoptimizePath(e){if(e.length>7||this.isReassigned)return;const t=this.deoptimizationTracker.getEntities(e);if(!t.has(this))if(t.add(this),0===e.length){if(!this.isReassigned){this.isReassigned=!0;const e=this.expressionsToBeDeoptimized;this.expressionsToBeDeoptimized=[];for(const t of e)t.deoptimizeCache();this.init&&this.init.deoptimizePath(UNKNOWN_PATH)}}else this.init&&this.init.deoptimizePath(e)}getLiteralValueAtPath(e,t,n){if(this.isReassigned||!this.init||e.length>7)return UnknownValue;const r=t.getEntities(e);if(r.has(this.init))return UnknownValue;this.expressionsToBeDeoptimized.push(n),r.add(this.init);const i=this.init.getLiteralValueAtPath(e,t,n);return r.delete(this.init),i}getReturnExpressionWhenCalledAtPath(e,t,n){if(this.isReassigned||!this.init||e.length>7)return UNKNOWN_EXPRESSION;const r=t.getEntities(e);if(r.has(this.init))return UNKNOWN_EXPRESSION;this.expressionsToBeDeoptimized.push(n),r.add(this.init);const i=this.init.getReturnExpressionWhenCalledAtPath(e,t,n);return r.delete(this.init),i}hasEffectsWhenAccessedAtPath(e,t){if(0===e.length)return!1;if(this.isReassigned||e.length>7)return!0;const n=t.accessed.getEntities(e);return!n.has(this)&&(n.add(this),this.init&&this.init.hasEffectsWhenAccessedAtPath(e,t))}hasEffectsWhenAssignedAtPath(e,t){if(this.included||e.length>7)return!0;if(0===e.length)return!1;if(this.isReassigned)return!0;const n=t.assigned.getEntities(e);return!n.has(this)&&(n.add(this),this.init&&this.init.hasEffectsWhenAssignedAtPath(e,t))}hasEffectsWhenCalledAtPath(e,t,n){if(e.length>7||this.isReassigned)return!0;const r=(t.withNew?n.instantiated:n.called).getEntities(e,t);return!r.has(this)&&(r.add(this),this.init&&this.init.hasEffectsWhenCalledAtPath(e,t,n))}include(){if(!this.included){this.included=!0,this.module.isExecuted||markModuleAndImpureDependenciesAsExecuted(this.module);for(const e of this.declarations){e.included||e.include(createInclusionContext(),!1);let t=e.parent;for(;!t.included&&(t.included=!0,t.type!==Program);)t=t.parent}}}includeCallArguments(e,t){if(this.isReassigned||this.init&&e.includedCallArguments.has(this.init))for(const n of t)n.include(e,!1);else this.init&&(e.includedCallArguments.add(this.init),this.init.includeCallArguments(e,t),e.includedCallArguments.delete(this.init))}markCalledFromTryStatement(){this.calledFromTryStatement=!0}}class Scope$1{constructor(){this.children=[],this.variables=new Map}addDeclaration(e,t,n=null,r){const i=e.name;let s=this.variables.get(i);return s?s.addDeclaration(e,n):(s=new LocalVariable(e.name,e,n||UNDEFINED_EXPRESSION,t),this.variables.set(i,s)),s}contains(e){return this.variables.has(e)}findVariable(e){throw new Error("Internal Error: findVariable needs to be implemented by a subclass")}}class GlobalScope extends Scope$1{constructor(){super(),this.variables.set("undefined",new UndefinedVariable)}findVariable(e){let t=this.variables.get(e);return t||(t=new GlobalVariable(e),this.variables.set(e,t)),t}}for(var charToInteger={},chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=0;i>>=1,p&&(a=0===a?-2147483648:-a),r[i]+=a,i++,a=o=0}}}return segmentify(n,r,i),t.push(n),t}function segmentify(e,t,n){4===n?e.push([t[0],t[1],t[2],t[3]]):5===n?e.push([t[0],t[1],t[2],t[3],t[4]]):1===n&&e.push([t[0]])}function encode(e){for(var t=0,n=0,r=0,i=0,s="",o=0;o0&&(s+=";"),0!==a.length){for(var c=0,l=[],u=0,p=a;u1&&(d+=encodeInteger(h[1]-t)+encodeInteger(h[2]-n)+encodeInteger(h[3]-r),t=h[1],n=h[2],r=h[3]),5===h.length&&(d+=encodeInteger(h[4]-i),i=h[4]),l.push(d)}s+=l.join(",")}}return s}function encodeInteger(e){var t="";e=e<0?-e<<1|1:e<<1;do{var n=31&e;(e>>>=5)>0&&(n|=32),t+=chars[n]}while(e>0);return t}var BitSet=function e(t){this.bits=t instanceof e?t.bits.slice():[]};BitSet.prototype.add=function(e){this.bits[e>>5]|=1<<(31&e)},BitSet.prototype.has=function(e){return!!(this.bits[e>>5]&1<<(31&e))};var Chunk=function(e,t,n){this.start=e,this.end=t,this.original=n,this.intro="",this.outro="",this.content=n,this.storeName=!1,this.edited=!1,Object.defineProperties(this,{previous:{writable:!0,value:null},next:{writable:!0,value:null}})};Chunk.prototype.appendLeft=function(e){this.outro+=e},Chunk.prototype.appendRight=function(e){this.intro=this.intro+e},Chunk.prototype.clone=function(){var e=new Chunk(this.start,this.end,this.original);return e.intro=this.intro,e.outro=this.outro,e.content=this.content,e.storeName=this.storeName,e.edited=this.edited,e},Chunk.prototype.contains=function(e){return this.start=r.length)return"\t";var i=r.reduce((function(e,t){var n=/^ +/.exec(t)[0].length;return Math.min(n,e)}),1/0);return new Array(i+1).join(" ")}function getRelativePath(e,t){var n=e.split(/[/\\]/),r=t.split(/[/\\]/);for(n.pop();n[0]===r[0];)n.shift(),r.shift();if(n.length)for(var i=n.length;i--;)n[i]="..";return n.concat(r).join("/")}SourceMap.prototype.toString=function(){return JSON.stringify(this)},SourceMap.prototype.toUrl=function(){return"data:application/json;charset=utf-8;base64,"+btoa$1(this.toString())};var toString$1=Object.prototype.toString;function isObject(e){return"[object Object]"===toString$1.call(e)}function getLocator$1(e){for(var t=e.split("\n"),n=[],r=0,i=0;r>1;e=0&&i.push(r),this.rawSegments.push(i)}else this.pending&&this.rawSegments.push(this.pending);this.advance(t),this.pending=null},Mappings.prototype.addUneditedChunk=function(e,t,n,r,i){for(var s=t.start,o=!0;s1){for(var n=0;n=e&&n<=t)throw new Error("Cannot move a selection inside itself");this._split(e),this._split(t),this._split(n);var r=this.byStart[e],i=this.byEnd[t],s=r.previous,o=i.next,a=this.byStart[n];if(!a&&i===this.lastChunk)return this;var c=a?a.previous:this.lastChunk;return s&&(s.next=o),o&&(o.previous=s),c&&(c.next=r),a&&(a.previous=i),r.previous||(this.firstChunk=i.next),i.next||(this.lastChunk=r.previous,this.lastChunk.next=null),r.previous=c,i.next=a||null,c||(this.firstChunk=r),a||(this.lastChunk=i),this},MagicString.prototype.overwrite=function(e,t,n,r){if("string"!=typeof n)throw new TypeError("replacement content must be a string");for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;if(t>this.original.length)throw new Error("end is out of bounds");if(e===t)throw new Error("Cannot overwrite a zero-length range – use appendLeft or prependRight instead");this._split(e),this._split(t),!0===r&&(warned.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),warned.storeName=!0),r={storeName:!0});var i=void 0!==r&&r.storeName,s=void 0!==r&&r.contentOnly;if(i){var o=this.original.slice(e,t);this.storedNames[o]=!0}var a=this.byStart[e],c=this.byEnd[t];if(a){if(t>a.end&&a.next!==this.byStart[a.end])throw new Error("Cannot overwrite across a split point");if(a.edit(n,i,s),a!==c){for(var l=a.next;l!==c;)l.edit("",!1),l=l.next;l.edit("",!1)}}else{var u=new Chunk(e,t,"").edit(n,i);c.next=u,u.previous=c}return this},MagicString.prototype.prepend=function(e){if("string"!=typeof e)throw new TypeError("outro content must be a string");return this.intro=e+this.intro,this},MagicString.prototype.prependLeft=function(e,t){if("string"!=typeof t)throw new TypeError("inserted content must be a string");this._split(e);var n=this.byEnd[e];return n?n.prependLeft(t):this.intro=t+this.intro,this},MagicString.prototype.prependRight=function(e,t){if("string"!=typeof t)throw new TypeError("inserted content must be a string");this._split(e);var n=this.byStart[e];return n?n.prependRight(t):this.outro=t+this.outro,this},MagicString.prototype.remove=function(e,t){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;if(e===t)return this;if(e<0||t>this.original.length)throw new Error("Character is out of bounds");if(e>t)throw new Error("end must be greater than start");this._split(e),this._split(t);for(var n=this.byStart[e];n;)n.intro="",n.outro="",n.edit(""),n=t>n.end?this.byStart[n.end]:null;return this},MagicString.prototype.lastChar=function(){if(this.outro.length)return this.outro[this.outro.length-1];var e=this.lastChunk;do{if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1]}while(e=e.previous);return this.intro.length?this.intro[this.intro.length-1]:""},MagicString.prototype.lastLine=function(){var e=this.outro.lastIndexOf(n);if(-1!==e)return this.outro.substr(e+1);var t=this.outro,r=this.lastChunk;do{if(r.outro.length>0){if(-1!==(e=r.outro.lastIndexOf(n)))return r.outro.substr(e+1)+t;t=r.outro+t}if(r.content.length>0){if(-1!==(e=r.content.lastIndexOf(n)))return r.content.substr(e+1)+t;t=r.content+t}if(r.intro.length>0){if(-1!==(e=r.intro.lastIndexOf(n)))return r.intro.substr(e+1)+t;t=r.intro+t}}while(r=r.previous);return-1!==(e=this.intro.lastIndexOf(n))?this.intro.substr(e+1)+t:this.intro+t},MagicString.prototype.slice=function(e,t){for(void 0===e&&(e=0),void 0===t&&(t=this.original.length);e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;for(var n="",r=this.firstChunk;r&&(r.start>e||r.end<=e);){if(r.start=t)return n;r=r.next}if(r&&r.edited&&r.start!==e)throw new Error("Cannot use replaced character "+e+" as slice start anchor.");for(var i=r;r;){!r.intro||i===r&&r.start!==e||(n+=r.intro);var s=r.start=t;if(s&&r.edited&&r.end!==t)throw new Error("Cannot use replaced character "+t+" as slice end anchor.");var o=i===r?e-r.start:0,a=s?r.content.length+t-r.end:r.content.length;if(n+=r.content.slice(o,a),!r.outro||s&&r.end!==t||(n+=r.outro),s)break;r=r.next}return n},MagicString.prototype.snip=function(e,t){var n=this.clone();return n.remove(0,e),n.remove(t,n.original.length),n},MagicString.prototype._split=function(e){if(!this.byStart[e]&&!this.byEnd[e])for(var t=this.lastSearchedChunk,n=e>t.end;t;){if(t.contains(e))return this._splitChunk(t,e);t=n?this.byStart[t.end]:this.byEnd[t.start]}},MagicString.prototype._splitChunk=function(e,t){if(e.edited&&e.content.length){var n=getLocator$1(this.original)(t);throw new Error("Cannot split a chunk that has already been edited ("+n.line+":"+n.column+' – "'+e.original+'")')}var r=e.split(t);return this.byEnd[t]=e,this.byStart[t]=r,this.byEnd[r.end]=r,e===this.lastChunk&&(this.lastChunk=r),this.lastSearchedChunk=e,!0},MagicString.prototype.toString=function(){for(var e=this.intro,t=this.firstChunk;t;)e+=t.toString(),t=t.next;return e+this.outro},MagicString.prototype.isEmpty=function(){var e=this.firstChunk;do{if(e.intro.length&&e.intro.trim()||e.content.length&&e.content.trim()||e.outro.length&&e.outro.trim())return!1}while(e=e.next);return!0},MagicString.prototype.length=function(){var e=this.firstChunk,t=0;do{t+=e.intro.length+e.content.length+e.outro.length}while(e=e.next);return t},MagicString.prototype.trimLines=function(){return this.trim("[\\r\\n]")},MagicString.prototype.trim=function(e){return this.trimStart(e).trimEnd(e)},MagicString.prototype.trimEndAborted=function(e){var t=new RegExp((e||"\\s")+"+$");if(this.outro=this.outro.replace(t,""),this.outro.length)return!0;var n=this.lastChunk;do{var r=n.end,i=n.trimEnd(t);if(n.end!==r&&(this.lastChunk===n&&(this.lastChunk=n.next),this.byEnd[n.end]=n,this.byStart[n.next.start]=n.next,this.byEnd[n.next.end]=n.next),i)return!0;n=n.previous}while(n);return!1},MagicString.prototype.trimEnd=function(e){return this.trimEndAborted(e),this},MagicString.prototype.trimStartAborted=function(e){var t=new RegExp("^"+(e||"\\s")+"+");if(this.intro=this.intro.replace(t,""),this.intro.length)return!0;var n=this.firstChunk;do{var r=n.end,i=n.trimStart(t);if(n.end!==r&&(n===this.lastChunk&&(this.lastChunk=n.next),this.byEnd[n.end]=n,this.byStart[n.next.start]=n.next,this.byEnd[n.next.end]=n.next),i)return!0;n=n.next}while(n);return!1},MagicString.prototype.trimStart=function(e){return this.trimStartAborted(e),this};var hasOwnProp=Object.prototype.hasOwnProperty,Bundle$1=function(e){void 0===e&&(e={}),this.intro=e.intro||"",this.separator=void 0!==e.separator?e.separator:"\n",this.sources=[],this.uniqueSources=[],this.uniqueSourceIndexByFilename={}};function relative(e,t){const n=e.split(/[/\\]/).filter(Boolean),r=t.split(/[/\\]/).filter(Boolean);for("."===n[0]&&n.shift(),"."===r[0]&&r.shift();n[0]&&r[0]&&n[0]===r[0];)n.shift(),r.shift();for(;".."===r[0]&&n.length>0;)r.shift(),n.pop();for(;n.pop();)r.unshift("..");return r.join("/")}function treeshakeNode(e,t,n,r){if(t.remove(n,r),e.annotations)for(const r of e.annotations){if(!(r.start0&&r.advance(t.separator);var s=e.filename?t.uniqueSourceIndexByFilename[e.filename]:-1,o=e.content,a=getLocator$1(o.original);o.intro&&r.advance(o.intro),o.firstChunk.eachNext((function(t){var i=a(t.start);t.intro.length&&r.advance(t.intro),e.filename?t.edited?r.addEdit(s,t.content,i,t.storeName?n.indexOf(t.original):-1):r.addUneditedChunk(s,t,o.original,i,o.sourcemapLocations):r.advance(t.content),t.outro.length&&r.advance(t.outro)})),o.outro&&r.advance(o.outro)})),{file:e.file?e.file.split(/[/\\]/).pop():null,sources:this.uniqueSources.map((function(t){return e.file?getRelativePath(e.file,t.filename):t.filename})),sourcesContent:this.uniqueSources.map((function(t){return e.includeContent?t.content:null})),names:n,mappings:r.raw}},Bundle$1.prototype.generateMap=function(e){return new SourceMap(this.generateDecodedMap(e))},Bundle$1.prototype.getIndentString=function(){var e={};return this.sources.forEach((function(t){var n=t.content.indentStr;null!==n&&(e[n]||(e[n]=0),e[n]+=1)})),Object.keys(e).sort((function(t,n){return e[t]-e[n]}))[0]||"\t"},Bundle$1.prototype.indent=function(e){var t=this;if(arguments.length||(e=this.getIndentString()),""===e)return this;var n=!this.intro||"\n"===this.intro.slice(-1);return this.sources.forEach((function(r,i){var s=void 0!==r.separator?r.separator:t.separator,o=n||i>0&&/\r?\n$/.test(s);r.content.indent(e,{exclude:r.indentExclusionRanges,indentStart:o}),n="\n"===r.content.lastChar()})),this.intro&&(this.intro=e+this.intro.replace(/^[^\n]/gm,(function(t,n){return n>0?e+t:t}))),this},Bundle$1.prototype.prepend=function(e){return this.intro=e+this.intro,this},Bundle$1.prototype.toString=function(){var e=this,t=this.sources.map((function(t,n){var r=void 0!==t.separator?t.separator:e.separator;return(n>0?r:"")+t.content.toString()})).join("");return this.intro+t},Bundle$1.prototype.isEmpty=function(){return(!this.intro.length||!this.intro.trim())&&!this.sources.some((function(e){return!e.content.isEmpty()}))},Bundle$1.prototype.length=function(){return this.sources.reduce((function(e,t){return e+t.content.length()}),this.intro.length)},Bundle$1.prototype.trimLines=function(){return this.trim("[\\r\\n]")},Bundle$1.prototype.trim=function(e){return this.trimStart(e).trimEnd(e)},Bundle$1.prototype.trimStart=function(e){var t=new RegExp("^"+(e||"\\s")+"+");if(this.intro=this.intro.replace(t,""),!this.intro){var n,r=0;do{if(!(n=this.sources[r++]))break}while(!n.content.trimStartAborted(e))}return this},Bundle$1.prototype.trimEnd=function(e){var t,n=new RegExp((e||"\\s")+"+$"),r=this.sources.length-1;do{if(!(t=this.sources[r--])){this.intro=this.intro.replace(n,"");break}}while(!t.content.trimEndAborted(e));return this};const NO_SEMICOLON={isNoStatement:!0};function findFirstOccurrenceOutsideComment(e,t,n=0){let r,i;for(r=e.indexOf(t,n);;){if(-1===(n=e.indexOf("/",n))||n>=r)return r;i=e.charCodeAt(++n),++n,(n=47===i?e.indexOf("\n",n)+1:e.indexOf("*/",n)+2)>r&&(r=e.indexOf(t,n))}}const WHITESPACE=/\s/;function findNonWhiteSpace(e,t){for(;tt)return t;if(n=e.charCodeAt(++r),47===n)return t;r=e.indexOf("*/",r+2)+2,r>t&&(t=e.indexOf("\n",r))}}function renderStatementList(e,t,n,r,i){let s,o,a,c,l=e[0],u=!l.included||l.needsBoundaries;u&&(c=n+findFirstLineBreakOutsideComment(t.original.slice(n,l.start))+1);for(let n=1;n<=e.length;n++)s=l,o=c,a=u,l=e[n],u=void 0!==l&&(!l.included||l.needsBoundaries),a||u?(c=s.end+findFirstLineBreakOutsideComment(t.original.slice(s.end,void 0===l?r:l.start))+1,s.included?a?s.render(t,i,{end:c,start:o}):s.render(t,i):treeshakeNode(s,t,o,c)):s.render(t,i)}function getCommaSeparatedNodesWithBoundaries(e,t,n,r){const i=[];let s,o,a,c,l,u=n-1;for(let r=0;rt.exportNamesByVariable.get(e).map(t=>`${t}:${n}${e.getName()}`).join(","+n)).join(","+n)}${n}})`}function getSystemExportFunctionLeft(e,t,n){const r=n.compact?"":" ",i=n.compact?"":";";return`function${r}(v)${r}{${r}return exports({${r}${e.map(e=>n.exportNamesByVariable.get(e).map(n=>`${n}:${r}${t?e.getName():"v"}`).join(","+r)).join(","+r)}${r}}),${r}v${i}${r}}(`}const chars$1="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",base=64;function toBase64(e){let t="";do{const n=e%64;e=Math.floor(e/64),t=chars$1[n]+t}while(0!==e);return t}const RESERVED_NAMES=Object.assign(Object.create(null),{await:!0,break:!0,case:!0,catch:!0,class:!0,const:!0,continue:!0,debugger:!0,default:!0,delete:!0,do:!0,else:!0,enum:!0,eval:!0,export:!0,extends:!0,false:!0,finally:!0,for:!0,function:!0,if:!0,implements:!0,import:!0,in:!0,instanceof:!0,interface:!0,let:!0,new:!0,null:!0,package:!0,private:!0,protected:!0,public:!0,return:!0,static:!0,super:!0,switch:!0,this:!0,throw:!0,true:!0,try:!0,typeof:!0,undefined:!0,var:!0,void:!0,while:!0,with:!0,yield:!0});function getSafeName(e,t){let n=e,r=1;for(;t.has(n)||RESERVED_NAMES[n];)n=`${e}$${toBase64(r++)}`;return t.add(n),n}class ChildScope extends Scope$1{constructor(e){super(),this.accessedOutsideVariables=new Map,this.parent=e,e.children.push(this)}addAccessedDynamicImport(e){(this.accessedDynamicImports||(this.accessedDynamicImports=new Set)).add(e),this.parent instanceof ChildScope&&this.parent.addAccessedDynamicImport(e)}addAccessedGlobalsByFormat(e){const t=this.accessedGlobalVariablesByFormat||(this.accessedGlobalVariablesByFormat=new Map);for(const n of Object.keys(e)){let r=t.get(n);r||(r=new Set,t.set(n,r));for(const t of e[n])r.add(t)}this.parent instanceof ChildScope&&this.parent.addAccessedGlobalsByFormat(e)}addNamespaceMemberAccess(e,t){this.accessedOutsideVariables.set(e,t),this.parent.addNamespaceMemberAccess(e,t)}addReturnExpression(e){this.parent instanceof ChildScope&&this.parent.addReturnExpression(e)}addUsedOutsideNames(e,t,n){for(const r of this.accessedOutsideVariables.values())r.included&&(e.add(r.getBaseVariableName()),"system"===t&&n.has(r)&&e.add("exports"));const r=this.accessedGlobalVariablesByFormat&&this.accessedGlobalVariablesByFormat.get(t);if(r)for(const t of r)e.add(t)}contains(e){return this.variables.has(e)||this.parent.contains(e)}deconflict(e,t){const n=new Set;if(this.addUsedOutsideNames(n,e,t),this.accessedDynamicImports)for(const e of this.accessedDynamicImports)e.inlineNamespace&&n.add(e.inlineNamespace.getBaseVariableName());for(const[e,t]of this.variables)(t.included||t.alwaysRendered)&&t.setSafeName(getSafeName(e,n));for(const n of this.children)n.deconflict(e,t)}findLexicalBoundary(){return this.parent.findLexicalBoundary()}findVariable(e){const t=this.variables.get(e)||this.accessedOutsideVariables.get(e);if(t)return t;const n=this.parent.findVariable(e);return this.accessedOutsideVariables.set(e,n),n}}const keys={Literal:[],Program:["body"]};function getAndCreateKeys(e){return keys[e.type]=Object.keys(e).filter(t=>"object"==typeof e[t]),keys[e.type]}const INCLUDE_PARAMETERS="variables";class NodeBase{constructor(e,t,n){this.included=!1,this.keys=keys[e.type]||getAndCreateKeys(e),this.parent=t,this.context=t.context,this.createScope(n),this.parseNode(e),this.initialise(),this.context.magicString.addSourcemapLocation(this.start),this.context.magicString.addSourcemapLocation(this.end)}bind(){for(const e of this.keys){const t=this[e];if(null!==t&&"annotations"!==e)if(Array.isArray(t))for(const e of t)null!==e&&e.bind();else t.bind()}}createScope(e){this.scope=e}declare(e,t){return[]}deoptimizePath(e){}getLiteralValueAtPath(e,t,n){return UnknownValue}getReturnExpressionWhenCalledAtPath(e,t,n){return UNKNOWN_EXPRESSION}hasEffects(e){for(const t of this.keys){const n=this[t];if(null!==n&&"annotations"!==t)if(Array.isArray(n)){for(const t of n)if(null!==t&&t.hasEffects(e))return!0}else if(n.hasEffects(e))return!0}return!1}hasEffectsWhenAccessedAtPath(e,t){return e.length>0}hasEffectsWhenAssignedAtPath(e,t){return!0}hasEffectsWhenCalledAtPath(e,t,n){return!0}include(e,t){this.included=!0;for(const n of this.keys){const r=this[n];if(null!==r&&"annotations"!==n)if(Array.isArray(r))for(const n of r)null!==n&&n.include(e,t);else r.include(e,t)}}includeCallArguments(e,t){for(const n of t)n.include(e,!1)}includeWithAllDeclaredVariables(e,t){this.include(t,e)}initialise(){}insertSemicolon(e){";"!==e.original[this.end-1]&&e.appendLeft(this.end,";")}parseNode(e){for(const t of Object.keys(e)){if(this.hasOwnProperty(t))continue;const n=e[t];if("object"!=typeof n||null===n||"annotations"===t)this[t]=n;else if(Array.isArray(n)){this[t]=[];for(const e of n)this[t].push(null===e?null:new(this.context.nodeConstructors[e.type]||this.context.nodeConstructors.UnknownNode)(e,this,this.scope))}else this[t]=new(this.context.nodeConstructors[n.type]||this.context.nodeConstructors.UnknownNode)(n,this,this.scope)}}render(e,t){for(const n of this.keys){const r=this[n];if(null!==r&&"annotations"!==n)if(Array.isArray(r))for(const n of r)null!==n&&n.render(e,t);else r.render(e,t)}}shouldBeIncluded(e){return this.included||!e.brokenFlow&&this.hasEffects(createHasEffectsContext())}toString(){return this.context.code.slice(this.start,this.end)}}class ClassNode extends NodeBase{createScope(e){this.scope=new ChildScope(e)}hasEffectsWhenAccessedAtPath(e){return!(e.length<=1)&&(e.length>2||"prototype"!==e[0])}hasEffectsWhenAssignedAtPath(e){return!(e.length<=1)&&(e.length>2||"prototype"!==e[0])}hasEffectsWhenCalledAtPath(e,t,n){return!t.withNew||(this.body.hasEffectsWhenCalledAtPath(e,t,n)||null!==this.superClass&&this.superClass.hasEffectsWhenCalledAtPath(e,t,n))}initialise(){null!==this.id&&this.id.declare("class",this)}}class ClassDeclaration extends ClassNode{initialise(){super.initialise(),null!==this.id&&(this.id.variable.isId=!0)}parseNode(e){null!==e.id&&(this.id=new this.context.nodeConstructors.Identifier(e.id,this,this.scope.parent)),super.parseNode(e)}render(e,t){"system"===t.format&&this.id&&t.exportNamesByVariable.has(this.id.variable)&&e.appendLeft(this.end,`${t.compact?"":" "}${getSystemExportStatement([this.id.variable],t)};`),super.render(e,t)}}class ArgumentsVariable extends LocalVariable{constructor(e){super("arguments",null,UNKNOWN_EXPRESSION,e)}hasEffectsWhenAccessedAtPath(e){return e.length>1}hasEffectsWhenAssignedAtPath(){return!0}hasEffectsWhenCalledAtPath(){return!0}}class ThisVariable extends LocalVariable{constructor(e){super("this",null,null,e)}getLiteralValueAtPath(){return UnknownValue}hasEffectsWhenAccessedAtPath(e,t){return this.getInit(t).hasEffectsWhenAccessedAtPath(e,t)||super.hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){return this.getInit(t).hasEffectsWhenAssignedAtPath(e,t)||super.hasEffectsWhenAssignedAtPath(e,t)}hasEffectsWhenCalledAtPath(e,t,n){return this.getInit(n).hasEffectsWhenCalledAtPath(e,t,n)||super.hasEffectsWhenCalledAtPath(e,t,n)}getInit(e){return e.replacedVariableInits.get(this)||UNKNOWN_EXPRESSION}}class ParameterScope extends ChildScope{constructor(e,t){super(e),this.parameters=[],this.hasRest=!1,this.context=t,this.hoistedBodyVarScope=new ChildScope(this)}addParameterDeclaration(e){const t=e.name;let n=this.hoistedBodyVarScope.variables.get(t);return n?n.addDeclaration(e,null):n=new LocalVariable(t,e,UNKNOWN_EXPRESSION,this.context),this.variables.set(t,n),n}addParameterVariables(e,t){this.parameters=e;for(const t of e)for(const e of t)e.alwaysRendered=!0;this.hasRest=t}includeCallArguments(e,t){let n=!1,r=!1;const i=this.hasRest&&this.parameters[this.parameters.length-1];for(let s=t.length-1;s>=0;s--){const o=this.parameters[s]||i,a=t[s];if(o){n=!1;for(const e of o)e.included&&(r=!0),e.calledFromTryStatement&&(n=!0)}!r&&a.shouldBeIncluded(e)&&(r=!0),r&&a.include(e,n)}}}class ReturnValueScope extends ParameterScope{constructor(){super(...arguments),this.returnExpression=null,this.returnExpressions=[]}addReturnExpression(e){this.returnExpressions.push(e)}getReturnExpression(){return null===this.returnExpression&&this.updateReturnExpression(),this.returnExpression}updateReturnExpression(){if(1===this.returnExpressions.length)this.returnExpression=this.returnExpressions[0];else{this.returnExpression=UNKNOWN_EXPRESSION;for(const e of this.returnExpressions)e.deoptimizePath(UNKNOWN_PATH)}}}class FunctionScope extends ReturnValueScope{constructor(e,t){super(e,t),this.variables.set("arguments",this.argumentsVariable=new ArgumentsVariable(t)),this.variables.set("this",this.thisVariable=new ThisVariable(t))}findLexicalBoundary(){return this}includeCallArguments(e,t){if(super.includeCallArguments(e,t),this.argumentsVariable.included)for(const n of t)n.included||n.include(e,!1)}}function isReference(e,t){if("MemberExpression"===e.type)return!e.computed&&isReference(e.object,e);if("Identifier"===e.type){if(!t)return!0;switch(t.type){case"MemberExpression":return t.computed||e===t.object;case"MethodDefinition":return t.computed;case"FieldDefinition":case"Property":return t.computed||e===t.value;case"ExportSpecifier":case"ImportSpecifier":return e===t.local;case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return!1;default:return!0}}return!1}const BLANK=Object.create(null);class Identifier$1 extends NodeBase{constructor(){super(...arguments),this.variable=null,this.bound=!1}addExportedVariables(e,t){null!==this.variable&&t.has(this.variable)&&e.push(this.variable)}bind(){this.bound||(this.bound=!0,null===this.variable&&isReference(this,this.parent)&&(this.variable=this.scope.findVariable(this.name),this.variable.addReference(this)),null!==this.variable&&this.variable instanceof LocalVariable&&null!==this.variable.additionalInitializers&&this.variable.consolidateInitializers())}declare(e,t){let n;switch(e){case"var":n=this.scope.addDeclaration(this,this.context,t,!0);break;case"function":n=this.scope.addDeclaration(this,this.context,t,"function");break;case"let":case"const":case"class":n=this.scope.addDeclaration(this,this.context,t,!1);break;case"parameter":n=this.scope.addParameterDeclaration(this);break;default:throw new Error(`Internal Error: Unexpected identifier kind ${e}.`)}return[this.variable=n]}deoptimizePath(e){this.bound||this.bind(),0!==e.length||this.scope.contains(this.name)||this.disallowImportReassignment(),this.variable.deoptimizePath(e)}getLiteralValueAtPath(e,t,n){return this.bound||this.bind(),this.variable.getLiteralValueAtPath(e,t,n)}getReturnExpressionWhenCalledAtPath(e,t,n){return this.bound||this.bind(),this.variable.getReturnExpressionWhenCalledAtPath(e,t,n)}hasEffects(){return this.context.options.treeshake.unknownGlobalSideEffects&&this.variable instanceof GlobalVariable&&this.variable.hasEffectsWhenAccessedAtPath(EMPTY_PATH)}hasEffectsWhenAccessedAtPath(e,t){return null!==this.variable&&this.variable.hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){return!this.variable||this.variable.hasEffectsWhenAssignedAtPath(e,t)}hasEffectsWhenCalledAtPath(e,t,n){return!this.variable||this.variable.hasEffectsWhenCalledAtPath(e,t,n)}include(){this.included||(this.included=!0,null!==this.variable&&this.context.includeVariable(this.variable))}includeCallArguments(e,t){this.variable.includeCallArguments(e,t)}render(e,t,{renderedParentType:n,isCalleeOfRenderedParent:r,isShorthandProperty:i}=BLANK){if(this.variable){const t=this.variable.getName();t!==this.name&&(e.overwrite(this.start,this.end,t,{contentOnly:!0,storeName:!0}),i&&e.prependRight(this.start,this.name+": ")),"eval"===t&&n===CallExpression&&r&&e.appendRight(this.start,"0, ")}}disallowImportReassignment(){return this.context.error({code:"ILLEGAL_REASSIGNMENT",message:`Illegal reassignment to import '${this.name}'`},this.start)}}class RestElement extends NodeBase{constructor(){super(...arguments),this.declarationInit=null}addExportedVariables(e,t){this.argument.addExportedVariables(e,t)}bind(){super.bind(),null!==this.declarationInit&&this.declarationInit.deoptimizePath([UnknownKey,UnknownKey])}declare(e,t){return this.declarationInit=t,this.argument.declare(e,UNKNOWN_EXPRESSION)}deoptimizePath(e){0===e.length&&this.argument.deoptimizePath(EMPTY_PATH)}hasEffectsWhenAssignedAtPath(e,t){return e.length>0||this.argument.hasEffectsWhenAssignedAtPath(EMPTY_PATH,t)}}class FunctionNode extends NodeBase{constructor(){super(...arguments),this.isPrototypeDeoptimized=!1}createScope(e){this.scope=new FunctionScope(e,this.context)}deoptimizePath(e){1===e.length&&("prototype"===e[0]?this.isPrototypeDeoptimized=!0:e[0]===UnknownKey&&(this.isPrototypeDeoptimized=!0,this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH)))}getReturnExpressionWhenCalledAtPath(e){return 0===e.length?this.scope.getReturnExpression():UNKNOWN_EXPRESSION}hasEffects(){return null!==this.id&&this.id.hasEffects()}hasEffectsWhenAccessedAtPath(e){return!(e.length<=1)&&(e.length>2||"prototype"!==e[0]||this.isPrototypeDeoptimized)}hasEffectsWhenAssignedAtPath(e){return!(e.length<=1)&&(e.length>2||"prototype"!==e[0]||this.isPrototypeDeoptimized)}hasEffectsWhenCalledAtPath(e,t,n){if(e.length>0)return!0;for(const e of this.params)if(e.hasEffects(n))return!0;const r=n.replacedVariableInits.get(this.scope.thisVariable);n.replacedVariableInits.set(this.scope.thisVariable,t.withNew?new UnknownObjectExpression:UNKNOWN_EXPRESSION);const{brokenFlow:i,ignore:s}=n;return n.ignore={breaks:!1,continues:!1,labels:new Set,returnAwaitYield:!0},!!this.body.hasEffects(n)||(n.brokenFlow=i,r?n.replacedVariableInits.set(this.scope.thisVariable,r):n.replacedVariableInits.delete(this.scope.thisVariable),n.ignore=s,!1)}include(e,t){this.included=!0,this.id&&this.id.include();const n=this.scope.argumentsVariable.included;for(const r of this.params)r instanceof Identifier$1&&!n||r.include(e,t);const{brokenFlow:r}=e;e.brokenFlow=0,this.body.include(e,t),e.brokenFlow=r}includeCallArguments(e,t){this.scope.includeCallArguments(e,t)}initialise(){null!==this.id&&this.id.declare("function",this),this.scope.addParameterVariables(this.params.map(e=>e.declare("parameter",UNKNOWN_EXPRESSION)),this.params[this.params.length-1]instanceof RestElement),this.body.addImplicitReturnExpressionToScope()}parseNode(e){this.body=new this.context.nodeConstructors.BlockStatement(e.body,this,this.scope.hoistedBodyVarScope),super.parseNode(e)}}FunctionNode.prototype.preventChildBlockScope=!0;class FunctionDeclaration extends FunctionNode{initialise(){super.initialise(),null!==this.id&&(this.id.variable.isId=!0)}parseNode(e){null!==e.id&&(this.id=new this.context.nodeConstructors.Identifier(e.id,this,this.scope.parent)),super.parseNode(e)}}function getDeclarationStart(e,t){return findNonWhiteSpace(e,findFirstOccurrenceOutsideComment(e,"default",t)+7)}function getIdInsertPosition(e,t,n,r){const i=findFirstOccurrenceOutsideComment(e,t,r)+t.length;e=e.slice(i,findFirstOccurrenceOutsideComment(e,n,i));const s=findFirstOccurrenceOutsideComment(e,"*");return-1===s?i:i+s+1}class ExportDefaultDeclaration extends NodeBase{include(e,t){super.include(e,t),t&&this.context.includeVariable(this.variable)}initialise(){const e=this.declaration;this.declarationName=e.id&&e.id.name||this.declaration.name,this.variable=this.scope.addExportDefaultDeclaration(this.declarationName||this.context.getModuleName(),this,this.context),this.context.addExport(this)}render(e,t,n){const{start:r,end:i}=n,s=getDeclarationStart(e.original,this.start);if(this.declaration instanceof FunctionDeclaration)this.renderNamedDeclaration(e,s,"function","(",null===this.declaration.id,t);else if(this.declaration instanceof ClassDeclaration)this.renderNamedDeclaration(e,s,"class","{",null===this.declaration.id,t);else{if(this.variable.getOriginalVariable()!==this.variable)return void treeshakeNode(this,e,r,i);if(!this.variable.included)return e.remove(this.start,s),this.declaration.render(e,t,{isCalleeOfRenderedParent:!1,renderedParentType:ExpressionStatement}),void(";"!==e.original[this.end-1]&&e.appendLeft(this.end,";"));this.renderVariableDeclaration(e,s,t)}this.declaration.render(e,t)}renderNamedDeclaration(e,t,n,r,i,s){const o=this.variable.getName();e.remove(this.start,t),i&&e.appendLeft(getIdInsertPosition(e.original,n,r,t)," "+o),"system"===s.format&&this.declaration instanceof ClassDeclaration&&s.exportNamesByVariable.has(this.variable)&&e.appendLeft(this.end,` ${getSystemExportStatement([this.variable],s)};`)}renderVariableDeclaration(e,t,n){const r=59===e.original.charCodeAt(this.end-1),i="system"===n.format&&n.exportNamesByVariable.get(this.variable);i?(e.overwrite(this.start,t,`${n.varOrConst} ${this.variable.getName()} = exports('${i[0]}', `),e.appendRight(r?this.end-1:this.end,")"+(r?"":";"))):(e.overwrite(this.start,t,`${n.varOrConst} ${this.variable.getName()} = `),r||e.appendLeft(this.end,";"))}}ExportDefaultDeclaration.prototype.needsBoundaries=!0;class ExportDefaultVariable extends LocalVariable{constructor(e,t,n){super(e,t,t.declaration,n),this.hasId=!1,this.originalId=null,this.originalVariableAndDeclarationModules=null;const r=t.declaration;(r instanceof FunctionDeclaration||r instanceof ClassDeclaration)&&r.id?(this.hasId=!0,this.originalId=r.id):r instanceof Identifier$1&&(this.originalId=r)}addReference(e){this.hasId||(this.name=e.name)}getAssignedVariableName(){return this.originalId&&this.originalId.name||null}getBaseVariableName(){const e=this.getOriginalVariable();return e===this?super.getBaseVariableName():e.getBaseVariableName()}getName(){const e=this.getOriginalVariable();return e===this?super.getName():e.getName()}getOriginalVariable(){return this.getOriginalVariableAndDeclarationModules().original}getOriginalVariableAndDeclarationModules(){if(null===this.originalVariableAndDeclarationModules)if(!this.originalId||!this.hasId&&(this.originalId.variable.isReassigned||this.originalId.variable instanceof UndefinedVariable))this.originalVariableAndDeclarationModules={modules:[],original:this};else{const e=this.originalId.variable;if(e instanceof ExportDefaultVariable){const{modules:t,original:n}=e.getOriginalVariableAndDeclarationModules();this.originalVariableAndDeclarationModules={modules:t.concat(this.module),original:n}}else this.originalVariableAndDeclarationModules={modules:[this.module],original:e}}return this.originalVariableAndDeclarationModules}}const MISSING_EXPORT_SHIM_VARIABLE="_missingExportShim",INTEROP_DEFAULT_VARIABLE="_interopDefault",INTEROP_NAMESPACE_VARIABLE="_interopNamespace";class ExportShimVariable extends Variable{constructor(e){super("_missingExportShim"),this.module=e}}class NamespaceVariable extends Variable{constructor(e,t){super(e.getModuleName()),this.memberVariables=null,this.mergedNamespaces=[],this.referencedEarly=!1,this.references=[],this.context=e,this.module=e.module,this.syntheticNamedExports=t}addReference(e){this.references.push(e),this.name=e.name}deoptimizePath(){const e=this.getMemberVariables();for(const t in e)e[t].deoptimizePath(UNKNOWN_PATH)}include(){if(!this.included){this.included=!0;const e=this.getMemberVariables();for(const e of this.references)if(e.context.getModuleExecIndex()<=this.context.getModuleExecIndex()){this.referencedEarly=!0;break}if(this.mergedNamespaces=this.context.includeAndGetAdditionalMergedNamespaces(),this.context.options.preserveModules)for(const t in e)e[t].include();else for(const t in e)this.context.includeVariable(e[t])}}renderBlock(e){const t=e.compact?"":" ",n=e.compact?"":"\n",r=e.indent,i=this.getMemberVariables(),s=Object.keys(i).map(n=>{const s=i[n];if(this.referencedEarly||s.isReassigned)return`${r}get ${n}${t}()${t}{${t}return ${s.getName()}${e.compact?"":";"}${t}}`;const o=RESERVED_NAMES[n]?`'${n}'`:n;return`${r}${o}: ${s.getName()}`});e.namespaceToStringTag&&s.unshift(`${r}[Symbol.toStringTag]:${t}'Module'`);const o=this.mergedNamespaces.length>0||this.syntheticNamedExports;o||s.unshift(`${r}__proto__:${t}null`);let a=`{${n}${s.join(","+n)}${n}}`;if(o){const e=["/*#__PURE__*/Object.create(null)"];this.mergedNamespaces.length>0&&e.push(...this.mergedNamespaces.map(e=>e.getName())),this.syntheticNamedExports&&e.push(this.module.getDefaultExport().getName()),s.length>0&&e.push(a),a=`/*#__PURE__*/Object.assign(${e.join(","+t)})`}e.freeze&&(a=`/*#__PURE__*/Object.freeze(${a})`);const c=this.getName();return a=`${e.varOrConst} ${c}${t}=${t}${a};`,"system"===e.format&&e.exportNamesByVariable.has(this)&&(a+=`${n}${getSystemExportStatement([this],e)};`),a}renderFirst(){return this.referencedEarly}getMemberVariables(){if(this.memberVariables)return this.memberVariables;const e=Object.create(null);for(const t of this.context.getExports().concat(this.context.getReexports()))"*"!==t[0]&&(e[t]=this.context.traceExport(t));return this.memberVariables=e,this.memberVariables=e}}NamespaceVariable.prototype.isNamespace=!0;class SyntheticNamedExportVariable extends Variable{constructor(e,t,n){super(t),this.context=e,this.module=e.module,this.defaultVariable=n}getBaseVariable(){let e=this.defaultVariable;return e instanceof ExportDefaultVariable&&(e=e.getOriginalVariable()),e instanceof SyntheticNamedExportVariable&&(e=e.getBaseVariable()),e}getName(){const e=this.name;return`${this.defaultVariable.getName()}${getPropertyAccess(e)}`}include(){this.included||(this.included=!0,this.context.includeVariable(this.defaultVariable))}}const getPropertyAccess=e=>/^(?!\d)[\w$]+$/.test(e)?"."+e:`[${JSON.stringify(e)}]`,esModuleExport="Object.defineProperty(exports, '__esModule', { value: true });",compactEsModuleExport="Object.defineProperty(exports,'__esModule',{value:true});";function getExportBlock(e,t,n,r,i,s,o="return "){const a=i?"":" ",c=i?"":"\n";if(!n){let n;if(e.length>0)n=e[0].local;else for(const e of t)if(e.reexports){const t=e.reexports[0];n=e.namedExportsMode&&"*"!==t.imported&&"default"!==t.imported?`${e.name}.${t.imported}`:e.name;break}return`${o}${n};`}let l="";for(const{name:e,reexports:r}of t)if(r&&n)for(const t of r)"*"===t.reexported&&(l&&(l+=c),t.needsLiveBinding?l+=`Object.keys(${e}).forEach(function${a}(k)${a}{${c}${s}if${a}(k${a}!==${a}'default')${a}Object.defineProperty(exports,${a}k,${a}{${c}${s}${s}enumerable:${a}true,${c}${s}${s}get:${a}function${a}()${a}{${c}${s}${s}${s}return ${e}[k];${c}${s}${s}}${c}${s}});${c}});`:l+=`Object.keys(${e}).forEach(function${a}(k)${a}{${c}${s}if${a}(k${a}!==${a}'default')${a}exports[k]${a}=${a}${e}[k];${c}});`);for(const{name:e,imports:i,reexports:o,isChunk:u,namedExportsMode:p,exportsNames:h}of t)if(o&&n)for(const t of o)if("default"!==t.imported||u)if("*"!==t.imported){l&&(l+=c);const n="default"!==t.imported||p?`${e}.${t.imported}`:e;l+=t.needsLiveBinding?`Object.defineProperty(exports,${a}'${t.reexported}',${a}{${c}${s}enumerable:${a}true,${c}${s}get:${a}function${a}()${a}{${c}${s}${s}return ${n};${c}${s}}${c}});`:`exports.${t.reexported}${a}=${a}${n};`}else"*"!==t.reexported&&(l&&(l+=c),l+=`exports.${t.reexported}${a}=${a}${e};`);else l&&(l+=c),h&&(o.some(e=>"default"===e.imported?"default"===e.reexported:"*"!==e.imported)||i&&i.some(e=>"default"!==e.imported))?l+=`exports.${t.reexported}${a}=${a}${e}${!1!==r?"__default":".default"};`:l+=`exports.${t.reexported}${a}=${a}${e};`;for(const t of e){const e="exports."+t.exported,n=t.local;e!==n&&(l&&(l+=c),l+=`${e}${a}=${a}${n};`)}return l}function getInteropBlock(e,t,n){const r=t.compact?"":" ";return e.map(({name:e,exportsNames:i,exportsDefault:s,namedExportsMode:o})=>o&&s&&t.interop?i?`${n} ${e}__default${r}=${r}'default'${r}in ${e}${r}?${r}${e}['default']${r}:${r}${e};`:`${e}${r}=${r}${e}${r}&&${r}Object.prototype.hasOwnProperty.call(${e},${r}'default')${r}?${r}${e}['default']${r}:${r}${e};`:null).filter(Boolean).join(t.compact?"":"\n")}function copyPropertyLiveBinding(e,t,n,r){return`${r}var d${e}=${e}Object.getOwnPropertyDescriptor(e,${e}k);${t}${r}Object.defineProperty(n,${e}k,${e}d.get${e}?${e}d${e}:${e}{${t}${r}${n}enumerable:${e}true,${t}${r}${n}get:${e}function${e}()${e}{${t}${r}${n}${n}return e[k];${t}${r}${n}}${t}${r}});${t}`}function copyPropertyStatic(e,t,n,r){return`${r}n[k]${e}=e${e}[k];${t}`}function getInteropNamespace(e,t,n,r){return`function _interopNamespace(e)${e}{${t}${n}if${e}(e${e}&&${e}e.__esModule)${e}{${e}return e;${e}}${e}else${e}{${t}${n}${n}var n${e}=${e}{};${t}${n}${n}if${e}(e)${e}{${t}${n}${n}${n}Object.keys(e).forEach(function${e}(k)${e}{${t}`+(r?copyPropertyLiveBinding:copyPropertyStatic)(e,t,n,n+n+n+n)+`${n}${n}${n}});${t}`+`${n}${n}}${t}`+`${n}${n}n['default']${e}=${e}e;${t}`+`${n}${n}return n;${t}`+`${n}}${t}`+`}${t}${t}`}const builtins$1={assert:!0,buffer:!0,console:!0,constants:!0,domain:!0,events:!0,http:!0,https:!0,os:!0,path:!0,process:!0,punycode:!0,querystring:!0,stream:!0,string_decoder:!0,timers:!0,tty:!0,url:!0,util:!0,vm:!0,zlib:!0};function warnOnBuiltins(e,t){const n=t.map(({id:e})=>e).filter(e=>e in builtins$1);if(!n.length)return;e({code:"MISSING_NODE_BUILTINS",message:`Creating a browser bundle that depends on Node.js built-in ${1===n.length?`module ('${n[0]}')`:`modules (${n.slice(0,-1).map(e=>`'${e}'`).join(", ")} and '${n.slice(-1)}')`}. You might need to include https://github.com/ionic-team/rollup-plugin-node-polyfills`,modules:n})}function removeExtensionFromRelativeAmdId(e){return"."===e[0]&&e.endsWith(".js")?e.slice(0,-3):e}function amd(e,{accessedGlobals:t,dependencies:n,exports:r,hasExports:i,indentString:s,intro:o,isEntryModuleFacade:a,namedExportsMode:c,outro:l,varOrConst:u,warn:p},h){warnOnBuiltins(p,n);const d=n.map(e=>`'${removeExtensionFromRelativeAmdId(e.id)}'`),f=n.map(e=>e.name),m=h.compact?"":"\n",g=h.compact?"":" ";c&&i&&(f.unshift("exports"),d.unshift("'exports'")),t.has("require")&&(f.unshift("require"),d.unshift("'require'")),t.has("module")&&(f.unshift("module"),d.unshift("'module'"));const _=h.amd||{},E=(_.id?`'${_.id}',${g}`:"")+(d.length?`[${d.join(","+g)}],${g}`:""),y=h.strict?g+"'use strict';":"",v=`${_.define}(${E}function${g}(${f.join(","+g)})${g}{${y}${m}${m}`,S=getInteropBlock(n,h,u);S&&e.prepend(S+m+m),t.has("_interopNamespace")&&e.prepend(getInteropNamespace(g,m,s,h.externalLiveBindings)),o&&e.prepend(o);const b=getExportBlock(r,n,c,h.interop,h.compact,s);return b&&e.append(m+m+b),c&&i&&a&&h.esModule&&e.append(`${m}${m}${h.compact?compactEsModuleExport:esModuleExport}`),l&&e.append(l),e.indent(s).append(m+m+"});").prepend(v)}function cjs(e,{accessedGlobals:t,dependencies:n,exports:r,hasExports:i,indentString:s,intro:o,isEntryModuleFacade:a,namedExportsMode:c,outro:l,varOrConst:u},p){const h=p.compact?"":"\n",d=p.compact?"":" ";o=(!1===p.strict?o:`'use strict';${h}${h}${o}`)+(c&&i&&a&&p.esModule?`${p.compact?compactEsModuleExport:esModuleExport}${h}${h}`:"");let f,m=!1,g=!1;f="";for(const{id:e,namedExportsMode:t,isChunk:r,name:i,reexports:s,imports:o,exportsNames:a,exportsDefault:c}of n)s||o?(f+=p.compact&&g?",":`${f?";"+h:""}${u} `,g=!0,p.interop&&!r&&c&&t?(m=!0,f+=a?`${i}${d}=${d}require('${e}')${p.compact?",":`;\n${u} `}${i}__default${d}=${d}_interopDefault(${i})`:`${i}${d}=${d}_interopDefault(require('${e}'))`):f+=`${i}${d}=${d}require('${e}')`):(f&&(f+=!p.compact||g?";"+h:","),g=!1,f+=`require('${e}')`);if(f&&(f+=";"),m){const e=p.compact?"e":"ex";o+=`function _interopDefault${d}(${e})${d}{${d}return${d}(${e}${d}&&${d}(typeof ${e}${d}===${d}'object')${d}&&${d}'default'${d}in ${e})${d}?${d}${e}['default']${d}:${d}${e}${p.compact?"":"; "}}${h}${h}`}t.has("_interopNamespace")&&(o+=getInteropNamespace(d,h,s,p.externalLiveBindings)),f&&(o+=f+h+h);const _=getExportBlock(r,n,c,p.interop,p.compact,s,`module.exports${d}=${d}`);return e.prepend(o),_&&e.append(h+h+_),l&&e.append(l),e}function es(e,{intro:t,outro:n,dependencies:r,exports:i,varOrConst:s},o){const a=o.compact?"":" ",c=o.compact?"":"\n",l=getImportBlock(r,a);l.length>0&&(t+=l.join(c)+c+c),t&&e.prepend(t);const u=getExportBlock$1(i,a,s);return u.length&&e.append(c+c+u.join(c).trim()),n&&e.append(n),e.trim()}function getImportBlock(e,t){const n=[];for(const{id:r,reexports:i,imports:s,name:o}of e)if(i||s){if(s){let e=null,i=null;const o=[];for(const t of s)"default"===t.imported?e=t:"*"===t.imported?i=t:o.push(t);i&&n.push(`import${t}*${t}as ${i.local} from${t}'${r}';`),e&&0===o.length?n.push(`import ${e.local} from${t}'${r}';`):o.length>0&&n.push(`import ${e?`${e.local},${t}`:""}{${t}${o.map(e=>e.imported===e.local?e.imported:`${e.imported} as ${e.local}`).join(","+t)}${t}}${t}from${t}'${r}';`)}if(i){let e=null;const a=[],c=[];for(const t of i)"*"===t.reexported?e=t:"*"===t.imported?a.push(t):c.push(t);if(e&&n.push(`export${t}*${t}from${t}'${r}';`),a.length>0){s&&s.some(e=>"*"===e.imported&&e.local===o)||n.push(`import${t}*${t}as ${o} from${t}'${r}';`);for(const e of a)n.push(`export${t}{${t}${o===e.reexported?o:`${o} as ${e.reexported}`} };`)}c.length>0&&n.push(`export${t}{${t}${c.map(e=>e.imported===e.reexported?e.imported:`${e.imported} as ${e.reexported}`).join(","+t)}${t}}${t}from${t}'${r}';`)}}else n.push(`import${t}'${r}';`);return n}function getExportBlock$1(e,t,n){const r=[],i=[];for(const s of e)"default"===s.exported?r.push(`export default ${s.local};`):(s.expression&&r.push(`${n} ${s.local}${t}=${t}${s.expression};`),i.push(s.exported===s.local?s.local:`${s.local} as ${s.exported}`));return i.length&&r.push(`export${t}{${t}${i.join(","+t)}${t}};`),r}const shouldUseDot=/^[a-zA-Z$_][a-zA-Z0-9$_]*$/;function property(e){return shouldUseDot.test(e)?"."+e:`['${e}']`}function keypath(e){return e.split(".").map(property).join("")}function setupNamespace(e,t,n,r){const i=r?"":" ",s=e.split(".");s[0]=("function"==typeof n?n(s[0]):n[s[0]])||s[0],s.pop();let o=t;return s.map(e=>(o+=property(e),`${o}${i}=${i}${o}${i}||${i}{}${r?"":";"}`)).join(r?",":"\n")+(r&&s.length?";":"\n")}function assignToDeepVariable(e,t,n,r,i){const s=r?"":" ",o=e.split(".");o[0]=("function"==typeof n?n(o[0]):n[o[0]])||o[0];const a=o.pop();let c=t,l=o.map(e=>(c+=property(e),`${c}${s}=${s}${c}${s}||${s}{}`)).concat(`${c}${property(a)}`).join(","+s).concat(`${s}=${s}${i}`);return o.length>0&&(l=`(${l})`),l}function trimEmptyImports(e){let t=e.length;for(;t--;){const n=e[t];if(n.exportsDefault||n.exportsNames)return e.slice(0,t+1)}return[]}const thisProp=e=>"this"+keypath(e);function iife(e,{dependencies:t,exports:n,hasExports:r,indentString:i,intro:s,namedExportsMode:o,outro:a,varOrConst:c,warn:l},u){const p=u.compact?"":" ",h=u.compact?"":"\n",{extend:d,name:f}=u,m=f&&-1!==f.indexOf("."),g=!d&&!m;if(f&&g&&!isLegal(f))return error$1({code:"ILLEGAL_IDENTIFIER_AS_NAME",message:`Given name "${f}" is not a legal JS identifier. If you need this, you can try "output.extend: true".`});warnOnBuiltins(l,t);const _=trimEmptyImports(t),E=_.map(e=>e.globalName||"null"),y=_.map(e=>e.name);r&&!f&&l({code:"MISSING_NAME_OPTION_FOR_IIFE_EXPORT",message:'If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.'}),o&&r&&(d?(E.unshift(`${thisProp(f)}${p}=${p}${thisProp(f)}${p}||${p}{}`),y.unshift("exports")):(E.unshift("{}"),y.unshift("exports")));const v=u.strict?`${i}'use strict';${h}${h}`:"";let S=`(function${p}(${y.join(","+p)})${p}{${h}${v}`;!r||d&&o||!f||(S=(g?`${c} ${f}`:thisProp(f))+`${p}=${p}${S}`),m&&r&&(S=setupNamespace(f,"this",u.globals,u.compact)+S);let b=`${h}${h}}(${E.join(","+p)}));`;!d&&o&&r&&(b=`${h}${h}${i}return exports;${b}`);const A=getInteropBlock(t,u,c);A&&e.prepend(A+h+h),s&&e.prepend(s);const C=getExportBlock(n,t,o,u.interop,u.compact,i);return C&&e.append(h+h+C),a&&e.append(a),e.indent(i).prepend(S).append(b)}function getStarExcludes({dependencies:e,exports:t}){const n=new Set(t.map(e=>e.exported));n.has("default")||n.add("default");for(const{reexports:t}of e)if(t)for(const e of t)"*"===e.imported||n.has(e.reexported)||n.add(e.reexported);return n}const getStarExcludesBlock=(e,t,n,r,i)=>e?`${i}${r}${t} _starExcludes${n}=${n}{${n}${[...e].map(e=>`${e}:${n}1`).join(","+n)}${n}};`:"",getImportBindingsBlock=(e,t,n,r)=>e.length?`${r}${n}var ${e.join(","+t)};`:"";function getExportsBlock(e,t,n,r){return 0===e.length?"":1===e.length?`${n}${n}${n}exports('${e[0].name}',${t}${e[0].value});${r}${r}`:`${n}${n}${n}exports({${r}`+e.map(({name:e,value:r})=>`${n}${n}${n}${n}${e}:${t}${r}`).join(","+r)+`${r}${n}${n}${n}});${r}${r}`}const getHoistedExportsBlock=(e,t,n,r)=>getExportsBlock(e.filter(e=>e.hoisted||e.uninitialized).map(e=>({name:e.exported,value:e.uninitialized?"void 0":e.local})),t,n,r),getMissingExportsBlock=(e,t,n,r)=>getExportsBlock(e.filter(e=>"_missingExportShim"===e.local).map(e=>({name:e.exported,value:"_missingExportShim"})),t,n,r),getSyntheticExportsBlock=(e,t,n,r)=>getExportsBlock(e.filter(e=>e.expression).map(e=>({name:e.exported,value:e.local})),t,n,r);function system(e,{accessedGlobals:t,dependencies:n,exports:r,hasExports:i,indentString:s,intro:o,outro:a,usesTopLevelAwait:c,varOrConst:l},u){const p=u.compact?"":"\n",h=u.compact?"":" ",d=n.map(e=>`'${e.id}'`),f=[];let m;const g=[];for(const{imports:e,reexports:t}of n){const i=[];if(e)for(const t of e)f.push(t.local),"*"===t.imported?i.push(`${t.local}${h}=${h}module;`):i.push(`${t.local}${h}=${h}module.${t.imported};`);if(t){let e=!1;if(t.length>1||1===t.length&&("*"===t[0].reexported||"*"===t[0].imported)){for(const o of t)"*"===o.reexported&&(m||(m=getStarExcludes({dependencies:n,exports:r})),e||(i.push(`${l} _setter${h}=${h}{};`),e=!0),i.push(`for${h}(var _$p${h}in${h}module)${h}{`),i.push(`${s}if${h}(!_starExcludes[_$p])${h}_setter[_$p]${h}=${h}module[_$p];`),i.push("}"));for(const e of t)"*"===e.imported&&"*"!==e.reexported&&i.push(`exports('${e.reexported}',${h}module);`);for(const n of t)"*"!==n.reexported&&"*"!==n.imported&&(e||(i.push(`${l} _setter${h}=${h}{};`),e=!0),i.push(`_setter.${n.reexported}${h}=${h}module.${n.imported};`));e&&i.push("exports(_setter);")}else for(const e of t)i.push(`exports('${e.reexported}',${h}module.${e.imported});`)}g.push(i.join(`${p}${s}${s}${s}`))}const _=u.name?`'${u.name}',${h}`:"",E=t.has("module")?`exports,${h}module`:i?"exports":"";let y=`System.register(${_}[`+d.join(","+h)+`],${h}function${h}(${E})${h}{${p}${s}${u.strict?"'use strict';":""}`+getStarExcludesBlock(m,l,h,s,p)+getImportBindingsBlock(f,h,s,p)+`${p}${s}return${h}{${g.length?`${p}${s}${s}setters:${h}[${g.map(e=>e?`function${h}(module)${h}{${p}${s}${s}${s}${e}${p}${s}${s}}`:u.systemNullSetters?"null":`function${h}()${h}{}`).join(","+h)}],`:""}${p}`;y+=`${s}${s}execute:${h}${c?"async"+h:""}function${h}()${h}{${p}${p}`+getHoistedExportsBlock(r,h,s,p);const v=`${p}${p}`+getSyntheticExportsBlock(r,h,s,p)+getMissingExportsBlock(r,h,s,p)+`${s}${s}}${p}${s}}${u.compact?"":";"}${p}});`;return o&&e.prepend(o),a&&e.append(a),e.indent(`${s}${s}${s}`).append(v).prepend(y)}function globalProp(e,t){return e?`${t}${keypath(e)}`:"null"}function safeAccess(e,t,n){const r=e.split(".");let i=t;return r.map(e=>(i+=property(e),i)).join(`${n}&&${n}`)}function umd(e,{dependencies:t,exports:n,hasExports:r,indentString:i,intro:s,namedExportsMode:o,outro:a,varOrConst:c,warn:l},u){const p=u.compact?"":" ",h=u.compact?"":"\n",d=u.compact?"f":"factory",f=u.compact?"g":"global";if(r&&!u.name)return error$1({code:"MISSING_NAME_OPTION_FOR_IIFE_EXPORT",message:'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.'});warnOnBuiltins(l,t);const m=t.map(e=>`'${e.id}'`),g=t.map(e=>`require('${e.id}')`),_=trimEmptyImports(t),E=_.map(e=>globalProp(e.globalName,f)),y=_.map(e=>e.name);o&&(r||u.noConflict)&&(m.unshift("'exports'"),g.unshift("exports"),E.unshift(assignToDeepVariable(u.name,f,u.globals,u.compact,(u.extend?`${globalProp(u.name,f)}${p}||${p}`:"")+"{}")),y.unshift("exports"));const v=(u.amd.id?`'${u.amd.id}',${p}`:"")+(m.length?`[${m.join(","+p)}],${p}`:""),S=u.amd.define,b=!o&&r?`module.exports${p}=${p}`:"",A=u.strict?`${p}'use strict';${h}`:"";let C;if(u.noConflict){const e=u.compact?"e":"exports";let t;if(!o&&r)t=`var ${e}${p}=${p}${assignToDeepVariable(u.name,f,u.globals,u.compact,`${d}(${E.join(","+p)})`)};`;else if(o){t=`var ${e}${p}=${p}${E.shift()};${h}${i}${i}${d}(${[e].concat(E).join(","+p)});`}C=`(function${p}()${p}{${h}${i}${i}var current${p}=${p}${safeAccess(u.name,f,p)};${h}${i}${i}${t}${h}${i}${i}${e}.noConflict${p}=${p}function${p}()${p}{${p}${globalProp(u.name,f)}${p}=${p}current;${p}return ${e}${u.compact?"":"; "}};${h}`+i+"}())"}else C=`${d}(${E.join(","+p)})`,!o&&r&&(C=assignToDeepVariable(u.name,f,u.globals,u.compact,C));const x=r||!0===u.noConflict&&o||E.length>0,$=x?"this,"+p:"",w=x?`(${f}${p}=${p}${f}${p}||${p}self,${p}`:"",T=x?")":"",R=`(function${p}(${x?`${f},${p}`:""}${d})${p}{${h}`+(x?`${i}typeof exports${p}===${p}'object'${p}&&${p}typeof module${p}!==${p}'undefined'${p}?${p}${b}${d}(${g.join(","+p)})${p}:${h}`:"")+`${i}typeof ${S}${p}===${p}'function'${p}&&${p}${S}.amd${p}?${p}${S}(${v}${d})${p}:${h}`+`${i}${w}${C}${T};${h}`+`}(${$}(function${p}(${y.join(", ")})${p}{${A}${h}`,N=h+h+"})));",D=getInteropBlock(t,u,c);D&&e.prepend(D+h+h),s&&e.prepend(s);const k=getExportBlock(n,t,o,u.interop,u.compact,i);return k&&e.append(h+h+k),o&&r&&u.esModule&&e.append(h+h+(u.compact?compactEsModuleExport:esModuleExport)),a&&e.append(a),e.trim().indent(i).append(N).prepend(R)}var finalisers={system,amd,cjs,es,iife,umd};const extractors={ArrayPattern(e,t){for(const n of t.elements)n&&extractors[n.type](e,n)},AssignmentPattern(e,t){extractors[t.left.type](e,t.left)},Identifier(e,t){e.push(t.name)},MemberExpression(){},ObjectPattern(e,t){for(const n of t.properties)"RestElement"===n.type?extractors.RestElement(e,n):extractors[n.value.type](e,n.value)},RestElement(e,t){extractors[t.argument.type](e,t.argument)}},extractAssignedNames=function(e){const t=[];return extractors[e.type](t,e),t};class ExportAllDeclaration extends NodeBase{hasEffects(){return!1}initialise(){this.context.addExport(this)}render(e,t,n){e.remove(n.start,n.end)}}ExportAllDeclaration.prototype.needsBoundaries=!0;class ArrayExpression extends NodeBase{bind(){super.bind();for(const e of this.elements)null!==e&&e.deoptimizePath(UNKNOWN_PATH)}getReturnExpressionWhenCalledAtPath(e){return 1!==e.length?UNKNOWN_EXPRESSION:getMemberReturnExpressionWhenCalled(arrayMembers,e[0])}hasEffectsWhenAccessedAtPath(e){return e.length>1}hasEffectsWhenCalledAtPath(e,t,n){return 1!==e.length||hasMemberEffectWhenCalled(arrayMembers,e[0],this.included,t,n)}}class ArrayPattern extends NodeBase{addExportedVariables(e,t){for(const n of this.elements)null!==n&&n.addExportedVariables(e,t)}declare(e){const t=[];for(const n of this.elements)null!==n&&t.push(...n.declare(e,UNKNOWN_EXPRESSION));return t}deoptimizePath(e){if(0===e.length)for(const t of this.elements)null!==t&&t.deoptimizePath(e)}hasEffectsWhenAssignedAtPath(e,t){if(e.length>0)return!0;for(const e of this.elements)if(null!==e&&e.hasEffectsWhenAssignedAtPath(EMPTY_PATH,t))return!0;return!1}}class BlockScope extends ChildScope{addDeclaration(e,t,n=null,r){return r?this.parent.addDeclaration(e,t,"function"===r?n:UNKNOWN_EXPRESSION,r):super.addDeclaration(e,t,n,!1)}}class ExpressionStatement$1 extends NodeBase{initialise(){this.directive&&"use strict"!==this.directive&&this.parent.type===Program&&this.context.warn({code:"MODULE_LEVEL_DIRECTIVE",message:`Module level directives cause errors when bundled, '${this.directive}' was ignored.`},this.start)}render(e,t){super.render(e,t),this.included&&this.insertSemicolon(e)}shouldBeIncluded(e){return this.directive&&"use strict"!==this.directive?this.parent.type!==Program:super.shouldBeIncluded(e)}}class BlockStatement$1 extends NodeBase{constructor(){super(...arguments),this.directlyIncluded=!1}addImplicitReturnExpressionToScope(){const e=this.body[this.body.length-1];e&&e.type===ReturnStatement||this.scope.addReturnExpression(UNKNOWN_EXPRESSION)}createScope(e){this.scope=this.parent.preventChildBlockScope?e:new BlockScope(e)}hasEffects(e){if(this.deoptimizeBody)return!0;for(const t of this.body){if(t.hasEffects(e))return!0;if(e.brokenFlow)break}return!1}include(e,t){if(!this.deoptimizeBody||!this.directlyIncluded){this.included=!0,this.directlyIncluded=!0,this.deoptimizeBody&&(t=!0);for(const n of this.body)(t||n.shouldBeIncluded(e))&&n.include(e,t)}}initialise(){const e=this.body[0];this.deoptimizeBody=e instanceof ExpressionStatement$1&&"use asm"===e.directive}render(e,t){this.body.length?renderStatementList(this.body,e,this.start+1,this.end-1,t):super.render(e,t)}}class ArrowFunctionExpression$1 extends NodeBase{createScope(e){this.scope=new ReturnValueScope(e,this.context)}deoptimizePath(e){1===e.length&&e[0]===UnknownKey&&this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH)}getReturnExpressionWhenCalledAtPath(e){return 0===e.length?this.scope.getReturnExpression():UNKNOWN_EXPRESSION}hasEffects(){return!1}hasEffectsWhenAccessedAtPath(e){return e.length>1}hasEffectsWhenAssignedAtPath(e){return e.length>1}hasEffectsWhenCalledAtPath(e,t,n){if(e.length>0)return!0;for(const e of this.params)if(e.hasEffects(n))return!0;const{ignore:r,brokenFlow:i}=n;return n.ignore={breaks:!1,continues:!1,labels:new Set,returnAwaitYield:!0},!!this.body.hasEffects(n)||(n.ignore=r,n.brokenFlow=i,!1)}include(e,t){this.included=!0;for(const n of this.params)n instanceof Identifier$1||n.include(e,t);const{brokenFlow:n}=e;e.brokenFlow=0,this.body.include(e,t),e.brokenFlow=n}includeCallArguments(e,t){this.scope.includeCallArguments(e,t)}initialise(){this.scope.addParameterVariables(this.params.map(e=>e.declare("parameter",UNKNOWN_EXPRESSION)),this.params[this.params.length-1]instanceof RestElement),this.body instanceof BlockStatement$1?this.body.addImplicitReturnExpressionToScope():this.scope.addReturnExpression(this.body)}parseNode(e){e.body.type===BlockStatement&&(this.body=new this.context.nodeConstructors.BlockStatement(e.body,this,this.scope.hoistedBodyVarScope)),super.parseNode(e)}}ArrowFunctionExpression$1.prototype.preventChildBlockScope=!0;class AssignmentExpression extends NodeBase{constructor(){super(...arguments),this.deoptimized=!1}hasEffects(e){return this.deoptimized||this.applyDeoptimizations(),this.right.hasEffects(e)||this.left.hasEffects(e)||this.left.hasEffectsWhenAssignedAtPath(EMPTY_PATH,e)}hasEffectsWhenAccessedAtPath(e,t){return e.length>0&&this.right.hasEffectsWhenAccessedAtPath(e,t)}include(e,t){this.deoptimized||this.applyDeoptimizations(),this.included=!0,this.left.include(e,t),this.right.include(e,t)}render(e,t){if(this.left.render(e,t),this.right.render(e,t),"system"===t.format){const n=this.left.variable&&t.exportNamesByVariable.get(this.left.variable);if("Identifier"===this.left.type&&n){const r=t.compact?"":" ",i=findFirstOccurrenceOutsideComment(e.original,this.operator,this.left.end),s=this.operator.length>1?`${n[0]}${r}${this.operator.slice(0,-1)}${r}`:"";e.overwrite(i,findNonWhiteSpace(e.original,i+this.operator.length),`=${r}${1===n.length?`exports('${n[0]}',${r}`:getSystemExportFunctionLeft([this.left.variable],!1,t)}${s}`),e.appendLeft(this.right.end,")")}else{const n=[];this.left.addExportedVariables(n,t.exportNamesByVariable),n.length>0&&(e.prependRight(this.start,getSystemExportFunctionLeft(n,!0,t)),e.appendLeft(this.end,")"))}}}applyDeoptimizations(){this.deoptimized=!0,this.left.deoptimizePath(EMPTY_PATH),this.right.deoptimizePath(UNKNOWN_PATH)}}class AssignmentPattern extends NodeBase{addExportedVariables(e,t){this.left.addExportedVariables(e,t)}bind(){super.bind(),this.left.deoptimizePath(EMPTY_PATH),this.right.deoptimizePath(UNKNOWN_PATH)}declare(e,t){return this.left.declare(e,t)}deoptimizePath(e){0===e.length&&this.left.deoptimizePath(e)}hasEffectsWhenAssignedAtPath(e,t){return e.length>0||this.left.hasEffectsWhenAssignedAtPath(EMPTY_PATH,t)}render(e,t,{isShorthandProperty:n}=BLANK){this.left.render(e,t,{isShorthandProperty:n}),this.right.render(e,t)}}class AwaitExpression extends NodeBase{hasEffects(e){return!e.ignore.returnAwaitYield||this.argument.hasEffects(e)}include(e,t){if(!this.included){this.included=!0;e:if(!this.context.usesTopLevelAwait){let e=this.parent;do{if(e instanceof FunctionNode||e instanceof ArrowFunctionExpression$1)break e}while(e=e.parent);this.context.usesTopLevelAwait=!0}}this.argument.include(e,t)}}const binaryOperators={"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,"%":(e,t)=>e%t,"&":(e,t)=>e&t,"*":(e,t)=>e*t,"**":(e,t)=>e**t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"<":(e,t)=>ee<e<=t,"==":(e,t)=>e==t,"===":(e,t)=>e===t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,">>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t,"^":(e,t)=>e^t,in:()=>UnknownValue,instanceof:()=>UnknownValue,"|":(e,t)=>e|t};class BinaryExpression extends NodeBase{deoptimizeCache(){}getLiteralValueAtPath(e,t,n){if(e.length>0)return UnknownValue;const r=this.left.getLiteralValueAtPath(EMPTY_PATH,t,n);if(r===UnknownValue)return UnknownValue;const i=this.right.getLiteralValueAtPath(EMPTY_PATH,t,n);if(i===UnknownValue)return UnknownValue;const s=binaryOperators[this.operator];return s?s(r,i):UnknownValue}hasEffects(e){return"+"===this.operator&&this.parent instanceof ExpressionStatement$1&&""===this.left.getLiteralValueAtPath(EMPTY_PATH,SHARED_RECURSION_TRACKER,this)||super.hasEffects(e)}hasEffectsWhenAccessedAtPath(e){return e.length>1}}class BreakStatement extends NodeBase{hasEffects(e){if(this.label){if(!e.ignore.labels.has(this.label.name))return!0;e.includedLabels.add(this.label.name),e.brokenFlow=2}else{if(!e.ignore.breaks)return!0;e.brokenFlow=1}return!1}include(e){this.included=!0,this.label&&(this.label.include(),e.includedLabels.add(this.label.name)),e.brokenFlow=this.label?2:1}}class Literal extends NodeBase{getLiteralValueAtPath(e){return e.length>0||null===this.value&&110!==this.context.code.charCodeAt(this.start)||"bigint"==typeof this.value||47===this.context.code.charCodeAt(this.start)?UnknownValue:this.value}getReturnExpressionWhenCalledAtPath(e){return 1!==e.length?UNKNOWN_EXPRESSION:getMemberReturnExpressionWhenCalled(this.members,e[0])}hasEffectsWhenAccessedAtPath(e){return null===this.value?e.length>0:e.length>1}hasEffectsWhenAssignedAtPath(e){return e.length>0}hasEffectsWhenCalledAtPath(e,t,n){return 1!==e.length||hasMemberEffectWhenCalled(this.members,e[0],this.included,t,n)}initialise(){this.members=getLiteralMembersForValue(this.value)}parseNode(e){this.value=e.value,this.regex=e.regex,super.parseNode(e)}render(e){"string"==typeof this.value&&e.indentExclusionRanges.push([this.start+1,this.end-1])}}function getResolvablePropertyKey(e){return e.computed?getResolvableComputedPropertyKey(e.property):e.property.name}function getResolvableComputedPropertyKey(e){return e instanceof Literal?String(e.value):null}function getPathIfNotComputed(e){const t=e.propertyKey,n=e.object;if("string"==typeof t){if(n instanceof Identifier$1)return[{key:n.name,pos:n.start},{key:t,pos:e.property.start}];if(n instanceof MemberExpression){const r=getPathIfNotComputed(n);return r&&[...r,{key:t,pos:e.property.start}]}}return null}function getStringFromPath(e){let t=e[0].key;for(let n=1;n0)if(this.arguments[this.arguments.length-1].included)for(const n of this.arguments)n.render(e,t);else{let n=this.arguments.length-2;for(;n>=0&&!this.arguments[n].included;)n--;if(n>=0){for(let r=0;r<=n;r++)this.arguments[r].render(e,t);e.remove(findFirstOccurrenceOutsideComment(e.original,",",this.arguments[n].end),this.end-1)}else e.remove(findFirstOccurrenceOutsideComment(e.original,"(",this.callee.end)+1,this.end-1)}n===ExpressionStatement&&this.callee.type===FunctionExpression&&(e.appendRight(this.start,"("),e.prependLeft(this.end,")"))}getReturnExpression(e){return null===this.returnExpression?(this.returnExpression=UNKNOWN_EXPRESSION,this.returnExpression=this.callee.getReturnExpressionWhenCalledAtPath(EMPTY_PATH,e,this)):this.returnExpression}}class CatchScope extends ParameterScope{addDeclaration(e,t,n,r){return r?this.parent.addDeclaration(e,t,n,r):super.addDeclaration(e,t,n,!1)}}class CatchClause extends NodeBase{createScope(e){this.scope=new CatchScope(e,this.context)}initialise(){this.param&&this.param.declare("parameter",UNKNOWN_EXPRESSION)}parseNode(e){this.body=new this.context.nodeConstructors.BlockStatement(e.body,this,this.scope),super.parseNode(e)}}CatchClause.prototype.preventChildBlockScope=!0;class ChainExpression extends NodeBase{}class ClassBodyScope extends ChildScope{findLexicalBoundary(){return this}}class MethodDefinition extends NodeBase{hasEffects(e){return this.key.hasEffects(e)}hasEffectsWhenCalledAtPath(e,t,n){return e.length>0||this.value.hasEffectsWhenCalledAtPath(EMPTY_PATH,t,n)}}class ClassBody extends NodeBase{createScope(e){this.scope=new ClassBodyScope(e)}hasEffectsWhenCalledAtPath(e,t,n){return e.length>0||null!==this.classConstructor&&this.classConstructor.hasEffectsWhenCalledAtPath(EMPTY_PATH,t,n)}initialise(){for(const e of this.body)if(e instanceof MethodDefinition&&"constructor"===e.kind)return void(this.classConstructor=e);this.classConstructor=null}}class ClassExpression extends ClassNode{}class MultiExpression{constructor(e){this.included=!1,this.expressions=e}deoptimizePath(e){for(const t of this.expressions)t.deoptimizePath(e)}getLiteralValueAtPath(){return UnknownValue}getReturnExpressionWhenCalledAtPath(e,t,n){return new MultiExpression(this.expressions.map(r=>r.getReturnExpressionWhenCalledAtPath(e,t,n)))}hasEffectsWhenAccessedAtPath(e,t){for(const n of this.expressions)if(n.hasEffectsWhenAccessedAtPath(e,t))return!0;return!1}hasEffectsWhenAssignedAtPath(e,t){for(const n of this.expressions)if(n.hasEffectsWhenAssignedAtPath(e,t))return!0;return!1}hasEffectsWhenCalledAtPath(e,t,n){for(const r of this.expressions)if(r.hasEffectsWhenCalledAtPath(e,t,n))return!0;return!1}include(e,t){for(const n of this.expressions)n.included||n.include(e,t)}includeCallArguments(){}}class ConditionalExpression extends NodeBase{constructor(){super(...arguments),this.expressionsToBeDeoptimized=[],this.isBranchResolutionAnalysed=!1,this.usedBranch=null,this.wasPathDeoptimizedWhileOptimized=!1}bind(){super.bind(),this.getUsedBranch()}deoptimizeCache(){if(null!==this.usedBranch){const e=this.usedBranch===this.consequent?this.alternate:this.consequent;this.usedBranch=null;const t=this.expressionsToBeDeoptimized;this.expressionsToBeDeoptimized=[],this.wasPathDeoptimizedWhileOptimized&&e.deoptimizePath(UNKNOWN_PATH);for(const e of t)e.deoptimizeCache()}}deoptimizePath(e){if(e.length>0){const t=this.getUsedBranch();null===t?(this.consequent.deoptimizePath(e),this.alternate.deoptimizePath(e)):(this.wasPathDeoptimizedWhileOptimized=!0,t.deoptimizePath(e))}}getLiteralValueAtPath(e,t,n){const r=this.getUsedBranch();return null===r?UnknownValue:(this.expressionsToBeDeoptimized.push(n),r.getLiteralValueAtPath(e,t,n))}getReturnExpressionWhenCalledAtPath(e,t,n){const r=this.getUsedBranch();return null===r?new MultiExpression([this.consequent.getReturnExpressionWhenCalledAtPath(e,t,n),this.alternate.getReturnExpressionWhenCalledAtPath(e,t,n)]):(this.expressionsToBeDeoptimized.push(n),r.getReturnExpressionWhenCalledAtPath(e,t,n))}hasEffects(e){return!!this.test.hasEffects(e)||(null===this.usedBranch?this.consequent.hasEffects(e)||this.alternate.hasEffects(e):this.usedBranch.hasEffects(e))}hasEffectsWhenAccessedAtPath(e,t){return 0!==e.length&&(null===this.usedBranch?this.consequent.hasEffectsWhenAccessedAtPath(e,t)||this.alternate.hasEffectsWhenAccessedAtPath(e,t):this.usedBranch.hasEffectsWhenAccessedAtPath(e,t))}hasEffectsWhenAssignedAtPath(e,t){return 0===e.length||(null===this.usedBranch?this.consequent.hasEffectsWhenAssignedAtPath(e,t)||this.alternate.hasEffectsWhenAssignedAtPath(e,t):this.usedBranch.hasEffectsWhenAssignedAtPath(e,t))}hasEffectsWhenCalledAtPath(e,t,n){return null===this.usedBranch?this.consequent.hasEffectsWhenCalledAtPath(e,t,n)||this.alternate.hasEffectsWhenCalledAtPath(e,t,n):this.usedBranch.hasEffectsWhenCalledAtPath(e,t,n)}include(e,t){this.included=!0,t||this.test.shouldBeIncluded(e)||null===this.usedBranch?(this.test.include(e,t),this.consequent.include(e,t),this.alternate.include(e,t)):this.usedBranch.include(e,t)}render(e,t,{renderedParentType:n,isCalleeOfRenderedParent:r,preventASI:i}=BLANK){if(this.test.included)super.render(e,t);else{const s=findFirstOccurrenceOutsideComment(e.original,":",this.consequent.end),o=(this.consequent.included?findFirstOccurrenceOutsideComment(e.original,"?",this.test.end):s)+1;i&&removeLineBreaks(e,o,this.usedBranch.start),e.remove(this.start,o),this.consequent.included&&e.remove(s,this.end),removeAnnotations(this,e),this.usedBranch.render(e,t,{isCalleeOfRenderedParent:n?r:this.parent.callee===this,renderedParentType:n||this.parent.type})}}getUsedBranch(){if(this.isBranchResolutionAnalysed)return this.usedBranch;this.isBranchResolutionAnalysed=!0;const e=this.test.getLiteralValueAtPath(EMPTY_PATH,SHARED_RECURSION_TRACKER,this);return e===UnknownValue?null:this.usedBranch=e?this.consequent:this.alternate}}class ContinueStatement extends NodeBase{hasEffects(e){if(this.label){if(!e.ignore.labels.has(this.label.name))return!0;e.includedLabels.add(this.label.name),e.brokenFlow=2}else{if(!e.ignore.continues)return!0;e.brokenFlow=1}return!1}include(e){this.included=!0,this.label&&(this.label.include(),e.includedLabels.add(this.label.name)),e.brokenFlow=this.label?2:1}}class DoWhileStatement extends NodeBase{hasEffects(e){if(this.test.hasEffects(e))return!0;const{brokenFlow:t,ignore:{breaks:n,continues:r}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=n,e.ignore.continues=r,e.brokenFlow=t,!1)}include(e,t){this.included=!0,this.test.include(e,t);const{brokenFlow:n}=e;this.body.include(e,t),e.brokenFlow=n}}class EmptyStatement extends NodeBase{hasEffects(){return!1}}class ExportNamedDeclaration extends NodeBase{bind(){null!==this.declaration&&this.declaration.bind()}hasEffects(e){return null!==this.declaration&&this.declaration.hasEffects(e)}initialise(){this.context.addExport(this)}render(e,t,n){const{start:r,end:i}=n;null===this.declaration?e.remove(r,i):(e.remove(this.start,this.declaration.start),this.declaration.render(e,t,{start:r,end:i}))}}ExportNamedDeclaration.prototype.needsBoundaries=!0;class ExportSpecifier extends NodeBase{}class FieldDefinition extends NodeBase{hasEffects(e){return this.key.hasEffects(e)||this.static&&null!==this.value&&this.value.hasEffects(e)}}class ForInStatement extends NodeBase{bind(){this.left.bind(),this.left.deoptimizePath(EMPTY_PATH),this.right.bind(),this.body.bind()}createScope(e){this.scope=new BlockScope(e)}hasEffects(e){if(this.left&&(this.left.hasEffects(e)||this.left.hasEffectsWhenAssignedAtPath(EMPTY_PATH,e))||this.right&&this.right.hasEffects(e))return!0;const{brokenFlow:t,ignore:{breaks:n,continues:r}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=n,e.ignore.continues=r,e.brokenFlow=t,!1)}include(e,t){this.included=!0,this.left.includeWithAllDeclaredVariables(t,e),this.left.deoptimizePath(EMPTY_PATH),this.right.include(e,t);const{brokenFlow:n}=e;this.body.include(e,t),e.brokenFlow=n}render(e,t){this.left.render(e,t,NO_SEMICOLON),this.right.render(e,t,NO_SEMICOLON),110===e.original.charCodeAt(this.right.start-1)&&e.prependLeft(this.right.start," "),this.body.render(e,t)}}class ForOfStatement extends NodeBase{bind(){this.left.bind(),this.left.deoptimizePath(EMPTY_PATH),this.right.bind(),this.body.bind()}createScope(e){this.scope=new BlockScope(e)}hasEffects(){return!0}include(e,t){this.included=!0,this.left.includeWithAllDeclaredVariables(t,e),this.left.deoptimizePath(EMPTY_PATH),this.right.include(e,t);const{brokenFlow:n}=e;this.body.include(e,t),e.brokenFlow=n}render(e,t){this.left.render(e,t,NO_SEMICOLON),this.right.render(e,t,NO_SEMICOLON),102===e.original.charCodeAt(this.right.start-1)&&e.prependLeft(this.right.start," "),this.body.render(e,t)}}class ForStatement extends NodeBase{createScope(e){this.scope=new BlockScope(e)}hasEffects(e){if(this.init&&this.init.hasEffects(e)||this.test&&this.test.hasEffects(e)||this.update&&this.update.hasEffects(e))return!0;const{brokenFlow:t,ignore:{breaks:n,continues:r}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=n,e.ignore.continues=r,e.brokenFlow=t,!1)}include(e,t){this.included=!0,this.init&&this.init.include(e,t),this.test&&this.test.include(e,t);const{brokenFlow:n}=e;this.update&&this.update.include(e,t),this.body.include(e,t),e.brokenFlow=n}render(e,t){this.init&&this.init.render(e,t,NO_SEMICOLON),this.test&&this.test.render(e,t,NO_SEMICOLON),this.update&&this.update.render(e,t,NO_SEMICOLON),this.body.render(e,t)}}class FunctionExpression$1 extends FunctionNode{}const unset=Symbol("unset");class IfStatement extends NodeBase{constructor(){super(...arguments),this.testValue=unset}deoptimizeCache(){this.testValue=UnknownValue}hasEffects(e){if(this.test.hasEffects(e))return!0;const t=this.getTestValue();if(t===UnknownValue){const{brokenFlow:t}=e;if(this.consequent.hasEffects(e))return!0;const n=e.brokenFlow;return e.brokenFlow=t,null===this.alternate?!1:!!this.alternate.hasEffects(e)||(e.brokenFlow=e.brokenFlow1}include(){if(!this.included){this.included=!0;const e=this.parent,t=this.metaProperty=e instanceof MemberExpression&&"string"==typeof e.propertyKey?e.propertyKey:null;t&&(t.startsWith(FILE_PREFIX)||t.startsWith(ASSET_PREFIX)||t.startsWith(CHUNK_PREFIX))?this.scope.addAccessedGlobalsByFormat(accessedFileUrlGlobals):this.scope.addAccessedGlobalsByFormat(accessedMetaUrlGlobals)}}initialise(){"import"===this.meta.name&&this.context.addImportMeta(this)}renderFinalMechanism(e,t,n,r){if(!this.included)return;const i=this.parent,s=this.metaProperty;if(s&&(s.startsWith(FILE_PREFIX)||s.startsWith(ASSET_PREFIX)||s.startsWith(CHUNK_PREFIX))){let o,a=null,c=null,l=null;s.startsWith(FILE_PREFIX)?(a=s.substr(FILE_PREFIX.length),o=r.getFileName(a)):s.startsWith(ASSET_PREFIX)?(warnDeprecation(`Using the "${ASSET_PREFIX}" prefix to reference files is deprecated. Use the "${FILE_PREFIX}" prefix instead.`,!0,this.context.options),c=s.substr(ASSET_PREFIX.length),o=r.getFileName(c)):(warnDeprecation(`Using the "${CHUNK_PREFIX}" prefix to reference files is deprecated. Use the "${FILE_PREFIX}" prefix instead.`,!0,this.context.options),l=s.substr(CHUNK_PREFIX.length),o=r.getFileName(l));const u=normalize(path$n.relative(path$n.dirname(t),o));let p;return null!==c&&(p=r.hookFirstSync("resolveAssetUrl",[{assetFileName:o,chunkId:t,format:n,moduleId:this.context.module.id,relativeAssetPath:u}])),p||(p=r.hookFirstSync("resolveFileUrl",[{assetReferenceId:c,chunkId:t,chunkReferenceId:l,fileName:o,format:n,moduleId:this.context.module.id,referenceId:a||c||l,relativePath:u}])||relativeUrlMechanisms[n](u)),void e.overwrite(i.start,i.end,p,{contentOnly:!0})}const o=r.hookFirstSync("resolveImportMeta",[s,{chunkId:t,format:n,moduleId:this.context.module.id}])||importMetaMechanisms[n]&&importMetaMechanisms[n](s,t);"string"==typeof o&&(i instanceof MemberExpression?e.overwrite(i.start,i.end,o,{contentOnly:!0}):e.overwrite(this.start,this.end,o,{contentOnly:!0}))}}const accessedMetaUrlGlobals={amd:["document","module","URL"],cjs:["document","require","URL"],iife:["document","URL"],system:["module"],umd:["document","require","URL"]},accessedFileUrlGlobals={amd:["document","require","URL"],cjs:["document","require","URL"],iife:["document","URL"],system:["module","URL"],umd:["document","require","URL"]},getResolveUrl=(e,t="URL")=>`new ${t}(${e}).href`,getRelativeUrlFromDocument=e=>getResolveUrl(`'${e}', document.currentScript && document.currentScript.src || document.baseURI`),getGenericImportMetaMechanism=e=>(t,n)=>{const r=e(n);return null===t?`({ url: ${r} })`:"url"===t?r:"undefined"},getUrlFromDocument=e=>`(document.currentScript && document.currentScript.src || new URL('${e}', document.baseURI).href)`,relativeUrlMechanisms={amd:e=>("."!==e[0]&&(e="./"+e),getResolveUrl(`require.toUrl('${e}'), document.baseURI`)),cjs:e=>`(typeof document === 'undefined' ? ${getResolveUrl(`'file:' + __dirname + '/${e}'`,"(require('u' + 'rl').URL)")} : ${getRelativeUrlFromDocument(e)})`,es:e=>getResolveUrl(`'${e}', import.meta.url`),iife:e=>getRelativeUrlFromDocument(e),system:e=>getResolveUrl(`'${e}', module.meta.url`),umd:e=>`(typeof document === 'undefined' ? ${getResolveUrl(`'file:' + __dirname + '/${e}'`,"(require('u' + 'rl').URL)")} : ${getRelativeUrlFromDocument(e)})`},importMetaMechanisms={amd:getGenericImportMetaMechanism(()=>getResolveUrl("module.uri, document.baseURI")),cjs:getGenericImportMetaMechanism(e=>`(typeof document === 'undefined' ? ${getResolveUrl("'file:' + __filename","(require('u' + 'rl').URL)")} : ${getUrlFromDocument(e)})`),iife:getGenericImportMetaMechanism(e=>getUrlFromDocument(e)),system:e=>null===e?"module.meta":"module.meta."+e,umd:getGenericImportMetaMechanism(e=>`(typeof document === 'undefined' ? ${getResolveUrl("'file:' + __filename","(require('u' + 'rl').URL)")} : ${getUrlFromDocument(e)})`)};class NewExpression extends NodeBase{bind(){super.bind();for(const e of this.arguments)e.deoptimizePath(UNKNOWN_PATH)}hasEffects(e){for(const t of this.arguments)if(t.hasEffects(e))return!0;return(!this.context.options.treeshake.annotations||!this.annotatedPure)&&(this.callee.hasEffects(e)||this.callee.hasEffectsWhenCalledAtPath(EMPTY_PATH,this.callOptions,e))}hasEffectsWhenAccessedAtPath(e){return e.length>1}initialise(){this.callOptions={args:this.arguments,withNew:!0}}}class SpreadElement extends NodeBase{bind(){super.bind(),this.argument.deoptimizePath([UnknownKey,UnknownKey])}}class ObjectExpression extends NodeBase{constructor(){super(...arguments),this.deoptimizedPaths=new Set,this.expressionsToBeDeoptimized=new Map,this.hasUnknownDeoptimizedProperty=!1,this.propertyMap=null,this.unmatchablePropertiesRead=[],this.unmatchablePropertiesWrite=[]}bind(){super.bind(),this.getPropertyMap()}deoptimizeCache(){this.hasUnknownDeoptimizedProperty||this.deoptimizeAllProperties()}deoptimizePath(e){if(this.hasUnknownDeoptimizedProperty)return;const t=this.getPropertyMap(),n=e[0];if(1===e.length){if("string"!=typeof n)return void this.deoptimizeAllProperties();if(!this.deoptimizedPaths.has(n)){this.deoptimizedPaths.add(n);const e=this.expressionsToBeDeoptimized.get(n);if(e)for(const t of e)t.deoptimizeCache()}}const r=1===e.length?UNKNOWN_PATH:e.slice(1);for(const e of"string"==typeof n?t[n]?t[n].propertiesRead:[]:this.properties)e.deoptimizePath(r)}getLiteralValueAtPath(e,t,n){const r=this.getPropertyMap(),i=e[0];if(0===e.length||this.hasUnknownDeoptimizedProperty||"string"!=typeof i||this.deoptimizedPaths.has(i))return UnknownValue;if(1===e.length&&!r[i]&&!objectMembers[i]&&0===this.unmatchablePropertiesRead.length){const e=this.expressionsToBeDeoptimized.get(i);return void(e?e.push(n):this.expressionsToBeDeoptimized.set(i,[n]))}if(!r[i]||null===r[i].exactMatchRead||r[i].propertiesRead.length>1)return UnknownValue;const s=this.expressionsToBeDeoptimized.get(i);return s?s.push(n):this.expressionsToBeDeoptimized.set(i,[n]),r[i].exactMatchRead.getLiteralValueAtPath(e.slice(1),t,n)}getReturnExpressionWhenCalledAtPath(e,t,n){const r=this.getPropertyMap(),i=e[0];if(0===e.length||this.hasUnknownDeoptimizedProperty||"string"!=typeof i||this.deoptimizedPaths.has(i))return UNKNOWN_EXPRESSION;if(1===e.length&&objectMembers[i]&&0===this.unmatchablePropertiesRead.length&&(!r[i]||null===r[i].exactMatchRead))return getMemberReturnExpressionWhenCalled(objectMembers,i);if(!r[i]||null===r[i].exactMatchRead||r[i].propertiesRead.length>1)return UNKNOWN_EXPRESSION;const s=this.expressionsToBeDeoptimized.get(i);return s?s.push(n):this.expressionsToBeDeoptimized.set(i,[n]),r[i].exactMatchRead.getReturnExpressionWhenCalledAtPath(e.slice(1),t,n)}hasEffectsWhenAccessedAtPath(e,t){if(0===e.length)return!1;const n=e[0],r=this.propertyMap;if(e.length>1&&(this.hasUnknownDeoptimizedProperty||"string"!=typeof n||this.deoptimizedPaths.has(n)||!r[n]||null===r[n].exactMatchRead))return!0;const i=e.slice(1);for(const e of"string"!=typeof n?this.properties:r[n]?r[n].propertiesRead:[])if(e.hasEffectsWhenAccessedAtPath(i,t))return!0;return!1}hasEffectsWhenAssignedAtPath(e,t){const n=e[0],r=this.propertyMap;if(e.length>1&&(this.hasUnknownDeoptimizedProperty||this.deoptimizedPaths.has(n)||!r[n]||null===r[n].exactMatchRead))return!0;const i=e.slice(1);for(const s of"string"!=typeof n?this.properties:e.length>1?r[n].propertiesRead:r[n]?r[n].propertiesWrite:[])if(s.hasEffectsWhenAssignedAtPath(i,t))return!0;return!1}hasEffectsWhenCalledAtPath(e,t,n){const r=e[0];if("string"!=typeof r||this.hasUnknownDeoptimizedProperty||this.deoptimizedPaths.has(r)||(this.propertyMap[r]?!this.propertyMap[r].exactMatchRead:e.length>1||!objectMembers[r]))return!0;const i=e.slice(1);if(this.propertyMap[r])for(const e of this.propertyMap[r].propertiesRead)if(e.hasEffectsWhenCalledAtPath(i,t,n))return!0;return!(1!==e.length||!objectMembers[r])&&hasMemberEffectWhenCalled(objectMembers,r,this.included,t,n)}render(e,t,{renderedParentType:n}=BLANK){super.render(e,t),n!==ExpressionStatement&&n!==ArrowFunctionExpression||(e.appendRight(this.start,"("),e.prependLeft(this.end,")"))}deoptimizeAllProperties(){this.hasUnknownDeoptimizedProperty=!0;for(const e of this.properties)e.deoptimizePath(UNKNOWN_PATH);for(const e of this.expressionsToBeDeoptimized.values())for(const t of e)t.deoptimizeCache()}getPropertyMap(){if(null!==this.propertyMap)return this.propertyMap;const e=this.propertyMap=Object.create(null);for(let t=this.properties.length-1;t>=0;t--){const n=this.properties[t];if(n instanceof SpreadElement){this.unmatchablePropertiesRead.push(n);continue}const r="get"!==n.kind,i="set"!==n.kind;let s;if(n.computed){const e=n.key.getLiteralValueAtPath(EMPTY_PATH,SHARED_RECURSION_TRACKER,this);if(e===UnknownValue){i?this.unmatchablePropertiesRead.push(n):this.unmatchablePropertiesWrite.push(n);continue}s=String(e)}else s=n.key instanceof Identifier$1?n.key.name:String(n.key.value);const o=e[s];o?(i&&null===o.exactMatchRead&&(o.exactMatchRead=n,o.propertiesRead.push(n,...this.unmatchablePropertiesRead)),r&&!i&&null===o.exactMatchWrite&&(o.exactMatchWrite=n,o.propertiesWrite.push(n,...this.unmatchablePropertiesWrite))):e[s]={exactMatchRead:i?n:null,exactMatchWrite:r?n:null,propertiesRead:i?[n,...this.unmatchablePropertiesRead]:[],propertiesWrite:r&&!i?[n,...this.unmatchablePropertiesWrite]:[]}}return e}}class ObjectPattern extends NodeBase{addExportedVariables(e,t){for(const n of this.properties)n.type===Property?n.value.addExportedVariables(e,t):n.argument.addExportedVariables(e,t)}declare(e,t){const n=[];for(const r of this.properties)n.push(...r.declare(e,t));return n}deoptimizePath(e){if(0===e.length)for(const t of this.properties)t.deoptimizePath(e)}hasEffectsWhenAssignedAtPath(e,t){if(e.length>0)return!0;for(const e of this.properties)if(e.hasEffectsWhenAssignedAtPath(EMPTY_PATH,t))return!0;return!1}}class PrivateName extends NodeBase{}class Program$1 extends NodeBase{constructor(){super(...arguments),this.hasCachedEffect=!1}hasEffects(e){if(this.hasCachedEffect)return!0;for(const t of this.body)if(t.hasEffects(e))return this.hasCachedEffect=!0;return!1}include(e,t){this.included=!0;for(const n of this.body)(t||n.shouldBeIncluded(e))&&n.include(e,t)}render(e,t){this.body.length?renderStatementList(this.body,e,this.start,this.end,t):super.render(e,t)}}class Property$1 extends NodeBase{constructor(){super(...arguments),this.declarationInit=null,this.returnExpression=null}bind(){super.bind(),"get"===this.kind&&this.getReturnExpression(),null!==this.declarationInit&&this.declarationInit.deoptimizePath([UnknownKey,UnknownKey])}declare(e,t){return this.declarationInit=t,this.value.declare(e,UNKNOWN_EXPRESSION)}deoptimizeCache(){}deoptimizePath(e){"get"===this.kind?this.getReturnExpression().deoptimizePath(e):this.value.deoptimizePath(e)}getLiteralValueAtPath(e,t,n){return"get"===this.kind?this.getReturnExpression().getLiteralValueAtPath(e,t,n):this.value.getLiteralValueAtPath(e,t,n)}getReturnExpressionWhenCalledAtPath(e,t,n){return"get"===this.kind?this.getReturnExpression().getReturnExpressionWhenCalledAtPath(e,t,n):this.value.getReturnExpressionWhenCalledAtPath(e,t,n)}hasEffects(e){return this.key.hasEffects(e)||this.value.hasEffects(e)}hasEffectsWhenAccessedAtPath(e,t){if("get"===this.kind){const n=t.accessed.getEntities(e);return!n.has(this)&&(n.add(this),this.value.hasEffectsWhenCalledAtPath(EMPTY_PATH,this.accessorCallOptions,t)||e.length>0&&this.returnExpression.hasEffectsWhenAccessedAtPath(e,t))}return this.value.hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){if("get"===this.kind){const n=t.assigned.getEntities(e);return!n.has(this)&&(n.add(this),this.returnExpression.hasEffectsWhenAssignedAtPath(e,t))}if("set"===this.kind){const n=t.assigned.getEntities(e);return!n.has(this)&&(n.add(this),this.value.hasEffectsWhenCalledAtPath(EMPTY_PATH,this.accessorCallOptions,t))}return this.value.hasEffectsWhenAssignedAtPath(e,t)}hasEffectsWhenCalledAtPath(e,t,n){if("get"===this.kind){const r=(t.withNew?n.instantiated:n.called).getEntities(e,t);return!r.has(this)&&(r.add(this),this.returnExpression.hasEffectsWhenCalledAtPath(e,t,n))}return this.value.hasEffectsWhenCalledAtPath(e,t,n)}initialise(){this.accessorCallOptions={args:NO_ARGS,withNew:!1}}render(e,t){this.shorthand||this.key.render(e,t),this.value.render(e,t,{isShorthandProperty:this.shorthand})}getReturnExpression(){return null===this.returnExpression?(this.returnExpression=UNKNOWN_EXPRESSION,this.returnExpression=this.value.getReturnExpressionWhenCalledAtPath(EMPTY_PATH,SHARED_RECURSION_TRACKER,this)):this.returnExpression}}class ReturnStatement$1 extends NodeBase{hasEffects(e){return!(e.ignore.returnAwaitYield&&(null===this.argument||!this.argument.hasEffects(e)))||(e.brokenFlow=2,!1)}include(e,t){this.included=!0,this.argument&&this.argument.include(e,t),e.brokenFlow=2}initialise(){this.scope.addReturnExpression(this.argument||UNKNOWN_EXPRESSION)}render(e,t){this.argument&&(this.argument.render(e,t,{preventASI:!0}),this.argument.start===this.start+6&&e.prependLeft(this.start+6," "))}}class SequenceExpression extends NodeBase{deoptimizePath(e){e.length>0&&this.expressions[this.expressions.length-1].deoptimizePath(e)}getLiteralValueAtPath(e,t,n){return this.expressions[this.expressions.length-1].getLiteralValueAtPath(e,t,n)}hasEffects(e){for(const t of this.expressions)if(t.hasEffects(e))return!0;return!1}hasEffectsWhenAccessedAtPath(e,t){return e.length>0&&this.expressions[this.expressions.length-1].hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){return 0===e.length||this.expressions[this.expressions.length-1].hasEffectsWhenAssignedAtPath(e,t)}hasEffectsWhenCalledAtPath(e,t,n){return this.expressions[this.expressions.length-1].hasEffectsWhenCalledAtPath(e,t,n)}include(e,t){this.included=!0;for(let n=0;n=0;s--){const o=this.cases[s];if(o.included&&(i=!0),!i){const e=createHasEffectsContext();e.ignore.breaks=!0,i=o.hasEffects(e)}i?(o.include(e,t),r=r0&&renderStatementList(this.cases,e,this.cases[0].start,this.end-1,t)}}class TaggedTemplateExpression extends NodeBase{bind(){if(super.bind(),this.tag.type===Identifier){const e=this.tag.name;this.scope.findVariable(e).isNamespace&&this.context.warn({code:"CANNOT_CALL_NAMESPACE",message:`Cannot call a namespace ('${e}')`},this.start),"eval"===e&&this.context.warn({code:"EVAL",message:"Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification",url:"https://rollupjs.org/guide/en/#avoiding-eval"},this.start)}}hasEffects(e){return super.hasEffects(e)||this.tag.hasEffectsWhenCalledAtPath(EMPTY_PATH,this.callOptions,e)}initialise(){this.callOptions={args:NO_ARGS,withNew:!1}}}class TemplateElement extends NodeBase{bind(){}hasEffects(){return!1}include(){this.included=!0}parseNode(e){this.value=e.value,super.parseNode(e)}render(){}}class TemplateLiteral extends NodeBase{getLiteralValueAtPath(e){return e.length>0||1!==this.quasis.length?UnknownValue:this.quasis[0].value.cooked}render(e,t){e.indentExclusionRanges.push([this.start,this.end]),super.render(e,t)}}class ModuleScope extends ChildScope{constructor(e,t){super(e),this.context=t,this.variables.set("this",new LocalVariable("this",null,UNDEFINED_EXPRESSION,t))}addExportDefaultDeclaration(e,t,n){const r=new ExportDefaultVariable(e,t,n);return this.variables.set("default",r),r}addNamespaceMemberAccess(e,t){t instanceof GlobalVariable&&this.accessedOutsideVariables.set(t.name,t)}deconflict(e,t){for(const n of this.children)n.deconflict(e,t)}findLexicalBoundary(){return this}findVariable(e){const t=this.variables.get(e)||this.accessedOutsideVariables.get(e);if(t)return t;const n=this.context.traceVariable(e)||this.parent.findVariable(e);return n instanceof GlobalVariable&&this.accessedOutsideVariables.set(e,n),n}}class ThisExpression extends NodeBase{bind(){super.bind(),this.variable=this.scope.findVariable("this")}hasEffectsWhenAccessedAtPath(e,t){return e.length>0&&this.variable.hasEffectsWhenAccessedAtPath(e,t)}hasEffectsWhenAssignedAtPath(e,t){return this.variable.hasEffectsWhenAssignedAtPath(e,t)}initialise(){this.alias=this.scope.findLexicalBoundary()instanceof ModuleScope?this.context.moduleContext:null,"undefined"===this.alias&&this.context.warn({code:"THIS_IS_UNDEFINED",message:"The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten",url:"https://rollupjs.org/guide/en/#error-this-is-undefined"},this.start)}render(e){null!==this.alias&&e.overwrite(this.start,this.end,this.alias,{contentOnly:!1,storeName:!0})}}class ThrowStatement extends NodeBase{hasEffects(){return!0}include(e,t){this.included=!0,this.argument.include(e,t),e.brokenFlow=2}render(e,t){this.argument.render(e,t,{preventASI:!0}),this.argument.start===this.start+5&&e.prependLeft(this.start+5," ")}}class TryStatement extends NodeBase{constructor(){super(...arguments),this.directlyIncluded=!1}hasEffects(e){return(this.context.options.treeshake.tryCatchDeoptimization?this.block.body.length>0:this.block.hasEffects(e))||null!==this.finalizer&&this.finalizer.hasEffects(e)}include(e,t){var n;const r=null===(n=this.context.options.treeshake)||void 0===n?void 0:n.tryCatchDeoptimization,{brokenFlow:i}=e;this.directlyIncluded&&r||(this.included=!0,this.directlyIncluded=!0,this.block.include(e,r?"variables":t),e.brokenFlow=i),null!==this.handler&&(this.handler.include(e,t),e.brokenFlow=i),null!==this.finalizer&&this.finalizer.include(e,t)}}const unaryOperators={"!":e=>!e,"+":e=>+e,"-":e=>-e,delete:()=>UnknownValue,typeof:e=>typeof e,void:()=>{},"~":e=>~e};class UnaryExpression extends NodeBase{bind(){super.bind(),"delete"===this.operator&&this.argument.deoptimizePath(EMPTY_PATH)}getLiteralValueAtPath(e,t,n){if(e.length>0)return UnknownValue;const r=this.argument.getLiteralValueAtPath(EMPTY_PATH,t,n);return r===UnknownValue?UnknownValue:unaryOperators[this.operator](r)}hasEffects(e){return!("typeof"===this.operator&&this.argument instanceof Identifier$1)&&(this.argument.hasEffects(e)||"delete"===this.operator&&this.argument.hasEffectsWhenAssignedAtPath(EMPTY_PATH,e))}hasEffectsWhenAccessedAtPath(e){return"void"===this.operator?e.length>0:e.length>1}}class UnknownNode extends NodeBase{hasEffects(){return!0}include(e){super.include(e,!0)}}class UpdateExpression extends NodeBase{bind(){if(super.bind(),this.argument.deoptimizePath(EMPTY_PATH),this.argument instanceof Identifier$1){this.scope.findVariable(this.argument.name).isReassigned=!0}}hasEffects(e){return this.argument.hasEffects(e)||this.argument.hasEffectsWhenAssignedAtPath(EMPTY_PATH,e)}hasEffectsWhenAccessedAtPath(e){return e.length>1}render(e,t){if(this.argument.render(e,t),"system"===t.format){const n=this.argument.variable,r=t.exportNamesByVariable.get(n);if(r&&r.length){const i=t.compact?"":" ",s=n.getName();if(this.prefix)1===r.length?e.overwrite(this.start,this.end,`exports('${r[0]}',${i}${this.operator}${s})`):e.overwrite(this.start,this.end,`(${this.operator}${s},${i}${getSystemExportStatement([n],t)},${i}${s})`);else if(r.length>1)e.overwrite(this.start,this.end,`${getSystemExportFunctionLeft([n],!1,t)}${this.operator}${s})`);else{let t;switch(this.operator){case"++":t=`${s}${i}+${i}1`;break;case"--":t=`${s}${i}-${i}1`}e.overwrite(this.start,this.end,`(exports('${r[0]}',${i}${t}),${i}${s}${this.operator})`)}}}}}function isReassignedExportsMember(e,t){return null!==e.renderBaseName&&t.has(e)&&e.isReassigned}function areAllDeclarationsIncludedAndNotExported(e,t){for(const n of e){if(!n.included)return!1;if(n.id.type===Identifier){if(t.has(n.id.variable))return!1}else{const e=[];if(n.id.addExportedVariables(e,t),e.length>0)return!1}}return!0}class VariableDeclaration extends NodeBase{deoptimizePath(){for(const e of this.declarations)e.deoptimizePath(EMPTY_PATH)}hasEffectsWhenAssignedAtPath(){return!1}include(e,t){this.included=!0;for(const n of this.declarations)(t||n.shouldBeIncluded(e))&&n.include(e,t)}includeWithAllDeclaredVariables(e,t){this.included=!0;for(const n of this.declarations)n.include(t,e)}initialise(){for(const e of this.declarations)e.declareDeclarator(this.kind)}render(e,t,n=BLANK){if(areAllDeclarationsIncludedAndNotExported(this.declarations,t.exportNamesByVariable)){for(const n of this.declarations)n.render(e,t);n.isNoStatement||59===e.original.charCodeAt(this.end-1)||e.appendLeft(this.end,";")}else this.renderReplacedDeclarations(e,t,n)}renderDeclarationEnd(e,t,n,r,i,s,o,a){59===e.original.charCodeAt(this.end-1)&&e.remove(this.end-1,this.end),s&&(t+=";"),null!==n?(10!==e.original.charCodeAt(r-1)||10!==e.original.charCodeAt(this.end)&&13!==e.original.charCodeAt(this.end)||(r--,13===e.original.charCodeAt(r)&&r--),r===n+1?e.overwrite(n,i,t):(e.overwrite(n,n+1,t),e.remove(r,i))):e.appendLeft(i,t),o.length>0&&e.appendLeft(i,` ${getSystemExportStatement(o,a)};`)}renderReplacedDeclarations(e,t,{start:n=this.start,end:r=this.end,isNoStatement:i}){const s=getCommaSeparatedNodesWithBoundaries(this.declarations,e,this.start+this.kind.length,this.end-(59===e.original.charCodeAt(this.end-1)?1:0));let o,a;a=/\n\s*$/.test(e.slice(this.start,s[0].start))?this.start+this.kind.length:s[0].start;let c=a-1;e.remove(this.start,c);let l,u,p=!1,h=!1,d="";const f=[];for(const{node:n,start:r,separator:i,contentEnd:m,end:g}of s)if(!n.included||n.id instanceof Identifier$1&&isReassignedExportsMember(n.id.variable,t.exportNamesByVariable)&&null===n.init)e.remove(r,g);else{if(l="",u="",n.id instanceof Identifier$1&&isReassignedExportsMember(n.id.variable,t.exportNamesByVariable))h&&(d+=";"),p=!1;else{if("system"===t.format&&null!==n.init)if(n.id.type!==Identifier)n.id.addExportedVariables(f,t.exportNamesByVariable);else{const r=t.exportNamesByVariable.get(n.id.variable);if(r){const i=t.compact?"":" ",s=findFirstOccurrenceOutsideComment(e.original,"=",n.id.end);e.prependLeft(findNonWhiteSpace(e.original,s+1),1===r.length?`exports('${r[0]}',${i}`:getSystemExportFunctionLeft([n.id.variable],!1,t)),u+=")"}}p?d+=",":(h&&(d+=";"),l+=this.kind+" ",p=!0)}a===c+1?e.overwrite(c,a,d+l):(e.overwrite(c,c+1,d),e.appendLeft(a,l)),n.render(e,t),o=m,a=g,h=!0,c=i,d=u}h?this.renderDeclarationEnd(e,d,c,o,a,!i,f,t):e.remove(n,r)}}class VariableDeclarator extends NodeBase{declareDeclarator(e){this.id.declare(e,this.init||UNDEFINED_EXPRESSION)}deoptimizePath(e){this.id.deoptimizePath(e)}render(e,t){null===this.init||this.init.included?super.render(e,t):(e.remove(this.id.end,this.end),this.id.render(e,t))}}class WhileStatement extends NodeBase{hasEffects(e){if(this.test.hasEffects(e))return!0;const{brokenFlow:t,ignore:{breaks:n,continues:r}}=e;return e.ignore.breaks=!0,e.ignore.continues=!0,!!this.body.hasEffects(e)||(e.ignore.breaks=n,e.ignore.continues=r,e.brokenFlow=t,!1)}include(e,t){this.included=!0,this.test.include(e,t);const{brokenFlow:n}=e;this.body.include(e,t),e.brokenFlow=n}}class YieldExpression extends NodeBase{bind(){super.bind(),null!==this.argument&&this.argument.deoptimizePath(UNKNOWN_PATH)}hasEffects(e){return!e.ignore.returnAwaitYield||null!==this.argument&&this.argument.hasEffects(e)}render(e,t){this.argument&&(this.argument.render(e,t),this.argument.start===this.start+5&&e.prependLeft(this.start+5," "))}}const nodeConstructors={ArrayExpression,ArrayPattern,ArrowFunctionExpression:ArrowFunctionExpression$1,AssignmentExpression,AssignmentPattern,AwaitExpression,BinaryExpression,BlockStatement:BlockStatement$1,BreakStatement,CallExpression:CallExpression$1,CatchClause,ChainExpression,ClassBody,ClassDeclaration,ClassExpression,ConditionalExpression,ContinueStatement,DoWhileStatement,EmptyStatement,ExportAllDeclaration,ExportDefaultDeclaration,ExportNamedDeclaration,ExportSpecifier,ExpressionStatement:ExpressionStatement$1,FieldDefinition,ForInStatement,ForOfStatement,ForStatement,FunctionDeclaration,FunctionExpression:FunctionExpression$1,Identifier:Identifier$1,IfStatement,ImportDeclaration,ImportDefaultSpecifier:ImportDefaultSpecifier$1,ImportExpression:Import,ImportNamespaceSpecifier:ImportNamespaceSpecifier$1,ImportSpecifier,LabeledStatement,Literal,LogicalExpression,MemberExpression,MetaProperty,MethodDefinition,NewExpression,ObjectExpression,ObjectPattern,PrivateName,Program:Program$1,Property:Property$1,RestElement,ReturnStatement:ReturnStatement$1,SequenceExpression,SpreadElement,Super,SwitchCase,SwitchStatement,TaggedTemplateExpression,TemplateElement,TemplateLiteral,ThisExpression,ThrowStatement,TryStatement,UnaryExpression,UnknownNode,UpdateExpression,VariableDeclaration,VariableDeclarator,WhileStatement,YieldExpression};function getId(e){return e.id}function getOriginalLocation(e,t){const n=e.filter(e=>e.mappings);for(;n.length>0;){const e=n.pop(),r=e.mappings[t.line-1];let i=!1;if(void 0!==r)for(const n of r)if(n[0]>=t.column){if(1===n.length)break;t={column:n[3],line:n[2]+1,name:5===n.length?e.names[n[4]]:void 0,source:e.sources[n[1]]},i=!0;break}if(!i)throw new Error("Can't resolve original location of error.")}return t}function skipThrough(e,t,n){n(e,t)}function ignore(e,t,n){}var base$1={};function handlePureAnnotationsOfNode(e,t,n=e.type){let r=t.commentNodes[t.commentIndex];for(;r&&e.start>=r.end;)markPureNode(e,r),r=t.commentNodes[++t.commentIndex];r&&r.end<=e.end&&base$1[n](e,t,handlePureAnnotationsOfNode)}function markPureNode(e,t){e.annotations?e.annotations.push(t):e.annotations=[t],"ExpressionStatement"===e.type&&(e=e.expression),"CallExpression"!==e.type&&"NewExpression"!==e.type||(e.annotatedPure=!0)}base$1.Program=base$1.BlockStatement=function(e,t,n){for(var r=0,i=e.body;rpureCommentRegex.test(e.text);function markPureCallExpressions(e,t){handlePureAnnotationsOfNode(t,{commentIndex:0,commentNodes:e.filter(isPureComment)})}let SOURCEMAPPING_URL="sourceMa";SOURCEMAPPING_URL+="ppingURL";const SOURCEMAPPING_URL_RE=new RegExp(`^#\\s+${SOURCEMAPPING_URL}=.+\\n?`);function tryParse(e,t,n){try{return t.parse(e.code,{...n,onComment:(t,n,r,i)=>e.comments.push({block:t,text:n,start:r,end:i})})}catch(t){let n=t.message.replace(/ \(\d+:\d+\)$/,"");return e.id.endsWith(".json")?n+=" (Note that you need @rollup/plugin-json to import JSON files)":e.id.endsWith(".js")||(n+=" (Note that you need plugins to import files that are not JavaScript)"),e.error({code:"PARSE_ERROR",message:n,parserError:t},t.pos)}}function handleMissingExport(e,t,n,r){return t.error({code:"MISSING_EXPORT",message:`'${e}' is not exported by ${relativeId(n)}, imported by ${relativeId(t.id)}`,url:"https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module"},r)}const MISSING_EXPORT_SHIM_DESCRIPTION={identifier:null,localName:"_missingExportShim"};function getVariableForExportNameRecursive(e,t,n,r=new Map){const i=r.get(t);if(i){if(i.has(e))return null;i.add(e)}else r.set(t,new Set([e]));return e.getVariableForExportName(t,n,r)}class Module{constructor(e,t,n,r,i,s){this.graph=e,this.id=t,this.options=n,this.moduleSideEffects=r,this.syntheticNamedExports=i,this.isEntryPoint=s,this.chunk=null,this.chunkFileNames=new Set,this.chunkName=null,this.comments=[],this.dependencies=new Set,this.dynamicDependencies=new Set,this.dynamicImporters=[],this.dynamicImports=[],this.execIndex=1/0,this.exportAllSources=new Set,this.exports=Object.create(null),this.exportsAll=Object.create(null),this.facadeChunk=null,this.implicitlyLoadedAfter=new Set,this.implicitlyLoadedBefore=new Set,this.importDescriptions=Object.create(null),this.importers=[],this.importMetas=[],this.imports=new Set,this.includedDynamicImporters=[],this.isExecuted=!1,this.isUserDefinedEntryPoint=!1,this.manualChunkAlias=null,this.preserveSignature=this.options.preserveEntrySignatures,this.reexportDescriptions=Object.create(null),this.sources=new Set,this.userChunkNames=new Set,this.usesTopLevelAwait=!1,this.allExportNames=null,this.defaultExport=null,this.exportAllModules=[],this.exportNamesByVariable=null,this.exportShimVariable=new ExportShimVariable(this),this.relevantDependencies=null,this.syntheticExports=new Map,this.transformDependencies=[],this.transitiveReexports=null,this.excludeFromSourcemap=/\0/.test(t),this.context=n.moduleContext(t)}basename(){const e=path$n.basename(this.id),t=path$n.extname(this.id);return makeLegal(t?e.slice(0,-t.length):e)}bindReferences(){this.ast.bind()}error(e,t){if("number"==typeof t){e.pos=t;let n=locate(this.code,t,{offsetLine:1});try{n=getOriginalLocation(this.sourcemapChain,n)}catch(e){this.warn({code:"SOURCEMAP_ERROR",loc:{column:n.column,file:this.id,line:n.line},message:"Error when using sourcemap for reporting an error: "+e.message,pos:t})}e.loc={column:n.column,file:this.id,line:n.line},e.frame=getCodeFrame(this.originalCode,n.line,n.column)}return error$1(e)}getAllExportNames(){if(this.allExportNames)return this.allExportNames;const e=this.allExportNames=new Set;for(const t of Object.keys(this.exports))e.add(t);for(const t of Object.keys(this.reexportDescriptions))e.add(t);for(const t of this.exportAllModules)if(t instanceof ExternalModule)e.add("*"+t.id);else for(const n of t.getAllExportNames())"default"!==n&&e.add(n);return e}getDefaultExport(){return null===this.defaultExport&&(this.defaultExport=void 0,this.defaultExport=this.getVariableForExportName("default")),this.defaultExport?this.defaultExport:error$1({code:Errors.SYNTHETIC_NAMED_EXPORTS_NEED_DEFAULT,id:this.id,message:"Modules with 'syntheticNamedExports' need a default export."})}getDependenciesToBeIncluded(){if(this.relevantDependencies)return this.relevantDependencies;const e=new Set,t=new Set,n=new Set(this.dependencies);let r=this.imports;if(this.isEntryPoint||this.includedDynamicImporters.length>0||this.options.preserveModules){r=new Set(r);for(const e of[...this.getReexports(),...this.getExports()])r.add(this.getVariableForExportName(e))}for(let i of r){if(i instanceof SyntheticNamedExportVariable)i=i.getBaseVariable();else if(i instanceof ExportDefaultVariable){const{modules:e,original:r}=i.getOriginalVariableAndDeclarationModules();i=r;for(const r of e)t.add(r),n.add(r)}e.add(i.module)}if(this.options.treeshake){for(const r of n)if((r.moduleSideEffects||t.has(r))&&!e.has(r))if(r instanceof ExternalModule||r.hasEffects())e.add(r);else for(const e of r.dependencies)n.add(e)}else for(const t of this.dependencies)e.add(t);return this.relevantDependencies=e}getExportNamesByVariable(){if(this.exportNamesByVariable)return this.exportNamesByVariable;const e=new Map;for(const t of this.getAllExportNames()){let n=this.getVariableForExportName(t);if(n instanceof ExportDefaultVariable&&(n=n.getOriginalVariable()),!n||!(n.included||n instanceof ExternalVariable))continue;const r=e.get(n);r?r.push(t):e.set(n,[t])}return this.exportNamesByVariable=e}getExports(){return Object.keys(this.exports)}getReexports(){if(this.transitiveReexports)return this.transitiveReexports;this.transitiveReexports=[];const e=new Set;for(const t in this.reexportDescriptions)e.add(t);for(const t of this.exportAllModules)if(t instanceof ExternalModule)e.add("*"+t.id);else for(const n of[...t.getReexports(),...t.getExports()])"default"!==n&&e.add(n);return this.transitiveReexports=[...e]}getRenderedExports(){const e=[],t=[];for(const n in this.exports){const r=this.getVariableForExportName(n);(r&&r.included?e:t).push(n)}return{renderedExports:e,removedExports:t}}getVariableForExportName(e,t,n){if("*"===e[0]){if(1===e.length)return this.namespace;return this.graph.modulesById.get(e.slice(1)).getVariableForExportName("*")}const r=this.reexportDescriptions[e];if(r){const e=getVariableForExportNameRecursive(r.module,r.localName,!1,n);return e||handleMissingExport(r.localName,this,r.module.id,r.start)}const i=this.exports[e];if(i){if(i===MISSING_EXPORT_SHIM_DESCRIPTION)return this.exportShimVariable;const e=i.localName;return this.traceVariable(e)||this.graph.scope.findVariable(e)}if("default"!==e)for(const t of this.exportAllModules){const r=getVariableForExportNameRecursive(t,e,!0,n);if(r)return r}if(!t){if(this.syntheticNamedExports){let t=this.syntheticExports.get(e);if(!t){const n=this.getDefaultExport();return t=new SyntheticNamedExportVariable(this.astContext,e,n),this.syntheticExports.set(e,t),t}return t}if(this.options.shimMissingExports)return this.shimMissingExport(e),this.exportShimVariable}return null}hasEffects(){return this.ast.included&&this.ast.hasEffects(createHasEffectsContext())}include(){const e=createInclusionContext();this.ast.shouldBeIncluded(e)&&this.ast.include(e,!1)}includeAllExports(){this.isExecuted||(this.graph.needsTreeshakingPass=!0,markModuleAndImpureDependenciesAsExecuted(this));for(const e of this.getExports()){const t=this.getVariableForExportName(e);t.deoptimizePath(UNKNOWN_PATH),t.included||(t.include(),this.graph.needsTreeshakingPass=!0)}for(const e of this.getReexports()){const t=this.getVariableForExportName(e);t.deoptimizePath(UNKNOWN_PATH),t.included||(t.include(),this.graph.needsTreeshakingPass=!0),t instanceof ExternalVariable&&(t.module.reexported=!0)}}includeAllInBundle(){this.ast.include(createInclusionContext(),!0)}isIncluded(){return this.ast.included||this.namespace.included}linkDependencies(){for(const e of this.sources)this.dependencies.add(this.graph.modulesById.get(this.resolvedIds[e].id));for(const{resolution:e}of this.dynamicImports)(e instanceof Module||e instanceof ExternalModule)&&this.dynamicDependencies.add(e);this.addModulesToImportDescriptions(this.importDescriptions),this.addModulesToImportDescriptions(this.reexportDescriptions);const e=[];for(const t of this.exportAllSources){const n=this.graph.modulesById.get(this.resolvedIds[t].id);(n instanceof ExternalModule?e:this.exportAllModules).push(n)}this.exportAllModules=[...this.exportAllModules,...e]}render(e){const t=this.magicString.clone();return this.ast.render(t,e),this.usesTopLevelAwait=this.astContext.usesTopLevelAwait,t}setSource({alwaysRemovedCode:e,ast:t,code:n,customTransformCache:r,moduleSideEffects:i,originalCode:s,originalSourcemap:o,resolvedIds:a,sourcemapChain:c,syntheticNamedExports:l,transformDependencies:u,transformFiles:p}){if(this.code=n,this.originalCode=s,this.originalSourcemap=o,this.sourcemapChain=c,p&&(this.transformFiles=p),this.transformDependencies=u,this.customTransformCache=r,"boolean"==typeof i&&(this.moduleSideEffects=i),"boolean"==typeof l&&(this.syntheticNamedExports=l),timeStart("generate ast",3),this.alwaysRemovedCode=e||[],t)this.esTreeAst=t;else{this.esTreeAst=tryParse(this,this.graph.acornParser,this.options.acorn);for(const e of this.comments)!e.block&&SOURCEMAPPING_URL_RE.test(e.text)&&this.alwaysRemovedCode.push([e.start,e.end]);markPureCallExpressions(this.comments,this.esTreeAst)}timeEnd("generate ast",3),this.resolvedIds=a||Object.create(null);const h=this.id;this.magicString=new MagicString(n,{filename:this.excludeFromSourcemap?null:h,indentExclusionRanges:[]});for(const[e,t]of this.alwaysRemovedCode)this.magicString.remove(e,t);timeStart("analyse ast",3),this.astContext={addDynamicImport:this.addDynamicImport.bind(this),addExport:this.addExport.bind(this),addImport:this.addImport.bind(this),addImportMeta:this.addImportMeta.bind(this),code:n,deoptimizationTracker:this.graph.deoptimizationTracker,error:this.error.bind(this),fileName:h,getExports:this.getExports.bind(this),getModuleExecIndex:()=>this.execIndex,getModuleName:this.basename.bind(this),getReexports:this.getReexports.bind(this),importDescriptions:this.importDescriptions,includeAndGetAdditionalMergedNamespaces:this.includeAndGetAdditionalMergedNamespaces.bind(this),includeDynamicImport:this.includeDynamicImport.bind(this),includeVariable:this.includeVariable.bind(this),magicString:this.magicString,module:this,moduleContext:this.context,nodeConstructors,options:this.options,traceExport:this.getVariableForExportName.bind(this),traceVariable:this.traceVariable.bind(this),usesTopLevelAwait:!1,warn:this.warn.bind(this)},this.scope=new ModuleScope(this.graph.scope,this.astContext),this.namespace=new NamespaceVariable(this.astContext,this.syntheticNamedExports),this.ast=new Program$1(this.esTreeAst,{type:"Module",context:this.astContext},this.scope),timeEnd("analyse ast",3)}toJSON(){return{alwaysRemovedCode:this.alwaysRemovedCode,ast:this.esTreeAst,code:this.code,customTransformCache:this.customTransformCache,dependencies:Array.from(this.dependencies,getId),id:this.id,moduleSideEffects:this.moduleSideEffects,originalCode:this.originalCode,originalSourcemap:this.originalSourcemap,resolvedIds:this.resolvedIds,sourcemapChain:this.sourcemapChain,syntheticNamedExports:this.syntheticNamedExports,transformDependencies:this.transformDependencies,transformFiles:this.transformFiles}}traceVariable(e){const t=this.scope.variables.get(e);if(t)return t;if(e in this.importDescriptions){const t=this.importDescriptions[e],n=t.module;if(n instanceof Module&&"*"===t.name)return n.namespace;const r=n.getVariableForExportName(t.name);return r||handleMissingExport(t.name,this,n.id,t.start)}return null}warn(e,t){if("number"==typeof t){e.pos=t;const{line:n,column:r}=locate(this.code,t,{offsetLine:1});e.loc={file:this.id,line:n,column:r},e.frame=getCodeFrame(this.code,n,r)}e.id=this.id,this.options.onwarn(e)}addDynamicImport(e){let t=e.source;t instanceof TemplateLiteral?1===t.quasis.length&&t.quasis[0].value.cooked&&(t=t.quasis[0].value.cooked):t instanceof Literal&&"string"==typeof t.value&&(t=t.value),this.dynamicImports.push({node:e,resolution:null,argument:t})}addExport(e){if(e instanceof ExportDefaultDeclaration)this.exports.default={identifier:e.variable.getAssignedVariableName(),localName:"default"};else if(e instanceof ExportAllDeclaration){const t=e.source.value;if(this.sources.add(t),e.exported){const n=e.exported.name;this.reexportDescriptions[n]={localName:"*",module:null,source:t,start:e.start}}else this.exportAllSources.add(t)}else if(e.source instanceof Literal){const t=e.source.value;this.sources.add(t);for(const n of e.specifiers){const e=n.exported.name;this.reexportDescriptions[e]={localName:n.local.name,module:null,source:t,start:n.start}}}else if(e.declaration){const t=e.declaration;if(t instanceof VariableDeclaration)for(const e of t.declarations)for(const t of extractAssignedNames(e.id))this.exports[t]={identifier:null,localName:t};else{const e=t.id.name;this.exports[e]={identifier:null,localName:e}}}else for(const t of e.specifiers){const e=t.local.name,n=t.exported.name;this.exports[n]={identifier:null,localName:e}}}addImport(e){const t=e.source.value;this.sources.add(t);for(const n of e.specifiers){const e=n.type===ImportDefaultSpecifier,r=n.type===ImportNamespaceSpecifier,i=e?"default":r?"*":n.imported.name;this.importDescriptions[n.local.name]={module:null,name:i,source:t,start:n.start}}}addImportMeta(e){this.importMetas.push(e)}addModulesToImportDescriptions(e){for(const t of Object.keys(e)){const n=e[t],r=this.resolvedIds[n.source].id;n.module=this.graph.modulesById.get(r)}}includeAndGetAdditionalMergedNamespaces(){const e=[];for(const t of this.exportAllModules)if(t instanceof ExternalModule){const n=t.getVariableForExportName("*");n.include(),this.imports.add(n),e.push(n)}else if(t.syntheticNamedExports){const n=t.getDefaultExport();n.include(),this.imports.add(n),e.push(n)}return e}includeDynamicImport(e){const t=this.dynamicImports.find(t=>t.node===e).resolution;t instanceof Module&&(t.includedDynamicImporters.push(this),t.includeAllExports())}includeVariable(e){const t=e.module;e.included||(e.include(),this.graph.needsTreeshakingPass=!0),t&&t!==this&&this.imports.add(e)}shimMissingExport(e){this.options.onwarn({code:"SHIMMED_EXPORT",exporter:relativeId(this.id),exportName:e,message:`Missing export "${e}" has been shimmed in module ${relativeId(this.id)}.`}),this.exports[e]=MISSING_EXPORT_SHIM_DESCRIPTION}}class Source{constructor(e,t){this.isOriginal=!0,this.filename=e,this.content=t}traceSegment(e,t,n){return{line:e,column:t,name:n,source:this}}}class Link{constructor(e,t){this.sources=t,this.names=e.names,this.mappings=e.mappings}traceMappings(){const e=[],t=[],n=[],r=[];for(const i of this.mappings){const s=[];for(const r of i){if(1==r.length)continue;const i=this.sources[r[1]];if(!i)continue;const o=i.traceSegment(r[2],r[3],5===r.length?this.names[r[4]]:"");if(o){let i=e.lastIndexOf(o.source.filename);if(-1===i)i=e.length,e.push(o.source.filename),t[i]=o.source.content;else if(null==t[i])t[i]=o.source.content;else if(null!=o.source.content&&t[i]!==o.source.content)return error$1({message:"Multiple conflicting contents for sourcemap source "+o.source.filename});const a=[r[0],i,o.line,o.column];if(o.name){let e=n.indexOf(o.name);-1===e&&(e=n.length,n.push(o.name)),a[4]=e}s.push(a)}}r.push(s)}return{sources:e,sourcesContent:t,names:n,mappings:r}}traceSegment(e,t,n){const r=this.mappings[e];if(!r)return null;let i=0,s=r.length-1;for(;i<=s;){const e=i+s>>1,o=r[e];if(o[0]===t){if(1==o.length)return null;const e=this.sources[o[1]];return e?e.traceSegment(o[2],o[3],5===o.length?this.names[o[4]]:n):null}o[0]>t?s=e-1:i=e+1}return null}}function getLinkMap(e){return function(t,n){return n.mappings?new Link(n,[t]):(e({code:"SOURCEMAP_BROKEN",message:`Sourcemap is likely to be incorrect: a plugin (${n.plugin}) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`,plugin:n.plugin,url:"https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect"}),new Link({mappings:[],names:[]},[t]))}}function getCollapsedSourcemap(e,t,n,r,i){let s;if(n){const t=n.sources,r=n.sourcesContent||[],i=path$n.dirname(e)||".",o=n.sourceRoot||".",a=t.map((e,t)=>new Source(path$n.resolve(i,o,e),r[t]));s=new Link(n,a)}else s=new Source(e,t);return r.reduce(i,s)}function collapseSourcemaps(e,t,n,r,i,s){const o=getLinkMap(s),a=n.filter(e=>!e.excludeFromSourcemap).map(e=>getCollapsedSourcemap(e.id,e.originalCode,e.originalSourcemap,e.sourcemapChain,o));let c=new Link(t,a);c=r.reduce(o,c);let{sources:l,sourcesContent:u,names:p,mappings:h}=c.traceMappings();if(e){const t=path$n.dirname(e);l=l.map(e=>path$n.relative(t,e)),e=path$n.basename(e)}return u=i?null:u,new SourceMap({file:e,sources:l,sourcesContent:u,names:p,mappings:h})}function collapseSourcemap(e,t,n,r,i){if(!r.length)return n;return{version:3,...getCollapsedSourcemap(e,t,n,r,getLinkMap(i)).traceMappings()}}const DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT={amd:deconflictImportsOther,cjs:deconflictImportsOther,es:deconflictImportsEsm,iife:deconflictImportsOther,system:deconflictImportsEsmOrSystem,umd:deconflictImportsOther};function deconflictChunk(e,t,n,r,i,s,o,a,c){for(const t of e)t.scope.addUsedOutsideNames(r,i,c);deconflictTopLevelVariables(r,e),DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[i](r,n,t,s,o,a);for(const t of e)t.scope.deconflict(i,c)}function deconflictImportsEsm(e,t,n,r,i,s){if(i)for(const t of n)t.variableName=getSafeName(t.variableName,e);deconflictImportsEsmOrSystem(e,t,n,r);for(const t of s)t.setSafeName(getSafeName(t.name,e))}function deconflictImportsEsmOrSystem(e,t,n,r){for(const n of t){const t=n.module,i=n.name;let s;s=t instanceof ExternalModule&&("*"===i||"default"===i)?"default"===i&&r&&t.exportsNamespace?t.variableName+"__default":t.variableName:i,n.setRenderNames(null,getSafeName(s,e))}}function deconflictImportsOther(e,t,n,r,i){for(const t of n)t.variableName=getSafeName(t.variableName,e);for(const e of t){const t=e.module;if(t instanceof ExternalModule){const n=e.name;"default"===n&&r&&(t.exportsNamespace||t.exportsNames)?e.setRenderNames(null,t.variableName+"__default"):"*"===n||"default"===n?e.setRenderNames(null,t.variableName):e.setRenderNames(t.variableName,null)}else{const n=t.chunk;"default"===n.exportMode||i&&e.isNamespace?e.setRenderNames(null,n.variableName):e.setRenderNames(n.variableName,n.getVariableExportName(e))}}}function deconflictTopLevelVariables(e,t){for(const n of t){for(const t of n.scope.variables.values())t.included&&!(t.renderBaseName||t instanceof ExportDefaultVariable&&t.getOriginalVariable()!==t)&&t.setRenderNames(null,getSafeName(t.name,e));const t=n.namespace;t.included&&t.setRenderNames(null,getSafeName(t.name,e))}}const needsEscapeRegEx=/[\\'\r\n\u2028\u2029]/,quoteNewlineRegEx=/(['\r\n\u2028\u2029])/g,backSlashRegEx=/\\/g;function escapeId(e){return e.match(needsEscapeRegEx)?e.replace(backSlashRegEx,"\\\\").replace(quoteNewlineRegEx,"\\$1"):e}const compareExecIndex=(e,t)=>e.execIndex>t.execIndex?1:-1;function sortByExecutionOrder(e){e.sort(compareExecIndex)}function analyseModuleExecution(e){let t=0;const n=[],r=new Set,i=new Set,s=new Map,o=[],a=e=>{if(e instanceof Module){for(const t of e.dependencies)s.has(t)?r.has(t)||n.push(getCyclePath(t,e,s)):(s.set(t,e),a(t));for(const t of e.implicitlyLoadedBefore)i.add(t);for(const{resolution:t}of e.dynamicImports)t instanceof Module&&i.add(t);o.push(e)}e.execIndex=t++,r.add(e)};for(const t of e)s.has(t)||(s.set(t,null),a(t));for(const e of i)s.has(e)||(s.set(e,null),a(e));return{orderedModules:o,cyclePaths:n}}function getCyclePath(e,t,n){const r=[relativeId(e.id)];let i=t;for(;i!==e;)r.push(relativeId(i.id)),i=n.get(i);return r.push(r[0]),r.reverse(),r}function assignExportsToMangledNames(e,t,n){let r=0;for(const i of e){let e=i.name[0];if(t[e])do{e=toBase64(++r),49===e.charCodeAt(0)&&(r+=9*64**(e.length-1),e=toBase64(r))}while(RESERVED_NAMES[e]||t[e]);t[e]=i,n.set(i,[e])}}function assignExportsToNames(e,t,n){for(const r of e){let e=0,i=r.name;for(;t[i];)i=r.name+"$"+ ++e;t[i]=r,n.set(r,[i])}}function getExportMode(e,{exports:t,name:n,format:r},i,s){const o=e.getExportNames();if("default"===t){if(1!==o.length||"default"!==o[0])return error$1(errIncompatibleExportOptionValue("default",o,i))}else if("none"===t&&o.length)return error$1(errIncompatibleExportOptionValue("none",o,i));return"auto"===t&&(0===o.length?t="none":1===o.length&&"default"===o[0]?t="default":("es"!==r&&-1!==o.indexOf("default")&&s(errMixedExport(i,n)),t="named")),t}function guessIndentString(e){const t=e.split("\n"),n=t.filter(e=>/^\t+/.test(e)),r=t.filter(e=>/^ {2,}/.test(e));if(0===n.length&&0===r.length)return null;if(n.length>=r.length)return"\t";const i=r.reduce((e,t)=>{const n=/^ +/.exec(t)[0].length;return Math.min(n,e)},1/0);return new Array(i+1).join(" ")}function getIndentString(e,t){if(!0!==t.indent)return t.indent;for(let t=0;t{if(null==t)return e;if("string"==typeof t&&(t={code:t,map:void 0}),null!==t.map){const e=decodedSourcemap(t.map);i.push(e||{missing:!0,plugin:n.name})}return t.code})}const NON_ASSET_EXTENSIONS=[".js",".jsx",".ts",".tsx"];function getGlobalName(e,t,n,r){const i="function"==typeof t?t(e.id):t[e.id];return i||(n?(r({code:"MISSING_GLOBAL_NAME",guess:e.variableName,message:`No name was provided for external module '${e.id}' in output.globals – guessing '${e.variableName}'`,source:e.id}),e.variableName):void 0)}class Chunk$1{constructor(e,t,n,r){this.orderedModules=e,this.inputOptions=t,this.unsetOptions=n,this.modulesById=r,this.entryModules=[],this.exportMode="named",this.facadeModule=null,this.id=null,this.variableName="chunk",this.dependencies=new Set,this.dynamicDependencies=new Set,this.dynamicEntryModules=[],this.exportNamesByVariable=null,this.exports=new Set,this.exportsByName=null,this.fileName=null,this.implicitEntryModules=[],this.implicitlyLoadedBefore=new Set,this.imports=new Set,this.indentString=void 0,this.isEmpty=!0,this.manualChunkAlias=null,this.name=null,this.needsExportsShim=!1,this.renderedDependencies=null,this.renderedExports=null,this.renderedHash=void 0,this.renderedModuleSources=new Map,this.renderedSource=null,this.sortedExportNames=null,this.strictFacade=!1,this.usedModules=void 0,this.execIndex=e.length>0?e[0].execIndex:1/0;const i=new Set(e);for(const t of e){this.isEmpty&&t.isIncluded()&&(this.isEmpty=!1),t.manualChunkAlias&&(this.manualChunkAlias=t.manualChunkAlias),t.chunk=this,t.isEntryPoint&&this.entryModules.push(t);for(const e of t.includedDynamicImporters)i.has(e)||this.dynamicEntryModules.push(t);t.implicitlyLoadedAfter.size>0&&this.implicitEntryModules.push(t)}const s=this.entryModules[0]||this.implicitEntryModules[0]||this.dynamicEntryModules[0]||this.orderedModules[this.orderedModules.length-1];s&&(this.variableName=makeLegal(path$n.basename(s.chunkName||s.manualChunkAlias||getAliasName(s.id))))}static generateFacade(e,t,n,r,i){const s=new Chunk$1([],e,t,n);s.assignFacadeName(i,r),r.facadeChunk||(r.facadeChunk=s);for(const e of r.getDependenciesToBeIncluded())s.dependencies.add(e instanceof Module?e.chunk:e);return!s.dependencies.has(r.chunk)&&r.moduleSideEffects&&r.hasEffects()&&s.dependencies.add(r.chunk),s.ensureReexportsAreAvailableForModule(r),s.facadeModule=r,s.strictFacade=!0,s}canModuleBeFacade(e,t){const n=e.getExportNamesByVariable();for(const t of this.exports)if(!n.has(t))return 0===n.size&&e.isUserDefinedEntryPoint&&"strict"===e.preserveSignature&&this.unsetOptions.has("preserveEntrySignatures")&&this.inputOptions.onwarn({code:"EMPTY_FACADE",id:e.id,message:`To preserve the export signature of the entry module "${relativeId(e.id)}", an empty facade chunk was created. This often happens when creating a bundle for a web app where chunks are placed in script tags and exports are ignored. In this case it is recommended to set "preserveEntrySignatures: false" to avoid this and reduce the number of chunks. Otherwise if this is intentional, set "preserveEntrySignatures: 'strict'" explicitly to silence this warning.`,url:"https://rollupjs.org/guide/en/#preserveentrysignatures"}),!1;for(const r of t)if(!n.has(r)&&r.module!==e)return!1;return!0}generateExports(e){this.sortedExportNames=null,this.exportsByName=Object.create(null),this.exportNamesByVariable=new Map;const t=new Set(this.exports);if(null!==this.facadeModule&&(!1!==this.facadeModule.preserveSignature||this.strictFacade)){const e=this.facadeModule.getExportNamesByVariable();for(const[n,r]of e){this.exportNamesByVariable.set(n,[...r]);for(const e of r)this.exportsByName[e]=n;t.delete(n)}}e.minifyInternalExports?assignExportsToMangledNames(t,this.exportsByName,this.exportNamesByVariable):assignExportsToNames(t,this.exportsByName,this.exportNamesByVariable),(this.inputOptions.preserveModules||this.facadeModule&&this.facadeModule.isEntryPoint)&&(this.exportMode=getExportMode(this,e,this.facadeModule.id,this.inputOptions.onwarn))}generateFacades(){const e=[],t=new Set([...this.entryModules,...this.implicitEntryModules]),n=new Set(this.dynamicEntryModules.map(e=>e.namespace));for(const e of t)if(e.preserveSignature)for(const t of e.getExportNamesByVariable().keys())n.add(t);for(const r of t){const t=Array.from(r.userChunkNames,e=>({name:e}));0===t.length&&r.isUserDefinedEntryPoint&&t.push({}),t.push(...Array.from(r.chunkFileNames,e=>({fileName:e}))),0===t.length&&t.push({}),this.facadeModule||!this.inputOptions.preserveModules&&"strict"===r.preserveSignature&&!this.canModuleBeFacade(r,n)||(this.facadeModule=r,r.facadeChunk=this,r.preserveSignature&&(this.strictFacade="strict"===r.preserveSignature,this.ensureReexportsAreAvailableForModule(r)),this.assignFacadeName(t.shift(),r));for(const n of t)e.push(Chunk$1.generateFacade(this.inputOptions,this.unsetOptions,this.modulesById,r,n))}for(const e of this.dynamicEntryModules)!this.facadeModule&&this.canModuleBeFacade(e,n)?(this.facadeModule=e,e.facadeChunk=this,this.strictFacade=!0,this.assignFacadeName({},e)):this.facadeModule===e&&!this.strictFacade&&this.canModuleBeFacade(e,n)?this.strictFacade=!0:e.facadeChunk&&e.facadeChunk.strictFacade||(e.namespace.include(),this.exports.add(e.namespace));return e}generateId(e,t,n,r,i){if(null!==this.fileName)return this.fileName;const[s,o]=this.facadeModule&&this.facadeModule.isUserDefinedEntryPoint?[t.entryFileNames,"output.entryFileNames"]:[t.chunkFileNames,"output.chunkFileNames"];return makeUnique(renderNamePattern(s,o,{format:()=>t.format,hash:()=>r?this.computeContentHashWithDependencies(e,t,n,i):"[hash]",name:()=>this.getChunkName()}),n)}generateIdPreserveModules(e,t,n,r){const i=this.orderedModules[0].id,s=sanitizeFileName(i);let o;if(isAbsolute(i)){const n=path$n.extname(i),a=r.has("entryFileNames")?NON_ASSET_EXTENSIONS.includes(n)?"[name].js":"[name][extname].js":t.entryFileNames;o=relative(e,`${path$n.dirname(s)}/${renderNamePattern(a,"output.entryFileNames",{ext:()=>n.substr(1),extname:()=>n,format:()=>t.format,name:()=>this.getChunkName()})}`)}else o="_virtual/"+path$n.basename(s);return makeUnique(normalize(o),n)}getChunkName(){return this.name||(this.name=sanitizeFileName(this.getFallbackChunkName()))}getExportNames(){return this.sortedExportNames||(this.sortedExportNames=Object.keys(this.exportsByName).sort())}getPrerenderedChunk(){const e=this.facadeModule,t=this.getChunkName.bind(this);return{code:void 0,dynamicImports:Array.from(this.dynamicDependencies,getId),exports:this.getExportNames(),facadeModuleId:e&&e.id,fileName:void 0,implicitlyLoadedBefore:Array.from(this.implicitlyLoadedBefore,getId),imports:Array.from(this.dependencies,getId),isDynamicEntry:this.dynamicEntryModules.length>0,isEntry:null!==e&&e.isEntryPoint,isImplicitEntry:this.implicitEntryModules.length>0,map:void 0,modules:this.renderedModules,get name(){return t()},type:"chunk"}}getRenderedHash(e){if(this.renderedHash)return this.renderedHash;const t=createHash(),n=e.hookReduceValueSync("augmentChunkHash","",[this.getPrerenderedChunk()],(e,t)=>(t&&(e+=t),e));return t.update(n),t.update(this.renderedSource.toString()),t.update(this.getExportNames().map(e=>{const t=this.exportsByName[e];return`${relativeId(t.module.id).replace(/\\/g,"/")}:${t.name}:${e}`}).join(",")),this.renderedHash=t.digest("hex")}getVariableExportName(e){return this.inputOptions.preserveModules&&e instanceof NamespaceVariable?"*":this.exportNamesByVariable.get(e)[0]}link(){for(const e of this.orderedModules)this.addDependenciesToChunk(e.getDependenciesToBeIncluded(),this.dependencies),this.addDependenciesToChunk(e.dynamicDependencies,this.dynamicDependencies),this.addDependenciesToChunk(e.implicitlyLoadedBefore,this.implicitlyLoadedBefore),this.setUpChunkImportsAndExportsForModule(e)}preRender(e,t,n){timeStart("render modules",3);const r=new Bundle$1({separator:e.compact?"":"\n\n"});this.usedModules=[],this.indentString=getIndentString(this.orderedModules,e);const i=e.compact?"":"\n",s=e.compact?"":" ",o={compact:e.compact,dynamicImportFunction:e.dynamicImportFunction,exportNamesByVariable:this.exportNamesByVariable,format:e.format,freeze:e.freeze,indent:this.indentString,namespaceToStringTag:e.namespaceToStringTag,outputPluginDriver:n,varOrConst:e.preferConst?"const":"var"};if(e.hoistTransitiveImports&&!this.inputOptions.preserveModules&&null!==this.facadeModule)for(const e of this.dependencies)e instanceof Chunk$1&&this.inlineChunkDependencies(e);const a=[...this.dependencies];sortByExecutionOrder(a),this.dependencies=new Set(a),this.prepareDynamicImports(),this.setIdentifierRenderResolutions(e);let c="";const l=this.renderedModules=Object.create(null);for(const t of this.orderedModules){let n=0;if(t.isIncluded()){const s=t.render(o).trim();n=s.length(),n&&(e.compact&&-1!==s.lastLine().indexOf("//")&&s.append("\n"),this.renderedModuleSources.set(t,s),r.addSource(s),this.usedModules.push(t));const a=t.namespace;if(a.included&&!this.inputOptions.preserveModules){const e=a.renderBlock(o);a.renderFirst()?c+=i+e:r.addSource(new MagicString(e))}}const{renderedExports:s,removedExports:a}=t.getRenderedExports();l[t.id]={originalLength:t.originalCode.length,removedExports:a,renderedExports:s,renderedLength:n}}if(c&&r.prepend(c+i+i),this.needsExportsShim&&r.prepend(`${i}${o.varOrConst} _missingExportShim${s}=${s}void 0;${i}${i}`),e.compact?this.renderedSource=r:this.renderedSource=r.trim(),this.renderedHash=void 0,this.isEmpty&&0===this.getExportNames().length&&0===this.dependencies.size){const e=this.getChunkName();this.inputOptions.onwarn({chunkName:e,code:"EMPTY_BUNDLE",message:`Generated an empty chunk: "${e}"`})}this.setExternalRenderPaths(e,t),this.renderedDependencies=this.getChunkDependencyDeclarations(e),this.renderedExports="none"===this.exportMode?[]:this.getChunkExportDeclarations(e.format),timeEnd("render modules",3)}async render(e,t,n,r){timeStart("render format",3);const i=this.id,s=e.format,o=finalisers[s];e.dynamicImportFunction&&"es"!==s&&this.inputOptions.onwarn({code:"INVALID_OPTION",message:'"output.dynamicImportFunction" is ignored for formats other than "es".'});for(const e of this.dependencies){const t=this.renderedDependencies.get(e);if(e instanceof ExternalModule){const n=e.renderPath;t.id=escapeId(e.renormalizeRenderPath?this.getRelativePath(n,!1):n)}else t.namedExportsMode="default"!==e.exportMode,t.id=escapeId(this.getRelativePath(e.id,!1))}this.finaliseDynamicImports(e),this.finaliseImportMetas(s,r);const a=0!==this.renderedExports.length||[...this.renderedDependencies.values()].some(e=>e.reexports&&0!==e.reexports.length);let c=!1;const l=new Set;for(const e of this.orderedModules){e.usesTopLevelAwait&&(c=!0);const t=e.scope.accessedGlobalVariablesByFormat,n=t&&t.get(s);if(n)for(const e of n)l.add(e)}if(c&&"es"!==s&&"system"!==s)return error$1({code:"INVALID_TLA_FORMAT",message:`Module format ${s} does not support top-level await. Use the "es" or "system" output formats rather.`});const u=o(this.renderedSource,{accessedGlobals:l,dependencies:[...this.renderedDependencies.values()],exports:this.renderedExports,hasExports:a,indentString:this.indentString,intro:t.intro,isEntryModuleFacade:this.inputOptions.preserveModules||null!==this.facadeModule&&this.facadeModule.isEntryPoint,namedExportsMode:"default"!==this.exportMode,outro:t.outro,usesTopLevelAwait:c,varOrConst:e.preferConst?"const":"var",warn:this.inputOptions.onwarn},e);t.banner&&u.prepend(t.banner),t.footer&&u.append(t.footer);const p=u.toString();timeEnd("render format",3);let h=null;const d=[];let f=await renderChunk({code:p,options:e,outputPluginDriver:r,renderChunk:n,sourcemapChain:d});if(e.sourcemap){let t;timeStart("sourcemap",3),t=e.file?path$n.resolve(e.sourcemapFile||e.file):e.dir?path$n.resolve(e.dir,i):path$n.resolve(i);const n=u.generateDecodedMap({});h=collapseSourcemaps(t,n,this.usedModules,d,e.sourcemapExcludeSources,this.inputOptions.onwarn),h.sources=h.sources.map(n=>{const{sourcemapPathTransform:r}=e;if(r){const e=r(n,t+".map");return"string"!=typeof e&&error$1(errFailedValidation("sourcemapPathTransform function must return a string.")),e}return n}).map(normalize),timeEnd("sourcemap",3)}return!0!==e.compact&&"\n"!==f[f.length-1]&&(f+="\n"),{code:f,map:h}}addDependenciesToChunk(e,t){for(const n of e)n instanceof Module?n.chunk&&n.chunk!==this&&t.add(n.chunk):t.add(n)}assignFacadeName({fileName:e,name:t},n){e?this.fileName=e:this.name=sanitizeFileName(t||n.chunkName||getAliasName(n.id))}computeContentHashWithDependencies(e,t,n,r){const i=createHash();i.update([e.intro,e.outro,e.banner,e.footer].map(e=>e||"").join(":")),i.update(t.format);const s=new Set([this]);for(const o of s)if(o instanceof ExternalModule?i.update(":"+o.renderPath):(i.update(o.getRenderedHash(r)),i.update(o.generateId(e,t,n,!1,r))),!(o instanceof ExternalModule))for(const e of[...o.dependencies,...o.dynamicDependencies])s.add(e);return i.digest("hex").substr(0,8)}ensureReexportsAreAvailableForModule(e){const t=e.getExportNamesByVariable();for(const e of t.keys()){const t=e instanceof SyntheticNamedExportVariable,n=t?e.getBaseVariable():e,r=n.module;!r||!r.chunk||r.chunk===this||n instanceof NamespaceVariable&&this.inputOptions.preserveModules||(r.chunk.exports.add(n),t&&this.imports.add(n))}}finaliseDynamicImports(e){const t="amd"===e.format;for(const[n,r]of this.renderedModuleSources)for(const{node:i,resolution:s}of n.dynamicImports){if(!s||!i.included||s instanceof Module&&s.chunk===this)continue;const n=s instanceof Module?`'${this.getRelativePath((s.facadeChunk||s.chunk).id,t)}'`:s instanceof ExternalModule?`'${s.renormalizeRenderPath?this.getRelativePath(s.renderPath,t):s.renderPath}'`:s;i.renderFinalResolution(r,n,s instanceof Module&&!(s.facadeChunk&&s.facadeChunk.strictFacade)&&s.chunk.exportNamesByVariable.get(s.namespace)[0],e)}}finaliseImportMetas(e,t){for(const[n,r]of this.renderedModuleSources)for(const i of n.importMetas)i.renderFinalMechanism(r,this.id,e,t)}getChunkDependencyDeclarations(e){const t=new Map;for(let n of this.getExportNames()){let r,i,s=!1;if("*"===n[0])s=e.externalLiveBindings,r=this.modulesById.get(n.substr(1)),i=n="*";else{const t=this.exportsByName[n];if(t instanceof SyntheticNamedExportVariable)continue;const o=t.module;if(!o||o.chunk===this)continue;o instanceof Module?(r=o.chunk,i=r.getVariableExportName(t),s=t.isReassigned):(r=o,i=t.name,s=e.externalLiveBindings)}let o=t.get(r);o||t.set(r,o=[]),o.push({imported:i,reexported:n,needsLiveBinding:s})}const n=new Set,r=new Map;for(const i of this.dependencies){const s=[];for(const e of this.imports)(e.module instanceof Module?e.module.chunk!==i:e.module!==i)||n.has(e)||(n.add(e),s.push({imported:e.module instanceof ExternalModule?e.name:e.module.chunk.getVariableExportName(e),local:e.getName()}));const o=t.get(i);let a,c,l=!0;i instanceof ExternalModule?(a=i.exportsNames||i.exportsNamespace,c="default"in i.declarations):(a=!0,c=!1,l="default"!==i.exportMode),r.set(i,{exportsDefault:c,exportsNames:a,globalName:i instanceof ExternalModule&&("umd"===e.format||"iife"===e.format)&&getGlobalName(i,e.globals,a||c,this.inputOptions.onwarn),id:void 0,imports:s.length>0?s:null,isChunk:i instanceof Chunk$1,name:i.variableName,namedExportsMode:l,reexports:o})}return r}getChunkExportDeclarations(e){const t=[];for(const n of this.getExportNames()){if("*"===n[0])continue;const r=this.exportsByName[n];if(!(r instanceof SyntheticNamedExportVariable)){const e=r.module;if(e&&e.chunk!==this)continue}let i=null,s=!1,o=!1,a=r.getName();if(r instanceof LocalVariable){r.init===UNDEFINED_EXPRESSION&&(o=!0);for(const e of r.declarations)if(e.parent instanceof FunctionDeclaration||e instanceof ExportDefaultDeclaration&&e.declaration instanceof FunctionDeclaration){s=!0;break}}else r instanceof SyntheticNamedExportVariable&&(i=a,"es"===e&&"default"!==n&&(a=r.renderName));t.push({exported:n,expression:i,hoisted:s,local:a,uninitialized:o})}return t}getFallbackChunkName(){return this.manualChunkAlias?this.manualChunkAlias:this.fileName?getAliasName(this.fileName):getAliasName(this.orderedModules[this.orderedModules.length-1].id)}getRelativePath(e,t){let n=normalize(relative(path$n.dirname(this.id),e));return t&&n.endsWith(".js")&&(n=n.slice(0,-3)),".."===n?"../../"+path$n.basename(e):""===n?"../"+path$n.basename(e):n.startsWith("../")?n:"./"+n}inlineChunkDependencies(e){for(const t of e.dependencies)this.dependencies.has(t)||(this.dependencies.add(t),t instanceof Chunk$1&&this.inlineChunkDependencies(t))}prepareDynamicImports(){for(const e of this.orderedModules)for(const{node:t,resolution:n}of e.dynamicImports)t.included&&(n instanceof Module?n.chunk===this?t.setInternalResolution(n.namespace):t.setExternalResolution(n.chunk.exportMode,n):t.setExternalResolution("auto",n))}setExternalRenderPaths(e,t){for(const n of[...this.dependencies,...this.dynamicDependencies])n instanceof ExternalModule&&n.setRenderPath(e,t)}setIdentifierRenderResolutions(e){const t=new Set;for(const n of this.getExportNames()){const r=this.exportsByName[n];r instanceof ExportShimVariable&&(this.needsExportsShim=!0),"es"!==e.format&&"system"!==e.format&&r.isReassigned&&!r.isId?r.setRenderNames("exports",n):r instanceof SyntheticNamedExportVariable?t.add(r):r.setRenderNames(null,null)}const n=new Set;switch(this.needsExportsShim&&n.add("_missingExportShim"),e.format){case"es":break;case"cjs":n.add("_interopDefault").add("require").add("__filename").add("__dirname");case"system":n.add("module");default:n.add("exports")}deconflictChunk(this.orderedModules,this.dependencies,this.imports,n,e.format,e.interop,this.inputOptions.preserveModules,t,this.exportNamesByVariable)}setUpChunkImportsAndExportsForModule(e){for(let t of e.imports)t instanceof ExportDefaultVariable&&(t=t.getOriginalVariable()),t instanceof SyntheticNamedExportVariable&&(t=t.getBaseVariable()),t.module&&t.module.chunk!==this&&(this.imports.add(t),!(t instanceof NamespaceVariable&&this.inputOptions.preserveModules)&&t.module instanceof Module&&t.module.chunk.exports.add(t));(e.isEntryPoint&&!1!==e.preserveSignature||e.includedDynamicImporters.some(e=>e.chunk!==this)||e.namespace.included)&&this.ensureReexportsAreAvailableForModule(e);for(const{node:t,resolution:n}of e.dynamicImports)t.included&&n instanceof Module&&n.chunk===this&&!n.namespace.included&&(n.namespace.include(),this.ensureReexportsAreAvailableForModule(n))}}const readFile=e=>new Promise((t,n)=>fs$n.readFile(e,"utf-8",(e,r)=>e?n(e):t(r)));function mkdirpath(e){const t=path$n.dirname(e);try{fs$n.readdirSync(t)}catch(e){mkdirpath(t);try{fs$n.mkdirSync(t)}catch(e){if("EEXIST"!==e.code)throw e}}}function writeFile(e,t){return new Promise((n,r)=>{mkdirpath(e),fs$n.writeFile(e,t,e=>{e?r(e):n()})})}async function resolveId(e,t,n,r,i){const s=await r.hookFirst("resolveId",[e,t],null,i);return null!=s?s:void 0===t||isAbsolute(e)||"."===e[0]?addJsExtensionIfNecessary(path$n.resolve(t?path$n.dirname(t):path$n.resolve(),e),n):null}function addJsExtensionIfNecessary(e,t){let n=findFile(e,t);return n||(n=findFile(e+".mjs",t),n||(n=findFile(e+".js",t),n))}function findFile(e,t){try{const n=fs$n.lstatSync(e);if(!t&&n.isSymbolicLink())return findFile(fs$n.realpathSync(e),t);if(t&&n.isSymbolicLink()||n.isFile()){const t=path$n.basename(e);if(-1!==fs$n.readdirSync(path$n.dirname(e)).indexOf(t))return e}}catch(e){}}const ANONYMOUS_PLUGIN_PREFIX="at position ",ANONYMOUS_OUTPUT_PLUGIN_PREFIX="at output position ";function throwPluginError(e,t,{hook:n,id:r}={}){return"string"==typeof e&&(e={message:e}),e.code&&e.code!==Errors.PLUGIN_ERROR&&(e.pluginCode=e.code),e.code=Errors.PLUGIN_ERROR,e.plugin=t,n&&(e.hook=n),r&&(e.id=r),error$1(e)}const deprecatedHooks=[{active:!0,deprecated:"resolveAssetUrl",replacement:"resolveFileUrl"}];function warnDeprecatedHooks(e,t){for(const{active:n,deprecated:r,replacement:i}of deprecatedHooks)for(const s of e)r in s&&warnDeprecation({message:`The "${r}" hook used by plugin ${s.name} is deprecated. The "${i}" hook should be used instead.`,plugin:s.name},n,t)}function createPluginCache(e){return{has(t){const n=e[t];return!!n&&(n[0]=0,!0)},get(t){const n=e[t];if(n)return n[0]=0,n[1]},set(t,n){e[t]=[0,n]},delete:t=>delete e[t]}}function getTrackedPluginCache(e,t){return{has:n=>(t(),e.has(n)),get:n=>(t(),e.get(n)),set:(n,r)=>(t(),e.set(n,r)),delete:n=>(t(),e.delete(n))}}const NO_CACHE={has:()=>!1,get(){},set(){},delete:()=>!1};function uncacheablePluginError(e){return e.startsWith("at position ")||e.startsWith("at output position ")?error$1({code:"ANONYMOUS_PLUGIN_CACHE",message:"A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey."}):error$1({code:"DUPLICATE_PLUGIN_NAME",message:`The plugin name ${e} is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).`})}function getCacheForUncacheablePlugin(e){return{has:()=>uncacheablePluginError(e),get:()=>uncacheablePluginError(e),set:()=>uncacheablePluginError(e),delete:()=>uncacheablePluginError(e)}}function transform(e,t,n,r){const i=t.id,s=[];let o=null===e.map?null:decodedSourcemap(e.map);const a=e.code;let c=e.ast;const l=[],u=[];let p=!1;const h=()=>p=!0;let d,f=null,m=null;const g=e.code;return n.hookReduceArg0("transform",[g,i],(function(e,t,n){if("string"==typeof t)t={ast:void 0,code:t,map:void 0};else{if(!t||"object"!=typeof t)return e;"string"==typeof t.map&&(t.map=JSON.parse(t.map)),"boolean"==typeof t.moduleSideEffects&&(f=t.moduleSideEffects),"boolean"==typeof t.syntheticNamedExports&&(m=t.syntheticNamedExports)}if(null!==t.map){const e=decodedSourcemap(t.map);s.push(e||{missing:!0,plugin:n.name})}return c=t.ast,t.code}),(e,t)=>(d=t,{...e,cache:p?e.cache:getTrackedPluginCache(e.cache,h),warn(t,n){"string"==typeof t&&(t={message:t}),n&&augmentCodeLocation(t,n,g,i),t.id=i,t.hook="transform",e.warn(t)},error:(t,n)=>("string"==typeof t&&(t={message:t}),n&&augmentCodeLocation(t,n,g,i),t.id=i,t.hook="transform",e.error(t)),emitAsset(e,t){const r={type:"asset",name:e,source:t};return u.push({...r}),n.emitFile(r)},emitChunk(e,t){const r={type:"chunk",id:e,name:t&&t.name};return u.push({...r}),n.emitFile(r)},emitFile:e=>(u.push(e),n.emitFile(e)),addWatchFile(t){l.push(t),e.addWatchFile(t)},setAssetSource(){return this.error({code:"INVALID_SETASSETSOURCE",message:"setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook."})},getCombinedSourcemap(){const e=collapseSourcemap(i,a,o,s,r);if(!e){return new MagicString(a).generateMap({includeContent:!0,hires:!0,source:i})}return o!==e&&(o=e,s.length=0),new SourceMap({...e,file:null,sourcesContent:e.sourcesContent})}})).catch(e=>throwPluginError(e,d.name,{hook:"transform",id:i})).then(e=>(p||u.length&&(t.transformFiles=u),{ast:c,code:e,customTransformCache:p,moduleSideEffects:f,originalCode:a,originalSourcemap:o,sourcemapChain:s,syntheticNamedExports:m,transformDependencies:l}))}class ModuleLoader{constructor(e,t,n,r){this.graph=e,this.modulesById=t,this.options=n,this.pluginDriver=r,this.implicitEntryModules=new Set,this.indexedEntryModules=[],this.latestLoadModulesPromise=Promise.resolve(),this.manualChunkModules={},this.nextEntryModuleIndex=0,this.hasModuleSideEffects=n.treeshake?n.treeshake.moduleSideEffects:()=>!0}async addEntryModules(e,t){const n=this.nextEntryModuleIndex;this.nextEntryModuleIndex+=e.length;const r=await this.extendLoadModulesPromise(Promise.all(e.map(({id:e,importer:t})=>this.loadEntryModule(e,!0,t,null))).then(r=>{let i=n;for(let n=0;ne.module===s);o?o.index=Math.min(o.index,i):this.indexedEntryModules.push({module:s,index:i}),i++}return this.indexedEntryModules.sort(({index:e},{index:t})=>e>t?1:-1),r}));return await this.awaitLoadModulesPromise(),{entryModules:this.indexedEntryModules.map(({module:e})=>e),implicitEntryModules:[...this.implicitEntryModules],manualChunkModulesByAlias:this.manualChunkModules,newEntryModules:r}}async addManualChunks(e){const t=[];for(const n of Object.keys(e)){const r=e[n];for(const e of r)t.push({id:e,alias:n})}const n=this.extendLoadModulesPromise(Promise.all(t.map(({id:e})=>this.loadEntryModule(e,!1,void 0,null))).then(e=>{for(let n=0;nthis.modulesById.keys(),getModuleInfo:this.graph.getModuleInfo};for(const n of this.modulesById.values())if(n instanceof Module){const r=e(n.id,t);"string"==typeof r&&this.addModuleToManualChunk(r,n)}}async emitChunk({fileName:e,id:t,importer:n,name:r,implicitlyLoadedAfterOneOf:i,preserveSignature:s}){const o={fileName:e||null,id:t,importer:n,name:r||null},a=i?await this.addEntryWithImplicitDependants(o,i):(await this.addEntryModules([o],!1)).newEntryModules[0];return null!=s&&(a.preserveSignature=s),a}async resolveId(e,t,n=null){return this.normalizeResolveIdResult(!this.options.external(e,t,!1)&&await resolveId(e,t,this.options.preserveSymlinks,this.pluginDriver,n),t,e)}addEntryWithImplicitDependants(e,t){return this.extendLoadModulesPromise(this.loadEntryModule(e.id,!1,e.importer,null).then(async n=>{if(addChunkNamesToModule(n,e,!1),!n.isEntryPoint){this.implicitEntryModules.add(n);const r=await Promise.all(t.map(t=>this.loadEntryModule(t,!1,e.importer,n.id)));for(const e of r)n.implicitlyLoadedAfter.add(e);for(const e of n.implicitlyLoadedAfter)e.implicitlyLoadedBefore.add(n)}return n}))}async addModuleSource(e,t,n){var r;let i;timeStart("load modules",3);try{i=null!==(r=await this.pluginDriver.hookFirst("load",[e]))&&void 0!==r?r:await readFile(e)}catch(n){timeEnd("load modules",3);let r="Could not load "+e;throw t&&(r+=` (imported by ${relativeId(t)})`),r+=": "+n.message,n.message=r,n}timeEnd("load modules",3);const s="string"==typeof i?{code:i}:"object"==typeof i&&"string"==typeof i.code?i:error$1(errBadLoader(e)),o=this.graph.cachedModules.get(e);if(o&&!o.customTransformCache&&o.originalCode===s.code){if(o.transformFiles)for(const e of o.transformFiles)this.pluginDriver.emitFile(e);n.setSource(o)}else"boolean"==typeof s.moduleSideEffects&&(n.moduleSideEffects=s.moduleSideEffects),"boolean"==typeof s.syntheticNamedExports&&(n.syntheticNamedExports=s.syntheticNamedExports),n.setSource(await transform(s,n,this.pluginDriver,this.options.onwarn))}addModuleToManualChunk(e,t){if(null!==t.manualChunkAlias&&t.manualChunkAlias!==e)return error$1(errCannotAssignModuleToChunk(t.id,e,t.manualChunkAlias));t.manualChunkAlias=e,this.manualChunkModules[e]||(this.manualChunkModules[e]=[]),this.manualChunkModules[e].push(t)}async awaitLoadModulesPromise(){let e;do{e=this.latestLoadModulesPromise,await e}while(e!==this.latestLoadModulesPromise)}extendLoadModulesPromise(e){return this.latestLoadModulesPromise=Promise.all([e,this.latestLoadModulesPromise]),e}fetchAllDependencies(e){return Promise.all([...Array.from(e.sources,async t=>{(await this.fetchResolvedDependency(t,e.id,e.resolvedIds[t]=e.resolvedIds[t]||this.handleResolveId(await this.resolveId(t,e.id),t,e.id))).importers.push(e.id)}),...e.dynamicImports.map(async t=>{const n=await this.resolveDynamicImport(e,t.argument,e.id);if(null!==n)if("string"==typeof n)t.resolution=n;else{(t.resolution=await this.fetchResolvedDependency(relativeId(n.id),e.id,n)).dynamicImporters.push(e.id)}})])}async fetchModule(e,t,n,r,i){const s=this.modulesById.get(e);if(s instanceof Module){if(i){s.isEntryPoint=!0,this.implicitEntryModules.delete(s);for(const e of s.implicitlyLoadedAfter)e.implicitlyLoadedBefore.delete(s);s.implicitlyLoadedAfter.clear()}return s}const o=new Module(this.graph,e,this.options,n,r,i);this.modulesById.set(e,o),this.graph.watchFiles[e]=!0,await this.addModuleSource(e,t,o),await this.fetchAllDependencies(o);for(const e in o.exports)"default"!==e&&(o.exportsAll[e]=o.id);for(const e of o.exportAllSources){const t=o.resolvedIds[e].id,n=this.modulesById.get(t);if(!(n instanceof ExternalModule))for(const e in n.exportsAll)e in o.exportsAll?this.options.onwarn(errNamespaceConflict(e,o,n)):o.exportsAll[e]=n.exportsAll[e]}return o}fetchResolvedDependency(e,t,n){if(n.external){this.modulesById.has(n.id)||this.modulesById.set(n.id,new ExternalModule(this.options,n.id,n.moduleSideEffects));const r=this.modulesById.get(n.id);return r instanceof ExternalModule?Promise.resolve(r):error$1(errInternalIdCannotBeExternal(e,t))}return this.fetchModule(n.id,t,n.moduleSideEffects,n.syntheticNamedExports,!1)}handleResolveId(e,t,n){return null===e?isRelative(t)?error$1(errUnresolvedImport(t,n)):(this.options.onwarn(errUnresolvedImportTreatedAsExternal(t,n)),{external:!0,id:t,moduleSideEffects:this.hasModuleSideEffects(t,!0),syntheticNamedExports:!1}):(e.external&&e.syntheticNamedExports&&this.options.onwarn(errExternalSyntheticExports(t,n)),e)}async loadEntryModule(e,t,n,r){const i=await resolveId(e,n,this.options.preserveSymlinks,this.pluginDriver,null);if(!1===i||i&&"object"==typeof i&&i.external)return error$1(null===r?errEntryCannotBeExternal(e):errImplicitDependantCannotBeExternal(e,r));const s=i&&"object"==typeof i?i.id:i;return"string"==typeof s?this.fetchModule(s,void 0,!0,!1,t):error$1(null===r?errUnresolvedEntry(e):errUnresolvedImplicitDependant(e,r))}normalizeResolveIdResult(e,t,n){let r="",i=!1,s=null,o=!1;if(e)"object"==typeof e?(r=e.id,e.external&&(i=!0),"boolean"==typeof e.moduleSideEffects&&(s=e.moduleSideEffects),"boolean"==typeof e.syntheticNamedExports&&(o=e.syntheticNamedExports)):(this.options.external(e,t,!0)&&(i=!0),r=i?normalizeRelativeExternalId(e,t):e);else{if(r=normalizeRelativeExternalId(n,t),!1!==e&&!this.options.external(r,t,!0))return null;i=!0}return{external:i,id:r,moduleSideEffects:"boolean"==typeof s?s:this.hasModuleSideEffects(r,i),syntheticNamedExports:o}}async resolveDynamicImport(e,t,n){const r=await this.pluginDriver.hookFirst("resolveDynamicImport",[t,n]);return"string"!=typeof t?"string"==typeof r?r:r?{external:!1,moduleSideEffects:!0,...r}:null:null==r?e.resolvedIds[t]=e.resolvedIds[t]||this.handleResolveId(await this.resolveId(t,e.id),t,e.id):this.handleResolveId(this.normalizeResolveIdResult(r,n,t),t,n)}}function normalizeRelativeExternalId(e,t){return isRelative(e)?t?path$n.resolve(t,"..",e):path$n.resolve(e):e}function addChunkNamesToModule(e,{fileName:t,name:n},r){null!==t?e.chunkFileNames.add(t):null!==n&&(null===e.chunkName&&(e.chunkName=n),r&&e.userChunkNames.add(n))}function getChunkAssignments(e,t){const n=new Map,{dependentEntryPointsByModule:r,dynamicEntryModules:i}=analyzeModuleGraph(e),s=getDynamicDependentEntryPoints(r,i),o=new Set(e);function a(e,t,i=e){const s=e.manualChunkAlias,o=new Set([e]);for(const e of o){const a=getDependentModules(n,e);if(s)e.manualChunkAlias=s,a.add(i);else{if(t&&c(t,r.get(e)))continue;a.add(i)}for(const t of e.getDependenciesToBeIncluded())t instanceof ExternalModule||t.manualChunkAlias||o.add(t)}}function c(e,t){const n=new Set(e);for(const e of n)if(!t.has(e)){if(o.has(e))return!1;const t=s.get(e);for(const e of t)n.add(e)}return!0}for(const e of Object.keys(t))for(const n of t[e])a(n,null,e);for(const t of e)t.manualChunkAlias||a(t,null);for(const e of i)e.manualChunkAlias||a(e,s.get(e));return createChunks([...Object.keys(t),...e,...i],n)}function analyzeModuleGraph(e){const t=new Set,n=new Map,r=new Set(e);for(const e of r){const i=new Set([e]);for(const s of i){getDependentModules(n,s).add(e);for(const e of s.getDependenciesToBeIncluded())e instanceof ExternalModule||i.add(e);for(const{resolution:e}of s.dynamicImports)e instanceof Module&&e.includedDynamicImporters.length>0&&!e.manualChunkAlias&&(t.add(e),r.add(e));for(const e of s.implicitlyLoadedBefore)t.add(e),r.add(e)}}return{dependentEntryPointsByModule:n,dynamicEntryModules:t}}function getDependentModules(e,t){const n=e.get(t)||new Set;return e.set(t,n),n}function getDynamicDependentEntryPoints(e,t){const n=new Map;for(const r of t){const t=getDependentModules(n,r);for(const n of[...r.includedDynamicImporters,...r.implicitlyLoadedAfter])for(const r of e.get(n))t.add(r)}return n}function createChunks(e,t){const n=Object.create(null);for(const[r,i]of t){let t="";for(const n of e)t+=i.has(n)?"X":"_";const s=n[t];s?s.push(r):n[t]=[r]}return Object.keys(n).map(e=>n[e])}function getDeprecatedContextHandler(e,t,n,r,i,s){let o=!1;return(...a)=>(o||(o=!0,warnDeprecation({message:`The "this.${t}" plugin context function used by plugin ${r} is deprecated. The "this.${n}" plugin context function should be used instead.`,plugin:r},i,s)),e(...a))}function getPluginContexts(e,t,n,r){const i=new Set;return(s,o)=>{let a,c=!0;if("string"!=typeof s.cacheKey&&(s.name.startsWith("at position ")||s.name.startsWith("at output position ")||i.has(s.name)?c=!1:i.add(s.name)),e)if(c){const t=s.cacheKey||s.name;a=createPluginCache(e[t]||(e[t]=Object.create(null)))}else a=getCacheForUncacheablePlugin(s.name);else a=NO_CACHE;return{addWatchFile(e){if(t.phase>=BuildPhase.GENERATE)return this.error(errInvalidRollupPhaseForAddWatchFile());t.watchFiles[e]=!0},cache:a,emitAsset:getDeprecatedContextHandler((e,t)=>r.emitFile({type:"asset",name:e,source:t}),"emitAsset","emitFile",s.name,!0,n),emitChunk:getDeprecatedContextHandler((e,t)=>r.emitFile({type:"chunk",id:e,name:t&&t.name}),"emitChunk","emitFile",s.name,!0,n),emitFile:r.emitFile,error:e=>throwPluginError(e,s.name),getAssetFileName:getDeprecatedContextHandler(r.getFileName,"getAssetFileName","getFileName",s.name,!0,n),getChunkFileName:getDeprecatedContextHandler(r.getFileName,"getChunkFileName","getFileName",s.name,!0,n),getFileName:r.getFileName,getModuleIds:()=>t.modulesById.keys(),getModuleInfo:t.getModuleInfo,isExternal:getDeprecatedContextHandler((e,t,r=!1)=>n.external(e,t,r),"isExternal","resolve",s.name,!0,n),meta:{rollupVersion:version,watchMode:t.watchMode},get moduleIds(){const e=t.modulesById.keys();return function*(){warnDeprecation({message:`Accessing "this.moduleIds" on the plugin context by plugin ${s.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`,plugin:s.name},!1,n),yield*e}()},parse:t.contextParse,resolve:(e,n,r)=>t.moduleLoader.resolveId(e,n,r&&r.skipSelf?o:null),resolveId:getDeprecatedContextHandler((e,n)=>t.moduleLoader.resolveId(e,n).then(e=>e&&e.id),"resolveId","resolve",s.name,!0,n),setAssetSource:r.setAssetSource,warn(e){"string"==typeof e&&(e={message:e}),e.code&&(e.pluginCode=e.code),e.code="PLUGIN_WARNING",e.plugin=s.name,n.onwarn(e)}}}}const inputHookNames={buildEnd:1,buildStart:1,load:1,options:1,resolveDynamicImport:1,resolveId:1,transform:1,watchChange:1},inputHooks=Object.keys(inputHookNames);function throwInvalidHookError(e,t){return error$1({code:"INVALID_PLUGIN_HOOK",message:`Error running plugin hook ${e} for ${t}, expected a function hook.`})}class PluginDriver{constructor(e,t,n,r,i){if(this.graph=e,this.options=t,warnDeprecatedHooks(n,t),this.pluginCache=r,this.fileEmitter=new FileEmitter(e,t,i&&i.fileEmitter),this.emitFile=this.fileEmitter.emitFile,this.getFileName=this.fileEmitter.getFileName,this.finaliseAssets=this.fileEmitter.assertAssetsFinalized,this.setOutputBundle=this.fileEmitter.setOutputBundle,this.plugins=n.concat(i?i.plugins:[]),this.pluginContexts=this.plugins.map(getPluginContexts(r,e,t,this.fileEmitter)),i)for(const e of n)for(const n of inputHooks)n in e&&t.onwarn(errInputHookInOutputPlugin(e.name,n))}createOutputPluginDriver(e){return new PluginDriver(this.graph,this.options,e,this.pluginCache,this)}hookFirst(e,t,n,r){let i=Promise.resolve(void 0);for(let s=0;snull!=r?r:this.runHook(e,t,s,!1,n)));return i}hookFirstSync(e,t,n){for(let r=0;r{})}hookReduceArg0(e,[t,...n],r,i){let s=Promise.resolve(t);for(let t=0;t{const o=[s,...n],a=this.runHook(e,o,t,!1,i);return a?a.then(e=>r.call(this.pluginContexts[t],s,e,this.plugins[t])):s});return s}hookReduceArg0Sync(e,[t,...n],r,i){for(let s=0;s{const o=this.runHook(e,n,t,!0,i);return o?o.then(e=>r.call(this.pluginContexts[t],s,e,this.plugins[t])):s});return s}hookReduceValueSync(e,t,n,r,i){let s=t;for(let t=0;tthis.runHook(e,t,i,!1,n));return r}hookSeqSync(e,t,n){for(let r=0;r"function"!=typeof o?r?o:throwInvalidHookError(e,s.name):o.apply(a,t)).catch(t=>throwPluginError(t,s.name,{hook:e}))}runHookSync(e,t,n,r){const i=this.plugins[n],s=i[e];if(!s)return;let o=this.pluginContexts[n];r&&(o=r(o,i));try{return"function"!=typeof s?throwInvalidHookError(e,i.name):s.apply(o,t)}catch(t){return throwPluginError(t,i.name,{hook:e})}}}function normalizeEntryModules(e){return Array.isArray(e)?e.map(e=>({fileName:null,id:e,implicitlyLoadedAfter:[],importer:void 0,name:null})):Object.keys(e).map(t=>({fileName:null,id:e[t],implicitlyLoadedAfter:[],importer:void 0,name:t}))}class Graph{constructor(e,t,n){var r,i;if(this.options=e,this.unsetOptions=t,this.modulesById=new Map,this.needsTreeshakingPass=!1,this.phase=BuildPhase.LOAD_AND_PARSE,this.watchFiles=Object.create(null),this.watchMode=!1,this.entryModules=[],this.externalModules=[],this.implicitEntryModules=[],this.manualChunkModulesByAlias={},this.modules=[],this.getModuleInfo=e=>{const t=this.modulesById.get(e);if(null==t)throw new Error("Unable to find module "+e);const n=[],r=[];if(t instanceof Module){for(const e of t.sources)n.push(t.resolvedIds[e].id);for(const{resolution:e}of t.dynamicImports)(e instanceof Module||e instanceof ExternalModule)&&r.push(e.id)}return{dynamicallyImportedIds:r,dynamicImporters:t.dynamicImporters.sort(),hasModuleSideEffects:t.moduleSideEffects,id:t.id,implicitlyLoadedAfterOneOf:t instanceof Module?Array.from(t.implicitlyLoadedAfter,getId):[],implicitlyLoadedBefore:t instanceof Module?Array.from(t.implicitlyLoadedBefore,getId):[],importedIds:n,importers:t.importers.sort(),isEntry:t instanceof Module&&t.isEntryPoint,isExternal:t instanceof ExternalModule}},this.deoptimizationTracker=new PathTracker,this.cachedModules=new Map,!1!==e.cache){if(null===(r=e.cache)||void 0===r?void 0:r.modules)for(const t of e.cache.modules)this.cachedModules.set(t.id,t);this.pluginCache=(null===(i=e.cache)||void 0===i?void 0:i.plugins)||Object.create(null);for(const e in this.pluginCache){const t=this.pluginCache[e];for(const e of Object.keys(t))t[e][0]++}}if(this.contextParse=(e,t={})=>this.acornParser.parse(e,{...this.options.acorn,...t}),n){this.watchMode=!0;const e=e=>this.pluginDriver.hookSeqSync("watchChange",[e]);n.on("change",e),n.once("restart",()=>{n.removeListener("change",e)})}this.pluginDriver=new PluginDriver(this,e,e.plugins,this.pluginCache),this.scope=new GlobalScope,this.acornParser=Parser.extend(...e.acornInjectPlugins),this.moduleLoader=new ModuleLoader(this,this.modulesById,this.options,this.pluginDriver)}async build(){timeStart("generate module graph",2),await this.generateModuleGraph(),timeEnd("generate module graph",2),timeStart("link and order modules",2),this.phase=BuildPhase.ANALYSE,this.linkAndOrderModules(),timeEnd("link and order modules",2),timeStart("mark included statements",2),this.includeStatements(),timeEnd("mark included statements",2),timeStart("generate chunks",2);const e=this.generateChunks();return timeEnd("generate chunks",2),this.phase=BuildPhase.GENERATE,e}generateChunks(){const e=[];if(this.options.preserveModules){for(const t of this.modules)if(t.isIncluded()||t.isEntryPoint||t.includedDynamicImporters.length>0){const n=new Chunk$1([t],this.options,this.unsetOptions,this.modulesById);n.entryModules=[t],e.push(n)}}else for(const t of this.options.inlineDynamicImports?[this.modules]:getChunkAssignments(this.entryModules,this.manualChunkModulesByAlias))sortByExecutionOrder(t),e.push(new Chunk$1(t,this.options,this.unsetOptions,this.modulesById));for(const t of e)t.link();const t=[];for(const n of e)t.push(...n.generateFacades());return[...e,...t]}getCache(){for(const e in this.pluginCache){const t=this.pluginCache[e];let n=!0;for(const e of Object.keys(t))t[e][0]>=this.options.experimentalCacheExpiry?delete t[e]:n=!1;n&&delete this.pluginCache[e]}return{modules:this.modules.map(e=>e.toJSON()),plugins:this.pluginCache}}async generateModuleGraph(){const{manualChunks:e}=this.options;if([{entryModules:this.entryModules,implicitEntryModules:this.implicitEntryModules,manualChunkModulesByAlias:this.manualChunkModulesByAlias}]=await Promise.all([this.moduleLoader.addEntryModules(normalizeEntryModules(this.options.input),!0),"object"==typeof e?this.moduleLoader.addManualChunks(e):null]),"function"==typeof e&&this.moduleLoader.assignManualChunks(e),0===this.entryModules.length)throw new Error("You must supply options.input to rollup");for(const e of this.modulesById.values())e instanceof Module?this.modules.push(e):this.externalModules.push(e)}includeStatements(){for(const e of[...this.entryModules,...this.implicitEntryModules])!1!==e.preserveSignature?e.includeAllExports():markModuleAndImpureDependenciesAsExecuted(e);if(this.options.treeshake){let e=1;do{timeStart("treeshaking pass "+e,3),this.needsTreeshakingPass=!1;for(const e of this.modules)e.isExecuted&&e.include();timeEnd("treeshaking pass "+e++,3)}while(this.needsTreeshakingPass)}else for(const e of this.modules)e.includeAllInBundle();for(const e of this.externalModules)e.warnUnusedImports();for(const e of this.implicitEntryModules)for(const t of e.implicitlyLoadedAfter)t.isEntryPoint||t.isIncluded()||error$1(errImplicitDependantIsNotIncluded(t))}linkAndOrderModules(){for(const e of this.modules)e.linkDependencies();const{orderedModules:e,cyclePaths:t}=analyseModuleExecution(this.entryModules);for(const e of t)this.options.onwarn({code:"CIRCULAR_DEPENDENCY",cycle:e,importer:e[0],message:"Circular dependency: "+e.join(" -> ")});this.modules=e;for(const e of this.modules)e.bindReferences();this.warnForMissingExports()}warnForMissingExports(){for(const e of this.modules)for(const t of Object.keys(e.importDescriptions)){const n=e.importDescriptions[t];"*"===n.name||n.module.getVariableForExportName(n.name)||e.warn({code:"NON_EXISTENT_EXPORT",message:`Non-existent export '${n.name}' is imported from ${relativeId(n.module.id)}`,name:n.name,source:n.module.id},n.start)}}}function ensureArray(e){return Array.isArray(e)?e.filter(Boolean):e?[e]:[]}function createCommonjsModule(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return commonjsRequire()}},n.exports),n.exports}function getCjsExportFromNamespace(e){return e&&e.default||e}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var require$$0=getCjsExportFromNamespace(acorn);const getPrototype=Object.getPrototypeOf||(e=>e.__proto__),getAcorn=e=>{if(e.acorn)return e.acorn;const t=require$$0;if(0!=t.version.indexOf("6.")&&0==t.version.indexOf("6.0.")&&0!=t.version.indexOf("7."))throw new Error("acorn-private-class-elements requires acorn@^6.1.0 or acorn@7.0.0, not "+t.version);for(let n=e;n&&n!==t.Parser;n=getPrototype(n))if(n!==t.Parser)throw new Error("acorn-private-class-elements does not support mixing different acorn copies");return t};var acornPrivateClassElements=function(e){if(e.prototype.parsePrivateName)return e;const t=getAcorn(e);return(e=class extends e{_branch(){return this.__branch=this.__branch||new e({ecmaVersion:this.options.ecmaVersion},this.input),this.__branch.end=this.end,this.__branch.pos=this.pos,this.__branch.type=this.type,this.__branch.value=this.value,this.__branch.containsEsc=this.containsEsc,this.__branch}parsePrivateClassElementName(e){e.computed=!1,e.key=this.parsePrivateName(),"constructor"==e.key.name&&this.raise(e.key.start,"Classes may not have a private element named constructor");const t={get:"set",set:"get"}[e.kind],n=this._privateBoundNames;return Object.prototype.hasOwnProperty.call(n,e.key.name)&&n[e.key.name]!==t&&this.raise(e.start,"Duplicate private element"),n[e.key.name]=e.kind||!0,delete this._unresolvedPrivateNames[e.key.name],e.key}parsePrivateName(){const e=this.startNode();return e.name=this.value,this.next(),this.finishNode(e,"PrivateName"),"never"==this.options.allowReserved&&this.checkUnreserved(e),e}getTokenFromCode(e){if(35===e){++this.pos;const e=this.readWord1();return this.finishToken(this.privateNameToken,e)}return super.getTokenFromCode(e)}parseClass(e,t){const n=this._outerPrivateBoundNames;this._outerPrivateBoundNames=this._privateBoundNames,this._privateBoundNames=Object.create(this._privateBoundNames||null);const r=this._outerUnresolvedPrivateNames;this._outerUnresolvedPrivateNames=this._unresolvedPrivateNames,this._unresolvedPrivateNames=Object.create(null);const i=super.parseClass(e,t),s=this._unresolvedPrivateNames;if(this._privateBoundNames=this._outerPrivateBoundNames,this._outerPrivateBoundNames=n,this._unresolvedPrivateNames=this._outerUnresolvedPrivateNames,this._outerUnresolvedPrivateNames=r,this._unresolvedPrivateNames)Object.assign(this._unresolvedPrivateNames,s);else{const e=Object.keys(s);e.length&&(e.sort((e,t)=>s[e]-s[t]),this.raise(s[e[0]],"Usage of undeclared private name"))}return i}parseClassSuper(e){const t=this._privateBoundNames;this._privateBoundNames=this._outerPrivateBoundNames;const n=this._unresolvedPrivateNames;this._unresolvedPrivateNames=this._outerUnresolvedPrivateNames;const r=super.parseClassSuper(e);return this._privateBoundNames=t,this._unresolvedPrivateNames=n,r}parseSubscript(e,n,r,i,s,o){const a=this.options.ecmaVersion>=11&&t.tokTypes.questionDot,c=this._branch();if(!(c.eat(t.tokTypes.dot)||a&&c.eat(t.tokTypes.questionDot))||c.type!=this.privateNameToken)return super.parseSubscript.apply(this,arguments);let l=!1;this.eat(t.tokTypes.dot)||(this.expect(t.tokTypes.questionDot),l=!0);let u=this.startNodeAt(n,r);return u.object=e,u.computed=!1,a&&(u.optional=l),this.type==this.privateNameToken?("Super"==e.type&&this.raise(this.start,"Cannot access private element on super"),u.property=this.parsePrivateName(),this._privateBoundNames&&this._privateBoundNames[u.property.name]||(this._unresolvedPrivateNames||this.raise(u.property.start,"Usage of undeclared private name"),this._unresolvedPrivateNames[u.property.name]=u.property.start)):u.property=this.parseIdent(!0),this.finishNode(u,"MemberExpression")}parseMaybeUnary(e,t){const n=super.parseMaybeUnary(e,t);return"delete"==n.operator&&"MemberExpression"==n.argument.type&&"PrivateName"==n.argument.property.type&&this.raise(n.start,"Private elements may not be deleted"),n}}).prototype.privateNameToken=new t.TokenType("privateName"),e},acornClassFields=function(e){const t=(e.acorn||require$$0).tokTypes;return e=acornPrivateClassElements(e),class extends e{_maybeParseFieldValue(e){if(this.eat(t.eq)){const t=this._inFieldValue;this._inFieldValue=!0,e.value=this.parseExpression(),this._inFieldValue=t}else e.value=null}parseClassElement(e){if(this.options.ecmaVersion>=8&&(this.type==t.name||this.type.keyword||this.type==this.privateNameToken||this.type==t.bracketL||this.type==t.string||this.type==t.num)){const e=this._branch();if(e.type==t.bracketL){let n=0;do{e.eat(t.bracketL)?++n:e.eat(t.bracketR)?--n:e.next()}while(n>0)}else e.next(!0);if(e.type==t.eq||e.canInsertSemicolon()||e.type==t.semi){const e=this.startNode();return this.type==this.privateNameToken?this.parsePrivateClassElementName(e):this.parsePropertyName(e),("Identifier"===e.key.type&&"constructor"===e.key.name||"Literal"===e.key.type&&"constructor"===e.key.value)&&this.raise(e.key.start,"Classes may not have a field called constructor"),this.enterScope(67),this._maybeParseFieldValue(e),this.exitScope(),this.finishNode(e,"FieldDefinition"),this.semicolon(),e}}return super.parseClassElement.apply(this,arguments)}parseIdent(e,t){const n=super.parseIdent(e,t);return this._inFieldValue&&"arguments"==n.name&&this.raise(n.start,"A class field initializer may not contain arguments"),n}}};function withoutAcornBigInt(e,t){return class extends t{readInt(e,t){if(null!=t)return super.readInt(e,t);let n=this.pos,r=0,i=!1;for(;;){let t,n=this.input.charCodeAt(this.pos);if(n>=97)t=n-97+10;else{if(95==n){i||this.raise(this.pos,"Invalid numeric separator"),++this.pos,i=!1;continue}t=n>=65?n-65+10:n>=48&&n<=57?n-48:1/0}if(t>=e)break;++this.pos,r=r*e+t,i=!0}return this.pos===n?null:(i||this.raise(this.pos-1,"Invalid numeric separator"),r)}readNumber(e){const t=super.readNumber(e);let n=this.end-this.start>=2&&48===this.input.charCodeAt(this.start);const r=this.getNumberInput(this.start,this.end);return r.length=97)t=n-97+10;else{if(95==n){i||this.raise(this.pos,"Invalid numeric separator"),++this.pos,i=!1;continue}t=n>=65?n-65+10:n>=48&&n<=57?n-48:1/0}if(t>=e)break;++this.pos,r=r*e+t,i=!0}return this.pos===n?null:(i||this.raise(this.pos-1,"Invalid numeric separator"),r)}readNumber(t){let n=this.pos;t||null!==this.readInt(10)||this.raise(n,"Invalid number");let r=this.pos-n>=2&&48===this.input.charCodeAt(n),i=!1;r&&this.strict&&this.raise(n,"Invalid number");let s=this.input.charCodeAt(this.pos);if(!r&&!t&&this.options.ecmaVersion>=11&&110===s){let t=this.getNumberInput(n,this.pos),r="undefined"!=typeof BigInt?BigInt(t):null;return++this.pos,e.isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(e.tokTypes.num,r)}r&&/[89]/.test(this.input.slice(n,this.pos))&&(r=!1,i=!0),46!==s||r||(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),69!==s&&101!==s||r||(s=this.input.charCodeAt(++this.pos),43!==s&&45!==s||++this.pos,null===this.readInt(10)&&this.raise(n,"Invalid number")),e.isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");let o=this.getNumberInput(n,this.pos);(r||i)&&o.length=11&&110===this.input.charCodeAt(this.pos)){let e=this.getNumberInput(n,this.pos);r="undefined"!=typeof BigInt?BigInt(e):null,++this.pos}else e.isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");return this.finishToken(e.tokTypes.num,r)}getNumberInput(e,t){return this.input.slice(e,t).replace(/_/g,"")}}}var acornNumericSeparator=function(e){const t=e.acorn||require$$0;return t.version.startsWith("6.")&&!(t.version.startsWith("6.0.")||t.version.startsWith("6.1."))||t.version.startsWith("7.")?withAcornBigInt(t,e):withoutAcornBigInt(t,e)},acornStaticClassFeatures=function(e){const t=acornPrivateClassElements(e),n=(e.acorn||require$$0).tokTypes;return class extends t{_maybeParseFieldValue(e){if(this.eat(n.eq)){const t=this._inStaticFieldScope;this._inStaticFieldScope=this.currentThisScope(),e.value=this.parseExpression(),this._inStaticFieldScope=t}else e.value=null}parseClassElement(e){if(this.options.ecmaVersion<8||!this.isContextual("static"))return super.parseClassElement.apply(this,arguments);const t=this._branch();if(t.next(),-1==[n.name,n.bracketL,n.string,n.num,this.privateNameToken].indexOf(t.type))return super.parseClassElement.apply(this,arguments);if(t.type==n.bracketL){let e=0;do{t.eat(n.bracketL)?++e:t.eat(n.bracketR)?--e:t.next()}while(e>0)}else t.next();if(t.type!=n.eq&&!t.canInsertSemicolon()&&t.type!=n.semi)return super.parseClassElement.apply(this,arguments);const r=this.startNode();return r.static=this.eatContextual("static"),this.type==this.privateNameToken?this.parsePrivateClassElementName(r):this.parsePropertyName(r),("Identifier"===r.key.type&&"constructor"===r.key.name||"Literal"===r.key.type&&!r.computed&&"constructor"===r.key.value)&&this.raise(r.key.start,"Classes may not have a field called constructor"),"prototype"!==(r.key.name||r.key.value)||r.computed||this.raise(r.key.start,"Classes may not have a static property named prototype"),this._maybeParseFieldValue(r),this.finishNode(r,"FieldDefinition"),this.semicolon(),r}parsePropertyName(e){e.static&&this.type==this.privateNameToken?this.parsePrivateClassElementName(e):super.parsePropertyName(e)}parseIdent(e,t){const n=super.parseIdent(e,t);return this._inStaticFieldScope&&this.currentThisScope()===this._inStaticFieldScope&&"arguments"==n.name&&this.raise(n.start,"A static class field initializer may not contain arguments"),n}}};const defaultOnWarn=e=>console.warn(e.message||e);function warnUnknownOptions(e,t,n,r,i=/$./){const s=new Set(t),o=Object.keys(e).filter(e=>!(s.has(e)||i.test(e)));o.length>0&&r({code:"UNKNOWN_OPTION",message:`Unknown ${n}: ${o.join(", ")}. Allowed options: ${[...s].sort().join(", ")}`})}function normalizeInputOptions(e){var t,n;const r=new Set,i=null!==(t=e.context)&&void 0!==t?t:"undefined",s=e.inlineDynamicImports||!1,o=getOnwarn(e),a=getPreserveModules(e,s),c=e.strictDeprecations||!1,l={acorn:getAcorn$1(e),acornInjectPlugins:getAcornInjectPlugins(e),cache:getCache(e),context:i,experimentalCacheExpiry:null!==(n=e.experimentalCacheExpiry)&&void 0!==n?n:10,external:getIdMatcher(e.external),inlineDynamicImports:s,input:getInput(e,s),manualChunks:getManualChunks(e,s,a),moduleContext:getModuleContext(e,i),onwarn:o,perf:e.perf||!1,plugins:ensureArray(e.plugins),preserveEntrySignatures:getPreserveEntrySignatures(e,r,a),preserveModules:a,preserveSymlinks:e.preserveSymlinks||!1,shimMissingExports:e.shimMissingExports||!1,strictDeprecations:c,treeshake:getTreeshake(e,o,c)};return warnUnknownOptions(e,[...Object.keys(l),"watch"],"input options",l.onwarn,/^(output)$/),{options:l,unsetOptions:r}}const getOnwarn=e=>e.onwarn?t=>{t.toString=()=>{let e="";return t.plugin&&(e+=`(${t.plugin} plugin) `),t.loc&&(e+=`${relativeId(t.loc.file)} (${t.loc.line}:${t.loc.column}) `),e+=t.message,e},e.onwarn(t,defaultOnWarn)}:defaultOnWarn,getPreserveModules=(e,t)=>{const n=e.preserveModules||!1;return n&&t?error$1({code:"INVALID_OPTION",message:'"preserveModules" does not support the "inlineDynamicImports" option.'}):n},getAcorn$1=e=>({allowAwaitOutsideFunction:!0,ecmaVersion:2020,preserveParens:!1,sourceType:"module",...e.acorn}),getAcornInjectPlugins=e=>[acornClassFields,acornStaticClassFeatures,acornNumericSeparator,...ensureArray(e.acornInjectPlugins)],getCache=e=>{var t;return(null===(t=e.cache)||void 0===t?void 0:t.cache)||e.cache},getIdMatcher=e=>{if(!0===e)return()=>!0;if("function"==typeof e)return(t,...n)=>!t.startsWith("\0")&&e(t,...n)||!1;if(e){const t=new Set,n=[];for(const r of ensureArray(e))r instanceof RegExp?n.push(r):t.add(r);return e=>t.has(e)||n.some(t=>t.test(e))}return()=>!1},getInput=(e,t)=>{const n=e.input,r=null==n?[]:"string"==typeof n?[n]:n;return t&&(Array.isArray(r)?r:Object.keys(r)).length>1?error$1({code:"INVALID_OPTION",message:'Multiple inputs are not supported for "inlineDynamicImports".'}):r},getManualChunks=(e,t,n)=>{const r=e.manualChunks;if(r){if(t)return error$1({code:"INVALID_OPTION",message:'"manualChunks" option is not supported for "inlineDynamicImports".'});if(n)return error$1({code:"INVALID_OPTION",message:'"preserveModules" does not support the "manualChunks" option.'})}return r||{}},getModuleContext=(e,t)=>{const n=e.moduleContext;if("function"==typeof n)return e=>{var r;return null!==(r=n(e))&&void 0!==r?r:t};if(n){const e=Object.create(null);for(const t of Object.keys(n))e[path$n.resolve(t)]=n[t];return n=>e[n]||t}return()=>t},getPreserveEntrySignatures=(e,t,n)=>{const r=e.preserveEntrySignatures;if(null==r)t.add("preserveEntrySignatures");else if(!1===r&&n)return error$1({code:"INVALID_OPTION",message:'"preserveModules" does not support setting "preserveEntrySignatures" to "false".'});return null!=r?r:"strict"},getTreeshake=(e,t,n)=>{const r=e.treeshake;return!1!==r&&(r&&!0!==r?(void 0!==r.pureExternalModules&&warnDeprecationWithOptions('The "treeshake.pureExternalModules" option is deprecated. The "treeshake.moduleSideEffects" option should be used instead. "treeshake.pureExternalModules: true" is equivalent to "treeshake.moduleSideEffects: \'no-external\'"',!0,t,n),{annotations:!1!==r.annotations,moduleSideEffects:getHasModuleSideEffects(r.moduleSideEffects,r.pureExternalModules,t),propertyReadSideEffects:!1!==r.propertyReadSideEffects,tryCatchDeoptimization:!1!==r.tryCatchDeoptimization,unknownGlobalSideEffects:!1!==r.unknownGlobalSideEffects}):{annotations:!0,moduleSideEffects:()=>!0,propertyReadSideEffects:!0,tryCatchDeoptimization:!0,unknownGlobalSideEffects:!0})},getHasModuleSideEffects=(e,t,n)=>{if("boolean"==typeof e)return()=>e;if("no-external"===e)return(e,t)=>!t;if("function"==typeof e)return(t,n)=>!!t.startsWith("\0")||!1!==e(t,n);if(Array.isArray(e)){const t=new Set(e);return e=>t.has(e)}e&&n(errInvalidOption("treeshake.moduleSideEffects",'please use one of false, "no-external", a function or an array'));const r=getIdMatcher(t);return(e,t)=>!(t&&r(e))};function normalizeOutputOptions(e,t){var n,r,i,s,o,a,c,l;const u=new Set,p=e.compact||!1,h=getFile(e,t),d=getFormat(e),f={amd:getAmd(e),assetFileNames:null!==(n=e.assetFileNames)&&void 0!==n?n:"assets/[name]-[hash][extname]",banner:getAddon(e,"banner"),chunkFileNames:null!==(r=e.chunkFileNames)&&void 0!==r?r:"[name]-[hash].js",compact:p,dir:getDir(e,h),dynamicImportFunction:getDynamicImportFunction(e,t),entryFileNames:getEntryFileNames(e,u),esModule:null===(i=e.esModule)||void 0===i||i,exports:getExports(e),extend:e.extend||!1,externalLiveBindings:null===(s=e.externalLiveBindings)||void 0===s||s,file:h,footer:getAddon(e,"footer"),format:d,freeze:null===(o=e.freeze)||void 0===o||o,globals:e.globals||{},hoistTransitiveImports:null===(a=e.hoistTransitiveImports)||void 0===a||a,indent:getIndent(e,p),interop:null===(c=e.interop)||void 0===c||c,intro:getAddon(e,"intro"),minifyInternalExports:getMinifyInternalExports(e,d,p),name:e.name,namespaceToStringTag:e.namespaceToStringTag||!1,noConflict:e.noConflict||!1,outro:getAddon(e,"outro"),paths:e.paths||{},plugins:ensureArray(e.plugins),preferConst:e.preferConst||!1,sourcemap:e.sourcemap||!1,sourcemapExcludeSources:e.sourcemapExcludeSources||!1,sourcemapFile:e.sourcemapFile,sourcemapPathTransform:e.sourcemapPathTransform,strict:null===(l=e.strict)||void 0===l||l,systemNullSetters:e.systemNullSetters||!1};return warnUnknownOptions(e,Object.keys(f),"output options",t.onwarn),{options:f,unsetOptions:u}}const getFile=(e,t)=>{const n=e.file;if("string"==typeof n){if(t.preserveModules)return error$1({code:"INVALID_OPTION",message:'You must set "output.dir" instead of "output.file" when using the "preserveModules" option.'});if(!Array.isArray(t.input))return error$1({code:"INVALID_OPTION",message:'You must set "output.dir" instead of "output.file" when providing named inputs.'})}return n},getFormat=e=>{const t=e.format;switch(t){case void 0:case"es":case"esm":case"module":return"es";case"cjs":case"commonjs":return"cjs";case"system":case"systemjs":return"system";case"amd":case"iife":case"umd":return t;default:return error$1({message:'You must specify "output.format", which can be one of "amd", "cjs", "system", "es", "iife" or "umd".',url:"https://rollupjs.org/guide/en/#output-format"})}},getAmd=e=>({define:"define",...e.amd}),getAddon=(e,t)=>{const n=e[t];return"function"==typeof n?n:()=>n||""},getDir=(e,t)=>{const n=e.dir;return"string"==typeof n&&"string"==typeof t?error$1({code:"INVALID_OPTION",message:'You must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks.'}):n},getDynamicImportFunction=(e,t)=>{const n=e.dynamicImportFunction;return n&&warnDeprecation('The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.',!1,t),n},getEntryFileNames=(e,t)=>{const n=e.entryFileNames;return null==n&&t.add("entryFileNames"),null!=n?n:"[name].js"};function getExports(e){const t=e.exports;return t&&!["default","named","none","auto"].includes(t)?error$1(errInvalidExportOptionValue(t)):t||"auto"}const getIndent=(e,t)=>{if(t)return"";const n=e.indent;return!1===n?"":null==n||n},getMinifyInternalExports=(e,t,n)=>{var r;return null!==(r=e.minifyInternalExports)&&void 0!==r?r:n||"es"===t||"system"===t};function rollup(e){return rollupInternal(e,null)}async function rollupInternal(e,t){const{options:n,unsetOptions:r}=getInputOptions(e,null!==t);initialiseTimers(n);const i=new Graph(n,r,t),s=!1!==e.cache;let o;delete n.cache,delete e.cache,timeStart("BUILD",1);try{await i.pluginDriver.hookParallel("buildStart",[n]),o=await i.build()}catch(e){const t=Object.keys(i.watchFiles);throw t.length>0&&(e.watchFiles=t),await i.pluginDriver.hookParallel("buildEnd",[e]),e}await i.pluginDriver.hookParallel("buildEnd",[]),timeEnd("BUILD",1);const a={cache:s?i.getCache():void 0,async generate(e){const{options:t,outputPluginDriver:r,unsetOptions:s}=getOutputOptionsAndPluginDriver(e,i.pluginDriver,n),a=new Bundle(t,s,n,r,o);return createOutput(await a.generate(!1))},watchFiles:Object.keys(i.watchFiles),async write(e){const{options:t,outputPluginDriver:r,unsetOptions:s}=getOutputOptionsAndPluginDriver(e,i.pluginDriver,n);if(!t.dir&&!t.file)return error$1({code:"MISSING_OPTION",message:'You must specify "output.file" or "output.dir" for the build.'});const a=new Bundle(t,s,n,r,o),c=await a.generate(!0);return await Promise.all(Object.keys(c).map(e=>writeOutputFile(c[e],t))),await r.hookParallel("writeBundle",[t,c]),createOutput(c)}};return n.perf&&(a.getTimings=getTimings),a}function getInputOptions(e,t){if(!e)throw new Error("You must supply an options object to rollup");const n=ensureArray(e.plugins),{options:r,unsetOptions:i}=normalizeInputOptions(n.reduce(applyOptionHook(t),e));return normalizePlugins(r.plugins,"at position "),{options:r,unsetOptions:i}}function applyOptionHook(e){return(t,n)=>n.options&&n.options.call({meta:{rollupVersion:version,watchMode:e}},t)||t}function normalizePlugins(e,t){for(let n=0;nt||e,e=>{const t=()=>e.error(errCannotEmitFromOptionsHook());return{...e,emitFile:t,setAssetSource:t}}),e)}function createOutput(e){return{output:Object.keys(e).map(t=>e[t]).filter(e=>Object.keys(e).length>0).sort((e,t)=>{const n=getSortingFileType(e),r=getSortingFileType(t);return n===r?0:n{fsEvents=e.default}).catch(e=>{fsEventsImportError=e})}function getFsEvents(){if(fsEventsImportError)throw fsEventsImportError;return fsEvents}!function(e){e[e.ENTRY_CHUNK=0]="ENTRY_CHUNK",e[e.SECONDARY_CHUNK=1]="SECONDARY_CHUNK",e[e.ASSET=2]="ASSET"}(SortingFileType||(SortingFileType={}));var fseventsImporter={__proto__:null,loadFsEvents,getFsEvents};class WatchEmitter extends events$1.EventEmitter{constructor(){super(),this.setMaxListeners(1/0)}close(){}}function watch(e){const t=new WatchEmitter,n=ensureArray(e).filter(e=>!1!==e.watch);if(0===n.length)throw error$1(errInvalidOption("watch",'there must be at least one config where "watch" is not set to "false"'));return loadFsEvents().then(()=>Promise.resolve().then((function(){return watch$3}))).then(({Watcher:e})=>new e(n,t)),t}function walk(e,{enter:t,leave:n}){return visit(e,null,t,n)}let should_skip=!1,should_remove=!1,replacement=null;const context={skip:()=>should_skip=!0,remove:()=>should_remove=!0,replace:e=>replacement=e};function replace(e,t,n,r){e&&(null!==n?e[t][n]=r:e[t]=r)}function remove(e,t,n){e&&(null!==n?e[t].splice(n,1):delete e[t])}function visit(e,t,n,r,i,s){if(e){if(n){const r=should_skip,o=should_remove,a=replacement;should_skip=!1,should_remove=!1,replacement=null,n.call(context,e,t,i,s),replacement&&replace(t,i,s,e=replacement),should_remove&&remove(t,i,s);const c=should_skip,l=should_remove;if(should_skip=r,should_remove=o,replacement=a,c)return e;if(l)return null}for(const t in e){const i=e[t];if("object"==typeof i)if(Array.isArray(i))for(let s=0,o=0;s?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};var constants={MAX_LENGTH:65536,POSIX_REGEX_SOURCE,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:path.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?WINDOWS_CHARS:POSIX_CHARS},utils$1=createCommonjsModule$1((function(e,t){const n=require("path"),r="win32"===process.platform,{REGEX_BACKSLASH:i,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_GLOBAL:a}=constants;t.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),t.hasRegexChars=e=>o.test(e),t.isRegexChar=e=>1===e.length&&t.hasRegexChars(e),t.escapeRegex=e=>e.replace(a,"\\$1"),t.toPosixSlashes=e=>e.replace(i,"/"),t.removeBackslashes=e=>e.replace(s,e=>"\\"===e?"":e),t.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},t.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===r||"\\"===n.sep,t.escapeLast=(e,n,r)=>{const i=e.lastIndexOf(n,r);return-1===i?e:"\\"===e[i-1]?t.escapeLast(e,n,i-1):`${e.slice(0,i)}\\${e.slice(i)}`},t.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},t.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r}}));const{CHAR_ASTERISK,CHAR_AT,CHAR_BACKWARD_SLASH,CHAR_COMMA,CHAR_DOT,CHAR_EXCLAMATION_MARK,CHAR_FORWARD_SLASH,CHAR_LEFT_CURLY_BRACE,CHAR_LEFT_PARENTHESES,CHAR_LEFT_SQUARE_BRACKET,CHAR_PLUS,CHAR_QUESTION_MARK,CHAR_RIGHT_CURLY_BRACE,CHAR_RIGHT_PARENTHESES,CHAR_RIGHT_SQUARE_BRACKET}=constants,isPathSeparator=e=>e===CHAR_FORWARD_SLASH||e===CHAR_BACKWARD_SLASH,depth=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)},scan=(e,t)=>{const n=t||{},r=e.length-1,i=!0===n.parts||!0===n.scanToEnd,s=[],o=[],a=[];let c,l,u=e,p=-1,h=0,d=0,f=!1,m=!1,g=!1,_=!1,E=!1,y=!1,v=!1,S=!1,b=!1,A=0,C={value:"",depth:0,isGlob:!1};const x=()=>p>=r,$=()=>(c=l,u.charCodeAt(++p));for(;p0&&(T=u.slice(0,h),u=u.slice(h),d-=h),w&&!0===g&&d>0?(w=u.slice(0,d),R=u.slice(d)):!0===g?(w="",R=u):w=u,w&&""!==w&&"/"!==w&&w!==u&&isPathSeparator(w.charCodeAt(w.length-1))&&(w=w.slice(0,-1)),!0===n.unescape&&(R&&(R=utils$1.removeBackslashes(R)),w&&!0===v&&(w=utils$1.removeBackslashes(w)));const N={prefix:T,input:e,start:h,base:w,glob:R,isBrace:f,isBracket:m,isGlob:g,isExtglob:_,isGlobstar:E,negated:S};if(!0===n.tokens&&(N.maxDepth=0,isPathSeparator(l)||o.push(C),N.tokens=o),!0===n.parts||!0===n.tokens){let t;for(let r=0;r{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();const n=`[${e.join("-")}]`;try{new RegExp(n)}catch(t){return e.map(e=>utils$1.escapeRegex(e)).join("..")}return n},syntaxError=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,parse$2=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");e=REPLACEMENTS[e]||e;const n={...t},r="number"==typeof n.maxLength?Math.min(MAX_LENGTH,n.maxLength):MAX_LENGTH;let i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);const s={type:"bos",value:"",output:n.prepend||""},o=[s],a=n.capture?"":"?:",c=utils$1.isWindows(t),l=constants.globChars(c),u=constants.extglobChars(l),{DOT_LITERAL:p,PLUS_LITERAL:h,SLASH_LITERAL:d,ONE_CHAR:f,DOTS_SLASH:m,NO_DOT:g,NO_DOT_SLASH:_,NO_DOTS_SLASH:E,QMARK:y,QMARK_NO_DOT:v,STAR:S,START_ANCHOR:b}=l,A=e=>`(${a}(?:(?!${b}${e.dot?m:p}).)*?)`,C=n.dot?"":g,x=n.dot?y:v;let $=!0===n.bash?A(n):S;n.capture&&($=`(${$})`),"boolean"==typeof n.noext&&(n.noextglob=n.noext);const w={input:e,index:-1,start:0,dot:!0===n.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};e=utils$1.removePrefix(e,w),i=e.length;const T=[],R=[],N=[];let D,k=s;const O=()=>w.index===i-1,I=w.peek=(t=1)=>e[w.index+t],P=w.advance=()=>e[++w.index],M=()=>e.slice(w.index+1),F=(e="",t=0)=>{w.consumed+=e,w.index+=t},L=e=>{w.output+=null!=e.output?e.output:e.value,F(e.value)},B=()=>{let e=1;for(;"!"===I()&&("("!==I(2)||"?"===I(3));)P(),w.start++,e++;return e%2!=0&&(w.negated=!0,w.start++,!0)},V=e=>{w[e]++,N.push(e)},U=e=>{w[e]--,N.pop()},H=e=>{if("globstar"===k.type){const t=w.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||T.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(w.output=w.output.slice(0,-k.output.length),k.type="star",k.value="*",k.output=$,w.output+=k.output)}if(T.length&&"paren"!==e.type&&!u[e.value]&&(T[T.length-1].inner+=e.value),(e.value||e.output)&&L(e),k&&"text"===k.type&&"text"===e.type)return k.value+=e.value,void(k.output=(k.output||"")+e.value);e.prev=k,o.push(e),k=e},G=(e,t)=>{const r={...u[t],conditions:1,inner:""};r.prev=k,r.parens=w.parens,r.output=w.output;const i=(n.capture?"(":"")+r.open;V("parens"),H({type:e,value:t,output:w.output?"":f}),H({type:"paren",extglob:!0,value:P(),output:i}),T.push(r)},j=e=>{let t=e.close+(n.capture?")":"");if("negate"===e.type){let r=$;e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=A(n)),(r!==$||O()||/^\)+$/.test(M()))&&(t=e.close=")$))"+r),"bos"===e.prev.type&&O()&&(w.negatedExtglob=!0)}H({type:"paren",extglob:!0,value:D,output:t}),U("parens")};if(!1!==n.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let r=!1,i=e.replace(REGEX_SPECIAL_CHARS_BACKREF,(e,t,n,i,s,o)=>"\\"===i?(r=!0,e):"?"===i?t?t+i+(s?y.repeat(s.length):""):0===o?x+(s?y.repeat(s.length):""):y.repeat(n.length):"."===i?p.repeat(n.length):"*"===i?t?t+i+(s?$:""):$:t?e:"\\"+e);return!0===r&&(i=!0===n.unescape?i.replace(/\\/g,""):i.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),i===e&&!0===n.contains?(w.output=e,w):(w.output=utils$1.wrapOutput(i,w,t),w)}for(;!O();){if(D=P(),"\0"===D)continue;if("\\"===D){const e=I();if("/"===e&&!0!==n.bash)continue;if("."===e||";"===e)continue;if(!e){D+="\\",H({type:"text",value:D});continue}const t=/^\\+/.exec(M());let r=0;if(t&&t[0].length>2&&(r=t[0].length,w.index+=r,r%2!=0&&(D+="\\")),!0===n.unescape?D=P()||"":D+=P()||"",0===w.brackets){H({type:"text",value:D});continue}}if(w.brackets>0&&("]"!==D||"["===k.value||"[^"===k.value)){if(!1!==n.posix&&":"===D){const e=k.value.slice(1);if(e.includes("[")&&(k.posix=!0,e.includes(":"))){const e=k.value.lastIndexOf("["),t=k.value.slice(0,e),n=k.value.slice(e+2),r=POSIX_REGEX_SOURCE$1[n];if(r){k.value=t+r,w.backtrack=!0,P(),s.output||1!==o.indexOf(k)||(s.output=f);continue}}}("["===D&&":"!==I()||"-"===D&&"]"===I())&&(D="\\"+D),"]"!==D||"["!==k.value&&"[^"!==k.value||(D="\\"+D),!0===n.posix&&"!"===D&&"["===k.value&&(D="^"),k.value+=D,L({value:D});continue}if(1===w.quotes&&'"'!==D){D=utils$1.escapeRegex(D),k.value+=D,L({value:D});continue}if('"'===D){w.quotes=1===w.quotes?0:1,!0===n.keepQuotes&&H({type:"text",value:D});continue}if("("===D){V("parens"),H({type:"paren",value:D});continue}if(")"===D){if(0===w.parens&&!0===n.strictBrackets)throw new SyntaxError(syntaxError("opening","("));const e=T[T.length-1];if(e&&w.parens===e.parens+1){j(T.pop());continue}H({type:"paren",value:D,output:w.parens?")":"\\)"}),U("parens");continue}if("["===D){if(!0!==n.nobracket&&M().includes("]"))V("brackets");else{if(!0!==n.nobracket&&!0===n.strictBrackets)throw new SyntaxError(syntaxError("closing","]"));D="\\"+D}H({type:"bracket",value:D});continue}if("]"===D){if(!0===n.nobracket||k&&"bracket"===k.type&&1===k.value.length){H({type:"text",value:D,output:"\\"+D});continue}if(0===w.brackets){if(!0===n.strictBrackets)throw new SyntaxError(syntaxError("opening","["));H({type:"text",value:D,output:"\\"+D});continue}U("brackets");const e=k.value.slice(1);if(!0===k.posix||"^"!==e[0]||e.includes("/")||(D="/"+D),k.value+=D,L({value:D}),!1===n.literalBrackets||utils$1.hasRegexChars(e))continue;const t=utils$1.escapeRegex(k.value);if(w.output=w.output.slice(0,-k.value.length),!0===n.literalBrackets){w.output+=t,k.value=t;continue}k.value=`(${a}${t}|${k.value})`,w.output+=k.value;continue}if("{"===D&&!0!==n.nobrace){V("braces");const e={type:"brace",value:D,output:"(",outputIndex:w.output.length,tokensIndex:w.tokens.length};R.push(e),H(e);continue}if("}"===D){const e=R[R.length-1];if(!0===n.nobrace||!e){H({type:"text",value:D,output:D});continue}let t=")";if(!0===e.dots){const e=o.slice(),r=[];for(let t=e.length-1;t>=0&&(o.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&r.unshift(e[t].value);t=expandRange(r,n),w.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=w.output.slice(0,e.outputIndex),r=w.tokens.slice(e.tokensIndex);e.value=e.output="\\{",D=t="\\}",w.output=n;for(const e of r)w.output+=e.output||e.value}H({type:"brace",value:D,output:t}),U("braces"),R.pop();continue}if("|"===D){T.length>0&&T[T.length-1].conditions++,H({type:"text",value:D});continue}if(","===D){let e=D;const t=R[R.length-1];t&&"braces"===N[N.length-1]&&(t.comma=!0,e="|"),H({type:"comma",value:D,output:e});continue}if("/"===D){if("dot"===k.type&&w.index===w.start+1){w.start=w.index+1,w.consumed="",w.output="",o.pop(),k=s;continue}H({type:"slash",value:D,output:d});continue}if("."===D){if(w.braces>0&&"dot"===k.type){"."===k.value&&(k.output=p);const e=R[R.length-1];k.type="dots",k.output+=D,k.value+=D,e.dots=!0;continue}if(w.braces+w.parens===0&&"bos"!==k.type&&"slash"!==k.type){H({type:"text",value:D,output:p});continue}H({type:"dot",value:D,output:p});continue}if("?"===D){if(!(k&&"("===k.value)&&!0!==n.noextglob&&"("===I()&&"?"!==I(2)){G("qmark",D);continue}if(k&&"paren"===k.type){const e=I();let t=D;if("<"===e&&!utils$1.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===k.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(M()))&&(t="\\"+D),H({type:"text",value:D,output:t});continue}if(!0!==n.dot&&("slash"===k.type||"bos"===k.type)){H({type:"qmark",value:D,output:v});continue}H({type:"qmark",value:D,output:y});continue}if("!"===D){if(!0!==n.noextglob&&"("===I()&&("?"!==I(2)||!/[!=<:]/.test(I(3)))){G("negate",D);continue}if(!0!==n.nonegate&&0===w.index){B();continue}}if("+"===D){if(!0!==n.noextglob&&"("===I()&&"?"!==I(2)){G("plus",D);continue}if(k&&"("===k.value||!1===n.regex){H({type:"plus",value:D,output:h});continue}if(k&&("bracket"===k.type||"paren"===k.type||"brace"===k.type)||w.parens>0){H({type:"plus",value:D});continue}H({type:"plus",value:h});continue}if("@"===D){if(!0!==n.noextglob&&"("===I()&&"?"!==I(2)){H({type:"at",extglob:!0,value:D,output:""});continue}H({type:"text",value:D});continue}if("*"!==D){"$"!==D&&"^"!==D||(D="\\"+D);const e=REGEX_NON_SPECIAL_CHARS.exec(M());e&&(D+=e[0],w.index+=e[0].length),H({type:"text",value:D});continue}if(k&&("globstar"===k.type||!0===k.star)){k.type="star",k.star=!0,k.value+=D,k.output=$,w.backtrack=!0,w.globstar=!0,F(D);continue}let t=M();if(!0!==n.noextglob&&/^\([^?]/.test(t)){G("star",D);continue}if("star"===k.type){if(!0===n.noglobstar){F(D);continue}const r=k.prev,i=r.prev,s="slash"===r.type||"bos"===r.type,o=i&&("star"===i.type||"globstar"===i.type);if(!0===n.bash&&(!s||t[0]&&"/"!==t[0])){H({type:"star",value:D,output:""});continue}const a=w.braces>0&&("comma"===r.type||"brace"===r.type),c=T.length&&("pipe"===r.type||"paren"===r.type);if(!s&&"paren"!==r.type&&!a&&!c){H({type:"star",value:D,output:""});continue}for(;"/**"===t.slice(0,3);){const n=e[w.index+4];if(n&&"/"!==n)break;t=t.slice(3),F("/**",3)}if("bos"===r.type&&O()){k.type="globstar",k.value+=D,k.output=A(n),w.output=k.output,w.globstar=!0,F(D);continue}if("slash"===r.type&&"bos"!==r.prev.type&&!o&&O()){w.output=w.output.slice(0,-(r.output+k.output).length),r.output="(?:"+r.output,k.type="globstar",k.output=A(n)+(n.strictSlashes?")":"|$)"),k.value+=D,w.globstar=!0,w.output+=r.output+k.output,F(D);continue}if("slash"===r.type&&"bos"!==r.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";w.output=w.output.slice(0,-(r.output+k.output).length),r.output="(?:"+r.output,k.type="globstar",k.output=`${A(n)}${d}|${d}${e})`,k.value+=D,w.output+=r.output+k.output,w.globstar=!0,F(D+P()),H({type:"slash",value:"/",output:""});continue}if("bos"===r.type&&"/"===t[0]){k.type="globstar",k.value+=D,k.output=`(?:^|${d}|${A(n)}${d})`,w.output=k.output,w.globstar=!0,F(D+P()),H({type:"slash",value:"/",output:""});continue}w.output=w.output.slice(0,-k.output.length),k.type="globstar",k.output=A(n),k.value+=D,w.output+=k.output,w.globstar=!0,F(D);continue}const r={type:"star",value:D,output:$};!0!==n.bash?!k||"bracket"!==k.type&&"paren"!==k.type||!0!==n.regex?(w.index!==w.start&&"slash"!==k.type&&"dot"!==k.type||("dot"===k.type?(w.output+=_,k.output+=_):!0===n.dot?(w.output+=E,k.output+=E):(w.output+=C,k.output+=C),"*"!==I()&&(w.output+=f,k.output+=f)),H(r)):(r.output=D,H(r)):(r.output=".*?","bos"!==k.type&&"slash"!==k.type||(r.output=C+r.output),H(r))}for(;w.brackets>0;){if(!0===n.strictBrackets)throw new SyntaxError(syntaxError("closing","]"));w.output=utils$1.escapeLast(w.output,"["),U("brackets")}for(;w.parens>0;){if(!0===n.strictBrackets)throw new SyntaxError(syntaxError("closing",")"));w.output=utils$1.escapeLast(w.output,"("),U("parens")}for(;w.braces>0;){if(!0===n.strictBrackets)throw new SyntaxError(syntaxError("closing","}"));w.output=utils$1.escapeLast(w.output,"{"),U("braces")}if(!0===n.strictSlashes||"star"!==k.type&&"bracket"!==k.type||H({type:"maybe_slash",value:"",output:d+"?"}),!0===w.backtrack){w.output="";for(const e of w.tokens)w.output+=null!=e.output?e.output:e.value,e.suffix&&(w.output+=e.suffix)}return w};parse$2.fastpaths=(e,t)=>{const n={...t},r="number"==typeof n.maxLength?Math.min(MAX_LENGTH,n.maxLength):MAX_LENGTH,i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);e=REPLACEMENTS[e]||e;const s=utils$1.isWindows(t),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:u,NO_DOTS:p,NO_DOTS_SLASH:h,STAR:d,START_ANCHOR:f}=constants.globChars(s),m=n.dot?p:u,g=n.dot?h:u,_=n.capture?"":"?:";let E=!0===n.bash?".*?":d;n.capture&&(E=`(${E})`);const y=e=>!0===e.noglobstar?E:`(${_}(?:(?!${f}${e.dot?l:o}).)*?)`,v=e=>{switch(e){case"*":return`${m}${c}${E}`;case".*":return`${o}${c}${E}`;case"*.*":return`${m}${E}${o}${c}${E}`;case"*/*":return`${m}${E}${a}${c}${g}${E}`;case"**":return m+y(n);case"**/*":return`(?:${m}${y(n)}${a})?${g}${c}${E}`;case"**/*.*":return`(?:${m}${y(n)}${a})?${g}${E}${o}${c}${E}`;case"**/.*":return`(?:${m}${y(n)}${a})?${o}${c}${E}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=v(t[1]);if(!n)return;return n+o+t[2]}}},S=utils$1.removePrefix(e,{negated:!1,prefix:""});let b=v(S);return b&&!0!==n.strictSlashes&&(b+=a+"?"),b};var parse_1=parse$2;const path$1=require("path"),isObject$1=e=>e&&"object"==typeof e&&!Array.isArray(e),picomatch=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map(e=>picomatch(e,t,n));return e=>{for(const t of r){const n=t(e);if(n)return n}return!1}}const r=(i=e)&&"object"==typeof i&&!Array.isArray(i)&&e.tokens&&e.input;var i;if(""===e||"string"!=typeof e&&!r)throw new TypeError("Expected pattern to be a non-empty string");const s=t||{},o=utils$1.isWindows(t),a=r?picomatch.compileRe(e,t):picomatch.makeRe(e,t,!1,!0),c=a.state;delete a.state;let l=()=>!1;if(s.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};l=picomatch(s.ignore,e,n)}const u=(n,r=!1)=>{const{isMatch:i,match:u,output:p}=picomatch.test(n,a,t,{glob:e,posix:o}),h={glob:e,state:c,regex:a,posix:o,input:n,output:p,match:u,isMatch:i};return"function"==typeof s.onResult&&s.onResult(h),!1===i?(h.isMatch=!1,!!r&&h):l(n)?("function"==typeof s.onIgnore&&s.onIgnore(h),h.isMatch=!1,!!r&&h):("function"==typeof s.onMatch&&s.onMatch(h),!r||h)};return n&&(u.state=c),u};picomatch.test=(e,t,n,{glob:r,posix:i}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const s=n||{},o=s.format||(i?utils$1.toPosixSlashes:null);let a=e===r,c=a&&o?o(e):e;return!1===a&&(c=o?o(e):e,a=c===r),!1!==a&&!0!==s.capture||(a=!0===s.matchBase||!0===s.basename?picomatch.matchBase(e,t,n,i):t.exec(c)),{isMatch:Boolean(a),match:a,output:c}},picomatch.matchBase=(e,t,n,r=utils$1.isWindows(n))=>(t instanceof RegExp?t:picomatch.makeRe(t,n)).test(path$1.basename(e)),picomatch.isMatch=(e,t,n)=>picomatch(t,n)(e),picomatch.parse=(e,t)=>Array.isArray(e)?e.map(e=>picomatch.parse(e,t)):parse_1(e,{...t,fastpaths:!1}),picomatch.scan=(e,t)=>scan_1(e,t),picomatch.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const i=t||{},s=i.contains?"":"^",o=i.contains?"":"$";let a=`${s}(?:${e.output})${o}`;e&&!0===e.negated&&(a=`^(?!${a}).*$`);const c=picomatch.toRegex(a,t);return!0===r&&(c.state=e),c},picomatch.makeRe=(e,t,n=!1,r=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");const i=t||{};let s,o={negated:!1,fastpaths:!0},a="";return e.startsWith("./")&&(e=e.slice(2),a=o.prefix="./"),!1===i.fastpaths||"."!==e[0]&&"*"!==e[0]||(s=parse_1.fastpaths(e,t)),void 0===s?(o=parse_1(e,t),o.prefix=a+(o.prefix||"")):o.output=s,picomatch.compileRe(o,t,n,r)},picomatch.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},picomatch.constants=constants;var picomatch_1=picomatch,picomatch$1=picomatch_1;const extractors$1={ArrayPattern(e,t){for(const n of t.elements)n&&extractors$1[n.type](e,n)},AssignmentPattern(e,t){extractors$1[t.left.type](e,t.left)},Identifier(e,t){e.push(t.name)},MemberExpression(){},ObjectPattern(e,t){for(const n of t.properties)"RestElement"===n.type?extractors$1.RestElement(e,n):extractors$1[n.value.type](e,n.value)},RestElement(e,t){extractors$1[t.argument.type](e,t.argument)}},extractAssignedNames$1=function(e){const t=[];return extractors$1[e.type](t,e),t},blockDeclarations={const:!0,let:!0};class Scope$2{constructor(e={}){this.parent=e.parent,this.isBlockScope=!!e.block,this.declarations=Object.create(null),e.params&&e.params.forEach(e=>{extractAssignedNames$1(e).forEach(e=>{this.declarations[e]=!0})})}addDeclaration(e,t,n){!t&&this.isBlockScope?this.parent.addDeclaration(e,t,n):e.id&&extractAssignedNames$1(e.id).forEach(e=>{this.declarations[e]=!0})}contains(e){return this.declarations[e]||!!this.parent&&this.parent.contains(e)}}const attachScopes=function(e,t="scope"){let n=new Scope$2;return walk(e,{enter(e,r){const i=e;if(/(Function|Class)Declaration/.test(i.type)&&n.addDeclaration(i,!1,!1),"VariableDeclaration"===i.type){const{kind:e}=i,t=blockDeclarations[e],s=r?r.type:"";t&&/ForOfStatement/.test(s)||i.declarations.forEach(e=>{n.addDeclaration(e,t,!0)})}let s;if(/Function/.test(i.type)){const e=i;s=new Scope$2({parent:n,block:!1,params:e.params}),"FunctionExpression"===e.type&&e.id&&s.addDeclaration(e,!1,!1)}"BlockStatement"!==i.type||/Function/.test(r.type)||(s=new Scope$2({parent:n,block:!0})),"CatchClause"===i.type&&(s=new Scope$2({parent:n,params:i.param?[i.param]:[],block:!0})),s&&(Object.defineProperty(i,t,{value:s,configurable:!0}),n=s)},leave(e){e[t]&&(n=n.parent)}}),n};function isArray$1(e){return Array.isArray(e)}function ensureArray$1(e){return isArray$1(e)?e:null==e?[]:[e]}function getMatcherString(e,t){if(!1===t)return e;const n=path$n.resolve(t||"").split(path$n.sep).join("/").replace(/[-^$*+?.()|[\]{}]/g,"\\$&");return path$n.posix.join(n,e)}const createFilter=function(e,t,n){const r=n&&n.resolve,i=e=>e instanceof RegExp?e:{test:t=>{const n=getMatcherString(e,r);return picomatch$1(n,{dot:!0})(t)}},s=ensureArray$1(e).map(i),o=ensureArray$1(t).map(i);return function(e){if("string"!=typeof e)return!1;if(/\0/.test(e))return!1;const t=e.split(path$n.sep).join("/");for(let e=0;et.toUpperCase()).replace(/[^$_a-zA-Z0-9]/g,"_");return(/\d/.test(t[0])||forbiddenIdentifiers.has(t))&&(t="_"+t),t||"_"};function stringify(e){return(JSON.stringify(e)||"undefined").replace(/[\u2028\u2029]/g,e=>"\\u"+("000"+e.charCodeAt(0).toString(16)).slice(-4))}function serializeArray(e,t,n){let r="[";const i=t?`\n${n}${t}`:"";for(let s=0;s0?",":""}${i}${serialize(e[s],t,n+t)}`}return`${r}${t?"\n"+n:""}]`}function serializeObject(e,t,n){let r="{";const i=t?`\n${n}${t}`:"",s=Object.entries(e);for(let e=0;e0?",":""}${i}${makeLegalIdentifier(o)===o?o:stringify(o)}:${t?" ":""}${serialize(a,t,n+t)}`}return`${r}${t?"\n"+n:""}}`}function serialize(e,t,n){return e===1/0?"Infinity":e===-1/0?"-Infinity":0===e&&1/e==-1/0?"-0":e instanceof Date?`new Date(${e.getTime()})`:e instanceof RegExp?e.toString():e!=e?"NaN":Array.isArray(e)?serializeArray(e,t,n):null===e?"null":"object"==typeof e?serializeObject(e,t,n):stringify(e)}const dataToEsm=function(e,t={}){const n=t.compact?"":"indent"in t?t.indent:"\t",r=t.compact?"":" ",i=t.compact?"":"\n",s=t.preferConst?"const":"var";if(!1===t.namedExports||"object"!=typeof e||Array.isArray(e)||e instanceof Date||e instanceof RegExp||null===e){const i=serialize(e,t.compact?null:n,"");return`export default${r||(/^[{[\-\/]/.test(i)?"":" ")}${i};`}let o="";const a=[];for(const[c,l]of Object.entries(e))c===makeLegalIdentifier(c)?(t.objectShorthand?a.push(c):a.push(`${c}:${r}${c}`),o+=`export ${s} ${c}${r}=${r}${serialize(l,t.compact?null:n,"")};${i}`):a.push(`${stringify(c)}:${r}${serialize(l,t.compact?null:n,"")}`);return`${o}export default${r}{${i}${n}${a.join(`,${i}${n}`)}${i}};${i}`};function json(e){void 0===e&&(e={});var t=createFilter(e.include,e.exclude),n="indent"in e?e.indent:"\t";return{name:"json",transform:function(r,i){return".json"===i.slice(-5)&&t(i)?{code:dataToEsm(JSON.parse(r),{preferConst:e.preferConst,compact:e.compact,namedExports:e.namedExports,indent:n}),map:{mappings:""}}:null}}}const isWin="win32"===process.platform,SEP=isWin?"\\\\+":"\\/",SEP_ESC=isWin?"\\\\":"/",GLOBSTAR="((?:[^/]*(?:/|$))*)",WILDCARD="([^/]*)",GLOBSTAR_SEGMENT=`((?:[^${SEP_ESC}]*(?:${SEP_ESC}|$))*)`,WILDCARD_SEGMENT=`([^${SEP_ESC}]*)`;function globrex(e,{extended:t=!1,globstar:n=!1,strict:r=!1,filepath:i=!1,flags:s=""}={}){let o="",a="",c={regex:"",segments:[]},l=!1,u=!1;const p=[];function h(e,{split:t,last:n,only:r}={}){"path"!==r&&(o+=e),i&&"regex"!==r&&(c.regex+="\\/"===e?SEP:e,t?(n&&(a+=e),""!==a&&(s.includes("g")||(a=`^${a}$`),c.segments.push(new RegExp(a,s))),a=""):a+=e)}let d,f;for(let i=0;i1&&("/"===r||void 0===r)&&("/"===o||void 0===o)?(h(GLOBSTAR,{only:"regex"}),h(GLOBSTAR_SEGMENT,{only:"path",last:!0,split:!0}),i++):(h(WILDCARD,{only:"regex"}),h(WILDCARD_SEGMENT,{only:"path"}))}else h(".*")}else{if(l){h("|");continue}h("\\"+d)}else{if(t){l=!1,h(")");continue}h("\\"+d)}else{if(t){l=!0,h("(");continue}h("\\"+d)}else{if(t){u=!1,h(d);continue}h("\\"+d)}else{if(u&&":"===f){i++;let t="";for(;":"!==e[++i];)t+=e[i];"alnum"===t?h("(\\w|\\d)"):"space"===t?h("\\s"):"digit"===t&&h("\\d"),i++;continue}if(t){u=!0,h(d);continue}h("\\"+d)}else{if(t){"("===f?p.push(d):h(".");continue}h("\\"+d)}else{if(t){if(u){h("^");continue}if("("===f){p.push(d),h("(?!"),i++;continue}h("\\"+d);continue}h("\\"+d)}else{if("("===f&&t){p.push(d);continue}h("\\"+d)}else{if(p.length){h(d);continue}h("\\"+d)}else{if(p.length){h(d);let e=p.pop();h("@"===e?"{1}":"!"===e?"([^/]*)":e);continue}h("\\"+d)}else{if(p.length){h(d);continue}h("\\"+d)}else h("\\"+d,{split:!0}),"/"!==f||r||(o+="?");s.includes("g")||(o=`^${o}$`,a=`^${a}$`,i&&(c.regex=`^${c.regex}$`));const m={regex:new RegExp(o,s)};return i&&(c.segments.push(new RegExp(a,s)),c.regex=new RegExp(c.regex,s),c.globstar=new RegExp(s.includes("g")?GLOBSTAR_SEGMENT:`^${GLOBSTAR_SEGMENT}$`,s),m.path=c),m}var globrex_1=globrex;const path$2=require("path"),CHARS={"{":"}","(":")","[":"]"},STRICT=/\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\)|(\\).|([@?!+*]\(.*\)))/,RELAXED=/\\(.)|(^!|[*?{}()[\]]|\(\?)/;function isglob(e,{strict:t=!0}={}){if(""===e)return!1;let n,r=t?STRICT:RELAXED;for(;n=r.exec(e);){if(n[2])return!0;let t=n.index+n[0].length,r=n[1],i=r?CHARS[r]:null;if(r&&i){let n=e.indexOf(i,t);-1!==n&&(t=n+1)}e=e.slice(t)}return!1}function parent(e,{strict:t=!1}={}){e=path$2.normalize(e).replace(/\/|\\/,"/"),/[\{\[].*[\/]*.*[\}\]]$/.test(e)&&(e+="/"),e+="a";do{e=path$2.dirname(e)}while(isglob(e,{strict:t})||/(^|[^\\])([\{\[]|\([^\)]+$)/.test(e));return e.replace(/\\([\*\?\|\[\]\(\)\{\}])/g,"$1")}function globalyzer(e,t={}){let n,r=parent(e,t),i=isglob(e,t);return"."!=r?(n=e.substr(r.length),n.startsWith("/")&&(n=n.substr(1))):n=e,i||(r=path$2.dirname(e),n="."!==r?e.substr(r.length):e),n.startsWith("./")&&(n=n.substr(2)),n.startsWith("/")&&(n=n.substr(1)),{base:r,glob:n,isGlob:i}}var src=globalyzer;const fs=require("fs"),{promisify}=require("util"),{join,resolve,relative:relative$1}=require("path"),isHidden=/(^|[\\\/])\.[^\\\/\.]/g,readdir=promisify(fs.readdir),stat=promisify(fs.stat);let CACHE={};async function walk$1(e,t,n,r,i="",s=0){const o=n.segments[s],a=join(r.cwd,t,i),c=await readdir(a),{dot:l,filesOnly:u}=r;let p,h,d,f,m,g=0,_=c.length;for(;g<_;g++)h=join(a,p=c[g]),d=i?join(i,p):p,!l&&isHidden.test(d)||(m=n.regex.test(d),void 0===(f=CACHE[d])&&(CACHE[d]=f=fs.lstatSync(h)),f.isDirectory()?o&&!o.test(p)||(!u&&m&&e.push(join(t,d)),await walk$1(e,t,n,r,d,o&&o.toString()!==n.globstar&&++s)):m&&e.push(relative$1(r.cwd,h)))}var tinyGlob=async function(e,t={}){if(!e)return[];let n=src(e);if(t.cwd=t.cwd||".",!n.isGlob)try{let n=resolve(t.cwd,e),r=await stat(n);return t.filesOnly&&!r.isFile()?[]:t.absolute?[n]:[e]}catch(e){if("ENOENT"!=e.code)throw e;return[]}t.flush&&(CACHE={});let r=[];const{path:i}=globrex_1(n.glob,{filepath:!0,globstar:!0,extended:!0});return i.globstar=i.globstar.toString(),await walk$1(r,n.base,i,t,".",0),t.absolute?r.map(e=>resolve(t.cwd,e)):r};function watcherPlugin({cwd:e=".",watchedFiles:t,onChange:n}={}){return"string"==typeof t&&(t=tinyGlob(t,{filesOnly:!0,cwd:e}).catch(e=>{throw Error("Failed to create file watcher:\n"+e.message)})).catch(()=>{}),{name:"watcher-plugin",async buildStart(){if(t=await t)for(const e of t)this.addWatchFile(e)},watchChange(t){const r="/"+path$n.relative(e,t.replace(/\.save\..*$/g,""));n(r)}}}var xhtml={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},reservedWords$3={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},ecma5AndLessKeywords$1="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",keywords$2={5:ecma5AndLessKeywords$1,"5module":ecma5AndLessKeywords$1+" export import",6:ecma5AndLessKeywords$1+" const class extends export import super"},keywordRelationalOperator$1=/^in(stanceof)?$/,nonASCIIidentifierStartChars$1="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",nonASCIIidentifierChars$1="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",nonASCIIidentifierStart$1=new RegExp("["+nonASCIIidentifierStartChars$1+"]"),nonASCIIidentifier$1=new RegExp("["+nonASCIIidentifierStartChars$1+nonASCIIidentifierChars$1+"]");nonASCIIidentifierStartChars$1=nonASCIIidentifierChars$1=null;var astralIdentifierStartCodes$1=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],astralIdentifierCodes$1=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function isInAstralSet$1(e,t){for(var n=65536,r=0;re)return!1;if((n+=t[r+1])>=e)return!0}}function isIdentifierStart$1(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&nonASCIIidentifierStart$1.test(String.fromCharCode(e)):!1!==t&&isInAstralSet$1(e,astralIdentifierStartCodes$1)))}function isIdentifierChar$1(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&nonASCIIidentifier$1.test(String.fromCharCode(e)):!1!==t&&(isInAstralSet$1(e,astralIdentifierStartCodes$1)||isInAstralSet$1(e,astralIdentifierCodes$1)))))}var TokenType$1=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function binop$1(e,t){return new TokenType$1(e,{beforeExpr:!0,binop:t})}var beforeExpr$1={beforeExpr:!0},startsExpr$1={startsExpr:!0},keywords$1$1={};function kw$1(e,t){return void 0===t&&(t={}),t.keyword=e,keywords$1$1[e]=new TokenType$1(e,t)}var types$2={num:new TokenType$1("num",startsExpr$1),regexp:new TokenType$1("regexp",startsExpr$1),string:new TokenType$1("string",startsExpr$1),name:new TokenType$1("name",startsExpr$1),eof:new TokenType$1("eof"),bracketL:new TokenType$1("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new TokenType$1("]"),braceL:new TokenType$1("{",{beforeExpr:!0,startsExpr:!0}),braceR:new TokenType$1("}"),parenL:new TokenType$1("(",{beforeExpr:!0,startsExpr:!0}),parenR:new TokenType$1(")"),comma:new TokenType$1(",",beforeExpr$1),semi:new TokenType$1(";",beforeExpr$1),colon:new TokenType$1(":",beforeExpr$1),dot:new TokenType$1("."),question:new TokenType$1("?",beforeExpr$1),arrow:new TokenType$1("=>",beforeExpr$1),template:new TokenType$1("template"),invalidTemplate:new TokenType$1("invalidTemplate"),ellipsis:new TokenType$1("...",beforeExpr$1),backQuote:new TokenType$1("`",startsExpr$1),dollarBraceL:new TokenType$1("${",{beforeExpr:!0,startsExpr:!0}),eq:new TokenType$1("=",{beforeExpr:!0,isAssign:!0}),assign:new TokenType$1("_=",{beforeExpr:!0,isAssign:!0}),incDec:new TokenType$1("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new TokenType$1("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:binop$1("||",1),logicalAND:binop$1("&&",2),bitwiseOR:binop$1("|",3),bitwiseXOR:binop$1("^",4),bitwiseAND:binop$1("&",5),equality:binop$1("==/!=/===/!==",6),relational:binop$1("/<=/>=",7),bitShift:binop$1("<>/>>>",8),plusMin:new TokenType$1("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:binop$1("%",10),star:binop$1("*",10),slash:binop$1("/",10),starstar:new TokenType$1("**",{beforeExpr:!0}),coalesce:binop$1("??",1),_break:kw$1("break"),_case:kw$1("case",beforeExpr$1),_catch:kw$1("catch"),_continue:kw$1("continue"),_debugger:kw$1("debugger"),_default:kw$1("default",beforeExpr$1),_do:kw$1("do",{isLoop:!0,beforeExpr:!0}),_else:kw$1("else",beforeExpr$1),_finally:kw$1("finally"),_for:kw$1("for",{isLoop:!0}),_function:kw$1("function",startsExpr$1),_if:kw$1("if"),_return:kw$1("return",beforeExpr$1),_switch:kw$1("switch"),_throw:kw$1("throw",beforeExpr$1),_try:kw$1("try"),_var:kw$1("var"),_const:kw$1("const"),_while:kw$1("while",{isLoop:!0}),_with:kw$1("with"),_new:kw$1("new",{beforeExpr:!0,startsExpr:!0}),_this:kw$1("this",startsExpr$1),_super:kw$1("super",startsExpr$1),_class:kw$1("class",startsExpr$1),_extends:kw$1("extends",beforeExpr$1),_export:kw$1("export"),_import:kw$1("import",startsExpr$1),_null:kw$1("null",startsExpr$1),_true:kw$1("true",startsExpr$1),_false:kw$1("false",startsExpr$1),_in:kw$1("in",{beforeExpr:!0,binop:7}),_instanceof:kw$1("instanceof",{beforeExpr:!0,binop:7}),_typeof:kw$1("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:kw$1("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:kw$1("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},lineBreak$1=/\r\n?|\n|\u2028|\u2029/,lineBreakG$1=new RegExp(lineBreak$1.source,"g");function isNewLine$1(e,t){return 10===e||13===e||!t&&(8232===e||8233===e)}var nonASCIIwhitespace$1=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,skipWhiteSpace$1=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ref$1=Object.prototype,hasOwnProperty$1=ref$1.hasOwnProperty,toString$2=ref$1.toString;function has$1(e,t){return hasOwnProperty$1.call(e,t)}var isArray$2=Array.isArray||function(e){return"[object Array]"===toString$2.call(e)};function wordsRegexp$1(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}var Position$1=function(e,t){this.line=e,this.column=t};Position$1.prototype.offset=function(e){return new Position$1(this.line,this.column+e)};var SourceLocation$1=function(e,t,n){this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile)};function getLineInfo$1(e,t){for(var n=1,r=0;;){lineBreakG$1.lastIndex=r;var i=lineBreakG$1.exec(e);if(!(i&&i.index=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),isArray$2(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}return isArray$2(t.onComment)&&(t.onComment=pushComment$1(t,t.onComment)),t}function pushComment$1(e,t){return function(n,r,i,s,o,a){var c={type:n?"Block":"Line",value:r,start:i,end:s};e.locations&&(c.loc=new SourceLocation$1(this,o,a)),e.ranges&&(c.range=[i,s]),t.push(c)}}var SCOPE_TOP$1=1,SCOPE_FUNCTION$1=2,SCOPE_VAR$1=SCOPE_TOP$1|SCOPE_FUNCTION$1,SCOPE_ASYNC$1=4,SCOPE_GENERATOR$1=8,SCOPE_ARROW$1=16,SCOPE_SIMPLE_CATCH$1=32,SCOPE_SUPER$1=64,SCOPE_DIRECT_SUPER$1=128;function functionFlags$1(e,t){return SCOPE_FUNCTION$1|(e?SCOPE_ASYNC$1:0)|(t?SCOPE_GENERATOR$1:0)}var BIND_NONE$1=0,BIND_VAR$1=1,BIND_LEXICAL$1=2,BIND_FUNCTION$1=3,BIND_SIMPLE_CATCH$1=4,BIND_OUTSIDE$1=5,Parser$1=function(e,t,n){this.options=e=getOptions$1(e),this.sourceFile=e.sourceFile,this.keywords=wordsRegexp$1(keywords$2[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var r="";if(!0!==e.allowReserved){for(var i=e.ecmaVersion;!(r=reservedWords$3[i]);i--);"module"===e.sourceType&&(r+=" await")}this.reservedWords=wordsRegexp$1(r);var s=(r?r+" ":"")+reservedWords$3.strict;this.reservedWordsStrict=wordsRegexp$1(s),this.reservedWordsStrictBind=wordsRegexp$1(s+" "+reservedWords$3.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf("\n",n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(lineBreak$1).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=types$2.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(SCOPE_TOP$1),this.regexpState=null},prototypeAccessors$1={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};Parser$1.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},prototypeAccessors$1.inFunction.get=function(){return(this.currentVarScope().flags&SCOPE_FUNCTION$1)>0},prototypeAccessors$1.inGenerator.get=function(){return(this.currentVarScope().flags&SCOPE_GENERATOR$1)>0},prototypeAccessors$1.inAsync.get=function(){return(this.currentVarScope().flags&SCOPE_ASYNC$1)>0},prototypeAccessors$1.allowSuper.get=function(){return(this.currentThisScope().flags&SCOPE_SUPER$1)>0},prototypeAccessors$1.allowDirectSuper.get=function(){return(this.currentThisScope().flags&SCOPE_DIRECT_SUPER$1)>0},prototypeAccessors$1.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Parser$1.prototype.inNonArrowFunction=function(){return(this.currentThisScope().flags&SCOPE_FUNCTION$1)>0},Parser$1.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r=,?^&]/.test(i)||"!"===i&&"="===this.input.charAt(r+1))}e+=t[0].length,skipWhiteSpace$1.lastIndex=e,e+=skipWhiteSpace$1.exec(this.input)[0].length,";"===this.input[e]&&e++}},pp$a.eat=function(e){return this.type===e&&(this.next(),!0)},pp$a.isContextual=function(e){return this.type===types$2.name&&this.value===e&&!this.containsEsc},pp$a.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},pp$a.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},pp$a.canInsertSemicolon=function(){return this.type===types$2.eof||this.type===types$2.braceR||lineBreak$1.test(this.input.slice(this.lastTokEnd,this.start))},pp$a.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},pp$a.semicolon=function(){this.eat(types$2.semi)||this.insertSemicolon()||this.unexpected()},pp$a.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},pp$a.expect=function(e){this.eat(e)||this.unexpected()},pp$a.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")},pp$a.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,"Parenthesized pattern")}},pp$a.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")},pp$a.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case types$2._class:return e&&this.unexpected(),this.parseClass(s,!0);case types$2._if:return this.parseIfStatement(s);case types$2._return:return this.parseReturnStatement(s);case types$2._switch:return this.parseSwitchStatement(s);case types$2._throw:return this.parseThrowStatement(s);case types$2._try:return this.parseTryStatement(s);case types$2._const:case types$2._var:return r=r||this.value,e&&"var"!==r&&this.unexpected(),this.parseVarStatement(s,r);case types$2._while:return this.parseWhileStatement(s);case types$2._with:return this.parseWithStatement(s);case types$2.braceL:return this.parseBlock(!0,s);case types$2.semi:return this.parseEmptyStatement(s);case types$2._export:case types$2._import:if(this.options.ecmaVersion>10&&i===types$2._import){skipWhiteSpace$1.lastIndex=this.pos;var o=skipWhiteSpace$1.exec(this.input),a=this.pos+o[0].length,c=this.input.charCodeAt(a);if(40===c||46===c)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),i===types$2._import?this.parseImport(s):this.parseExport(s,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var l=this.value,u=this.parseExpression();return i===types$2.name&&"Identifier"===u.type&&this.eat(types$2.colon)?this.parseLabeledStatement(s,l,u,e):this.parseExpressionStatement(s,u)}},pp$1$1.parseBreakContinueStatement=function(e,t){var n="break"===t;this.next(),this.eat(types$2.semi)||this.insertSemicolon()?e.label=null:this.type!==types$2.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r=6?this.eat(types$2.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},pp$1$1.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(loopLabel$1),this.enterScope(0),this.expect(types$2.parenL),this.type===types$2.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===types$2._var||this.type===types$2._const||n){var r=this.startNode(),i=n?"let":this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,"VariableDeclaration"),(this.type===types$2._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===r.declarations.length?(this.options.ecmaVersion>=9&&(this.type===types$2._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,r)):(t>-1&&this.unexpected(t),this.parseFor(e,r))}var s=new DestructuringErrors$1,o=this.parseExpression(!0,s);return this.type===types$2._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===types$2._in?t>-1&&this.unexpected(t):e.await=t>-1),this.toAssignable(o,!1,s),this.checkLVal(o),this.parseForIn(e,o)):(this.checkExpressionErrors(s,!0),t>-1&&this.unexpected(t),this.parseFor(e,o))},pp$1$1.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,FUNC_STATEMENT$1|(n?0:FUNC_HANGING_STATEMENT$1),!1,t)},pp$1$1.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(types$2._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},pp$1$1.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(types$2.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},pp$1$1.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(types$2.braceL),this.labels.push(switchLabel$1),this.enterScope(0);for(var n=!1;this.type!==types$2.braceR;)if(this.type===types$2._case||this.type===types$2._default){var r=this.type===types$2._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!0,t.test=null),this.expect(types$2.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},pp$1$1.parseThrowStatement=function(e){return this.next(),lineBreak$1.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var empty$2=[];pp$1$1.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===types$2._catch){var t=this.startNode();if(this.next(),this.eat(types$2.parenL)){t.param=this.parseBindingAtom();var n="Identifier"===t.param.type;this.enterScope(n?SCOPE_SIMPLE_CATCH$1:0),this.checkLVal(t.param,n?BIND_SIMPLE_CATCH$1:BIND_LEXICAL$1),this.expect(types$2.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(types$2._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},pp$1$1.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},pp$1$1.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(loopLabel$1),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},pp$1$1.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},pp$1$1.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},pp$1$1.parseLabeledStatement=function(e,t,n,r){for(var i=0,s=this.labels;i=0;a--){var c=this.labels[a];if(c.statementStart!==e.start)break;c.statementStart=this.start,c.kind=o}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?-1===r.indexOf("label")?r+"label":r:"label"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},pp$1$1.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},pp$1$1.parseBlock=function(e,t,n){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(types$2.braceL),e&&this.enterScope(0);this.type!==types$2.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},pp$1$1.parseFor=function(e,t){return e.init=t,this.expect(types$2.semi),e.test=this.type===types$2.semi?null:this.parseExpression(),this.expect(types$2.semi),e.update=this.type===types$2.parenR?null:this.parseExpression(),this.expect(types$2.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},pp$1$1.parseForIn=function(e,t){var n=this.type===types$2._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!n||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)?this.raise(t.start,(n?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===t.type&&this.raise(t.start,"Invalid left-hand side in for-loop"),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(types$2.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,n?"ForInStatement":"ForOfStatement")},pp$1$1.parseVar=function(e,t,n){for(e.declarations=[],e.kind=n;;){var r=this.startNode();if(this.parseVarId(r,n),this.eat(types$2.eq)?r.init=this.parseMaybeAssign(t):"const"!==n||this.type===types$2._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===r.id.type||t&&(this.type===types$2._in||this.isContextual("of"))?r.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(types$2.comma))break}return e},pp$1$1.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?BIND_VAR$1:BIND_LEXICAL$1,!1)};var FUNC_STATEMENT$1=1,FUNC_HANGING_STATEMENT$1=2,FUNC_NULLABLE_ID$1=4;pp$1$1.parseFunction=function(e,t,n,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===types$2.star&&t&FUNC_HANGING_STATEMENT$1&&this.unexpected(),e.generator=this.eat(types$2.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&FUNC_STATEMENT$1&&(e.id=t&FUNC_NULLABLE_ID$1&&this.type!==types$2.name?null:this.parseIdent(),!e.id||t&FUNC_HANGING_STATEMENT$1||this.checkLVal(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?BIND_VAR$1:BIND_LEXICAL$1:BIND_FUNCTION$1));var i=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(functionFlags$1(e.async,e.generator)),t&FUNC_STATEMENT$1||(e.id=this.type===types$2.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(e,t&FUNC_STATEMENT$1?"FunctionDeclaration":"FunctionExpression")},pp$1$1.parseFunctionParams=function(e){this.expect(types$2.parenL),e.params=this.parseBindingList(types$2.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},pp$1$1.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.startNode(),i=!1;for(r.body=[],this.expect(types$2.braceL);this.type!==types$2.braceR;){var s=this.parseClassElement(null!==e.superClass);s&&(r.body.push(s),"MethodDefinition"===s.type&&"constructor"===s.kind&&(i&&this.raise(s.start,"Duplicate constructor in the same class"),i=!0))}return this.strict=n,this.next(),e.body=this.finishNode(r,"ClassBody"),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},pp$1$1.parseClassElement=function(e){var t=this;if(this.eat(types$2.semi))return null;var n=this.startNode(),r=function(e,r){void 0===r&&(r=!1);var i=t.start,s=t.startLoc;return!!t.eatContextual(e)&&(!(t.type===types$2.parenL||r&&t.canInsertSemicolon())||(n.key&&t.unexpected(),n.computed=!1,n.key=t.startNodeAt(i,s),n.key.name=e,t.finishNode(n.key,"Identifier"),!1))};n.kind="method",n.static=r("static");var i=this.eat(types$2.star),s=!1;i||(this.options.ecmaVersion>=8&&r("async",!0)?(s=!0,i=this.options.ecmaVersion>=9&&this.eat(types$2.star)):r("get")?n.kind="get":r("set")&&(n.kind="set")),n.key||this.parsePropertyName(n);var o=n.key,a=!1;return n.computed||n.static||!("Identifier"===o.type&&"constructor"===o.name||"Literal"===o.type&&"constructor"===o.value)?n.static&&"Identifier"===o.type&&"prototype"===o.name&&this.raise(o.start,"Classes may not have a static property named prototype"):("method"!==n.kind&&this.raise(o.start,"Constructor can't have get/set modifier"),i&&this.raise(o.start,"Constructor can't be a generator"),s&&this.raise(o.start,"Constructor can't be an async method"),n.kind="constructor",a=e),this.parseClassMethod(n,i,s,a),"get"===n.kind&&0!==n.value.params.length&&this.raiseRecoverable(n.value.start,"getter should have no params"),"set"===n.kind&&1!==n.value.params.length&&this.raiseRecoverable(n.value.start,"setter should have exactly one param"),"set"===n.kind&&"RestElement"===n.value.params[0].type&&this.raiseRecoverable(n.value.params[0].start,"Setter cannot use rest params"),n},pp$1$1.parseClassMethod=function(e,t,n,r){return e.value=this.parseMethod(t,n,r),this.finishNode(e,"MethodDefinition")},pp$1$1.parseClassId=function(e,t){this.type===types$2.name?(e.id=this.parseIdent(),t&&this.checkLVal(e.id,BIND_LEXICAL$1,!1)):(!0===t&&this.unexpected(),e.id=null)},pp$1$1.parseClassSuper=function(e){e.superClass=this.eat(types$2._extends)?this.parseExprSubscripts():null},pp$1$1.parseExport=function(e,t){if(this.next(),this.eat(types$2.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseIdent(!0),this.checkExport(t,e.exported.name,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==types$2.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(types$2._default)){var n;if(this.checkExport(t,"default",this.lastTokStart),this.type===types$2._function||(n=this.isAsyncFunction())){var r=this.startNode();this.next(),n&&this.next(),e.declaration=this.parseFunction(r,FUNC_STATEMENT$1|FUNC_NULLABLE_ID$1,!1,n)}else if(this.type===types$2._class){var i=this.startNode();e.declaration=this.parseClass(i,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==types$2.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var s=0,o=e.specifiers;s=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r=8&&!s&&"async"===o.name&&!this.canInsertSemicolon()&&this.eat(types$2._function))return this.parseFunction(this.startNodeAt(r,i),0,!1,!0);if(n&&!this.canInsertSemicolon()){if(this.eat(types$2.arrow))return this.parseArrowExpression(this.startNodeAt(r,i),[o],!1);if(this.options.ecmaVersion>=8&&"async"===o.name&&this.type===types$2.name&&!s)return o=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(types$2.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(r,i),[o],!0)}return o;case types$2.regexp:var a=this.value;return(t=this.parseLiteral(a.value)).regex={pattern:a.pattern,flags:a.flags},t;case types$2.num:case types$2.string:return this.parseLiteral(this.value);case types$2._null:case types$2._true:case types$2._false:return(t=this.startNode()).value=this.type===types$2._null?null:this.type===types$2._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case types$2.parenL:var c=this.start,l=this.parseParenAndDistinguishExpression(n);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(e.parenthesizedAssign=c),e.parenthesizedBind<0&&(e.parenthesizedBind=c)),l;case types$2.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(types$2.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case types$2.braceL:return this.parseObj(!1,e);case types$2._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case types$2._class:return this.parseClass(this.startNode(),!1);case types$2._new:return this.parseNew();case types$2.backQuote:return this.parseTemplate();case types$2._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},pp$3$1.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var t=this.parseIdent(!0);switch(this.type){case types$2.parenL:return this.parseDynamicImport(e);case types$2.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}},pp$3$1.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(types$2.parenR)){var t=this.start;this.eat(types$2.comma)&&this.eat(types$2.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},pp$3$1.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},pp$3$1.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1)),this.next(),this.finishNode(t,"Literal")},pp$3$1.parseParenExpression=function(){this.expect(types$2.parenL);var e=this.parseExpression();return this.expect(types$2.parenR),e},pp$3$1.parseParenAndDistinguishExpression=function(e){var t,n=this.start,r=this.startLoc,i=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s,o=this.start,a=this.startLoc,c=[],l=!0,u=!1,p=new DestructuringErrors$1,h=this.yieldPos,d=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==types$2.parenR;){if(l?l=!1:this.expect(types$2.comma),i&&this.afterTrailingComma(types$2.parenR,!0)){u=!0;break}if(this.type===types$2.ellipsis){s=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===types$2.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}c.push(this.parseMaybeAssign(!1,p,this.parseParenItem))}var f=this.start,m=this.startLoc;if(this.expect(types$2.parenR),e&&!this.canInsertSemicolon()&&this.eat(types$2.arrow))return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=h,this.awaitPos=d,this.parseParenArrowList(n,r,c);c.length&&!u||this.unexpected(this.lastTokStart),s&&this.unexpected(s),this.checkExpressionErrors(p,!0),this.yieldPos=h||this.yieldPos,this.awaitPos=d||this.awaitPos,c.length>1?((t=this.startNodeAt(o,a)).expressions=c,this.finishNodeAt(t,"SequenceExpression",f,m)):t=c[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(n,r);return g.expression=t,this.finishNode(g,"ParenthesizedExpression")}return t},pp$3$1.parseParenItem=function(e){return e},pp$3$1.parseParenArrowList=function(e,t,n){return this.parseArrowExpression(this.startNodeAt(e,t),n)};var empty$1$1=[];pp$3$1.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(types$2.dot)){e.meta=t;var n=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),n&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.inNonArrowFunction()||this.raiseRecoverable(e.start,"'new.target' can only be used in functions"),this.finishNode(e,"MetaProperty")}var r=this.start,i=this.startLoc,s=this.type===types$2._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),r,i,!0),s&&"ImportExpression"===e.callee.type&&this.raise(r,"Cannot use new with import()"),this.eat(types$2.parenL)?e.arguments=this.parseExprList(types$2.parenR,this.options.ecmaVersion>=8,!1):e.arguments=empty$1$1,this.finishNode(e,"NewExpression")},pp$3$1.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===types$2.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value,cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),n.tail=this.type===types$2.backQuote,this.finishNode(n,"TemplateElement")},pp$3$1.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===types$2.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(types$2.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(types$2.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,"TemplateLiteral")},pp$3$1.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===types$2.name||this.type===types$2.num||this.type===types$2.string||this.type===types$2.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===types$2.star)&&!lineBreak$1.test(this.input.slice(this.lastTokEnd,this.start))},pp$3$1.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(types$2.braceR);){if(r)r=!1;else if(this.expect(types$2.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(types$2.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,i,t),n.properties.push(s)}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")},pp$3$1.parseProperty=function(e,t){var n,r,i,s,o=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(types$2.ellipsis))return e?(o.argument=this.parseIdent(!1),this.type===types$2.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(o,"RestElement")):(this.type===types$2.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),o.argument=this.parseMaybeAssign(!1,t),this.type===types$2.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(o,"SpreadElement"));this.options.ecmaVersion>=6&&(o.method=!1,o.shorthand=!1,(e||t)&&(i=this.start,s=this.startLoc),e||(n=this.eat(types$2.star)));var a=this.containsEsc;return this.parsePropertyName(o),!e&&!a&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(o)?(r=!0,n=this.options.ecmaVersion>=9&&this.eat(types$2.star),this.parsePropertyName(o,t)):r=!1,this.parsePropertyValue(o,e,n,r,i,s,t,a),this.finishNode(o,"Property")},pp$3$1.parsePropertyValue=function(e,t,n,r,i,s,o,a){if((n||r)&&this.type===types$2.colon&&this.unexpected(),this.eat(types$2.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===types$2.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(n,r);else if(t||a||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===types$2.comma||this.type===types$2.braceR)this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=i),e.kind="init",t?e.value=this.parseMaybeDefault(i,s,e.key):this.type===types$2.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,s,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected();else{(n||r)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var c="get"===e.kind?0:1;if(e.value.params.length!==c){var l=e.value.start;"get"===e.kind?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}},pp$3$1.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(types$2.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(types$2.bracketR),e.key;e.computed=!1}return e.key=this.type===types$2.num||this.type===types$2.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},pp$3$1.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},pp$3$1.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(functionFlags$1(t,r.generator)|SCOPE_SUPER$1|(n?SCOPE_DIRECT_SUPER$1:0)),this.expect(types$2.parenL),r.params=this.parseBindingList(types$2.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(r,"FunctionExpression")},pp$3$1.parseArrowExpression=function(e,t,n){var r=this.yieldPos,i=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(functionFlags$1(n,!1)|SCOPE_ARROW$1),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=r,this.awaitPos=i,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")},pp$3$1.parseFunctionBody=function(e,t,n){var r=t&&this.type!==types$2.braceL,i=this.strict,s=!1;if(r)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);i&&!o||(s=this.strictDirective(this.end))&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var a=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(e,!i&&!s&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLVal(e.id,BIND_OUTSIDE$1),e.body=this.parseBlock(!1,void 0,s&&!i),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=a}this.exitScope()},pp$3$1.isSimpleParamList=function(e){for(var t=0,n=e;t-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&SCOPE_TOP$1&&delete this.undefinedExports[e]}else if(t===BIND_SIMPLE_CATCH$1){this.currentScope().lexical.push(e)}else if(t===BIND_FUNCTION$1){var s=this.currentScope();r=this.treatFunctionsAsVar?s.lexical.indexOf(e)>-1:s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var a=this.scopeStack[o];if(a.lexical.indexOf(e)>-1&&!(a.flags&SCOPE_SIMPLE_CATCH$1&&a.lexical[0]===e)||!this.treatFunctionsAsVarInScope(a)&&a.functions.indexOf(e)>-1){r=!0;break}if(a.var.push(e),this.inModule&&a.flags&SCOPE_TOP$1&&delete this.undefinedExports[e],a.flags&SCOPE_VAR$1)break}r&&this.raiseRecoverable(n,"Identifier '"+e+"' has already been declared")},pp$5$1.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},pp$5$1.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},pp$5$1.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&SCOPE_VAR$1)return t}},pp$5$1.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&SCOPE_VAR$1&&!(t.flags&SCOPE_ARROW$1))return t}};var Node$1=function(e,t,n){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new SourceLocation$1(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},pp$6$1=Parser$1.prototype;function finishNodeAt$1(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}pp$6$1.startNode=function(){return new Node$1(this,this.start,this.startLoc)},pp$6$1.startNodeAt=function(e,t){return new Node$1(this,e,t)},pp$6$1.finishNode=function(e,t){return finishNodeAt$1.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},pp$6$1.finishNodeAt=function(e,t,n,r){return finishNodeAt$1.call(this,e,t,n,r)};var TokContext$1=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},types$1$1={b_stat:new TokContext$1("{",!1),b_expr:new TokContext$1("{",!0),b_tmpl:new TokContext$1("${",!1),p_stat:new TokContext$1("(",!1),p_expr:new TokContext$1("(",!0),q_tmpl:new TokContext$1("`",!0,!0,(function(e){return e.tryReadTemplateToken()})),f_stat:new TokContext$1("function",!1),f_expr:new TokContext$1("function",!0),f_expr_gen:new TokContext$1("function",!0,!1,null,!0),f_gen:new TokContext$1("function",!1,!1,null,!0)},pp$7$1=Parser$1.prototype;pp$7$1.initialContext=function(){return[types$1$1.b_stat]},pp$7$1.braceIsBlock=function(e){var t=this.curContext();return t===types$1$1.f_expr||t===types$1$1.f_stat||(e!==types$2.colon||t!==types$1$1.b_stat&&t!==types$1$1.b_expr?e===types$2._return||e===types$2.name&&this.exprAllowed?lineBreak$1.test(this.input.slice(this.lastTokEnd,this.start)):e===types$2._else||e===types$2.semi||e===types$2.eof||e===types$2.parenR||e===types$2.arrow||(e===types$2.braceL?t===types$1$1.b_stat:e!==types$2._var&&e!==types$2._const&&e!==types$2.name&&!this.exprAllowed):!t.isExpr)},pp$7$1.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},pp$7$1.updateContext=function(e){var t,n=this.type;n.keyword&&e===types$2.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},types$2.parenR.updateContext=types$2.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===types$1$1.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},types$2.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?types$1$1.b_stat:types$1$1.b_expr),this.exprAllowed=!0},types$2.dollarBraceL.updateContext=function(){this.context.push(types$1$1.b_tmpl),this.exprAllowed=!0},types$2.parenL.updateContext=function(e){var t=e===types$2._if||e===types$2._for||e===types$2._with||e===types$2._while;this.context.push(t?types$1$1.p_stat:types$1$1.p_expr),this.exprAllowed=!0},types$2.incDec.updateContext=function(){},types$2._function.updateContext=types$2._class.updateContext=function(e){!e.beforeExpr||e===types$2.semi||e===types$2._else||e===types$2._return&&lineBreak$1.test(this.input.slice(this.lastTokEnd,this.start))||(e===types$2.colon||e===types$2.braceL)&&this.curContext()===types$1$1.b_stat?this.context.push(types$1$1.f_stat):this.context.push(types$1$1.f_expr),this.exprAllowed=!1},types$2.backQuote.updateContext=function(){this.curContext()===types$1$1.q_tmpl?this.context.pop():this.context.push(types$1$1.q_tmpl),this.exprAllowed=!1},types$2.star.updateContext=function(e){if(e===types$2._function){var t=this.context.length-1;this.context[t]===types$1$1.f_expr?this.context[t]=types$1$1.f_expr_gen:this.context[t]=types$1$1.f_gen}this.exprAllowed=!0},types$2.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==types$2.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var ecma9BinaryProperties$1="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",ecma10BinaryProperties$1=ecma9BinaryProperties$1+" Extended_Pictographic",ecma11BinaryProperties$1=ecma10BinaryProperties$1,unicodeBinaryProperties$1={9:ecma9BinaryProperties$1,10:ecma10BinaryProperties$1,11:ecma11BinaryProperties$1},unicodeGeneralCategoryValues$1="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",ecma9ScriptValues$1="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",ecma10ScriptValues$1=ecma9ScriptValues$1+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ecma11ScriptValues$1=ecma10ScriptValues$1+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",unicodeScriptValues$1={9:ecma9ScriptValues$1,10:ecma10ScriptValues$1,11:ecma11ScriptValues$1},data$1={};function buildUnicodeData$1(e){var t=data$1[e]={binary:wordsRegexp$1(unicodeBinaryProperties$1[e]+" "+unicodeGeneralCategoryValues$1),nonBinary:{General_Category:wordsRegexp$1(unicodeGeneralCategoryValues$1),Script:wordsRegexp$1(unicodeScriptValues$1[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}buildUnicodeData$1(9),buildUnicodeData$1(10),buildUnicodeData$1(11);var pp$8$1=Parser$1.prototype,RegExpValidationState$1=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=data$1[e.options.ecmaVersion>=11?11:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function codePointToString$2(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function isSyntaxCharacter$1(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function isRegExpIdentifierStart$1(e){return isIdentifierStart$1(e,!0)||36===e||95===e}function isRegExpIdentifierPart$1(e){return isIdentifierChar$1(e,!0)||36===e||95===e||8204===e||8205===e}function isControlLetter$1(e){return e>=65&&e<=90||e>=97&&e<=122}function isValidUnicode$1(e){return e>=0&&e<=1114111}function isCharacterClassEscape$1(e){return 100===e||68===e||115===e||83===e||119===e||87===e}function isUnicodePropertyNameCharacter$1(e){return isControlLetter$1(e)||95===e}function isUnicodePropertyValueCharacter$1(e){return isUnicodePropertyNameCharacter$1(e)||isDecimalDigit$1(e)}function isDecimalDigit$1(e){return e>=48&&e<=57}function isHexDigit$1(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function hexToInt$1(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function isOctalDigit$1(e){return e>=48&&e<=55}RegExpValidationState$1.prototype.reset=function(e,t,n){var r=-1!==n.indexOf("u");this.start=0|e,this.source=t+"",this.flags=n,this.switchU=r&&this.parser.options.ecmaVersion>=6,this.switchN=r&&this.parser.options.ecmaVersion>=9},RegExpValidationState$1.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},RegExpValidationState$1.prototype.at=function(e,t){void 0===t&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!t&&!this.switchU||i<=55295||i>=57344||e+1>=r)return i;var s=n.charCodeAt(e+1);return s>=56320&&s<=57343?(i<<10)+s-56613888:i},RegExpValidationState$1.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i,s=n.charCodeAt(e);return!t&&!this.switchU||s<=55295||s>=57344||e+1>=r||(i=n.charCodeAt(e+1))<56320||i>57343?e+1:e+2},RegExpValidationState$1.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},RegExpValidationState$1.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},RegExpValidationState$1.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},RegExpValidationState$1.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},pp$8$1.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=0;r-1&&this.raise(e.start,"Duplicate regular expression flag")}},pp$8$1.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},pp$8$1.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,n=e.backReferenceNames;t=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},pp$8$1.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},pp$8$1.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},pp$8$1.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return-1!==i&&i=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},pp$8$1.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},pp$8$1.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},pp$8$1.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!isSyntaxCharacter$1(t)&&(e.lastIntValue=t,e.advance(),!0)},pp$8$1.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;-1!==(n=e.current())&&!isSyntaxCharacter$1(n);)e.advance();return e.pos!==t},pp$8$1.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},pp$8$1.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e))return-1!==e.groupNames.indexOf(e.lastStringValue)&&e.raise("Duplicate capture group name"),void e.groupNames.push(e.lastStringValue);e.raise("Invalid group")}},pp$8$1.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},pp$8$1.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=codePointToString$2(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=codePointToString$2(e.lastIntValue);return!0}return!1},pp$8$1.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),92===r&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),isRegExpIdentifierStart$1(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)},pp$8$1.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),92===r&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),isRegExpIdentifierPart$1(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)},pp$8$1.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},pp$8$1.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},pp$8$1.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},pp$8$1.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},pp$8$1.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},pp$8$1.regexp_eatZero=function(e){return 48===e.current()&&!isDecimalDigit$1(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},pp$8$1.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},pp$8$1.regexp_eatControlLetter=function(e){var t=e.current();return!!isControlLetter$1(t)&&(e.lastIntValue=t%32,e.advance(),!0)},pp$8$1.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var s=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=1024*(i-55296)+(o-56320)+65536,!0}e.pos=s,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&isValidUnicode$1(e.lastIntValue))return!0;r&&e.raise("Invalid unicode escape"),e.pos=n}return!1},pp$8$1.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},pp$8$1.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1},pp$8$1.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(isCharacterClassEscape$1(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(80===t||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1},pp$8$1.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i),!0}return!1},pp$8$1.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){has$1(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(n)||e.raise("Invalid property value")},pp$8$1.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},pp$8$1.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";isUnicodePropertyNameCharacter$1(t=e.current());)e.lastStringValue+=codePointToString$2(t),e.advance();return""!==e.lastStringValue},pp$8$1.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";isUnicodePropertyValueCharacter$1(t=e.current());)e.lastStringValue+=codePointToString$2(t),e.advance();return""!==e.lastStringValue},pp$8$1.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},pp$8$1.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1},pp$8$1.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;!e.switchU||-1!==t&&-1!==n||e.raise("Invalid character class"),-1!==t&&-1!==n&&t>n&&e.raise("Range out of order in character class")}}},pp$8$1.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(99===n||isOctalDigit$1(n))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var r=e.current();return 93!==r&&(e.lastIntValue=r,e.advance(),!0)},pp$8$1.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},pp$8$1.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!isDecimalDigit$1(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},pp$8$1.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},pp$8$1.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;isDecimalDigit$1(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t},pp$8$1.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;isHexDigit$1(n=e.current());)e.lastIntValue=16*e.lastIntValue+hexToInt$1(n),e.advance();return e.pos!==t},pp$8$1.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*n+e.lastIntValue:e.lastIntValue=8*t+n}else e.lastIntValue=t;return!0}return!1},pp$8$1.regexp_eatOctalDigit=function(e){var t=e.current();return isOctalDigit$1(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},pp$8$1.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r>10),56320+(1023&e)))}pp$9$1.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Token$1(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},pp$9$1.getToken=function(){return this.next(),new Token$1(this)},"undefined"!=typeof Symbol&&(pp$9$1[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===types$2.eof,value:t}}}}),pp$9$1.curContext=function(){return this.context[this.context.length-1]},pp$9$1.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(types$2.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},pp$9$1.readToken=function(e){return isIdentifierStart$1(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},pp$9$1.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},pp$9$1.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),n=this.pos,r=this.input.indexOf("*/",this.pos+=2);if(-1===r&&this.raise(this.pos-2,"Unterminated comment"),this.pos=r+2,this.options.locations)for(lineBreakG$1.lastIndex=n;(e=lineBreakG$1.exec(this.input))&&e.index8&&e<14||e>=5760&&nonASCIIwhitespace$1.test(String.fromCharCode(e))))break e;++this.pos}}},pp$9$1.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},pp$9$1.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(types$2.ellipsis)):(++this.pos,this.finishToken(types$2.dot))},pp$9$1.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(types$2.assign,2):this.finishOp(types$2.slash,1)},pp$9$1.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=42===e?types$2.star:types$2.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++n,r=types$2.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(types$2.assign,n+1):this.finishOp(r,n)},pp$9$1.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.finishOp(124===e?types$2.logicalOR:types$2.logicalAND,2):61===t?this.finishOp(types$2.assign,2):this.finishOp(124===e?types$2.bitwiseOR:types$2.bitwiseAND,1)},pp$9$1.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(types$2.assign,2):this.finishOp(types$2.bitwiseXOR,1)},pp$9$1.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!lineBreak$1.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(types$2.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(types$2.assign,2):this.finishOp(types$2.plusMin,1)},pp$9$1.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+n)?this.finishOp(types$2.assign,n+1):this.finishOp(types$2.bitShift,n)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(n=2),this.finishOp(types$2.relational,n)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},pp$9$1.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(types$2.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(types$2.arrow)):this.finishOp(61===e?types$2.eq:types$2.prefix,1)},pp$9$1.readToken_question=function(){if(this.options.ecmaVersion>=11&&63===this.input.charCodeAt(this.pos+1))return this.finishOp(types$2.coalesce,2);return this.finishOp(types$2.question,1)},pp$9$1.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(types$2.parenL);case 41:return++this.pos,this.finishToken(types$2.parenR);case 59:return++this.pos,this.finishToken(types$2.semi);case 44:return++this.pos,this.finishToken(types$2.comma);case 91:return++this.pos,this.finishToken(types$2.bracketL);case 93:return++this.pos,this.finishToken(types$2.bracketR);case 123:return++this.pos,this.finishToken(types$2.braceL);case 125:return++this.pos,this.finishToken(types$2.braceR);case 58:return++this.pos,this.finishToken(types$2.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(types$2.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(types$2.prefix,1)}this.raise(this.pos,"Unexpected character '"+codePointToString$1$1(e)+"'")},pp$9$1.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},pp$9$1.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(lineBreak$1.test(r)&&this.raise(n,"Unterminated regular expression"),e)e=!1;else{if("["===r)t=!0;else if("]"===r&&t)t=!1;else if("/"===r&&!t)break;e="\\"===r}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var s=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(s);var a=this.regexpState||(this.regexpState=new RegExpValidationState$1(this));a.reset(n,i,o),this.validateRegExpFlags(a),this.validateRegExpPattern(a);var c=null;try{c=new RegExp(i,o)}catch(e){}return this.finishToken(types$2.regexp,{pattern:i,flags:o,value:c})},pp$9$1.readInt=function(e,t){for(var n=this.pos,r=0,i=0,s=null==t?1/0:t;i=97?o-97+10:o>=65?o-65+10:o>=48&&o<=57?o-48:1/0)>=e)break;++this.pos,r=r*e+a}return this.pos===n||null!=t&&this.pos-n!==t?null:r},pp$9$1.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return null==n&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(n="undefined"!=typeof BigInt?BigInt(this.input.slice(t,this.pos)):null,++this.pos):isIdentifierStart$1(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(types$2.num,n)},pp$9$1.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10)||this.raise(t,"Invalid number");var n=this.pos-t>=2&&48===this.input.charCodeAt(t);n&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&110===r){var i=this.input.slice(t,this.pos),s="undefined"!=typeof BigInt?BigInt(i):null;return++this.pos,isIdentifierStart$1(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(types$2.num,s)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),46!==r||n||(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),69!==r&&101!==r||n||(43!==(r=this.input.charCodeAt(++this.pos))&&45!==r||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),isIdentifierStart$1(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var o=this.input.slice(t,this.pos),a=n?parseInt(o,8):parseFloat(o);return this.finishToken(types$2.num,a)},pp$9$1.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},pp$9$1.readString=function(e){for(var t="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;92===r?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):(isNewLine$1(r,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(types$2.string,t)};var INVALID_TEMPLATE_ESCAPE_ERROR$1={};pp$9$1.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==INVALID_TEMPLATE_ESCAPE_ERROR$1)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},pp$9$1.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw INVALID_TEMPLATE_ESCAPE_ERROR$1;this.raise(e,t)},pp$9$1.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(96===n||36===n&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==types$2.template&&this.type!==types$2.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(types$2.template,e)):36===n?(this.pos+=2,this.finishToken(types$2.dollarBraceL)):(++this.pos,this.finishToken(types$2.backQuote));if(92===n)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(isNewLine$1(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},pp$9$1.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),"0"===r&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return isNewLine$1(t)?"":String.fromCharCode(t)}},pp$9$1.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return null===n&&this.invalidStringToken(t,"Bad character escape sequence"),n},pp$9$1.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos...",!0,!0),l={tc_oTag:o,tc_cTag:a,tc_expr:c},u={jsxName:new s("jsxName"),jsxText:new s("jsxText",{beforeExpr:!0}),jsxTagStart:new s("jsxTagStart"),jsxTagEnd:new s("jsxTagEnd")};u.jsxTagStart.updateContext=function(){this.context.push(c),this.context.push(o),this.exprAllowed=!1},u.jsxTagEnd.updateContext=function(e){let t=this.context.pop();t===o&&e===n.slash||t===a?(this.context.pop(),this.exprAllowed=this.curContext()===c):this.exprAllowed=!0},t={tokContexts:l,tokTypes:u},r.set(e,t)}return t}function s(e){return e?"JSXIdentifier"===e.type?e.name:"JSXNamespacedName"===e.type?e.namespace.name+":"+e.name.name:"JSXMemberExpression"===e.type?s(e.object)+"."+s(e.property):void 0:e}e.exports=function(e){return e=e||{},function(r){return function(e,r){const o=r.acorn||require$$0$1,a=i(o),c=o.tokTypes,l=a.tokTypes,u=o.tokContexts,p=a.tokContexts.tc_oTag,h=a.tokContexts.tc_cTag,d=a.tokContexts.tc_expr,f=o.isNewLine,m=o.isIdentifierStart,g=o.isIdentifierChar;return class extends r{static get acornJsx(){return a}jsx_readToken(){let e="",t=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");let n=this.input.charCodeAt(this.pos);switch(n){case 60:case 123:return this.pos===this.start?60===n&&this.exprAllowed?(++this.pos,this.finishToken(l.jsxTagStart)):this.getTokenFromCode(n):(e+=this.input.slice(t,this.pos),this.finishToken(l.jsxText,e));case 38:e+=this.input.slice(t,this.pos),e+=this.jsx_readEntity(),t=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(62===n?">":"}")+'` or `{"'+this.input[this.pos]+'"}`?');default:f(n)?(e+=this.input.slice(t,this.pos),e+=this.jsx_readNewLine(!0),t=this.pos):++this.pos}}}jsx_readNewLine(e){let t,n=this.input.charCodeAt(this.pos);return++this.pos,13===n&&10===this.input.charCodeAt(this.pos)?(++this.pos,t=e?"\n":"\r\n"):t=String.fromCharCode(n),this.options.locations&&(++this.curLine,this.lineStart=this.pos),t}jsx_readString(e){let t="",n=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let r=this.input.charCodeAt(this.pos);if(r===e)break;38===r?(t+=this.input.slice(n,this.pos),t+=this.jsx_readEntity(),n=this.pos):f(r)?(t+=this.input.slice(n,this.pos),t+=this.jsx_readNewLine(!1),n=this.pos):++this.pos}return t+=this.input.slice(n,this.pos++),this.finishToken(c.string,t)}jsx_readEntity(){let e,r="",i=0,s=this.input[this.pos];"&"!==s&&this.raise(this.pos,"Entity must start with an ampersand");let o=++this.pos;for(;this.pos")}let a=i.name?"Element":"Fragment";return n["opening"+a]=i,n["closing"+a]=o,n.children=r,this.type===c.relational&&"<"===this.value&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(n,"JSX"+a)}jsx_parseText(){let e=this.parseLiteral(this.value);return e.type="JSXText",e}jsx_parseElement(){let e=this.start,t=this.startLoc;return this.next(),this.jsx_parseElementAt(e,t)}parseExprAtom(e){return this.type===l.jsxText?this.jsx_parseText():this.type===l.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(e)}readToken(e){let t=this.curContext();if(t===d)return this.jsx_readToken();if(t===p||t===h){if(m(e))return this.jsx_readWord();if(62==e)return++this.pos,this.finishToken(l.jsxTagEnd);if((34===e||39===e)&&t==p)return this.jsx_readString(e)}return 60===e&&this.exprAllowed&&33!==this.input.charCodeAt(this.pos+1)?(++this.pos,this.finishToken(l.jsxTagStart)):super.readToken(e)}updateContext(e){if(this.type==c.braceL){var t=this.curContext();t==p?this.context.push(u.b_expr):t==d?this.context.push(u.b_tmpl):super.updateContext(e),this.exprAllowed=!0}else{if(this.type!==c.slash||e!==l.jsxTagStart)return super.updateContext(e);this.context.length-=2,this.context.push(h),this.exprAllowed=!1}}}}({allowNamespaces:!1!==e.allowNamespaces,allowNamespacedObjects:!!e.allowNamespacedObjects},r)}},Object.defineProperty(e.exports,"tokTypes",{get:function(){return i(require$$0$1).tokTypes},configurable:!0,enumerable:!0})}));function simple(e,t,n,r,i){n||(n=base$2),function e(r,i,s){var o=s||r.type,a=t[o];n[o](r,i,e),a&&a(r,i)}(e,r,i)}function ancestor(e,t,n,r,i){var s=[];n||(n=base$2),function e(r,i,o){var a=o||r.type,c=t[a],l=r!==s[s.length-1];l&&s.push(r),n[a](r,i,e),c&&c(r,i||s,s),l&&s.pop()}(e,r,i)}function recursive(e,t,n,r,i){var s=n?make(n,r||void 0):r;!function e(t,n,r){s[r||t.type](t,n,e)}(e,t,i)}function makeTest(e){return"string"==typeof e?function(t){return t===e}:e||function(){return!0}}var Found=function(e,t){this.node=e,this.state=t};function full(e,t,n,r,i){n||(n=base$2),function e(r,i,s){var o=s||r.type;n[o](r,i,e),s||t(r,i,o)}(e,r,i)}function fullAncestor(e,t,n,r){n||(n=base$2);var i=[];!function e(r,s,o){var a=o||r.type,c=r!==i[i.length-1];c&&i.push(r),n[a](r,s,e),o||t(r,s||i,i,a),c&&i.pop()}(e,r)}function findNodeAt(e,t,n,r,i,s){i||(i=base$2),r=makeTest(r);try{!function e(s,o,a){var c=a||s.type;if((null==t||s.start<=t)&&(null==n||s.end>=n)&&i[c](s,o,e),(null==t||s.start===t)&&(null==n||s.end===n)&&r(c,s))throw new Found(s,o)}(e,s)}catch(e){if(e instanceof Found)return e;throw e}}function findNodeAround(e,t,n,r,i){n=makeTest(n),r||(r=base$2);try{!function e(i,s,o){var a=o||i.type;if(!(i.start>t||i.end=t&&n(a,i))throw new Found(i,s);r[a](i,s,e)}}(e,i)}catch(e){if(e instanceof Found)return e;throw e}}function findNodeBefore(e,t,n,r,i){var s;return n=makeTest(n),r||(r=base$2),function e(i,o,a){if(!(i.start>t)){var c=a||i.type;i.end<=t&&(!s||s.node.end0&&(s+=";"),0!==a.length){for(var c=0,l=[],u=0,p=a;u1&&(d+=encodeInteger$1(h[1]-t)+encodeInteger$1(h[2]-n)+encodeInteger$1(h[3]-r),t=h[1],n=h[2],r=h[3]),5===h.length&&(d+=encodeInteger$1(h[4]-i),i=h[4]),l.push(d)}s+=l.join(",")}}return s}function encodeInteger$1(e){var t="";e=e<0?-e<<1|1:e<<1;do{var n=31&e;(e>>>=5)>0&&(n|=32),t+=chars$2[n]}while(e>0);return t}var BitSet$1=function e(t){this.bits=t instanceof e?t.bits.slice():[]};BitSet$1.prototype.add=function(e){this.bits[e>>5]|=1<<(31&e)},BitSet$1.prototype.has=function(e){return!!(this.bits[e>>5]&1<<(31&e))};var Chunk$2=function(e,t,n){this.start=e,this.end=t,this.original=n,this.intro="",this.outro="",this.content=n,this.storeName=!1,this.edited=!1,Object.defineProperties(this,{previous:{writable:!0,value:null},next:{writable:!0,value:null}})};Chunk$2.prototype.appendLeft=function(e){this.outro+=e},Chunk$2.prototype.appendRight=function(e){this.intro=this.intro+e},Chunk$2.prototype.clone=function(){var e=new Chunk$2(this.start,this.end,this.original);return e.intro=this.intro,e.outro=this.outro,e.content=this.content,e.storeName=this.storeName,e.edited=this.edited,e},Chunk$2.prototype.contains=function(e){return this.start=r.length)return"\t";var i=r.reduce((function(e,t){var n=/^ +/.exec(t)[0].length;return Math.min(n,e)}),1/0);return new Array(i+1).join(" ")}function getRelativePath$1(e,t){var n=e.split(/[/\\]/),r=t.split(/[/\\]/);for(n.pop();n[0]===r[0];)n.shift(),r.shift();if(n.length)for(var i=n.length;i--;)n[i]="..";return n.concat(r).join("/")}SourceMap$1.prototype.toString=function(){return JSON.stringify(this)},SourceMap$1.prototype.toUrl=function(){return"data:application/json;charset=utf-8;base64,"+btoa$2(this.toString())};var toString$3=Object.prototype.toString;function isObject$2(e){return"[object Object]"===toString$3.call(e)}function getLocator$2(e){for(var t=e.split("\n"),n=[],r=0,i=0;r>1;e=0&&i.push(r),this.rawSegments.push(i)}else this.pending&&this.rawSegments.push(this.pending);this.advance(t),this.pending=null},Mappings$1.prototype.addUneditedChunk=function(e,t,n,r,i){for(var s=t.start,o=!0;s1){for(var n=0;n=e&&n<=t)throw new Error("Cannot move a selection inside itself");this._split(e),this._split(t),this._split(n);var r=this.byStart[e],i=this.byEnd[t],s=r.previous,o=i.next,a=this.byStart[n];if(!a&&i===this.lastChunk)return this;var c=a?a.previous:this.lastChunk;return s&&(s.next=o),o&&(o.previous=s),c&&(c.next=r),a&&(a.previous=i),r.previous||(this.firstChunk=i.next),i.next||(this.lastChunk=r.previous,this.lastChunk.next=null),r.previous=c,i.next=a||null,c||(this.firstChunk=r),a||(this.lastChunk=i),this},MagicString$1.prototype.overwrite=function(e,t,n,r){if("string"!=typeof n)throw new TypeError("replacement content must be a string");for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;if(t>this.original.length)throw new Error("end is out of bounds");if(e===t)throw new Error("Cannot overwrite a zero-length range – use appendLeft or prependRight instead");this._split(e),this._split(t),!0===r&&(warned$1.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),warned$1.storeName=!0),r={storeName:!0});var i=void 0!==r&&r.storeName,s=void 0!==r&&r.contentOnly;if(i){var o=this.original.slice(e,t);this.storedNames[o]=!0}var a=this.byStart[e],c=this.byEnd[t];if(a){if(t>a.end&&a.next!==this.byStart[a.end])throw new Error("Cannot overwrite across a split point");if(a.edit(n,i,s),a!==c){for(var l=a.next;l!==c;)l.edit("",!1),l=l.next;l.edit("",!1)}}else{var u=new Chunk$2(e,t,"").edit(n,i);c.next=u,u.previous=c}return this},MagicString$1.prototype.prepend=function(e){if("string"!=typeof e)throw new TypeError("outro content must be a string");return this.intro=e+this.intro,this},MagicString$1.prototype.prependLeft=function(e,t){if("string"!=typeof t)throw new TypeError("inserted content must be a string");this._split(e);var n=this.byEnd[e];return n?n.prependLeft(t):this.intro=t+this.intro,this},MagicString$1.prototype.prependRight=function(e,t){if("string"!=typeof t)throw new TypeError("inserted content must be a string");this._split(e);var n=this.byStart[e];return n?n.prependRight(t):this.outro=t+this.outro,this},MagicString$1.prototype.remove=function(e,t){for(;e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;if(e===t)return this;if(e<0||t>this.original.length)throw new Error("Character is out of bounds");if(e>t)throw new Error("end must be greater than start");this._split(e),this._split(t);for(var n=this.byStart[e];n;)n.intro="",n.outro="",n.edit(""),n=t>n.end?this.byStart[n.end]:null;return this},MagicString$1.prototype.lastChar=function(){if(this.outro.length)return this.outro[this.outro.length-1];var e=this.lastChunk;do{if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1]}while(e=e.previous);return this.intro.length?this.intro[this.intro.length-1]:""},MagicString$1.prototype.lastLine=function(){var e=this.outro.lastIndexOf(n$1);if(-1!==e)return this.outro.substr(e+1);var t=this.outro,n=this.lastChunk;do{if(n.outro.length>0){if(-1!==(e=n.outro.lastIndexOf(n$1)))return n.outro.substr(e+1)+t;t=n.outro+t}if(n.content.length>0){if(-1!==(e=n.content.lastIndexOf(n$1)))return n.content.substr(e+1)+t;t=n.content+t}if(n.intro.length>0){if(-1!==(e=n.intro.lastIndexOf(n$1)))return n.intro.substr(e+1)+t;t=n.intro+t}}while(n=n.previous);return-1!==(e=this.intro.lastIndexOf(n$1))?this.intro.substr(e+1)+t:this.intro+t},MagicString$1.prototype.slice=function(e,t){for(void 0===e&&(e=0),void 0===t&&(t=this.original.length);e<0;)e+=this.original.length;for(;t<0;)t+=this.original.length;for(var n="",r=this.firstChunk;r&&(r.start>e||r.end<=e);){if(r.start=t)return n;r=r.next}if(r&&r.edited&&r.start!==e)throw new Error("Cannot use replaced character "+e+" as slice start anchor.");for(var i=r;r;){!r.intro||i===r&&r.start!==e||(n+=r.intro);var s=r.start=t;if(s&&r.edited&&r.end!==t)throw new Error("Cannot use replaced character "+t+" as slice end anchor.");var o=i===r?e-r.start:0,a=s?r.content.length+t-r.end:r.content.length;if(n+=r.content.slice(o,a),!r.outro||s&&r.end!==t||(n+=r.outro),s)break;r=r.next}return n},MagicString$1.prototype.snip=function(e,t){var n=this.clone();return n.remove(0,e),n.remove(t,n.original.length),n},MagicString$1.prototype._split=function(e){if(!this.byStart[e]&&!this.byEnd[e])for(var t=this.lastSearchedChunk,n=e>t.end;t;){if(t.contains(e))return this._splitChunk(t,e);t=n?this.byStart[t.end]:this.byEnd[t.start]}},MagicString$1.prototype._splitChunk=function(e,t){if(e.edited&&e.content.length){var n=getLocator$2(this.original)(t);throw new Error("Cannot split a chunk that has already been edited ("+n.line+":"+n.column+' – "'+e.original+'")')}var r=e.split(t);return this.byEnd[t]=e,this.byStart[t]=r,this.byEnd[r.end]=r,e===this.lastChunk&&(this.lastChunk=r),this.lastSearchedChunk=e,!0},MagicString$1.prototype.toString=function(){for(var e=this.intro,t=this.firstChunk;t;)e+=t.toString(),t=t.next;return e+this.outro},MagicString$1.prototype.isEmpty=function(){var e=this.firstChunk;do{if(e.intro.length&&e.intro.trim()||e.content.length&&e.content.trim()||e.outro.length&&e.outro.trim())return!1}while(e=e.next);return!0},MagicString$1.prototype.length=function(){var e=this.firstChunk,t=0;do{t+=e.intro.length+e.content.length+e.outro.length}while(e=e.next);return t},MagicString$1.prototype.trimLines=function(){return this.trim("[\\r\\n]")},MagicString$1.prototype.trim=function(e){return this.trimStart(e).trimEnd(e)},MagicString$1.prototype.trimEndAborted=function(e){var t=new RegExp((e||"\\s")+"+$");if(this.outro=this.outro.replace(t,""),this.outro.length)return!0;var n=this.lastChunk;do{var r=n.end,i=n.trimEnd(t);if(n.end!==r&&(this.lastChunk===n&&(this.lastChunk=n.next),this.byEnd[n.end]=n,this.byStart[n.next.start]=n.next,this.byEnd[n.next.end]=n.next),i)return!0;n=n.previous}while(n);return!1},MagicString$1.prototype.trimEnd=function(e){return this.trimEndAborted(e),this},MagicString$1.prototype.trimStartAborted=function(e){var t=new RegExp("^"+(e||"\\s")+"+");if(this.intro=this.intro.replace(t,""),this.intro.length)return!0;var n=this.firstChunk;do{var r=n.end,i=n.trimStart(t);if(n.end!==r&&(n===this.lastChunk&&(this.lastChunk=n.next),this.byEnd[n.end]=n,this.byStart[n.next.start]=n.next,this.byEnd[n.next.end]=n.next),i)return!0;n=n.next}while(n);return!1},MagicString$1.prototype.trimStart=function(e){return this.trimStartAborted(e),this};const cjsDefault=e=>"default"in e?e.default:e,walk$2=cjsDefault(acornWalk);function codegen(e){if(null==e)return"";switch(e.type){case"Expression":return codegen(e.expression);case"SequenceExpression":return e.expressions.map(codegen).join(",");case"IfStatement":return`if(${codegen(e.condition)})${codegen(e.block)}`;case"BlockStatement":return`{${e.body.map(codegen).join(";")}}`;case"MemberExpression":return e.computed?codegen(e.object)+"["+codegen(e.property)+"]":codegen(e.object)+"."+codegen(e.property);case"Identifier":return e.name;case"NumberLiteral":case"BooleanLiteral":case"RegexpLiteral":return e.value;case"StringLiteral":return`'${e.value.replace(/'/g,"\\'")}'`;case"TaggedTemplate":return codegen(e.tag)+codegen(e.template);case"TemplateLiteral":return"`"+e.quasis.reduce((t,n,r)=>t+n.value.raw+codegen(e.expressions[r]))+"`";case"VariableDeclaration":return e.type+" "+e.declarators.map(codegen).join(",");case"VariableDeclarator":return codegen(e.id)+(e.init?"="+codegen(e.init):"")}}function template(e){return e=String(e),t=>template.ast(e.replace(/[A-Z0-9]+/g,e=>codegen(t[e])))}function def(e,t,n){Object.defineProperty(e,t,{value:n})}cjsDefault(jsxWalk).extend(walk$2.base),template.ast=function(e,t){Array.isArray(e)&&(e=e.reduce((e,n,r)=>e+n+(r===t.length?"":t[r]),""));const n=this.ctx;if(!n)throw Error("template.ast() called without a parsing context.");return n.parse(e,{expression:!0})};class Path{constructor(e,t,n){this.node=e,this.ancestors=t,this.ctx=n,this.shouldStop=!1,def(this,"ancestors",t),def(this,"ctx",n),def(this,"shouldStop",!1),this.key=this.parentKey=null;const r=this.parent;for(const t in r)if(r[t]===e){this.key=this.parentKey=t;break}}get parentPath(){const e=this.ancestors.slice(),t=e.pop();return new Path(t,e,this.ctx)}get parent(){return this.ancestors[this.ancestors.length-1]}forEach(e){(Array.isArray(this.node)?this.node:[this.node]).forEach(t=>{e(new Path(t,this.ancestors.slice(),this.ctx))})}get(e){const t=this.ancestors.slice();let n,r=this.node;const i=/(?:(?:\.|^)([^.[]+)|\[([^[\]]+)\])/g;for(;n=i.exec(e);){const e=r;r=r[n[1]||n[2]],Array.isArray(r)||t.push(e)}return new Path(r,t,this.ctx)}replaceWith(e){this.node=e,this.parent[this.parentKey]=this.node,this.replaceWithString(codegen(e))}replaceWithString(e){this.ctx.out.overwrite(this.node.start,this.node.end,e)}prependString(e){this.ctx.out.appendLeft(this.node.start,e)}appendString(e){this.ctx.out.appendRight(this.node.end,e)}stop(){this.shouldStop=!0}getSource(){return this.ctx.code.substring(this.node.start,this.node.end)}}const types$3=new Proxy({identifier:e=>({type:"Identifier",name:e}),stringLiteral:e=>({type:"StringLiteral",name:e}),booleanLiteral:e=>({type:"BooleanLiteral",name:e}),numericLiteral:e=>({type:"NumericLiteral",name:e}),expressionStatement:e=>({type:"ExpressionStatement",expression:e})},{get(e,t){if(Reflect.hasOwnProperty(e,t))return e[t];if("string"!=typeof t)return;if(t.startsWith("is")){const n=t.substring(2);return e[t]=e=>{if(null==e)return!1;return("node"in e?e.node:e).type===n},e[t]}const n=t[0].toUpperCase()+t.substring(1),r=/Literal/.test(t)?"value":"expression";return e[t]=e=>({type:n,[r]:e}),e[t]}});function visit$1(e,t,n){const{ctx:r}=this,i=[];let s;for(walk$2.fullAncestor(e,(e,n,s)=>{if(s=s.slice(0,-1),e.type in t){const o=new r.Path(e,s);let a=t[e.type];if("object"==typeof a&&("enter"in a||"exit"in a)&&(a.exit&&i.push([a.exit,e,n,s]),a=a.enter),a&&a(o,n),o.shouldStop)return!1}},walk$2.base,n);s=i.pop();){const[e,t,n,i]=s;e(new r.Path(t,i),n)}}function createContext({code:e,out:t,parse:n}){const r={code:e,out:t,parse:n,types:types$3,visit:visit$1,template,Path},i={ctx:r};return r.visit=r.visit.bind(i),r.template=template.bind(i),r.template.ast=template.ast.bind(i),r.Path=function(e,t){return new Path(e,t,r)},r}const DEFAULTS={parse(){throw Error("options.parse() is required")},sourceMaps:!1};function transform$1(e,{presets:t,plugins:n,parse:r,filename:i,ast:s,sourceMaps:o,sourceFileName:a}={}){r=r||DEFAULTS.parse;const c=new MagicString$1(e),{types:l,template:u,visit:p}=createContext({code:e,out:c,parse:r}),h=[];resolvePreset({presets:t,plugins:n},h);const d={};for(let e=0;ee.replace(/^(\t+)/,(e,t)=>" ".repeat(t.length));function codeFrame(e,t){const{line:n,column:r}=t,i=e.split("\n"),s=String(n).length+2,o=e=>String(e).padStart(s);let a="";n>1&&(a+=`\n${o(n-2)} | ${normalize$1(i[n-2])}`),a+=`\n${o(n-1)} | ${normalize$1(i[n-1])}`;const c=(i[n-1].match(/^\t+/)||[]).length;return a+=`\n${"-".repeat(s+3+r+c)}^`,n/(^[A-Z]|[.$])/.test(e),r=t=>!e.isJSXElement(t.parentPath.parent);return{name:"transform-jsx-to-htm",visitor:{Program:{exit(e,t){if(t.jsx){const n=t.opts||{},r=n.lib||"htm/preact";let i=n.import||"html";n.importAs&&n.importAs!==i&&(i+=" as "+n.importAs),e.get("body").prependString(`import { ${i} } from ${JSON.stringify(r)};\n`)}}},JSXOpeningElement(t,i){const{node:s}=t;i.jsx=!0;let o="<",a=t.get("name").getSource();n(a)&&(a="${"+a+"}"),o+=a,t.get("attributes").forEach(t=>{if(o+=" ",e.isJSXSpreadAttribute(t)&&(o+="..."),o+=t.get("name").getSource(),t.node.value&&!0!==t.node.value.value){o+="=";const n=t.get("value").getSource();e.isLiteral(t.node.value)||(o+="$"),o+=n}}),s.selfClosing&&(o+=" /"),o+=">",r(t)&&(o="html`"+o,s.selfClosing&&(o+="`")),t.replaceWithString(o)},JSXClosingElement(e){const{node:t}=e;let i=t.name.name;n(i)&&(i="/");let s=``;r(e)&&(s+="`"),e.replaceWithString(s)},JSXExpressionContainer(e){e.prependString("$")},JSXText(e){e.replaceWithString(e.node.value)}}}}function htmPlugin({include:e}={}){return{name:"htm-plugin",options:e=>(e.acornInjectPlugins=[acornJsx()].concat(e.acornInjectPlugins||[]),e),transform(t,n){if("\0"===n[0])return;if(e){if(!("function"==typeof e?e(n):n.match(e)))return}const r=Date.now(),i=transform$1(t,{plugins:[transformJsxToHtm],filename:n,sourceMaps:!0,parse:this.parse}),s=Date.now();return s-r>50&&this.warn(`${n} took ${s-r}ms`),i}}}const PREFRESH="\nimport '@prefresh/core';\nif (import.meta.hot) {\n let a=0, m=import(import.meta.url);\n import.meta.hot.accept(async ({module}) => {\n m = await m;\n try {\n if (!a++) for (let i in module) self.__PREFRESH__.replaceComponent(m[i], module[i]);\n } catch (e) {\n import.meta.hot.invalidate();\n throw e;\n }\n });\n}\n",wmrClientPromise=Promise.resolve("function log(...args) {\n\tconsole.info('[wmr] ', ...args);\n}\n\nconst strip = url => url.replace(/\\?t=\\d+/g, '');\n\nconst resolve = url => new URL(url, location.origin).href;\n\nlet ws;\nfunction connect() {\n\t// Pared-down inline version of https://github.com/lukeed/sockette <3\n\tws = new WebSocket(location.origin.replace('http', 'ws') + '/_hmr');\n\tws.onmessage = handleMessage;\n\tws.onerror = handleError;\n\t// ws.onopen = () => log('connected');\n\t// ws.onclose = () => log('disconnected');\n}\n\nsetTimeout(connect);\n\nlet errorCount = 0;\n\nfunction handleMessage(e) {\n\tconst data = JSON.parse(e.data);\n\tswitch (data.type) {\n\t\tcase 'update':\n\t\t\tdata.changes.forEach(url => {\n\t\t\t\turl = resolve(url);\n\n\t\t\t\tif (!mods.get(url)) {\n\t\t\t\t\tconst isCss = /\\.css$/.test(url);\n\t\t\t\t\tif (isCss && mods.has(url + '.js')) {\n\t\t\t\t\t\turl += '.js';\n\t\t\t\t\t} else if (isCss && updateStyleSheet(url)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn location.reload();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// ignore already-pending updates (but not in-flight updates):\n\t\t\t\tif (updateQueue.indexOf(url) < 1) {\n\t\t\t\t\tupdateQueue.push(url);\n\t\t\t\t}\n\t\t\t\tconst errorId = errorCount;\n\t\t\t\tif (!updating)\n\t\t\t\t\tdequeue().then(() => {\n\t\t\t\t\t\tif (errorId === errorCount) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t// console.clear();\n\t\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'error':\n\t\t\terrorCount++;\n\t\t\tconsole.error(data.error);\n\t\t\t// if (typeof data.error === 'string') {\n\t\t\t// \tlet err = data.error.replace(/ \\(([^(]+):(\\d+):(\\d+)\\)/, (s, file, line, col) => {\n\t\t\t// \t\treturn ` (${file}:${line}:${col})`;\n\t\t\t// \t});\n\t\t\t// \tconsole.error(err);\n\t\t\t// } else {\n\t\t\t// \tconsole.error(data.error);\n\t\t\t// }\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tlog('unknown message: ', data);\n\t}\n}\n\nfunction handleError(e) {\n\tif (e && e.code === 'ECONNREFUSED') {\n\t\tsetTimeout(connect, 1000);\n\t}\n\tlog('connection error');\n}\n\n// HMR updates are queued uniquely and run in sequence\nconst updateQueue = [];\nlet updating = false;\nfunction dequeue() {\n\tupdating = updateQueue.length !== 0;\n\treturn updating && update(updateQueue.shift()).then(dequeue, dequeue);\n}\nfunction update(url) {\n\tconst mod = getMod(url);\n\tconst dispose = Array.from(mod.dispose);\n\tconst accept = Array.from(mod.accept);\n\tconst newUrl = url + '?t=' + Date.now();\n\tconst p = mod.import ? mod.import(newUrl) : import(newUrl);\n\treturn p.then(m => {\n\t\taccept.forEach(c => (c({ module: m }), mod.accept.delete(c)));\n\t\tdispose.forEach(c => (c(), mod.dispose.delete(c)));\n\t\t// accept.forEach(c => c({ module: m }));\n\t\t// dispose.forEach(c => c());\n\t});\n}\n\nconst mods = new Map();\nfunction getMod(url) {\n\turl = strip(url);\n\tlet mod = mods.get(url);\n\tif (!mod) mods.set(url, (mod = { accept: new Set(), dispose: new Set() }));\n\treturn mod;\n}\n\n// HMR API\nexport function createHotContext(url) {\n\tconst mod = getMod(url);\n\treturn {\n\t\taccept(fn) {\n\t\t\tmod.accept.add(fn);\n\t\t},\n\t\tdispose(fn) {\n\t\t\tmod.dispose.add(fn);\n\t\t},\n\t\tinvalidate() {\n\t\t\tlocation.reload();\n\t\t}\n\t};\n}\n\n// CSS HMR API (for sheets imported via proxy modules)\nconst styles = new Map();\nexport function style(filename, id) {\n\tid = resolve(id || filename);\n\tlet node = styles.get(id);\n\tif (node) {\n\t\tnode.href = filename;\n\t} else {\n\t\tconst node = document.createElement('link');\n\t\tnode.rel = 'stylesheet';\n\t\tnode.href = filename;\n\t\tdocument.head.appendChild(node);\n\t\tstyles.set(id, node);\n\t}\n}\n\n// Update a non-imported stylesheet\nfunction updateStyleSheet(url) {\n\tconst sheets = document.styleSheets;\n\tfor (let i = 0; i < sheets.length; i++) {\n\t\tif (strip(sheets[i].href) === url) {\n\t\t\tsheets[i].ownerNode.href = strip(url) + '?t=' + Date.now();\n\t\t\treturn true;\n\t\t}\n\t}\n}\n"),wmrProdClientPromise=Promise.resolve("export function createHotContext() {}\n\nexport function style(filename) {\n\tconst node = document.createElement('link');\n\tnode.rel = 'stylesheet';\n\tnode.href = filename;\n\tdocument.head.appendChild(node);\n}\n");function getWmrClient({hot:e=!0}={}){return e?wmrClientPromise:wmrProdClientPromise}function wmrPlugin({hot:e=!0}={}){return{name:"wmr",resolveId(e){if("wmr"==e)return"\0wmr.js"},load(t){if("\0wmr.js"==t)return getWmrClient({hot:e})},resolveImportMeta:e=>"hot"===e?"$IMPORT_META_HOT$":null,transform(t,n){let r=/(import\.meta\.hot|\$IMPORT_META_HOT\$)/.test(t),i="",s="";if(t.match(/module\.hot/)&&(r=!0,i+="const module={hot:import.meta.hot};\n"),t.match(/<\/([a-z][a-z0-9.:-]*)?>/i)&&(r=!0,s+="\n"+PREFRESH),!r)return null;const o=new MagicString$1(t,{filename:n,indentExclusionRanges:void 0});return e?(o.append(s),o.prepend("import { createHotContext as $createHotContext$ } from 'wmr';const $IMPORT_META_HOT$ = $createHotContext$(import.meta.url);"+i)):o.prepend("const $IMPORT_META_HOT$ = null;"+i),{code:o.toString(),map:o.generateMap({includeContent:!1})}}}}function wmrStylesPlugin({cwd:e,hot:t}={}){const n=new Set;return{name:"wmr-styles",options:e=>(n.clear(),forEachInput(e.input,e=>{const t=path$n.resolve(".",e);n.add(path$n.dirname(t))}),e),async load(n){if(!n.match(/\.css$/))return;const r=path$n.relative(e||"",path$n.resolve(e,n));let i=await fs$n.promises.readFile(n,"utf-8"),s=[];if(n.match(/\.module\.css$/)){const e="_"+hash(r);i=i.replace(/\.([a-z0-9_-]+)/gi,(t,n)=>{const r=n+e,i=/^\d|[^a-z0-9_$]/gi.test(n)?"'":"";return s.push(`${i+n+i}:'${r}'`),"."+r})}return{code:`\n\t\t\t\timport { style } from 'wmr';\n\t\t\t\tstyle(import.meta.ROLLUP_FILE_URL_${this.emitFile({type:"asset",name:path$n.basename(n),source:i})}, ${JSON.stringify(r)});\n\n\t\t\t\t${t&&"\n\t\t\t\t\timport.meta.hot.accept(({ module: { default: s } }) => {\n\t\t\t\t\t\tfor (let i in s) styles[i] = s[i];\n\t\t\t\t\t});\n\t\t\t\t"}\n\n\t\t\t\tconst styles = {${s.join(",")}};\n\t\t\t\texport default styles;\n\t\t\t`.replace(/^\s+/gm,""),moduleSideEffects:!0,syntheticNamedExports:!0}}}}function multiRelative(e,t){let n;return e.forEach(e=>{const r=path$n.relative(e,t);(!n||r.length>>0).toString(36)}function localNpmPlugin({publicPath:e="/@npm"}={}){return{name:"localNpmPlugin",options:t=>(t.external=[new RegExp("^"+e.replace(/([[\]()-.*+])/g,"\\$1"))].concat(t.external||[]),t),outputOptions(t){const n=t.paths;return t.paths=t=>t.startsWith(e)?t:n?"function"==typeof n?n(t):n[t]:void 0,t},resolveId(t){if(!t.match(/^\.?\//))return{id:`${e}/${t}`,external:!0,moduleSideEffects:!0}}}}var intToCharMap="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),encode$2=function(e){if(0<=e&&e>1;return 1==(1&e)?-t:t}var encode$3=function(e){var t,n="",r=toVLQSigned(e);do{t=r&VLQ_BASE_MASK,(r>>>=VLQ_BASE_SHIFT)>0&&(t|=VLQ_CONTINUATION_BIT),n+=base64.encode(t)}while(r>0);return n},decode$2=function(e,t,n){var r,i,s=e.length,o=0,a=0;do{if(t>=s)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(i=base64.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));r=!!(i&VLQ_CONTINUATION_BIT),o+=(i&=VLQ_BASE_MASK)<=0;u--)"."===(o=c[u])?c.splice(u,1):".."===o?l++:l>0&&(""===o?(c.splice(u+1,l),l=0):(c.splice(u,2),l--));return""===(n=c.join("/"))&&(n=a?"/":"."),r?(r.path=n,s(r)):n}function a(e,t){""===e&&(e="."),""===t&&(t=".");var n=i(t),a=i(e);if(a&&(e=a.path||"/"),n&&!n.scheme)return a&&(n.scheme=a.scheme),s(n);if(n||t.match(r))return t;if(a&&!a.host&&!a.path)return a.host=t,s(a);var c="/"===t.charAt(0)?t:o(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=c,s(a)):c}t.urlParse=i,t.urlGenerate=s,t.normalize=o,t.join=a,t.isAbsolute=function(e){return"/"===e.charAt(0)||n.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var c=!("__proto__"in Object.create(null));function l(e){return e}function u(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function p(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=c?l:function(e){return u(e)?"$"+e:e},t.fromSetString=c?l:function(e){return u(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var r=p(e.source,t.source);return 0!==r||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)||n||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=e.generatedLine-t.generatedLine)?r:p(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r||0!==(r=e.generatedColumn-t.generatedColumn)||n||0!==(r=p(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:p(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=p(e.source,t.source))||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:p(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var r=i(n);if(!r)throw new Error("sourceMapURL could not be parsed");if(r.path){var c=r.path.lastIndexOf("/");c>=0&&(r.path=r.path.substring(0,c+1))}t=a(s(r),t)}return o(t)}})),has$2=Object.prototype.hasOwnProperty,hasNativeMap="undefined"!=typeof Map;function ArraySet(){this._array=[],this._set=hasNativeMap?new Map:Object.create(null)}ArraySet.fromArray=function(e,t){for(var n=new ArraySet,r=0,i=e.length;r=0)return t}else{var n=util.toSetString(e);if(has$2.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},ArraySet.prototype.at=function(e){if(e>=0&&en||r==n&&s>=i||util.compareByGeneratedPositionsInflated(e,t)<=0}function MappingList(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},MappingList.prototype.add=function(e){generatedPositionAfter(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},MappingList.prototype.toArray=function(){return this._sorted||(this._array.sort(util.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};var MappingList_1=MappingList,mappingList={MappingList:MappingList_1},ArraySet$1=arraySet.ArraySet,MappingList$1=mappingList.MappingList;function SourceMapGenerator(e){e||(e={}),this._file=util.getArg(e,"file",null),this._sourceRoot=util.getArg(e,"sourceRoot",null),this._skipValidation=util.getArg(e,"skipValidation",!1),this._sources=new ArraySet$1,this._names=new ArraySet$1,this._mappings=new MappingList$1,this._sourcesContents=null}SourceMapGenerator.prototype._version=3,SourceMapGenerator.fromSourceMap=function(e){var t=e.sourceRoot,n=new SourceMapGenerator({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var r={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,null!=t&&(r.source=util.relative(t,r.source)),r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),n.addMapping(r)})),e.sources.forEach((function(r){var i=r;null!==t&&(i=util.relative(t,r)),n._sources.has(i)||n._sources.add(i);var s=e.sourceContentFor(r);null!=s&&n.setSourceContent(r,s)})),n},SourceMapGenerator.prototype.addMapping=function(e){var t=util.getArg(e,"generated"),n=util.getArg(e,"original",null),r=util.getArg(e,"source",null),i=util.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,r,i),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=i&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:r,name:i})},SourceMapGenerator.prototype.setSourceContent=function(e,t){var n=e;null!=this._sourceRoot&&(n=util.relative(this._sourceRoot,n)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[util.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[util.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},SourceMapGenerator.prototype.applySourceMap=function(e,t,n){var r=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}var i=this._sourceRoot;null!=i&&(r=util.relative(i,r));var s=new ArraySet$1,o=new ArraySet$1;this._mappings.unsortedForEach((function(t){if(t.source===r&&null!=t.originalLine){var a=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=a.source&&(t.source=a.source,null!=n&&(t.source=util.join(n,t.source)),null!=i&&(t.source=util.relative(i,t.source)),t.originalLine=a.line,t.originalColumn=a.column,null!=a.name&&(t.name=a.name))}var c=t.source;null==c||s.has(c)||s.add(c);var l=t.name;null==l||o.has(l)||o.add(l)}),this),this._sources=s,this._names=o,e.sources.forEach((function(t){var r=e.sourceContentFor(t);null!=r&&(null!=n&&(t=util.join(n,t)),null!=i&&(t=util.relative(i,t)),this.setSourceContent(t,r))}),this)},SourceMapGenerator.prototype._validateMapping=function(e,t,n,r){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},SourceMapGenerator.prototype._serializeMappings=function(){for(var e,t,n,r,i=0,s=1,o=0,a=0,c=0,l=0,u="",p=this._mappings.toArray(),h=0,d=p.length;h0){if(!util.compareByGeneratedPositionsInflated(t,p[h-1]))continue;e+=","}e+=base64Vlq.encode(t.generatedColumn-i),i=t.generatedColumn,null!=t.source&&(r=this._sources.indexOf(t.source),e+=base64Vlq.encode(r-l),l=r,e+=base64Vlq.encode(t.originalLine-1-a),a=t.originalLine-1,e+=base64Vlq.encode(t.originalColumn-o),o=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=base64Vlq.encode(n-c),c=n)),u+=e}return u},SourceMapGenerator.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=util.relative(t,e));var n=util.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)},SourceMapGenerator.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},SourceMapGenerator.prototype.toString=function(){return JSON.stringify(this.toJSON())};var SourceMapGenerator_1=SourceMapGenerator,sourceMapGenerator={SourceMapGenerator:SourceMapGenerator_1},binarySearch=createCommonjsModule$1((function(e,t){t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,n,r,i){if(0===n.length)return-1;var s=function e(n,r,i,s,o,a){var c=Math.floor((r-n)/2)+n,l=o(i,s[c],!0);return 0===l?c:l>0?r-c>1?e(c,r,i,s,o,a):a==t.LEAST_UPPER_BOUND?r1?e(n,c,i,s,o,a):a==t.LEAST_UPPER_BOUND?c:n<0?-1:n}(-1,n.length,e,n,r,i||t.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===r(n[s],n[s-1],!0);)--s;return s}}));function swap(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function randomIntInRange(e,t){return Math.round(e+Math.random()*(t-e))}function doQuickSort(e,t,n,r){if(n=0){var s=this._originalMappings[i];if(void 0===e.column)for(var o=s.originalLine;s&&s.originalLine===o;)r.push({line:util.getArg(s,"generatedLine",null),column:util.getArg(s,"generatedColumn",null),lastColumn:util.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var a=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==a;)r.push({line:util.getArg(s,"generatedLine",null),column:util.getArg(s,"generatedColumn",null),lastColumn:util.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return r};var SourceMapConsumer_1=SourceMapConsumer;function BasicSourceMapConsumer(e,t){var n=e;"string"==typeof e&&(n=util.parseSourceMapInput(e));var r=util.getArg(n,"version"),i=util.getArg(n,"sources"),s=util.getArg(n,"names",[]),o=util.getArg(n,"sourceRoot",null),a=util.getArg(n,"sourcesContent",null),c=util.getArg(n,"mappings"),l=util.getArg(n,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);o&&(o=util.normalize(o)),i=i.map(String).map(util.normalize).map((function(e){return o&&util.isAbsolute(o)&&util.isAbsolute(e)?util.relative(o,e):e})),this._names=ArraySet$2.fromArray(s.map(String),!0),this._sources=ArraySet$2.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map((function(e){return util.computeSourceURL(o,e,t)})),this.sourceRoot=o,this.sourcesContent=a,this._mappings=c,this._sourceMapURL=t,this.file=l}function Mapping(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}BasicSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype),BasicSourceMapConsumer.prototype.consumer=SourceMapConsumer,BasicSourceMapConsumer.prototype._findSourceIndex=function(e){var t,n=e;if(null!=this.sourceRoot&&(n=util.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);for(t=0;t1&&(n.source=p+i[1],p+=i[1],n.originalLine=l+i[2],l=n.originalLine,n.originalLine+=1,n.originalColumn=u+i[3],u=n.originalColumn,i.length>4&&(n.name=h+i[4],h+=i[4])),E.push(n),"number"==typeof n.originalLine&&_.push(n)}quickSort$1(E,util.compareByGeneratedPositionsDeflated),this.__generatedMappings=E,quickSort$1(_,util.compareByOriginalPositions),this.__originalMappings=_},BasicSourceMapConsumer.prototype._findMapping=function(e,t,n,r,i,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return binarySearch.search(e,t,i,s)},BasicSourceMapConsumer.prototype.computeColumnSpans=function(){for(var e=0;e=0){var r=this._generatedMappings[n];if(r.generatedLine===t.generatedLine){var i=util.getArg(r,"source",null);null!==i&&(i=this._sources.at(i),i=util.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=util.getArg(r,"name",null);return null!==s&&(s=this._names.at(s)),{source:i,line:util.getArg(r,"originalLine",null),column:util.getArg(r,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},BasicSourceMapConsumer.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return null==e})))},BasicSourceMapConsumer.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var r,i=e;if(null!=this.sourceRoot&&(i=util.relative(this.sourceRoot,i)),null!=this.sourceRoot&&(r=util.urlParse(this.sourceRoot))){var s=i.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!r.path||"/"==r.path)&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(t)return null;throw new Error('"'+i+'" is not in the SourceMap.')},BasicSourceMapConsumer.prototype.generatedPositionFor=function(e){var t=util.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:util.getArg(e,"line"),originalColumn:util.getArg(e,"column")},r=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",util.compareByOriginalPositions,util.getArg(e,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(r>=0){var i=this._originalMappings[r];if(i.source===n.source)return{line:util.getArg(i,"generatedLine",null),column:util.getArg(i,"generatedColumn",null),lastColumn:util.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};var BasicSourceMapConsumer_1=BasicSourceMapConsumer;function IndexedSourceMapConsumer(e,t){var n=e;"string"==typeof e&&(n=util.parseSourceMapInput(e));var r=util.getArg(n,"version"),i=util.getArg(n,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new ArraySet$2,this._names=new ArraySet$2;var s={line:-1,column:0};this._sections=i.map((function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=util.getArg(e,"offset"),r=util.getArg(n,"line"),i=util.getArg(n,"column");if(r=0;t--)this.prepend(e[t]);else{if(!e[isSourceNode]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},SourceNode.prototype.walk=function(e){for(var t,n=0,r=this.children.length;n0){for(t=[],n=0;n5&&t<2015&&(t+=2009),r[n]=t}else r[n]=e&&y(e,n)?e[n]:t[n];else r[n]=t[n];return r}function o(){}function a(){return!1}function c(){return!0}function l(){return this}function u(){return null}var p=function(){function e(e,s,o){var a,c=[],l=[];function u(){var u=s(e[a],a),p=u instanceof i;return p&&(u=u.v),u instanceof n?(u=u.v)instanceof r?l.push.apply(l,o?u.v.slice().reverse():u.v):l.push(u):u!==t&&(u instanceof r?c.push.apply(c,o?u.v.slice().reverse():u.v):c.push(u)),p}if(Array.isArray(e))if(o){for(a=e.length;--a>=0&&!u(););c.reverse(),l.reverse()}else for(a=0;a=0;)e[n]===t&&e.splice(n,1)}function g(e,t){return e.length<2?e.slice():function e(n){if(n.length<=1)return n;var r=Math.floor(n.length/2),i=n.slice(0,r),s=n.slice(r);return function(e,n){for(var r=[],i=0,s=0,o=0;i!?|~^")),N=/[0-9a-f]/i,D=/^0x[0-9a-f]+$/i,k=/^0[0-7]+$/,O=/^0o[0-7]+$/i,I=/^0b[01]+$/i,P=/^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i,M=/^(0[xob])?[0-9a-f]+n$/i,F=_(["in","instanceof","typeof","new","void","delete","++","--","+","-","!","~","&","|","^","*","**","/","%",">>","<<",">>>","<",">","<=",">=","==","===","!=","!==","?","=","+=","-=","/=","*=","**=","%=",">>=","<<=",">>>=","|=","^=","&=","&&","??","||"]),L=_(n("  \n\r\t\f\v​           \u2028\u2029   \ufeff")),B=_(n("\n\r\u2028\u2029")),V=_(n(";]),:")),U=_(n("[{(,;:")),H=_(n("[]{}(),;:")),G={ID_Start:/[$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/(?:[$0-9A-Z_a-z\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF])+/};function j(e,t){if(W(e.charCodeAt(t))){if(K(e.charCodeAt(t+1)))return e.charAt(t)+e.charAt(t+1)}else if(K(e.charCodeAt(t))&&W(e.charCodeAt(t-1)))return e.charAt(t-1)+e.charAt(t);return e.charAt(t)}function W(e){return e>=55296&&e<=56319}function K(e){return e>=56320&&e<=57343}function z(e){return e>=48&&e<=57}function X(e){return G.ID_Start.test(e)}function q(e){return G.ID_Continue.test(e)}function Y(e){return/^[a-z_$][a-z0-9_$]*$/i.test(e)}function Q(e,t){if(/^[a-z_$][a-z0-9_$]*$/i.test(e))return!0;if(!t&&/[\ud800-\udfff]/.test(e))return!1;var n=G.ID_Start.exec(e);return!(!n||0!==n.index||(e=e.slice(n[0].length))&&(!(n=G.ID_Continue.exec(e))||n[0].length!==e.length))}function Z(e,t=!0){if(!t&&e.includes("e"))return NaN;if(D.test(e))return parseInt(e.substr(2),16);if(k.test(e))return parseInt(e.substr(1),8);if(O.test(e))return parseInt(e.substr(2),8);if(I.test(e))return parseInt(e.substr(2),2);if(P.test(e))return parseFloat(e);var n=parseFloat(e);return n==e?n:void 0}class J extends Error{constructor(e,t,n,r,i){super(),this.name="SyntaxError",this.message=e,this.filename=t,this.line=n,this.col=r,this.pos=i}}function ee(e,t,n,r,i){throw new J(e,t,n,r,i)}function te(e,t,n){return e.type==t&&(null==n||e.value==n)}var ne={};function re(e,t,n,r){var i={text:e,filename:t,pos:0,tokpos:0,line:1,tokline:0,col:0,tokcol:0,newline_before:!1,regex_allowed:!1,brace_counter:0,template_braces:[],comments_before:[],directives:{},directive_stack:[]};function s(){return j(i.text,i.pos)}function o(e,t){var n=j(i.text,i.pos++);if(e&&!n)throw ne;return B.has(n)?(i.newline_before=i.newline_before||!t,++i.line,i.col=0,"\r"==n&&"\n"==s()&&(++i.pos,n="\n")):(n.length>1&&(++i.pos,++i.col),++i.col),n}function a(e){for(;e--;)o()}function c(e){return i.text.substr(i.pos,e.length)==e}function l(e,t){var n=i.text.indexOf(e,i.pos);if(t&&-1==n)throw ne;return n}function u(){i.tokline=i.line,i.tokcol=i.col,i.tokpos=i.pos}var p=!1,h=null;function d(n,r,s){i.regex_allowed="operator"==n&&!se.has(r)||"keyword"==n&&T.has(r)||"punc"==n&&U.has(r)||"arrow"==n,"punc"==n&&"."==r?p=!0:s||(p=!1);var o={type:n,value:r,line:i.tokline,col:i.tokcol,pos:i.tokpos,endline:i.line,endcol:i.col,endpos:i.pos,nlb:i.newline_before,file:t};return/^(?:num|string|regexp)$/i.test(n)&&(o.raw=e.substring(o.pos,o.endpos)),s||(o.comments_before=i.comments_before,o.comments_after=i.comments_before=[]),i.newline_before=!1,o=new pe(o),s||(h=o),o}function f(){for(;L.has(s());)o()}function m(e){ee(e,t,i.tokline,i.tokcol,i.tokpos)}function g(e){var t=!1,n=!1,r=!1,i="."==e,a=!1,c=!1,l=function(e){for(var t,n="",r=0;(t=s())&&e(t,r++);)n+=o();return n}((function(s,o){if(a)return!1;switch(s.charCodeAt(0)){case 95:return c=!0;case 98:case 66:return r=!0;case 111:case 79:case 120:case 88:return!r&&(r=!0);case 101:case 69:return!!r||!t&&(t=n=!0);case 45:return n||0==o&&!e;case 43:return n;case n=!1,46:return!(i||r||t)&&(i=!0)}return"n"===s?(a=!0,!0):N.test(s)}));if(e&&(l=e+l),k.test(l)&&G.has_directive("use strict")&&m("Legacy octal literals are not allowed in strict mode"),c&&(l.endsWith("_")?m("Numeric separators are not allowed at the end of numeric literals"):l.includes("__")&&m("Only one underscore is allowed as numeric separator"),l=l.replace(/_/g,"")),l.endsWith("n")){const e=l.slice(0,-1),t=Z(e,D.test(e));if(!i&&M.test(l)&&!isNaN(t))return d("big_int",e);m("Invalid or unexpected token")}var u=Z(l);if(!isNaN(u))return d("num",u);m("Invalid syntax: "+l)}function _(e){return e>="0"&&e<="7"}function E(e,t,n){var r,a=o(!0,e);switch(a.charCodeAt(0)){case 110:return"\n";case 114:return"\r";case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 120:return String.fromCharCode(y(2,t));case 117:if("{"==s()){for(o(!0),"}"===s()&&m("Expecting hex-character between {}");"0"==s();)o(!0);var c,u=l("}",!0)-i.pos;return(u>6||(c=y(u,t))>1114111)&&m("Unicode reference out of bounds"),o(!0),(r=c)>65535?(r-=65536,String.fromCharCode(55296+(r>>10))+String.fromCharCode(r%1024+56320)):String.fromCharCode(r)}return String.fromCharCode(y(4,t));case 10:return"";case 13:if("\n"==s())return o(!0,e),""}return _(a)?(n&&t&&("0"===a&&!_(s())||m("Octal escape sequences are not allowed in template strings")),function(e,t){var n=s();return n>="0"&&n<="7"&&(e+=o(!0))[0]<="3"&&(n=s())>="0"&&n<="7"&&(e+=o(!0)),"0"===e?"\0":(e.length>0&&G.has_directive("use strict")&&t&&m("Legacy octal escape sequences are not allowed in strict mode"),String.fromCharCode(parseInt(e,8)))}(a,t)):a}function y(e,t){for(var n=0;e>0;--e){if(!t&&isNaN(parseInt(s(),16)))return parseInt(n,16)||"";var r=o(!0);isNaN(parseInt(r,16))&&m("Invalid hex-character pattern in string"),n+=r}return parseInt(n,16)}var v=V("Unterminated string constant",(function(){for(var e=o(),t="";;){var n=o(!0,!0);if("\\"==n)n=E(!0,!0);else if("\r"==n||"\n"==n)m("Unterminated string constant");else if(n==e)break;t+=n}var r=d("string",t);return r.quote=e,r})),S=V("Unterminated template",(function(e){e&&i.template_braces.push(i.brace_counter);var t,n,r="",a="";for(o(!0,!0);"`"!=(t=o(!0,!0));){if("\r"==t)"\n"==s()&&++i.pos,t="\n";else if("$"==t&&"{"==s())return o(!0,!0),i.brace_counter++,(n=d(e?"template_head":"template_substitution",r)).raw=a,n;if(a+=t,"\\"==t){var c=i.pos;t=E(!0,!(h&&("name"===h.type||"punc"===h.type&&(")"===h.value||"]"===h.value))),!0),a+=i.text.substr(c,i.pos-c)}r+=t}return i.template_braces.pop(),(n=d(e?"template_head":"template_substitution",r)).raw=a,n.end=!0,n}));function b(e){var t,n=i.regex_allowed,r=function(){for(var e=i.text,t=i.pos,n=i.text.length;t"===s()?(o(),d("arrow","=>")):I("=");case 96:return S(!0);case 123:i.brace_counter++;break;case 125:if(i.brace_counter--,i.template_braces.length>0&&i.template_braces[i.template_braces.length-1]===i.brace_counter)return S(!1)}if(z(l))return g();if(H.has(t))return d("punc",o());if(R.has(t))return I();if(92==l||X(t))return _=C(),p?d("name",_):$.has(_)?d("atom",_):x.has(_)?F.has(_)?d("operator",_):d("keyword",_):d("name",_);break}var _;m("Unexpected character '"+t+"'")}return G.next=o,G.peek=s,G.context=function(e){return e&&(i=e),i},G.add_directive=function(e){i.directive_stack[i.directive_stack.length-1].push(e),void 0===i.directives[e]?i.directives[e]=1:i.directives[e]++},G.push_directives_stack=function(){i.directive_stack.push([])},G.pop_directives_stack=function(){for(var e=i.directive_stack[i.directive_stack.length-1],t=0;t0},G}var ie=_(["typeof","void","delete","--","++","!","~","-","+"]),se=_(["--","++"]),oe=_(["=","+=","-=","/=","*=","**=","%=",">>=","<<=",">>>=","|=","^=","&="]),ae=function(e,t){for(var n=0;n","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]],{}),ce=_(["atom","num","big_int","string","regexp","name"]);function le(e,t){const n=new Map;t=s(t,{bare_returns:!1,ecma:2017,expression:!1,filename:null,html5_comments:!0,module:!1,shebang:!0,strict:!1,toplevel:null},!0);var r={input:"string"==typeof e?re(e,t.filename,t.html5_comments,t.shebang):e,token:null,prev:null,peeked:null,in_function:0,in_async:-1,in_generator:-1,in_directives:!0,in_loop:0,labels:[]};function i(e,t){return te(r.token,e,t)}function o(){return r.peeked||(r.peeked=r.input())}function a(){return r.prev=r.token,r.peeked||o(),r.token=r.peeked,r.peeked=null,r.in_directives=r.in_directives&&("string"==r.token.type||i("punc",";")),r.token}function c(){return r.prev}function l(e,t,n,i){var s=r.input.context();ee(e,s.filename,null!=t?t:s.tokline,null!=n?n:s.tokcol,null!=i?i:s.tokpos)}function u(e,t){l(t,e.line,e.col)}function p(e){null==e&&(e=r.token),u(e,"Unexpected token: "+e.type+" ("+e.value+")")}function h(e,t){if(i(e,t))return a();u(r.token,"Unexpected token "+r.token.type+" «"+r.token.value+"», expected "+e+" «"+t+"»")}function d(e){return h("punc",e)}function f(e){return e.nlb||!e.comments_before.every(e=>!e.nlb)}function m(){return!t.strict&&(i("eof")||i("punc","}")||f(r.token))}function g(){return r.in_generator===r.in_function}function _(){return r.in_async===r.in_function}function E(e){i("punc",";")?a():e||m()||p()}function y(){d("(");var e=We(!0);return d(")"),e}function v(e){return function(...t){const n=r.token,i=e(...t);return i.start=n,i.end=c(),i}}function S(){(i("operator","/")||i("operator","/="))&&(r.peeked=null,r.token=r.input(r.token.value.substr(1)))}r.token=a();var b=v((function(e,n,s){switch(S(),r.token.type){case"string":if(r.in_directives){var g=o();!r.token.raw.includes("\\")&&(te(g,"punc",";")||te(g,"punc","}")||f(g)||te(g,"eof"))?r.input.add_directive(r.token.value):r.in_directives=!1}var v=r.in_directives,C=A();return v&&C.body instanceof pn?new me(C.body):C;case"template_head":case"num":case"big_int":case"regexp":case"operator":case"atom":return A();case"name":if("async"==r.token.value&&te(o(),"keyword","function"))return a(),a(),n&&l("functions are not allowed as the body of a loop"),T(Be,!1,!0,e);if("import"==r.token.value&&!te(o(),"punc","(")){a();var $=function(){var e,t,n=c();i("name")&&(e=ue(en)),i("punc",",")&&a(),((t=Z(!0))||e)&&h("name","from");var s=r.token;return"string"!==s.type&&p(),a(),new dt({start:n,imported_name:e,imported_names:t,module_name:new pn({start:s,value:s.value,quote:s.quote,end:s}),end:r.token})}();return E(),$}return te(o(),"punc",":")?function(){var e=ue(nn);"await"===e.name&&_()&&u(r.prev,"await cannot be used as label inside async function"),r.labels.some(t=>t.name===e.name)&&l("Label "+e.name+" defined twice"),d(":"),r.labels.push(e);var t=b();return r.labels.pop(),t instanceof Ce||e.references.forEach((function(t){t instanceof Ye&&(t=t.label.start,l("Continue label `"+e.name+"` refers to non-IterationStatement.",t.line,t.col,t.pos))})),new Ae({body:t,label:e})}():A();case"punc":switch(r.token.value){case"{":return new ve({start:r.token,body:O(),end:c()});case"[":case"(":return A();case";":return r.in_directives=!1,a(),new Se;default:p()}case"keyword":switch(r.token.value){case"break":return a(),x(qe);case"continue":return a(),x(Ye);case"debugger":return a(),E(),new fe;case"do":a();var w=Xe(b);h("keyword","while");var R=y();return E(!0),new $e({body:w,condition:R});case"while":return a(),new we({condition:y(),body:Xe((function(){return b(!1,!0)}))});case"for":return a(),function(){var e="`for await` invalid in this context",t=r.token;"name"==t.type&&"await"==t.value?(_()||u(t,e),a()):t=!1,d("(");var n=null;if(i("punc",";"))t&&u(t,e);else{n=i("keyword","var")?(a(),M(!0)):i("keyword","let")?(a(),F(!0)):i("keyword","const")?(a(),L(!0)):We(!0,!0);var s=i("operator","in"),o=i("name","of");if(t&&!o&&u(t,e),s||o)return n instanceof at?n.definitions.length>1&&u(n.start,"Only one variable declaration allowed in for..in loop"):xe(n)||(n=ke(n))instanceof Ve||u(n.start,"Invalid left-hand side in for..in loop"),a(),s?function(e){var t=We(!0);return d(")"),new Re({init:e,object:t,body:Xe((function(){return b(!1,!0)}))})}(n):function(e,t){var n=e instanceof at?e.definitions[0].name:null,r=We(!0);return d(")"),new Ne({await:t,init:e,name:n,object:r,body:Xe((function(){return b(!1,!0)}))})}(n,!!t)}return function(e){d(";");var t=i("punc",";")?null:We(!0);d(";");var n=i("punc",")")?null:We(!0);return d(")"),new Te({init:e,condition:t,step:n,body:Xe((function(){return b(!1,!0)}))})}(n)}();case"class":return a(),n&&l("classes are not allowed as the body of a loop"),s&&l("classes are not allowed as the body of an if"),X(Ft);case"function":return a(),n&&l("functions are not allowed as the body of a loop"),T(Be,!1,!1,e);case"if":return a(),function(){var e=y(),t=b(!1,!1,!0),n=null;return i("keyword","else")&&(a(),n=b(!1,!1,!0)),new Je({condition:e,body:t,alternative:n})}();case"return":0!=r.in_function||t.bare_returns||l("'return' outside of function"),a();var D=null;return i("punc",";")?a():m()||(D=We(!0),E()),new Ke({value:D});case"switch":return a(),new et({expression:y(),body:Xe(I)});case"throw":return a(),f(r.token)&&l("Illegal newline after 'throw'"),D=We(!0),E(),new ze({value:D});case"try":return a(),function(){var e=O(),t=null,n=null;if(i("keyword","catch")){var s=r.token;if(a(),i("punc","{"))var o=null;else d("("),o=N(void 0,Jt),d(")");t=new st({start:s,argname:o,body:O(),end:c()})}return i("keyword","finally")&&(s=r.token,a(),n=new ot({start:s,body:O(),end:c()})),t||n||l("Missing catch/finally blocks"),new it({body:e,bcatch:t,bfinally:n})}();case"var":return a(),$=M(),E(),$;case"let":return a(),$=F(),E(),$;case"const":return a(),$=L(),E(),$;case"with":return r.input.has_directive("use strict")&&l("Strict mode may not include a with statement"),a(),new De({expression:y(),body:b()});case"export":if(!te(o(),"punc","("))return a(),$=function(){var e,t,n,s,l,u=r.token;if(i("keyword","default"))e=!0,a();else if(t=Z(!1)){if(i("name","from")){a();var h=r.token;return"string"!==h.type&&p(),a(),new ft({start:u,is_default:e,exported_names:t,module_name:new pn({start:h,value:h.value,quote:h.quote,end:h}),end:c()})}return new ft({start:u,is_default:e,exported_names:t,end:c()})}return i("punc","{")||e&&(i("keyword","class")||i("keyword","function"))&&te(o(),"punc")?(s=We(!1),E()):(n=b(e))instanceof at&&e?p(n.start):n instanceof at||n instanceof Pe||n instanceof Ft?l=n:n instanceof ge?s=n.body:p(n.start),new ft({start:u,is_default:e,exported_value:s,exported_definition:l,end:c()})}(),i("punc",";")&&E(),$}}p()}));function A(e){return new ge({body:(e=We(!0),E(),e)})}function x(e){var t,n=null;m()||(n=ue(an,!0)),null!=n?((t=r.labels.find(e=>e.name===n.name))||l("Undefined label "+n.name),n.thedef=t):0==r.in_loop&&l(e.TYPE+" not inside a loop or switch"),E();var i=new e({label:n});return t&&t.references.push(i),i}var $=function(e,t,n){f(r.token)&&l("Unexpected newline before arrow (=>)"),h("arrow","=>");var s=k(i("punc","{"),!1,n),o=s instanceof Array&&s.length?s[s.length-1].end:s instanceof Array?e:s.end;return new Le({start:e,end:o,async:n,argnames:t,body:s})},T=function(e,t,n,r){var s=e===Be,o=i("operator","*");o&&a();var l=i("name")?ue(s?zt:Yt):null;s&&!l&&(r?e=Fe:p()),!l||e===Me||l instanceof Ut||p(c());var u=[],h=k(!0,o||t,n,l,u);return new e({start:u.start,end:h.end,is_generator:o,async:n,name:l,argnames:u,body:h})};function R(e,t){var n=new Set,r=!1,i=!1,s=!1,o=!!t,a={add_parameter:function(t){if(n.has(t.value))!1===r&&(r=t),a.check_strict();else if(n.add(t.value),e)switch(t.value){case"arguments":case"eval":case"yield":o&&u(t,"Unexpected "+t.value+" identifier as parameter inside strict mode");break;default:w.has(t.value)&&p()}},mark_default_assignment:function(e){!1===i&&(i=e)},mark_spread:function(e){!1===s&&(s=e)},mark_strict_mode:function(){o=!0},is_strict:function(){return!1!==i||!1!==s||o},check_strict:function(){a.is_strict()&&!1!==r&&u(r,"Parameter "+r.value+" was used already")}};return a}function N(e,t){var n,s=!1;return void 0===e&&(e=R(!0,r.input.has_directive("use strict"))),i("expand","...")&&(s=r.token,e.mark_spread(r.token),a()),n=D(e,t),i("operator","=")&&!1===s&&(e.mark_default_assignment(r.token),a(),n=new wt({start:n.start,left:n,operator:"=",right:We(!1),end:r.token})),!1!==s&&(i("punc",")")||p(),n=new Ie({start:s,expression:n,end:s})),e.check_strict(),n}function D(e,t){var n,s=[],u=!0,h=!1,f=r.token;if(void 0===e&&(e=R(!1,r.input.has_directive("use strict"))),t=void 0===t?Kt:t,i("punc","[")){for(a();!i("punc","]");){if(u?u=!1:d(","),i("expand","...")&&(h=!0,n=r.token,e.mark_spread(r.token),a()),i("punc"))switch(r.token.value){case",":s.push(new yn({start:r.token,end:r.token}));continue;case"]":break;case"[":case"{":s.push(D(e,t));break;default:p()}else i("name")?(e.add_parameter(r.token),s.push(ue(t))):l("Invalid function parameter");i("operator","=")&&!1===h&&(e.mark_default_assignment(r.token),a(),s[s.length-1]=new wt({start:s[s.length-1].start,left:s[s.length-1],operator:"=",right:We(!1),end:r.token})),h&&(i("punc","]")||l("Rest element must be last element"),s[s.length-1]=new Ie({start:n,expression:s[s.length-1],end:n}))}return d("]"),e.check_strict(),new Ve({start:f,names:s,is_array:!0,end:c()})}if(i("punc","{")){for(a();!i("punc","}");){if(u?u=!1:d(","),i("expand","...")&&(h=!0,n=r.token,e.mark_spread(r.token),a()),i("name")&&(te(o(),"punc")||te(o(),"operator"))&&[",","}","="].includes(o().value)){e.add_parameter(r.token);var m=c(),g=ue(t);h?s.push(new Ie({start:n,expression:g,end:g.end})):s.push(new Dt({start:m,key:g.name,value:g,end:g.end}))}else{if(i("punc","}"))continue;var _=r.token,E=J();null===E?p(c()):"name"!==c().type||i("punc",":")?(d(":"),s.push(new Dt({start:_,quote:_.quote,key:E,value:D(e,t),end:c()}))):s.push(new Dt({start:c(),key:E,value:new t({start:c(),name:E,end:c()}),end:c()}))}h?i("punc","}")||l("Rest element must be last element"):i("operator","=")&&(e.mark_default_assignment(r.token),a(),s[s.length-1].value=new wt({start:s[s.length-1].value.start,left:s[s.length-1].value,operator:"=",right:We(!1),end:r.token}))}return d("}"),e.check_strict(),new Ve({start:f,names:s,is_array:!1,end:c()})}if(i("name"))return e.add_parameter(r.token),ue(t);l("Invalid function parameter")}function k(e,n,s,o,c){var l=r.in_loop,u=r.labels,h=r.in_generator,f=r.in_async;if(++r.in_function,n&&(r.in_generator=r.in_function),s&&(r.in_async=r.in_function),c&&function(e){var n=R(!0,r.input.has_directive("use strict"));for(d("(");!i("punc",")");){var s=N(n);if(e.push(s),i("punc",")")||(d(","),i("punc",")")&&t.ecma<2017&&p()),s instanceof Ie)break}a()}(c),e&&(r.in_directives=!0),r.in_loop=0,r.labels=[],e){r.input.push_directives_stack();var m=O();o&&le(o),c&&c.forEach(le),r.input.pop_directives_stack()}else m=[new Ke({start:r.token,value:We(!1),end:r.token})];return--r.in_function,r.in_loop=l,r.labels=u,r.in_generator=h,r.in_async=f,m}function O(){d("{");for(var e=[];!i("punc","}");)i("eof")&&p(),e.push(b());return a(),e}function I(){d("{");for(var e,t=[],n=null,s=null;!i("punc","}");)i("eof")&&p(),i("keyword","case")?(s&&(s.end=c()),n=[],s=new rt({start:(e=r.token,a(),e),expression:We(!0),body:n}),t.push(s),d(":")):i("keyword","default")?(s&&(s.end=c()),n=[],s=new nt({start:(e=r.token,a(),d(":"),e),body:n}),t.push(s)):(n||p(),n.push(b()));return s&&(s.end=c()),a(),t}function P(e,t){for(var n,s=[];;){var o="var"===t?Ht:"const"===t?jt:"let"===t?Wt:null;if(i("punc","{")||i("punc","[")?n=new pt({start:r.token,name:D(void 0,o),value:i("operator","=")?(h("operator","="),We(!1,e)):null,end:c()}):"import"==(n=new pt({start:r.token,name:ue(o),value:i("operator","=")?(a(),We(!1,e)):e||"const"!==t?null:l("Missing initializer in const declaration"),end:c()})).name.name&&l("Unexpected token: import"),s.push(n),!i("punc",","))break;a()}return s}var M=function(e){return new ct({start:c(),definitions:P(e,"var"),end:c()})},F=function(e){return new lt({start:c(),definitions:P(e,"let"),end:c()})},L=function(e){return new ut({start:c(),definitions:P(e,"const"),end:c()})};function B(){var e,t=r.token;switch(t.type){case"name":e=ne(rn);break;case"num":e=new hn({start:t,end:t,value:t.value});break;case"big_int":e=new dn({start:t,end:t,value:t.value});break;case"string":e=new pn({start:t,end:t,value:t.value,quote:t.quote});break;case"regexp":e=new fn({start:t,end:t,value:t.value});break;case"atom":switch(t.value){case"false":e=new bn({start:t,end:t});break;case"true":e=new An({start:t,end:t});break;case"null":e=new gn({start:t,end:t})}}return a(),e}function U(e,t,n,r){var i=function(e,t){return t?new wt({start:e.start,left:e,operator:"=",right:t,end:t.end}):e};return e instanceof Rt?i(new Ve({start:e.start,end:e.end,is_array:!1,names:e.properties.map(U)}),r):e instanceof Dt?(e.value=U(e.value,0,e.key),i(e,r)):e instanceof yn?e:e instanceof Ve?(e.names=e.names.map(U),i(e,r)):e instanceof rn?i(new Kt({name:e.name,start:e.start,end:e.end}),r):e instanceof Ie?(e.expression=U(e.expression),i(e,r)):e instanceof Tt?i(new Ve({start:e.start,end:e.end,is_array:!0,names:e.elements.map(U)}),r):e instanceof $t?i(U(e.left,0,0,e.right),r):e instanceof wt?(e.left=U(e.left,0,e.left),e):void l("Invalid function parameter",e.start.line,e.start.col)}var H=function(e,s){if(i("operator","new"))return function(e){var n=r.token;if(h("operator","new"),i("punc","."))return a(),h("name","target"),de(new Vt({start:n,end:c()}),e);var s,o=H(!1);i("punc","(")?(a(),s=j(")",t.ecma>=2017)):s=[];var l=new gt({start:n,expression:o,args:s,end:c()});return pe(l),de(l,e)}(e);var l,u=r.token,f=i("name","async")&&"["!=(l=o()).value&&"arrow"!=l.type&&B();if(i("punc")){switch(r.token.value){case"(":if(f&&!e)break;var m=function(e,n){var s,o,l,u=[];for(d("(");!i("punc",")");)s&&p(s),i("expand","...")?(s=r.token,n&&(o=r.token),a(),u.push(new Ie({start:c(),expression:We(),end:r.token}))):u.push(We()),i("punc",")")||(d(","),i("punc",")")&&(t.ecma<2017&&p(),l=c(),n&&(o=l)));return d(")"),e&&i("arrow","=>")?s&&l&&p(l):o&&p(o),u}(s,!f);if(s&&i("arrow","=>"))return $(u,m.map(U),!!f);var g=f?new mt({expression:f,args:m}):1==m.length?m[0]:new _t({expressions:m});if(g.start){const e=u.comments_before.length;if(n.set(u,e),g.start.comments_before.unshift(...u.comments_before),u.comments_before=g.start.comments_before,0==e&&u.comments_before.length>0){var _=u.comments_before[0];_.nlb||(_.nlb=u.nlb,u.nlb=!1)}u.comments_after=g.start.comments_after}g.start=u;var E=c();return g.end&&(E.comments_before=g.end.comments_before,g.end.comments_after.push(...E.comments_after),E.comments_after=g.end.comments_after),g.end=E,g instanceof mt&&pe(g),de(g,e);case"[":return de(W(),e);case"{":return de(z(),e)}f||p()}if(s&&i("name")&&te(o(),"arrow")){var y=new Kt({name:r.token.value,start:u,end:u});return a(),$(u,[y],!!f)}if(i("keyword","function")){a();var v=T(Fe,!1,!!f);return v.start=u,v.end=c(),de(v,e)}if(f)return de(f,e);if(i("keyword","class")){a();var S=X(Lt);return S.start=u,S.end=c(),de(S,e)}return i("template_head")?de(G(),e):ce.has(r.token.type)?de(B(),e):void p()};function G(){var e=[],t=r.token;for(e.push(new Ge({start:r.token,raw:r.token.raw,value:r.token.value,end:r.token}));!r.token.end;)a(),S(),e.push(We(!0)),te("template_substitution")||p(),e.push(new Ge({start:r.token,raw:r.token.raw,value:r.token.value,end:r.token}));return a(),new He({start:t,segments:e,end:r.token})}function j(e,t,n){for(var s=!0,o=[];!i("punc",e)&&(s?s=!1:d(","),!t||!i("punc",e));)i("punc",",")&&n?o.push(new yn({start:r.token,end:r.token})):i("expand","...")?(a(),o.push(new Ie({start:c(),expression:We(),end:r.token}))):o.push(We(!1));return a(),o}var W=v((function(){return d("["),new Tt({elements:j("]",!t.strict,!0)})})),K=v((e,t)=>T(Me,e,t)),z=v((function(){var e=r.token,n=!0,s=[];for(d("{");!i("punc","}")&&(n?n=!1:d(","),t.strict||!i("punc","}"));)if("expand"!=(e=r.token).type){var o,l=J();if(i("punc",":"))null===l?p(c()):(a(),o=We(!1));else{var u=q(l,e);if(u){s.push(u);continue}o=new rn({start:c(),name:l,end:c()})}i("operator","=")&&(a(),o=new $t({start:e,left:o,operator:"=",right:We(!1),end:c()})),s.push(new Dt({start:e,quote:e.quote,key:l instanceof he?l:""+l,value:o,end:c()}))}else a(),s.push(new Ie({start:e,expression:We(!1),end:c()}));return a(),new Rt({properties:s})}));function X(e){var t,n,s,o,l=[];for(r.input.push_directives_stack(),r.input.add_directive("use strict"),"name"==r.token.type&&"extends"!=r.token.value&&(s=ue(e===Ft?Qt:Zt)),e!==Ft||s||p(),"extends"==r.token.value&&(a(),o=We(!0)),d("{");i("punc",";");)a();for(;!i("punc","}");)for(t=r.token,(n=q(J(),t,!0))||p(),l.push(n);i("punc",";");)a();return r.input.pop_directives_stack(),a(),new e({start:t,name:s,extends:o,properties:l,end:c()})}function q(e,t,n){var s=function(e,t){return"string"==typeof e||"number"==typeof e?new Xt({start:t,name:""+e,end:c()}):(null===e&&p(),e)},o=!1,l=!1,u=!1,h=t;if(n&&"static"===e&&!i("punc","(")&&(l=!0,h=r.token,e=J()),"async"!==e||i("punc","(")||i("punc",",")||i("punc","}")||i("operator","=")||(o=!0,h=r.token,e=J()),null===e&&(u=!0,h=r.token,null===(e=J())&&p()),i("punc","("))return e=s(e,t),new It({start:t,static:l,is_generator:u,async:o,key:e,quote:e instanceof Xt?h.quote:void 0,value:K(u,o),end:c()});const d=r.token;if("get"==e){if(!i("punc")||i("punc","["))return e=s(J(),t),new Ot({start:t,static:l,key:e,quote:e instanceof Xt?d.quote:void 0,value:K(),end:c()})}else if("set"==e&&(!i("punc")||i("punc","[")))return e=s(J(),t),new kt({start:t,static:l,key:e,quote:e instanceof Xt?d.quote:void 0,value:K(),end:c()});if(n){const n=(e=>"string"==typeof e||"number"==typeof e?new qt({start:h,end:h,name:""+e}):(null===e&&p(),e))(e),r=n instanceof qt?h.quote:void 0;if(i("operator","="))return a(),new Mt({start:t,static:l,quote:r,key:n,value:We(!1),end:c()});if(i("name")||i("punc",";")||i("punc","}"))return new Mt({start:t,static:l,quote:r,key:n,end:c()})}}function Y(e){function t(e){return new e({name:J(),start:c(),end:c()})}var n,s,o=e?tn:on,l=e?en:sn,u=r.token;return e?n=t(o):s=t(l),i("name","as")?(a(),e?s=t(l):n=t(o)):e?s=new l(n):n=new o(s),new ht({start:u,foreign_name:n,name:s,end:c()})}function Q(e,t){var n,i=e?tn:on,s=e?en:sn,o=r.token,a=c();return t=t||new s({name:"*",start:o,end:a}),n=new i({name:"*",start:o,end:a}),new ht({start:o,foreign_name:n,name:t,end:a})}function Z(e){var t;if(i("punc","{")){for(a(),t=[];!i("punc","}");)t.push(Y(e)),i("punc",",")&&a();a()}else if(i("operator","*")){var n;a(),e&&i("name","as")&&(a(),n=ue(e?en:on)),t=[Q(e,n)]}return t}function J(){var e=r.token;switch(e.type){case"punc":if("["===e.value){a();var t=We(!1);return d("]"),t}p(e);case"operator":if("*"===e.value)return a(),null;["delete","in","instanceof","new","typeof","void"].includes(e.value)||p(e);case"name":case"string":case"num":case"big_int":case"keyword":case"atom":return a(),e.value;default:p(e)}}function ne(e){var t=r.token.value;return new("this"==t?cn:"super"==t?ln:e)({name:String(t),start:r.token,end:r.token})}function le(e){var t=e.name;g()&&"yield"==t&&u(e.start,"Yield cannot be used as identifier inside generators"),r.input.has_directive("use strict")&&("yield"==t&&u(e.start,"Unexpected yield identifier inside strict mode"),e instanceof Ut&&("arguments"==t||"eval"==t)&&u(e.start,"Unexpected "+t+" in strict mode"))}function ue(e,t){if(!i("name"))return t||l("Name expected"),null;var n=ne(e);return le(n),a(),n}function pe(e){var t=e.start,r=t.comments_before;const i=n.get(t);for(var s=null!=i?i:r.length;--s>=0;){var o=r[s];if(/[@#]__/.test(o.value)){if(/[@#]__PURE__/.test(o.value)){C(e,Rn);break}if(/[@#]__INLINE__/.test(o.value)){C(e,Nn);break}if(/[@#]__NOINLINE__/.test(o.value)){C(e,Dn);break}}}}var de=function(e,t){var n,s=e.start;if(i("punc","."))return a(),de(new yt({start:s,expression:e,property:(n=r.token,"name"!=n.type&&p(),a(),n.value),end:c()}),t);if(i("punc","[")){a();var o=We(!0);return d("]"),de(new vt({start:s,expression:e,property:o,end:c()}),t)}if(t&&i("punc","(")){a();var l=new mt({start:s,expression:e,args:_e(),end:c()});return pe(l),de(l,!0)}return i("template_head")?de(new Ue({start:s,prefix:e,template_string:G(),end:c()}),t):e};function _e(){for(var e=[];!i("punc",")");)i("expand","...")?(a(),e.push(new Ie({start:c(),expression:We(!1),end:c()}))):e.push(We(!1)),i("punc",")")||(d(","),i("punc",")")&&t.ecma<2017&&p());return a(),e}var Ee=function(e,t){var n=r.token;if("name"==n.type&&"await"==n.value){if(_())return a(),_()||l("Unexpected await expression outside async function",r.prev.line,r.prev.col,r.prev.pos),new Qe({start:c(),end:r.token,expression:Ee(!0)});r.input.has_directive("use strict")&&u(r.token,"Unexpected await identifier inside strict mode")}if(i("operator")&&ie.has(n.value)){a(),S();var s=ye(bt,n,Ee(e));return s.start=n,s.end=c(),s}for(var o=H(e,t);i("operator")&&se.has(r.token.value)&&!f(r.token);)o instanceof Le&&p(),(o=ye(At,r.token,o)).start=n,o.end=r.token,a();return o};function ye(e,t,n){var i=t.value;switch(i){case"++":case"--":xe(n)||l("Invalid use of "+i+" operator",t.line,t.col,t.pos);break;case"delete":n instanceof rn&&r.input.has_directive("use strict")&&l("Calling delete on expression not allowed in strict mode",n.start.line,n.start.col,n.start.pos)}return new e({operator:i,expression:n})}var be=function(e,t,n){var s=i("operator")?r.token.value:null;"in"==s&&n&&(s=null),"**"==s&&e instanceof bt&&!te(e.start,"punc","(")&&"--"!==e.operator&&"++"!==e.operator&&p(e.start);var o=null!=s?ae[s]:null;if(null!=o&&(o>t||"**"===s&&t===o)){a();var c=be(Ee(!0),o,n);return be(new Ct({start:e.start,left:e,operator:s,right:c,end:c.end}),t,n)}return e};function xe(e){return e instanceof Et||e instanceof rn}function ke(e){if(e instanceof Rt)e=new Ve({start:e.start,names:e.properties.map(ke),is_array:!1,end:e.end});else if(e instanceof Tt){for(var t=[],n=0;n=0;)s+="this."+t[o]+" = props."+t[o]+";";const a=r&&Object.create(r.prototype);(a&&a.initialize||n&&n.initialize)&&(s+="this.initialize();"),s+="}",s+="this.flags = 0;",s+="}";var c=new Function(s)();if(a&&(c.prototype=a,c.BASE=r),r&&r.SUBCLASSES.push(c),c.prototype.CTOR=c,c.prototype.constructor=c,c.PROPS=t||null,c.SELF_PROPS=i,c.SUBCLASSES=[],e&&(c.prototype.TYPE=c.TYPE=e),n)for(o in n)y(n,o)&&("$"===o[0]?c[o.substr(1)]=n[o]:c.prototype[o]=n[o]);return c.DEFMETHOD=function(e,t){this.prototype[e]=t},c}var pe=ue("Token","type value line col pos endline endcol endpos nlb comments_before comments_after file raw quote end",{},null),he=ue("Node","start end",{_clone:function(e){if(e){var t=this.clone();return t.transform(new Tn((function(e){if(e!==t)return e.clone(!0)})))}return new this.CTOR(this)},clone:function(e){return this._clone(e)},$documentation:"Base class of all AST nodes",$propdoc:{start:"[AST_Token] The first token of this node",end:"[AST_Token] The last token of this node"},_walk:function(e){return e._visit(this)},walk:function(e){return this._walk(e)},_children_backwards:()=>{}},null);he.warn_function=null,he.warn=function(e,t){he.warn_function&&he.warn_function(f(e,t))};var de=ue("Statement",null,{$documentation:"Base class of all statements"}),fe=ue("Debugger",null,{$documentation:"Represents a debugger statement"},de),me=ue("Directive","value quote",{$documentation:'Represents a directive, like "use strict";',$propdoc:{value:"[string] The value of this directive as a plain string (it's not an AST_String!)",quote:"[string] the original quote character"}},de),ge=ue("SimpleStatement","body",{$documentation:"A statement consisting of an expression, i.e. a = 1 + 2",$propdoc:{body:"[AST_Node] an expression node (should not be instanceof AST_Statement)"},_walk:function(e){return e._visit(this,(function(){this.body._walk(e)}))},_children_backwards(e){e(this.body)}},de);function _e(e,t){const n=e.body;for(var r=0,i=n.length;r SymbolDef for all variables/functions defined in this scope",functions:"[Map/S] like `variables`, but only lists function declarations",uses_with:"[boolean/S] tells whether this scope uses the `with` statement",uses_eval:"[boolean/S] tells whether this scope contains a direct call to the global `eval`",parent_scope:"[AST_Scope?/S] link to the parent scope",enclosed:"[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes",cname:"[integer/S] current index for mangling variables (used internally by the mangler)"},get_defun_scope:function(){for(var e=this;e.is_block_scope();)e=e.parent_scope;return e},clone:function(e){var t=this._clone(e);return this.variables&&(t.variables=new Map(this.variables)),this.functions&&(t.functions=new Map(this.functions)),this.enclosed&&(t.enclosed=this.enclosed.slice()),this._block_scope&&(t._block_scope=this._block_scope),t},pinned:function(){return this.uses_eval||this.uses_with}},ye),Oe=ue("Toplevel","globals",{$documentation:"The toplevel scope",$propdoc:{globals:"[Map/S] a map of name -> SymbolDef for all undeclared names"},wrap_commonjs:function(e){var t=this.body,n="(function(exports){'$ORIG';})(typeof "+e+"=='undefined'?("+e+"={}):"+e+");";return(n=le(n)).transform(new Tn((function(e){if(e instanceof me&&"$ORIG"==e.value)return p.splice(t)})))},wrap_enclose:function(e){"string"!=typeof e&&(e="");var t=e.indexOf(":");t<0&&(t=e.length);var n=this.body;return le(["(function(",e.slice(0,t),'){"$ORIG"})(',e.slice(t+1),")"].join("")).transform(new Tn((function(e){if(e instanceof me&&"$ORIG"==e.value)return p.splice(n)})))}},ke),Ie=ue("Expansion","expression",{$documentation:"An expandible argument, such as ...rest, a splat, such as [1,2,...all], or an expansion in a variable declaration, such as var [first, ...rest] = list",$propdoc:{expression:"[AST_Node] the thing to be expanded"},_walk:function(e){return e._visit(this,(function(){this.expression.walk(e)}))},_children_backwards(e){e(this.expression)}}),Pe=ue("Lambda","name argnames uses_arguments is_generator async",{$documentation:"Base class for functions",$propdoc:{name:"[AST_SymbolDeclaration?] the name of this function",argnames:"[AST_SymbolFunarg|AST_Destructuring|AST_Expansion|AST_DefaultAssign*] array of function arguments, destructurings, or expanding arguments",uses_arguments:"[boolean/S] tells whether this function accesses the arguments array",is_generator:"[boolean] is this a generator method",async:"[boolean] is this method async"},args_as_names:function(){for(var e=[],t=0;t b)"},Pe),Be=ue("Defun",null,{$documentation:"A function definition"},Pe),Ve=ue("Destructuring","names is_array",{$documentation:"A destructuring of several names. Used in destructuring assignment and with destructuring function argument names",$propdoc:{names:"[AST_Node*] Array of properties or elements",is_array:"[Boolean] Whether the destructuring represents an object or array"},_walk:function(e){return e._visit(this,(function(){this.names.forEach((function(t){t._walk(e)}))}))},_children_backwards(e){let t=this.names.length;for(;t--;)e(this.names[t])},all_symbols:function(){var e=[];return this.walk(new wn((function(t){t instanceof Bt&&e.push(t)}))),e}}),Ue=ue("PrefixedTemplateString","template_string prefix",{$documentation:"A templatestring with a prefix, such as String.raw`foobarbaz`",$propdoc:{template_string:"[AST_TemplateString] The template string",prefix:"[AST_SymbolRef|AST_PropAccess] The prefix, which can be a symbol such as `foo` or a dotted expression such as `String.raw`."},_walk:function(e){return e._visit(this,(function(){this.prefix._walk(e),this.template_string._walk(e)}))},_children_backwards(e){e(this.template_string),e(this.prefix)}}),He=ue("TemplateString","segments",{$documentation:"A template string literal",$propdoc:{segments:"[AST_Node*] One or more segments, starting with AST_TemplateSegment. AST_Node may follow AST_TemplateSegment, but each AST_Node must be followed by AST_TemplateSegment."},_walk:function(e){return e._visit(this,(function(){this.segments.forEach((function(t){t._walk(e)}))}))},_children_backwards(e){let t=this.segments.length;for(;t--;)e(this.segments[t])}}),Ge=ue("TemplateSegment","value raw",{$documentation:"A segment of a template string literal",$propdoc:{value:"Content of the segment",raw:"Raw content of the segment"}}),je=ue("Jump",null,{$documentation:"Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)"},de),We=ue("Exit","value",{$documentation:"Base class for “exits” (`return` and `throw`)",$propdoc:{value:"[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return"},_walk:function(e){return e._visit(this,this.value&&function(){this.value._walk(e)})},_children_backwards(e){this.value&&e(this.value)}},je),Ke=ue("Return",null,{$documentation:"A `return` statement"},We),ze=ue("Throw",null,{$documentation:"A `throw` statement"},We),Xe=ue("LoopControl","label",{$documentation:"Base class for loop control statements (`break` and `continue`)",$propdoc:{label:"[AST_LabelRef?] the label, or null if none"},_walk:function(e){return e._visit(this,this.label&&function(){this.label._walk(e)})},_children_backwards(e){this.label&&e(this.label)}},je),qe=ue("Break",null,{$documentation:"A `break` statement"},Xe),Ye=ue("Continue",null,{$documentation:"A `continue` statement"},Xe),Qe=ue("Await","expression",{$documentation:"An `await` statement",$propdoc:{expression:"[AST_Node] the mandatory expression being awaited"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e)}))},_children_backwards(e){e(this.expression)}}),Ze=ue("Yield","expression is_star",{$documentation:"A `yield` statement",$propdoc:{expression:"[AST_Node?] the value returned or thrown by this statement; could be null (representing undefined) but only when is_star is set to false",is_star:"[Boolean] Whether this is a yield or yield* statement"},_walk:function(e){return e._visit(this,this.expression&&function(){this.expression._walk(e)})},_children_backwards(e){this.expression&&e(this.expression)}}),Je=ue("If","condition alternative",{$documentation:"A `if` statement",$propdoc:{condition:"[AST_Node] the `if` condition",alternative:"[AST_Statement?] the `else` part, or null if not present"},_walk:function(e){return e._visit(this,(function(){this.condition._walk(e),this.body._walk(e),this.alternative&&this.alternative._walk(e)}))},_children_backwards(e){this.alternative&&e(this.alternative),e(this.body),e(this.condition)}},be),et=ue("Switch","expression",{$documentation:"A `switch` statement",$propdoc:{expression:"[AST_Node] the `switch` “discriminant”"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e),_e(this,e)}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);e(this.expression)}},ye),tt=ue("SwitchBranch",null,{$documentation:"Base class for `switch` branches"},ye),nt=ue("Default",null,{$documentation:"A `default` switch branch"},tt),rt=ue("Case","expression",{$documentation:"A `case` switch branch",$propdoc:{expression:"[AST_Node] the `case` expression"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e),_e(this,e)}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);e(this.expression)}},tt),it=ue("Try","bcatch bfinally",{$documentation:"A `try` statement",$propdoc:{bcatch:"[AST_Catch?] the catch block, or null if not present",bfinally:"[AST_Finally?] the finally block, or null if not present"},_walk:function(e){return e._visit(this,(function(){_e(this,e),this.bcatch&&this.bcatch._walk(e),this.bfinally&&this.bfinally._walk(e)}))},_children_backwards(e){this.bfinally&&e(this.bfinally),this.bcatch&&e(this.bcatch);let t=this.body.length;for(;t--;)e(this.body[t])}},ye),st=ue("Catch","argname",{$documentation:"A `catch` node; only makes sense as part of a `try` statement",$propdoc:{argname:"[AST_SymbolCatch|AST_Destructuring|AST_Expansion|AST_DefaultAssign] symbol for the exception"},_walk:function(e){return e._visit(this,(function(){this.argname&&this.argname._walk(e),_e(this,e)}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);this.argname&&e(this.argname)}},ye),ot=ue("Finally",null,{$documentation:"A `finally` node; only makes sense as part of a `try` statement"},ye),at=ue("Definitions","definitions",{$documentation:"Base class for `var` or `const` nodes (variable declarations/initializations)",$propdoc:{definitions:"[AST_VarDef*] array of variable definitions"},_walk:function(e){return e._visit(this,(function(){for(var t=this.definitions,n=0,r=t.length;n a`"},Ct),Tt=ue("Array","elements",{$documentation:"An array literal",$propdoc:{elements:"[AST_Node*] array of elements"},_walk:function(e){return e._visit(this,(function(){for(var t=this.elements,n=0,r=t.length;nt._walk(e))}))},_children_backwards(e){let t=this.properties.length;for(;t--;)e(this.properties[t]);this.extends&&e(this.extends),this.name&&e(this.name)}},ke),Mt=ue("ClassProperty","static quote",{$documentation:"A class property",$propdoc:{static:"[boolean] whether this is a static key",quote:"[string] which quote is being used"},_walk:function(e){return e._visit(this,(function(){this.key instanceof he&&this.key._walk(e),this.value instanceof he&&this.value._walk(e)}))},_children_backwards(e){this.value instanceof he&&e(this.value),this.key instanceof he&&e(this.key)},computed_key(){return!(this.key instanceof qt)}},Nt),Ft=ue("DefClass",null,{$documentation:"A class definition"},Pt),Lt=ue("ClassExpression",null,{$documentation:"A class expression."},Pt),Bt=ue("Symbol","scope name thedef",{$propdoc:{name:"[string] name of this symbol",scope:"[AST_Scope/S] the current scope (not necessarily the definition scope)",thedef:"[SymbolDef/S] the definition of this symbol"},$documentation:"Base class for all symbols"}),Vt=ue("NewTarget",null,{$documentation:"A reference to new.target"}),Ut=ue("SymbolDeclaration","init",{$documentation:"A declaration symbol (symbol in var/const, function name or argument, symbol in catch)"},Bt),Ht=ue("SymbolVar",null,{$documentation:"Symbol defining a variable"},Ut),Gt=ue("SymbolBlockDeclaration",null,{$documentation:"Base class for block-scoped declaration symbols"},Ut),jt=ue("SymbolConst",null,{$documentation:"A constant declaration"},Gt),Wt=ue("SymbolLet",null,{$documentation:"A block-scoped `let` declaration"},Gt),Kt=ue("SymbolFunarg",null,{$documentation:"Symbol naming a function argument"},Ht),zt=ue("SymbolDefun",null,{$documentation:"Symbol defining a function"},Ut),Xt=ue("SymbolMethod",null,{$documentation:"Symbol in an object defining a method"},Bt),qt=ue("SymbolClassProperty",null,{$documentation:"Symbol for a class property"},Bt),Yt=ue("SymbolLambda",null,{$documentation:"Symbol naming a function expression"},Ut),Qt=ue("SymbolDefClass",null,{$documentation:"Symbol naming a class's name in a class declaration. Lexically scoped to its containing scope, and accessible within the class."},Gt),Zt=ue("SymbolClass",null,{$documentation:"Symbol naming a class's name. Lexically scoped to the class."},Ut),Jt=ue("SymbolCatch",null,{$documentation:"Symbol naming the exception in catch"},Gt),en=ue("SymbolImport",null,{$documentation:"Symbol referring to an imported name"},Gt),tn=ue("SymbolImportForeign",null,{$documentation:"A symbol imported from a module, but it is defined in the other module, and its real name is irrelevant for this module's purposes"},Bt),nn=ue("Label","references",{$documentation:"Symbol naming a label (declaration)",$propdoc:{references:"[AST_LoopControl*] a list of nodes referring to this label"},initialize:function(){this.references=[],this.thedef=this}},Bt),rn=ue("SymbolRef",null,{$documentation:"Reference to some symbol (not definition/declaration)"},Bt),sn=ue("SymbolExport",null,{$documentation:"Symbol referring to a name to export"},rn),on=ue("SymbolExportForeign",null,{$documentation:"A symbol exported from this module, but it is used in the other module, and its real name is irrelevant for this module's purposes"},Bt),an=ue("LabelRef",null,{$documentation:"Reference to a label symbol"},Bt),cn=ue("This",null,{$documentation:"The `this` symbol"},Bt),ln=ue("Super",null,{$documentation:"The `super` symbol"},cn),un=ue("Constant",null,{$documentation:"Base class for all constants",getValue:function(){return this.value}}),pn=ue("String","value quote",{$documentation:"A string literal",$propdoc:{value:"[string] the contents of this string",quote:"[string] the original quote character"}},un),hn=ue("Number","value literal",{$documentation:"A number literal",$propdoc:{value:"[number] the numeric value",literal:"[string] numeric value as string (optional)"}},un),dn=ue("BigInt","value",{$documentation:"A big int literal",$propdoc:{value:"[string] big int value"}},un),fn=ue("RegExp","value",{$documentation:"A regexp literal",$propdoc:{value:"[RegExp] the actual regexp"}},un),mn=ue("Atom",null,{$documentation:"Base class for atoms"},un),gn=ue("Null",null,{$documentation:"The `null` atom",value:null},mn),_n=ue("NaN",null,{$documentation:"The impossible value",value:NaN},mn),En=ue("Undefined",null,{$documentation:"The `undefined` value",value:void 0},mn),yn=ue("Hole",null,{$documentation:"A hole in an array",value:void 0},mn),vn=ue("Infinity",null,{$documentation:"The `Infinity` value",value:1/0},mn),Sn=ue("Boolean",null,{$documentation:"Base class for booleans"},mn),bn=ue("False",null,{$documentation:"The `false` atom",value:!1},Sn),An=ue("True",null,{$documentation:"The `true` atom",value:!0},Sn);function Cn(e,t,n=[e]){const r=n.push.bind(n);for(;n.length;){const e=n.pop(),i=t(e,n);if(i){if(i===$n)return!0}else e._children_backwards(r)}return!1}function xn(e,t,n){const r=[e],i=r.push.bind(r),s=n?n.slice():[],o=[];let a;const c={parent:(e=0)=>-1===e?a:n&&e>=s.length?(e-=s.length,n[n.length-(e+1)]):s[s.length-(1+e)]};for(;r.length;){for(a=r.pop();o.length&&r.length==o[o.length-1];)s.pop(),o.pop();const e=t(a,c);if(e){if(e===$n)return!0;continue}const n=r.length;a._children_backwards(i),r.length>n&&(s.push(a),o.push(n-1))}return!1}const $n=Symbol("abort walk");class wn{constructor(e){this.visit=e,this.stack=[],this.directives=Object.create(null)}_visit(e,t){this.push(e);var n=this.visit(e,t?function(){t.call(e)}:o);return!n&&t&&t.call(e),this.pop(),n}parent(e){return this.stack[this.stack.length-2-(e||0)]}push(e){e instanceof Pe?this.directives=Object.create(this.directives):e instanceof me&&!this.directives[e.value]?this.directives[e.value]=e:e instanceof Pt&&(this.directives=Object.create(this.directives),this.directives["use strict"]||(this.directives["use strict"]=e)),this.stack.push(e)}pop(){var e=this.stack.pop();(e instanceof Pe||e instanceof Pt)&&(this.directives=Object.getPrototypeOf(this.directives))}self(){return this.stack[this.stack.length-1]}find_parent(e){for(var t=this.stack,n=t.length;--n>=0;){var r=t[n];if(r instanceof e)return r}}has_directive(e){var t=this.directives[e];if(t)return t;var n=this.stack[this.stack.length-1];if(n instanceof ke&&n.body)for(var r=0;r=0;)if((r=t[n])instanceof Ae&&r.label.name==e.label.name)return r.body}else for(n=t.length;--n>=0;){var r;if((r=t[n])instanceof Ce||e instanceof qe&&r instanceof et)return r}}}class Tn extends wn{constructor(e,t){super(),this.before=e,this.after=t}}const Rn=1,Nn=2,Dn=4;var kn=Object.freeze({__proto__:null,AST_Accessor:Me,AST_Array:Tt,AST_Arrow:Le,AST_Assign:$t,AST_Atom:mn,AST_Await:Qe,AST_BigInt:dn,AST_Binary:Ct,AST_Block:ye,AST_BlockStatement:ve,AST_Boolean:Sn,AST_Break:qe,AST_Call:mt,AST_Case:rt,AST_Catch:st,AST_Class:Pt,AST_ClassExpression:Lt,AST_ClassProperty:Mt,AST_ConciseMethod:It,AST_Conditional:xt,AST_Const:ut,AST_Constant:un,AST_Continue:Ye,AST_Debugger:fe,AST_Default:nt,AST_DefaultAssign:wt,AST_DefClass:Ft,AST_Definitions:at,AST_Defun:Be,AST_Destructuring:Ve,AST_Directive:me,AST_Do:$e,AST_Dot:yt,AST_DWLoop:xe,AST_EmptyStatement:Se,AST_Exit:We,AST_Expansion:Ie,AST_Export:ft,AST_False:bn,AST_Finally:ot,AST_For:Te,AST_ForIn:Re,AST_ForOf:Ne,AST_Function:Fe,AST_Hole:yn,AST_If:Je,AST_Import:dt,AST_Infinity:vn,AST_IterationStatement:Ce,AST_Jump:je,AST_Label:nn,AST_LabeledStatement:Ae,AST_LabelRef:an,AST_Lambda:Pe,AST_Let:lt,AST_LoopControl:Xe,AST_NameMapping:ht,AST_NaN:_n,AST_New:gt,AST_NewTarget:Vt,AST_Node:he,AST_Null:gn,AST_Number:hn,AST_Object:Rt,AST_ObjectGetter:Ot,AST_ObjectKeyVal:Dt,AST_ObjectProperty:Nt,AST_ObjectSetter:kt,AST_PrefixedTemplateString:Ue,AST_PropAccess:Et,AST_RegExp:fn,AST_Return:Ke,AST_Scope:ke,AST_Sequence:_t,AST_SimpleStatement:ge,AST_Statement:de,AST_StatementWithBody:be,AST_String:pn,AST_Sub:vt,AST_Super:ln,AST_Switch:et,AST_SwitchBranch:tt,AST_Symbol:Bt,AST_SymbolBlockDeclaration:Gt,AST_SymbolCatch:Jt,AST_SymbolClass:Zt,AST_SymbolClassProperty:qt,AST_SymbolConst:jt,AST_SymbolDeclaration:Ut,AST_SymbolDefClass:Qt,AST_SymbolDefun:zt,AST_SymbolExport:sn,AST_SymbolExportForeign:on,AST_SymbolFunarg:Kt,AST_SymbolImport:en,AST_SymbolImportForeign:tn,AST_SymbolLambda:Yt,AST_SymbolLet:Wt,AST_SymbolMethod:Xt,AST_SymbolRef:rn,AST_SymbolVar:Ht,AST_TemplateSegment:Ge,AST_TemplateString:He,AST_This:cn,AST_Throw:ze,AST_Token:pe,AST_Toplevel:Oe,AST_True:An,AST_Try:it,AST_Unary:St,AST_UnaryPostfix:At,AST_UnaryPrefix:bt,AST_Undefined:En,AST_Var:ct,AST_VarDef:pt,AST_While:we,AST_With:De,AST_Yield:Ze,TreeTransformer:Tn,TreeWalker:wn,walk:Cn,walk_abort:$n,walk_body:_e,walk_parent:xn,_INLINE:Nn,_NOINLINE:Dn,_PURE:Rn});function On(e,t){e.DEFMETHOD("transform",(function(e,n){let r=void 0;if(e.push(this),e.before&&(r=e.before(this,t,n)),void 0===r&&(r=this,t(r,e),e.after)){const t=e.after(r,n);void 0!==t&&(r=t)}return e.pop(),r}))}function In(e,t){return p(e,(function(e){return e.transform(t,!0)}))}function Pn(e){let t=e.parent(-1);for(let n,r=0;n=e.parent(r);r++){if(n instanceof de&&n.body===t)return!0;if(!(n instanceof _t&&n.expressions[0]===t||"Call"===n.TYPE&&n.expression===t||n instanceof Ue&&n.prefix===t||n instanceof yt&&n.expression===t||n instanceof vt&&n.expression===t||n instanceof xt&&n.condition===t||n instanceof Ct&&n.left===t||n instanceof At&&n.expression===t))return!1;t=n}}On(he,o),On(Ae,(function(e,t){e.label=e.label.transform(t),e.body=e.body.transform(t)})),On(ge,(function(e,t){e.body=e.body.transform(t)})),On(ye,(function(e,t){e.body=In(e.body,t)})),On($e,(function(e,t){e.body=e.body.transform(t),e.condition=e.condition.transform(t)})),On(we,(function(e,t){e.condition=e.condition.transform(t),e.body=e.body.transform(t)})),On(Te,(function(e,t){e.init&&(e.init=e.init.transform(t)),e.condition&&(e.condition=e.condition.transform(t)),e.step&&(e.step=e.step.transform(t)),e.body=e.body.transform(t)})),On(Re,(function(e,t){e.init=e.init.transform(t),e.object=e.object.transform(t),e.body=e.body.transform(t)})),On(De,(function(e,t){e.expression=e.expression.transform(t),e.body=e.body.transform(t)})),On(We,(function(e,t){e.value&&(e.value=e.value.transform(t))})),On(Xe,(function(e,t){e.label&&(e.label=e.label.transform(t))})),On(Je,(function(e,t){e.condition=e.condition.transform(t),e.body=e.body.transform(t),e.alternative&&(e.alternative=e.alternative.transform(t))})),On(et,(function(e,t){e.expression=e.expression.transform(t),e.body=In(e.body,t)})),On(rt,(function(e,t){e.expression=e.expression.transform(t),e.body=In(e.body,t)})),On(it,(function(e,t){e.body=In(e.body,t),e.bcatch&&(e.bcatch=e.bcatch.transform(t)),e.bfinally&&(e.bfinally=e.bfinally.transform(t))})),On(st,(function(e,t){e.argname&&(e.argname=e.argname.transform(t)),e.body=In(e.body,t)})),On(at,(function(e,t){e.definitions=In(e.definitions,t)})),On(pt,(function(e,t){e.name=e.name.transform(t),e.value&&(e.value=e.value.transform(t))})),On(Ve,(function(e,t){e.names=In(e.names,t)})),On(Pe,(function(e,t){e.name&&(e.name=e.name.transform(t)),e.argnames=In(e.argnames,t),e.body instanceof he?e.body=e.body.transform(t):e.body=In(e.body,t)})),On(mt,(function(e,t){e.expression=e.expression.transform(t),e.args=In(e.args,t)})),On(_t,(function(e,t){const n=In(e.expressions,t);e.expressions=n.length?n:[new hn({value:0})]})),On(yt,(function(e,t){e.expression=e.expression.transform(t)})),On(vt,(function(e,t){e.expression=e.expression.transform(t),e.property=e.property.transform(t)})),On(Ze,(function(e,t){e.expression&&(e.expression=e.expression.transform(t))})),On(Qe,(function(e,t){e.expression=e.expression.transform(t)})),On(St,(function(e,t){e.expression=e.expression.transform(t)})),On(Ct,(function(e,t){e.left=e.left.transform(t),e.right=e.right.transform(t)})),On(xt,(function(e,t){e.condition=e.condition.transform(t),e.consequent=e.consequent.transform(t),e.alternative=e.alternative.transform(t)})),On(Tt,(function(e,t){e.elements=In(e.elements,t)})),On(Rt,(function(e,t){e.properties=In(e.properties,t)})),On(Nt,(function(e,t){e.key instanceof he&&(e.key=e.key.transform(t)),e.value&&(e.value=e.value.transform(t))})),On(Pt,(function(e,t){e.name&&(e.name=e.name.transform(t)),e.extends&&(e.extends=e.extends.transform(t)),e.properties=In(e.properties,t)})),On(Ie,(function(e,t){e.expression=e.expression.transform(t)})),On(ht,(function(e,t){e.foreign_name=e.foreign_name.transform(t),e.name=e.name.transform(t)})),On(dt,(function(e,t){e.imported_name&&(e.imported_name=e.imported_name.transform(t)),e.imported_names&&In(e.imported_names,t),e.module_name=e.module_name.transform(t)})),On(ft,(function(e,t){e.exported_definition&&(e.exported_definition=e.exported_definition.transform(t)),e.exported_value&&(e.exported_value=e.exported_value.transform(t)),e.exported_names&&In(e.exported_names,t),e.module_name&&(e.module_name=e.module_name.transform(t))})),On(He,(function(e,t){e.segments=In(e.segments,t)})),On(Ue,(function(e,t){e.prefix=e.prefix.transform(t),e.template_string=e.template_string.transform(t)}));const Mn=/^$|[;{][\s\n]*$/,Fn=/[@#]__(PURE|INLINE|NOINLINE)__/g;function Ln(e){return("comment2"===e.type||"comment1"===e.type)&&/@preserve|@lic|@cc_on|^\**!/i.test(e.value)}function Bn(e){var t=!e;void 0===(e=s(e,{ascii_only:!1,beautify:!1,braces:!1,comments:"some",ecma:5,ie8:!1,indent_level:4,indent_start:0,inline_script:!0,keep_numbers:!1,keep_quoted_props:!1,max_line_len:!1,preamble:null,preserve_annotations:!1,quote_keys:!1,quote_style:0,safari10:!1,semicolons:!0,shebang:!0,shorthand:void 0,source_map:null,webkit:!1,width:80,wrap_iife:!1,wrap_func_args:!0},!0)).shorthand&&(e.shorthand=e.ecma>5);var n=a;if(e.comments){let t=e.comments;if("string"==typeof e.comments&&/^\/.*\/[a-zA-Z]*$/.test(e.comments)){var r=e.comments.lastIndexOf("/");t=new RegExp(e.comments.substr(1,r-1),e.comments.substr(r+1))}n=t instanceof RegExp?function(e){return"comment5"!=e.type&&t.test(e.value)}:"function"==typeof t?function(e){return"comment5"!=e.type&&t(this,e)}:"some"===t?Ln:c}var i=0,l=0,u=1,p=0,h="";let d=new Set;var f=e.ascii_only?function(t,n){return e.ecma>=2015&&(t=t.replace(/[\ud800-\udbff][\udc00-\udfff]/g,(function(e){return"\\u{"+function(e,t){return W(e.charCodeAt(0))?65536+(e.charCodeAt(0)-55296<<10)+e.charCodeAt(1)-56320:e.charCodeAt(0)}(e).toString(16)+"}"}))),t.replace(/[\u0000-\u001f\u007f-\uffff]/g,(function(e){var t=e.charCodeAt(0).toString(16);if(t.length<=2&&!n){for(;t.length<2;)t="0"+t;return"\\x"+t}for(;t.length<4;)t="0"+t;return"\\u"+t}))}:function(e){return e.replace(/[\ud800-\udbff][\udc00-\udfff]|([\ud800-\udbff]|[\udc00-\udfff])/g,(function(e,t){return t?"\\u"+t.charCodeAt(0).toString(16):e}))};function m(t,n){var r=function(t,n){var r=0,i=0;function s(){return"'"+t.replace(/\x27/g,"\\'")+"'"}function o(){return'"'+t.replace(/\x22/g,'\\"')+'"'}if(t=t.replace(/[\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff]/g,(function(n,s){switch(n){case'"':return++r,'"';case"'":return++i,"'";case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r";case"\t":return"\\t";case"\b":return"\\b";case"\f":return"\\f";case"\v":return e.ie8?"\\x0B":"\\v";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";case"\ufeff":return"\\ufeff";case"\0":return/[0-9]/.test(j(t,s+1))?"\\x00":"\\0"}return n})),t=f(t),"`"===n)return"`"+t.replace(/`/g,"\\`")+"`";switch(e.quote_style){case 1:return s();case 2:return o();case 3:return"'"==n?s():o();default:return r>i?s():o()}}(t,n);return e.inline_script&&(r=(r=(r=r.replace(/<\x2f(script)([>\/\t\n\f\r ])/gi,"<\\/$1$2")).replace(/\x3c!--/g,"\\x3c!--")).replace(/--\x3e/g,"--\\x3e")),r}var g,E,y=!1,v=!1,S=!1,b=0,A=!1,C=!1,x=-1,$="",w=e.source_map&&[],T=w?function(){w.forEach((function(t){try{e.source_map.add(t.token.file,t.line,t.col,t.token.line,t.token.col,t.name||"name"!=t.token.type?t.name:t.token.value)}catch(e){null!=t.token.file&&he.warn("Couldn't figure out mapping for {file}:{line},{col} → {cline},{ccol} [{name}]",{file:t.token.file,line:t.token.line,col:t.token.col,cline:t.line,ccol:t.col,name:t.name||""})}})),w=[]}:o,R=e.max_line_len?function(){if(l>e.max_line_len){if(b){var t=h.slice(0,b),n=h.slice(b);if(w){var r=n.length-l;w.forEach((function(e){e.line++,e.col+=r}))}h=t+"\n"+n,u++,p++,l=n.length}l>e.max_line_len&&he.warn("Output exceeds {max_line_len} characters",e)}b&&(b=0,T())}:o,N=_("( [ + * / - , . `");function D(t){var n=j(t=String(t),0);A&&n&&(A=!1,"\n"!==n&&(D("\n"),O())),C&&n&&(C=!1,/[\s;})]/.test(n)||k()),x=-1;var r=$.charAt($.length-1);S&&(S=!1,(":"!==r||"}"!==n)&&(n&&";}".includes(n)||";"===r)||(e.semicolons||N.has(n)?(h+=";",l++,p++):(R(),l>0&&(h+="\n",p++,u++,l=0),/^\s+$/.test(t)&&(S=!0)),e.beautify||(v=!1))),v&&((q(r)&&(q(n)||"\\"==n)||"/"==n&&n==r||("+"==n||"-"==n)&&n==$)&&(h+=" ",l++,p++),v=!1),g&&(w.push({token:g,name:E,line:u,col:l}),g=!1,b||T()),h+=t,y="("==t[t.length-1],p+=t.length;var i=t.split(/\r?\n/),s=i.length-1;u+=s,l+=i[0].length,s>0&&(R(),l=i[s].length),$=t}var k=e.beautify?function(){D(" ")}:function(){v=!0},O=e.beautify?function(t){var n;e.beautify&&D((n=t?.5:0," ".repeat(e.indent_start+i-n*e.indent_level)))}:o,I=e.beautify?function(e,t){!0===e&&(e=L());var n=i;i=e;var r=t();return i=n,r}:function(e,t){return t()},P=e.beautify?function(){if(x<0)return D("\n");"\n"!=h[x]&&(h=h.slice(0,x)+"\n"+h.slice(x),p++,u++),x++}:e.max_line_len?function(){R(),b=h.length}:o,M=e.beautify?function(){D(";")}:function(){S=!0};function F(){S=!1,D(";")}function L(){return i+e.indent_level}function B(){return b&&R(),h}function V(){let e=h.length-1;for(;e>=0;){const t=h.charCodeAt(e);if(10===t)return!0;if(32!==t)return!1;e--}return!0}function U(t){return e.preserve_annotations||(t=t.replace(Fn," ")),/^\s*$/.test(t)?"":t.replace(/(<\s*\/\s*)(script)/i,"<\\/$2")}var H=[];return{get:B,toString:B,indent:O,in_directive:!1,use_asm:null,active_scope:null,indentation:function(){return i},current_width:function(){return l-i},should_break:function(){return e.width&&this.current_width()>=e.width},has_parens:function(){return y},newline:P,print:D,star:function(){D("*")},space:k,comma:function(){D(","),k()},colon:function(){D(":"),k()},last:function(){return $},semicolon:M,force_semicolon:F,to_utf8:f,print_name:function(e){D(function(e){return e=e.toString(),f(e,!0)}(e))},print_string:function(e,t,n){var r=m(e,t);!0!==n||r.includes("\\")||(Mn.test(h)||F(),F()),D(r)},print_template_string_chars:function(e){var t=m(e,"`").replace(/\${/g,"\\${");return D(t.substr(1,t.length-2))},encode_string:m,next_indent:L,with_indent:I,with_block:function(e){var t;return D("{"),P(),I(L(),(function(){t=e()})),O(),D("}"),t},with_parens:function(e){D("(");var t=e();return D(")"),t},with_square:function(e){D("[");var t=e();return D("]"),t},add_mapping:w?function(e,t){g=e,E=t}:o,option:function(t){return e[t]},printed_comments:d,prepend_comments:t?o:function(t){var r=t.start;if(!r)return;var i=this.printed_comments;const s=t instanceof We&&t.value;if(r.comments_before&&i.has(r.comments_before)){if(!s)return;r.comments_before=[]}var o=r.comments_before;if(o||(o=r.comments_before=[]),i.add(o),s){var a=new wn((function(e){var t=a.parent();if(!(t instanceof We||t instanceof Ct&&t.left===e||"Call"==t.TYPE&&t.expression===e||t instanceof xt&&t.condition===e||t instanceof yt&&t.expression===e||t instanceof _t&&t.expressions[0]===e||t instanceof vt&&t.expression===e||t instanceof At))return!0;if(e.start){var n=e.start.comments_before;n&&!i.has(n)&&(i.add(n),o=o.concat(n))}}));a.push(t),t.value.walk(a)}if(0==p){o.length>0&&e.shebang&&"comment5"===o[0].type&&!i.has(o[0])&&(D("#!"+o.shift().value+"\n"),O());var c=e.preamble;c&&D(c.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g,"\n"))}if(0!=(o=o.filter(n,t).filter(e=>!i.has(e))).length){var l=V();o.forEach((function(e,t){if(i.add(e),l||(e.nlb?(D("\n"),O(),l=!0):t>0&&k()),/comment[134]/.test(e.type))(n=U(e.value))&&(D("//"+n+"\n"),O()),l=!0;else if("comment2"==e.type){var n;(n=U(e.value))&&D("/*"+n+"*/"),l=!1}})),l||(r.nlb?(D("\n"),O()):k())}},append_comments:t||n===a?o:function(e,t){var r=e.end;if(r){var i=this.printed_comments,s=r[t?"comments_before":"comments_after"];if(s&&!i.has(s)&&(e instanceof de||s.every(e=>!/comment[134]/.test(e.type)))){i.add(s);var o=h.length;s.filter(n,e).forEach((function(e,n){if(!i.has(e))if(i.add(e),C=!1,A?(D("\n"),O(),A=!1):e.nlb&&(n>0||!V())?(D("\n"),O()):(n>0||!t)&&k(),/comment[134]/.test(e.type)){const t=U(e.value);t&&D("//"+t),A=!0}else if("comment2"==e.type){const t=U(e.value);t&&D("/*"+t+"*/"),C=!0}})),h.length>o&&(x=o)}}},line:function(){return u},col:function(){return l},pos:function(){return p},push_node:function(e){H.push(e)},pop_node:function(){return H.pop()},parent:function(e){return H[H.length-2-(e||0)]}}}!function(){function e(e,t){e.DEFMETHOD("_codegen",t)}function t(e,n){Array.isArray(e)?e.forEach((function(e){t(e,n)})):e.DEFMETHOD("needs_parens",n)}function n(e,t,n,r){var i=e.length-1;n.in_directive=r,e.forEach((function(e,r){!0!==n.in_directive||e instanceof me||e instanceof Se||e instanceof ge&&e.body instanceof pn||(n.in_directive=!1),e instanceof Se||(n.indent(),e.print(n),r==i&&t||(n.newline(),t&&n.newline())),!0===n.in_directive&&e instanceof ge&&e.body instanceof pn&&(n.in_directive=!1)})),n.in_directive=!1}function r(e,t){t.print("{"),t.with_indent(t.next_indent(),(function(){t.append_comments(e,!0)})),t.print("}")}function i(e,t,i){e.body.length>0?t.with_block((function(){n(e.body,!1,t,i)})):r(e,t)}function s(e,t,n){var r=!1;n&&(r=Cn(e,e=>e instanceof ke||(e instanceof Ct&&"in"==e.operator?$n:void 0))),e.print(t,r)}function c(e,t,n){return n.option("quote_keys")?n.print_string(e):""+ +e==e&&e>=0?n.option("keep_numbers")?n.print(e):n.print(h(e)):(w.has(e)?n.option("ie8"):n.option("ecma")<2015?!Y(e):!Q(e,!0))||t&&n.option("keep_quoted_props")?n.print_string(e,t):n.print_name(e)}he.DEFMETHOD("print",(function(e,t){var n=this,r=n._codegen;function i(){e.prepend_comments(n),n.add_source_map(e),r(n,e),e.append_comments(n)}n instanceof ke?e.active_scope=n:!e.use_asm&&n instanceof me&&"use asm"==n.value&&(e.use_asm=e.active_scope),e.push_node(n),t||n.needs_parens(e)?e.with_parens(i):i(),e.pop_node(),n===e.use_asm&&(e.use_asm=null)})),he.DEFMETHOD("_print",he.prototype.print),he.DEFMETHOD("print_to_string",(function(e){var t=Bn(e);return this.print(t),t.get()})),t(he,a),t(Fe,(function(e){return!((e.has_parens()||!Pn(e))&&!(e.option("webkit")&&(t=e.parent())instanceof Et&&t.expression===this)&&!(e.option("wrap_iife")&&(t=e.parent())instanceof mt&&t.expression===this)&&!(e.option("wrap_func_args")&&(t=e.parent())instanceof mt&&t.args.includes(this)));var t})),t(Le,(function(e){var t=e.parent();return t instanceof Et&&t.expression===this})),t(Rt,(function(e){return!e.has_parens()&&Pn(e)})),t(Lt,Pn),t(St,(function(e){var t=e.parent();return t instanceof Et&&t.expression===this||t instanceof mt&&t.expression===this||t instanceof Ct&&"**"===t.operator&&this instanceof bt&&t.left===this&&"++"!==this.operator&&"--"!==this.operator})),t(Qe,(function(e){var t=e.parent();return t instanceof Et&&t.expression===this||t instanceof mt&&t.expression===this||e.option("safari10")&&t instanceof bt})),t(_t,(function(e){var t=e.parent();return t instanceof mt||t instanceof St||t instanceof Ct||t instanceof pt||t instanceof Et||t instanceof Tt||t instanceof Nt||t instanceof xt||t instanceof Le||t instanceof wt||t instanceof Ie||t instanceof Ne&&this===t.object||t instanceof Ze||t instanceof ft})),t(Ct,(function(e){var t=e.parent();if(t instanceof mt&&t.expression===this)return!0;if(t instanceof St)return!0;if(t instanceof Et&&t.expression===this)return!0;if(t instanceof Ct){const e=t.operator,n=this.operator;if("??"===n&&("||"===e||"&&"===e))return!0;const r=ae[e],i=ae[n];if(r>i||r==i&&(this===t.right||"**"==e))return!0}})),t(Ze,(function(e){var t=e.parent();return t instanceof Ct&&"="!==t.operator||t instanceof mt&&t.expression===this||t instanceof xt&&t.condition===this||t instanceof St||t instanceof Et&&t.expression===this||void 0})),t(Et,(function(e){var t=e.parent();if(t instanceof gt&&t.expression===this)return Cn(this,e=>e instanceof ke||(e instanceof mt?$n:void 0))})),t(mt,(function(e){var t,n=e.parent();return!!(n instanceof gt&&n.expression===this||n instanceof ft&&n.is_default&&this.expression instanceof Fe)||this.expression instanceof Fe&&n instanceof Et&&n.expression===this&&(t=e.parent(1))instanceof $t&&t.left===n})),t(gt,(function(e){var t=e.parent();if(0===this.args.length&&(t instanceof Et||t instanceof mt&&t.expression===this))return!0})),t(hn,(function(e){var t=e.parent();if(t instanceof Et&&t.expression===this){var n=this.getValue();if(n<0||/^0/.test(h(n)))return!0}})),t(dn,(function(e){var t=e.parent();if(t instanceof Et&&t.expression===this&&this.getValue().startsWith("-"))return!0})),t([$t,xt],(function(e){var t=e.parent();return t instanceof St||t instanceof Ct&&!(t instanceof $t)||t instanceof mt&&t.expression===this||t instanceof xt&&t.condition===this||t instanceof Et&&t.expression===this||this instanceof $t&&this.left instanceof Ve&&!1===this.left.is_array||void 0})),e(me,(function(e,t){t.print_string(e.value,e.quote),t.semicolon()})),e(Ie,(function(e,t){t.print("..."),e.expression.print(t)})),e(Ve,(function(e,t){t.print(e.is_array?"[":"{");var n=e.names.length;e.names.forEach((function(e,r){r>0&&t.comma(),e.print(t),r==n-1&&e instanceof yn&&t.comma()})),t.print(e.is_array?"]":"}")})),e(fe,(function(e,t){t.print("debugger"),t.semicolon()})),be.DEFMETHOD("_do_print_body",(function(e){p(this.body,e)})),e(de,(function(e,t){e.body.print(t),t.semicolon()})),e(Oe,(function(e,t){n(e.body,!0,t,!0),t.print("")})),e(Ae,(function(e,t){e.label.print(t),t.colon(),e.body.print(t)})),e(ge,(function(e,t){e.body.print(t),t.semicolon()})),e(ve,(function(e,t){i(e,t)})),e(Se,(function(e,t){t.semicolon()})),e($e,(function(e,t){t.print("do"),t.space(),d(e.body,t),t.space(),t.print("while"),t.space(),t.with_parens((function(){e.condition.print(t)})),t.semicolon()})),e(we,(function(e,t){t.print("while"),t.space(),t.with_parens((function(){e.condition.print(t)})),t.space(),e._do_print_body(t)})),e(Te,(function(e,t){t.print("for"),t.space(),t.with_parens((function(){e.init?(e.init instanceof at?e.init.print(t):s(e.init,t,!0),t.print(";"),t.space()):t.print(";"),e.condition?(e.condition.print(t),t.print(";"),t.space()):t.print(";"),e.step&&e.step.print(t)})),t.space(),e._do_print_body(t)})),e(Re,(function(e,t){t.print("for"),e.await&&(t.space(),t.print("await")),t.space(),t.with_parens((function(){e.init.print(t),t.space(),t.print(e instanceof Ne?"of":"in"),t.space(),e.object.print(t)})),t.space(),e._do_print_body(t)})),e(De,(function(e,t){t.print("with"),t.space(),t.with_parens((function(){e.expression.print(t)})),t.space(),e._do_print_body(t)})),Pe.DEFMETHOD("_do_print",(function(e,t){var n=this;t||(n.async&&(e.print("async"),e.space()),e.print("function"),n.is_generator&&e.star(),n.name&&e.space()),n.name instanceof Bt?n.name.print(e):t&&n.name instanceof he&&e.with_square((function(){n.name.print(e)})),e.with_parens((function(){n.argnames.forEach((function(t,n){n&&e.comma(),t.print(e)}))})),e.space(),i(n,e,!0)})),e(Pe,(function(e,t){e._do_print(t)})),e(Ue,(function(e,t){var n=e.prefix,r=n instanceof Pe||n instanceof Ct||n instanceof xt||n instanceof _t||n instanceof St||n instanceof yt&&n.expression instanceof Rt;r&&t.print("("),e.prefix.print(t),r&&t.print(")"),e.template_string.print(t)})),e(He,(function(e,t){var n=t.parent()instanceof Ue;t.print("`");for(var r=0;r"),e.space();const s=t.body[0];if(1===t.body.length&&s instanceof Ke){const t=s.value;t?function e(t){return t instanceof Rt||(t instanceof _t?e(t.expressions[0]):"Call"===t.TYPE?e(t.expression):t instanceof Ue?e(t.prefix):t instanceof yt||t instanceof vt?e(t.expression):t instanceof xt?e(t.condition):t instanceof Ct?e(t.left):t instanceof At&&e(t.expression))}(t)?(e.print("("),t.print(e),e.print(")")):t.print(e):e.print("{}")}else i(t,e);r&&e.print(")")})),We.DEFMETHOD("_do_print",(function(e,t){if(e.print(t),this.value){e.space();const t=this.value.start.comments_before;t&&t.length&&!e.printed_comments.has(t)?(e.print("("),this.value.print(e),e.print(")")):this.value.print(e)}e.semicolon()})),e(Ke,(function(e,t){e._do_print(t,"return")})),e(ze,(function(e,t){e._do_print(t,"throw")})),e(Ze,(function(e,t){var n=e.is_star?"*":"";t.print("yield"+n),e.expression&&(t.space(),e.expression.print(t))})),e(Qe,(function(e,t){t.print("await"),t.space();var n=e.expression,r=!(n instanceof mt||n instanceof rn||n instanceof Et||n instanceof St||n instanceof un);r&&t.print("("),e.expression.print(t),r&&t.print(")")})),Xe.DEFMETHOD("_do_print",(function(e,t){e.print(t),this.label&&(e.space(),this.label.print(e)),e.semicolon()})),e(qe,(function(e,t){e._do_print(t,"break")})),e(Ye,(function(e,t){e._do_print(t,"continue")})),e(Je,(function(e,t){t.print("if"),t.space(),t.with_parens((function(){e.condition.print(t)})),t.space(),e.alternative?(function(e,t){var n=e.body;if(t.option("braces")||t.option("ie8")&&n instanceof $e)return d(n,t);if(!n)return t.force_semicolon();for(;;)if(n instanceof Je){if(!n.alternative)return void d(e.body,t);n=n.alternative}else{if(!(n instanceof be))break;n=n.body}p(e.body,t)}(e,t),t.space(),t.print("else"),t.space(),e.alternative instanceof Je?e.alternative.print(t):p(e.alternative,t)):e._do_print_body(t)})),e(et,(function(e,t){t.print("switch"),t.space(),t.with_parens((function(){e.expression.print(t)})),t.space();var n=e.body.length-1;n<0?r(e,t):t.with_block((function(){e.body.forEach((function(e,r){t.indent(!0),e.print(t),r0&&t.newline()}))}))})),tt.DEFMETHOD("_do_print_body",(function(e){e.newline(),this.body.forEach((function(t){e.indent(),t.print(e),e.newline()}))})),e(nt,(function(e,t){t.print("default:"),e._do_print_body(t)})),e(rt,(function(e,t){t.print("case"),t.space(),e.expression.print(t),t.print(":"),e._do_print_body(t)})),e(it,(function(e,t){t.print("try"),t.space(),i(e,t),e.bcatch&&(t.space(),e.bcatch.print(t)),e.bfinally&&(t.space(),e.bfinally.print(t))})),e(st,(function(e,t){t.print("catch"),e.argname&&(t.space(),t.with_parens((function(){e.argname.print(t)}))),t.space(),i(e,t)})),e(ot,(function(e,t){t.print("finally"),t.space(),i(e,t)})),at.DEFMETHOD("_do_print",(function(e,t){e.print(t),e.space(),this.definitions.forEach((function(t,n){n&&e.comma(),t.print(e)}));var n=e.parent();(!(n instanceof Te||n instanceof Re)||n&&n.init!==this)&&e.semicolon()})),e(lt,(function(e,t){e._do_print(t,"let")})),e(ct,(function(e,t){e._do_print(t,"var")})),e(ut,(function(e,t){e._do_print(t,"const")})),e(dt,(function(e,t){t.print("import"),t.space(),e.imported_name&&e.imported_name.print(t),e.imported_name&&e.imported_names&&(t.print(","),t.space()),e.imported_names&&(1===e.imported_names.length&&"*"===e.imported_names[0].foreign_name.name?e.imported_names[0].print(t):(t.print("{"),e.imported_names.forEach((function(n,r){t.space(),n.print(t),r0&&(e.comma(),e.should_break()&&(e.newline(),e.indent())),t.print(e)}))})),e(_t,(function(e,t){e._do_print(t)})),e(yt,(function(e,t){var n=e.expression;n.print(t);var r=e.property;(w.has(r)?t.option("ie8"):!Q(r,t.option("ecma")>=2015))?(t.print("["),t.add_mapping(e.end),t.print_string(r),t.print("]")):(n instanceof hn&&n.getValue()>=0&&(/[xa-f.)]/i.test(t.last())||t.print(".")),t.print("."),t.add_mapping(e.end),t.print_name(r))})),e(vt,(function(e,t){e.expression.print(t),t.print("["),e.property.print(t),t.print("]")})),e(bt,(function(e,t){var n=e.operator;t.print(n),(/^[a-z]/i.test(n)||/[+-]$/.test(n)&&e.expression instanceof bt&&/^[+-]/.test(e.expression.operator))&&t.space(),e.expression.print(t)})),e(At,(function(e,t){e.expression.print(t),t.print(e.operator)})),e(Ct,(function(e,t){var n=e.operator;e.left.print(t),">"==n[0]&&e.left instanceof At&&"--"==e.left.operator?t.print(" "):t.space(),t.print(n),("<"==n||"<<"==n)&&e.right instanceof bt&&"!"==e.right.operator&&e.right.expression instanceof bt&&"--"==e.right.expression.operator?t.print(" "):t.space(),e.right.print(t)})),e(xt,(function(e,t){e.condition.print(t),t.space(),t.print("?"),t.space(),e.consequent.print(t),t.space(),t.colon(),e.alternative.print(t)})),e(Tt,(function(e,t){t.with_square((function(){var n=e.elements,r=n.length;r>0&&t.space(),n.forEach((function(e,n){n&&t.comma(),e.print(t),n===r-1&&e instanceof yn&&t.comma()})),r>0&&t.space()}))})),e(Rt,(function(e,t){e.properties.length>0?t.with_block((function(){e.properties.forEach((function(e,n){n&&(t.print(","),t.newline()),t.indent(),e.print(t)})),t.newline()})):r(e,t)})),e(Pt,(function(e,t){if(t.print("class"),t.space(),e.name&&(e.name.print(t),t.space()),e.extends){var n=!(e.extends instanceof rn||e.extends instanceof Et||e.extends instanceof Lt||e.extends instanceof Fe);t.print("extends"),n?t.print("("):t.space(),e.extends.print(t),n?t.print(")"):t.space()}e.properties.length>0?t.with_block((function(){e.properties.forEach((function(e,n){n&&t.newline(),t.indent(),e.print(t)})),t.newline()})):t.print("{}")})),e(Vt,(function(e,t){t.print("new.target")})),e(Dt,(function(e,t){function n(e){var t=e.definition();return t?t.mangled_name||t.name:e.name}var r=t.option("shorthand");r&&e.value instanceof Bt&&Q(e.key,t.option("ecma")>=2015)&&n(e.value)===e.key&&!w.has(e.key)?c(e.key,e.quote,t):r&&e.value instanceof wt&&e.value.left instanceof Bt&&Q(e.key,t.option("ecma")>=2015)&&n(e.value.left)===e.key?(c(e.key,e.quote,t),t.space(),t.print("="),t.space(),e.value.right.print(t)):(e.key instanceof he?t.with_square((function(){e.key.print(t)})):c(e.key,e.quote,t),t.colon(),e.value.print(t))})),e(Mt,(e,t)=>{e.static&&(t.print("static"),t.space()),e.key instanceof qt?c(e.key.name,e.quote,t):(t.print("["),e.key.print(t),t.print("]")),e.value&&(t.print("="),e.value.print(t)),t.semicolon()}),Nt.DEFMETHOD("_print_getter_setter",(function(e,t){var n=this;n.static&&(t.print("static"),t.space()),e&&(t.print(e),t.space()),n.key instanceof Xt?c(n.key.name,n.quote,t):t.with_square((function(){n.key.print(t)})),n.value._do_print(t,!0)})),e(kt,(function(e,t){e._print_getter_setter("set",t)})),e(Ot,(function(e,t){e._print_getter_setter("get",t)})),e(It,(function(e,t){var n;e.is_generator&&e.async?n="async*":e.is_generator?n="*":e.async&&(n="async"),e._print_getter_setter(n,t)})),Bt.DEFMETHOD("_do_print",(function(e){var t=this.definition();e.print_name(t?t.mangled_name||t.name:this.name)})),e(Bt,(function(e,t){e._do_print(t)})),e(yn,o),e(cn,(function(e,t){t.print("this")})),e(ln,(function(e,t){t.print("super")})),e(un,(function(e,t){t.print(e.getValue())})),e(pn,(function(e,t){t.print_string(e.getValue(),e.quote,t.in_directive)})),e(hn,(function(e,t){(t.option("keep_numbers")||t.use_asm)&&e.start&&null!=e.start.raw?t.print(e.start.raw):t.print(h(e.getValue()))})),e(dn,(function(e,t){t.print(e.getValue()+"n")}));const l=/(<\s*\/\s*script)/i,u=(e,t)=>t.replace("/","\\/");function p(e,t){t.option("braces")?d(e,t):!e||e instanceof Se?t.force_semicolon():e.print(t)}function h(e){var t,n,r,i=e.toString(10).replace(/^0\./,".").replace("e+","e"),s=[i];return Math.floor(e)===e&&(e<0?s.push("-0x"+(-e).toString(16).toLowerCase()):s.push("0x"+e.toString(16).toLowerCase())),(t=/^\.0+/.exec(i))?(n=t[0].length,r=i.slice(n),s.push(r+"e-"+(r.length+n-1))):(t=/0+$/.exec(i))?(n=t[0].length,s.push(i.slice(0,-n)+"e"+n)):(t=/^(\d)\.(\d+)e(-?\d+)$/.exec(i))&&s.push(t[1]+t[2]+"e"+(t[3]-t[2].length)),function(e){for(var t=e[0],n=t.length,r=1;r{n+=e}),n}(r):"",n=n.replace(l,u),t.print(t.to_utf8(`/${n}/${r}`));const i=t.parent();i instanceof Ct&&/^\w/.test(i.operator)&&i.left===e&&t.print(" ")})),f([he,Ae,Oe],o),f([Tt,ve,st,Pt,un,fe,at,me,ot,je,Pe,gt,Rt,be,Bt,et,tt,He,Ge,it],(function(e){e.add_mapping(this.start)})),f([Ot,kt],(function(e){e.add_mapping(this.start,this.key.name)})),f([Nt],(function(e){e.add_mapping(this.start,this.key)}))}();const Vn=(e,t)=>null===e&&null===t||e.TYPE===t.TYPE&&e.shallow_cmp(t),Un=e=>{const t=Object.keys(e).map(t=>{if("eq"===e[t])return`this.${t} === other.${t}`;if("exist"===e[t])return`(this.${t} == null ? other.${t} == null : this.${t} === other.${t})`;throw new Error("mkshallow: Unexpected instruction: "+e[t])}).join(" && ");return new Function("other","return "+t)},Hn=()=>!0;he.prototype.shallow_cmp=function(){throw new Error("did not find a shallow_cmp function for "+this.constructor.name)},fe.prototype.shallow_cmp=Hn,me.prototype.shallow_cmp=Un({value:"eq"}),ge.prototype.shallow_cmp=Hn,ye.prototype.shallow_cmp=Hn,Se.prototype.shallow_cmp=Hn,Ae.prototype.shallow_cmp=Un({"label.name":"eq"}),$e.prototype.shallow_cmp=Hn,we.prototype.shallow_cmp=Hn,Te.prototype.shallow_cmp=Un({init:"exist",condition:"exist",step:"exist"}),Re.prototype.shallow_cmp=Hn,Ne.prototype.shallow_cmp=Hn,De.prototype.shallow_cmp=Hn,Oe.prototype.shallow_cmp=Hn,Ie.prototype.shallow_cmp=Hn,Pe.prototype.shallow_cmp=Un({is_generator:"eq",async:"eq"}),Ve.prototype.shallow_cmp=Un({is_array:"eq"}),Ue.prototype.shallow_cmp=Hn,He.prototype.shallow_cmp=Hn,Ge.prototype.shallow_cmp=Un({value:"eq"}),je.prototype.shallow_cmp=Hn,Xe.prototype.shallow_cmp=Hn,Qe.prototype.shallow_cmp=Hn,Ze.prototype.shallow_cmp=Un({is_star:"eq"}),Je.prototype.shallow_cmp=Un({alternative:"exist"}),et.prototype.shallow_cmp=Hn,tt.prototype.shallow_cmp=Hn,it.prototype.shallow_cmp=Un({bcatch:"exist",bfinally:"exist"}),st.prototype.shallow_cmp=Un({argname:"exist"}),ot.prototype.shallow_cmp=Hn,at.prototype.shallow_cmp=Hn,pt.prototype.shallow_cmp=Un({value:"exist"}),ht.prototype.shallow_cmp=Hn,dt.prototype.shallow_cmp=Un({imported_name:"exist",imported_names:"exist"}),ft.prototype.shallow_cmp=Un({exported_definition:"exist",exported_value:"exist",exported_names:"exist",module_name:"eq",is_default:"eq"}),mt.prototype.shallow_cmp=Hn,_t.prototype.shallow_cmp=Hn,Et.prototype.shallow_cmp=Hn,yt.prototype.shallow_cmp=Un({property:"eq"}),St.prototype.shallow_cmp=Un({operator:"eq"}),Ct.prototype.shallow_cmp=Un({operator:"eq"}),xt.prototype.shallow_cmp=Hn,Tt.prototype.shallow_cmp=Hn,Rt.prototype.shallow_cmp=Hn,Nt.prototype.shallow_cmp=Hn,Dt.prototype.shallow_cmp=Un({key:"eq"}),kt.prototype.shallow_cmp=Un({static:"eq"}),Ot.prototype.shallow_cmp=Un({static:"eq"}),It.prototype.shallow_cmp=Un({static:"eq",is_generator:"eq",async:"eq"}),Pt.prototype.shallow_cmp=Un({name:"exist",extends:"exist"}),Mt.prototype.shallow_cmp=Un({static:"eq"}),Bt.prototype.shallow_cmp=Un({name:"eq"}),Vt.prototype.shallow_cmp=Hn,cn.prototype.shallow_cmp=Hn,ln.prototype.shallow_cmp=Hn,pn.prototype.shallow_cmp=Un({value:"eq"}),hn.prototype.shallow_cmp=Un({value:"eq"}),dn.prototype.shallow_cmp=Un({value:"eq"}),fn.prototype.shallow_cmp=function(e){return this.value.flags===e.value.flags&&this.value.source===e.value.source},mn.prototype.shallow_cmp=Hn;let Gn=null,jn=null;class Wn{constructor(e,t,n){this.name=t.name,this.orig=[t],this.init=n,this.eliminated=0,this.assignments=0,this.scope=e,this.replaced=0,this.global=!1,this.export=0,this.mangled_name=null,this.undeclared=!1,this.id=Wn.next_id++,this.chained=!1,this.direct_access=!1,this.escaped=0,this.recursive_refs=0,this.references=[],this.should_replace=void 0,this.single_use=!1,this.fixed=!1,Object.seal(this)}fixed_value(){return!this.fixed||this.fixed instanceof he?this.fixed:this.fixed()}unmangleable(e){return e||(e={}),!!(Gn&&Gn.has(this.id)&&v(e.keep_fnames,this.orig[0].name))||this.global&&!e.toplevel||1&this.export||this.undeclared||!e.eval&&this.scope.pinned()||(this.orig[0]instanceof Yt||this.orig[0]instanceof zt)&&v(e.keep_fnames,this.orig[0].name)||this.orig[0]instanceof Xt||(this.orig[0]instanceof Zt||this.orig[0]instanceof Qt)&&v(e.keep_classnames,this.orig[0].name)}mangle(e){const t=e.cache&&e.cache.props;if(this.global&&t&&t.has(this.name))this.mangled_name=t.get(this.name);else if(!this.mangled_name&&!this.unmangleable(e)){var n=this.scope,r=this.orig[0];e.ie8&&r instanceof Yt&&(n=n.parent_scope);const i=Kn(this);this.mangled_name=i?i.mangled_name||i.name:n.next_mangled(e,this),this.global&&t&&t.set(this.name,this.mangled_name)}}}function Kn(e){if(e.orig[0]instanceof Jt&&e.scope.is_block_scope())return e.scope.get_defun_scope().variables.get(e.name)}function zn(e,t){var n=e.enclosed;e:for(;;){var r=Xn(++e.cname);if(!w.has(r)&&!(t.reserved.has(r)||jn&&jn.has(r))){for(let e=n.length;--e>=0;){const i=n[e];if(r==(i.mangled_name||i.unmangleable(t)&&i.name))continue e}return r}}}Wn.next_id=1,ke.DEFMETHOD("figure_out_scope",(function(e,{parent_scope:t=null,toplevel:n=this}={}){if(e=s(e,{cache:null,ie8:!1,safari10:!1}),!(n instanceof Oe))throw new Error("Invalid toplevel scope");var r=this.parent_scope=t,i=new Map,o=null,a=null,c=[],l=new wn((t,n)=>{if(t.is_block_scope()){const i=r;t.block_scope=r=new ke(t),r._block_scope=!0;const s=t instanceof st?i.parent_scope:i;if(r.init_scope_vars(s),r.uses_with=i.uses_with,r.uses_eval=i.uses_eval,e.safari10&&(t instanceof Te||t instanceof Re)&&c.push(r),t instanceof et){const e=r;r=i,t.expression.walk(l),r=e;for(let e=0;ee===t||(t instanceof Gt?e instanceof Yt:!(e instanceof Wt||e instanceof jt)))||ee(`"${t.name}" is redeclared`,t.start.file,t.start.line,t.start.col,t.start.pos),t instanceof Kt||u(g,2),o!==r){t.mark_enclosed();var g=r.find_variable(t);t.thedef!==g&&(t.thedef=g,t.reference())}}else if(t instanceof an){var _=i.get(t.name);if(!_)throw new Error(f("Undefined label {name} [{line},{col}]",{name:t.name,line:t.start.line,col:t.start.col}));t.thedef=_}r instanceof Oe||!(t instanceof ft||t instanceof dt)||ee(`"${t.TYPE}" statement may only appear at the top level`,t.start.file,t.start.line,t.start.col,t.start.pos)}});function u(e,t){if(a){var n=0;do{t++}while(l.parent(n++)!==a)}var r=l.parent(t);if(e.export=r instanceof ft?1:0){var i=r.exported_definition;(i instanceof Be||i instanceof Ft)&&r.is_default&&(e.export=2)}}if(this.walk(l),this instanceof Oe&&(this.globals=new Map),l=new wn(e=>{if(e instanceof Xe&&e.label)return e.label.thedef.references.push(e),!0;if(e instanceof rn){var t,r=e.name;if("eval"==r&&l.parent()instanceof mt)for(var i=e.scope;i&&!i.uses_eval;i=i.parent_scope)i.uses_eval=!0;return l.parent()instanceof ht&&l.parent(1).module_name||!(t=e.scope.find_variable(r))?(t=n.def_global(e),e instanceof sn&&(t.export=1)):t.scope instanceof Pe&&"arguments"==r&&(t.scope.uses_arguments=!0),e.thedef=t,e.reference(),!e.scope.is_block_scope()||t.orig[0]instanceof Gt||(e.scope=e.scope.get_defun_scope()),!0}var s;if(e instanceof Jt&&(s=Kn(e.definition())))for(i=e.scope;i&&(d(i.enclosed,s),i!==s.scope);)i=i.parent_scope}),this.walk(l),(e.ie8||e.safari10)&&Cn(this,e=>{if(e instanceof Jt){var t=e.name,r=e.thedef.references,i=e.scope.get_defun_scope(),s=i.find_variable(t)||n.globals.get(t)||i.def_variable(e);return r.forEach((function(e){e.thedef=s,e.reference()})),e.thedef=s,e.reference(),!0}}),e.safari10)for(const e of c)e.parent_scope.variables.forEach((function(t){d(e.enclosed,t)}))})),Oe.DEFMETHOD("def_global",(function(e){var t=this.globals,n=e.name;if(t.has(n))return t.get(n);var r=new Wn(this,e);return r.undeclared=!0,r.global=!0,t.set(n,r),r})),ke.DEFMETHOD("init_scope_vars",(function(e){this.variables=new Map,this.functions=new Map,this.uses_with=!1,this.uses_eval=!1,this.parent_scope=e,this.enclosed=[],this.cname=-1,this._var_name_cache=null})),ke.DEFMETHOD("var_names",(function e(){var t=this._var_name_cache;return t||(this._var_name_cache=t=new Set(this.parent_scope?e.call(this.parent_scope):null),this._added_var_names&&this._added_var_names.forEach(e=>{t.add(e)}),this.enclosed.forEach((function(e){t.add(e.name)})),this.variables.forEach((function(e,n){t.add(n)}))),t})),ke.DEFMETHOD("add_var_name",(function(e){this._added_var_names||(this._added_var_names=new Set),this._added_var_names.add(e),this._var_name_cache||this.var_names(),this._var_name_cache.add(e)})),ke.DEFMETHOD("add_child_scope",(function(e){if(e.parent_scope===this)return;e.parent_scope=this,e._var_name_cache=null,e._added_var_names&&e._added_var_names.forEach(t=>e.add_var_name(t));const t=new Set(e.enclosed),n=(()=>{const e=[];let t=this;do{e.push(t)}while(t=t.parent_scope);return e.reverse(),e})(),r=[];for(const e of n){r.forEach(t=>d(e.enclosed,t));for(const n of e.variables.values())t.has(n)&&(d(r,n),d(e.enclosed,n))}})),he.DEFMETHOD("is_block_scope",a),Pt.DEFMETHOD("is_block_scope",a),Pe.DEFMETHOD("is_block_scope",a),Oe.DEFMETHOD("is_block_scope",a),tt.DEFMETHOD("is_block_scope",a),ye.DEFMETHOD("is_block_scope",c),ke.DEFMETHOD("is_block_scope",(function(){return this._block_scope||!1})),Ce.DEFMETHOD("is_block_scope",c),Pe.DEFMETHOD("init_scope_vars",(function(){ke.prototype.init_scope_vars.apply(this,arguments),this.uses_arguments=!1,this.def_variable(new Kt({name:"arguments",start:this.start,end:this.end}))})),Le.DEFMETHOD("init_scope_vars",(function(){ke.prototype.init_scope_vars.apply(this,arguments),this.uses_arguments=!1})),Bt.DEFMETHOD("mark_enclosed",(function(){for(var e=this.definition(),t=this.scope;t&&(d(t.enclosed,e),t!==e.scope);)t=t.parent_scope})),Bt.DEFMETHOD("reference",(function(){this.definition().references.push(this),this.mark_enclosed()})),ke.DEFMETHOD("find_variable",(function(e){return e instanceof Bt&&(e=e.name),this.variables.get(e)||this.parent_scope&&this.parent_scope.find_variable(e)})),ke.DEFMETHOD("def_function",(function(e,t){var n=this.def_variable(e,t);return(!n.init||n.init instanceof Be)&&(n.init=t),this.functions.set(e.name,n),n})),ke.DEFMETHOD("def_variable",(function(e,t){var n=this.variables.get(e.name);return n?(n.orig.push(e),n.init&&(n.scope!==e.scope||n.init instanceof Fe)&&(n.init=t)):(n=new Wn(this,e,t),this.variables.set(e.name,n),n.global=!this.parent_scope),e.thedef=n})),ke.DEFMETHOD("next_mangled",(function(e){return zn(this,e)})),Oe.DEFMETHOD("next_mangled",(function(e){let t;const n=this.mangled_names;do{t=zn(this,e)}while(n.has(t));return t})),Fe.DEFMETHOD("next_mangled",(function(e,t){for(var n=t.orig[0]instanceof Kt&&this.name&&this.name.definition(),r=n?n.mangled_name||n.name:null;;){var i=zn(this,e);if(!r||r!=i)return i}})),Bt.DEFMETHOD("unmangleable",(function(e){var t=this.definition();return!t||t.unmangleable(e)})),nn.DEFMETHOD("unmangleable",a),Bt.DEFMETHOD("unreferenced",(function(){return!this.definition().references.length&&!this.scope.pinned()})),Bt.DEFMETHOD("definition",(function(){return this.thedef})),Bt.DEFMETHOD("global",(function(){return this.thedef.global})),Oe.DEFMETHOD("_default_mangler_options",(function(e){return(e=s(e,{eval:!1,ie8:!1,keep_classnames:!1,keep_fnames:!1,module:!1,reserved:[],toplevel:!1})).module&&(e.toplevel=!0),Array.isArray(e.reserved)||e.reserved instanceof Set||(e.reserved=[]),e.reserved=new Set(e.reserved),e.reserved.add("arguments"),e})),Oe.DEFMETHOD("mangle_names",(function(e){e=this._default_mangler_options(e);var t=-1,n=[];e.keep_fnames&&(Gn=new Set);const r=this.mangled_names=new Set;e.cache&&(this.globals.forEach(s),e.cache.props&&e.cache.props.forEach((function(e){r.add(e)})));var i=new wn((function(r,i){if(r instanceof Ae){var o=t;return i(),t=o,!0}if(r instanceof ke)r.variables.forEach(s);else if(r.is_block_scope())r.block_scope.variables.forEach(s);else if(Gn&&r instanceof pt&&r.value instanceof Pe&&!r.value.name&&v(e.keep_fnames,r.name.name))Gn.add(r.name.definition().id);else{if(r instanceof nn){let e;do{e=Xn(++t)}while(w.has(e));return r.mangled_name=e,!0}!e.ie8&&!e.safari10&&r instanceof Jt&&n.push(r.definition())}}));function s(t){!(e.reserved.has(t.name)||1&t.export)&&n.push(t)}this.walk(i),(e.keep_fnames||e.keep_classnames)&&(jn=new Set,n.forEach(t=>{t.name.length<6&&t.unmangleable(e)&&jn.add(t.name)})),n.forEach(t=>{t.mangle(e)}),Gn=null,jn=null})),Oe.DEFMETHOD("find_colliding_names",(function(e){const t=e.cache&&e.cache.props,n=new Set;return e.reserved.forEach(r),this.globals.forEach(i),this.walk(new wn((function(e){e instanceof ke&&e.variables.forEach(i),e instanceof Jt&&i(e.definition())}))),n;function r(e){n.add(e)}function i(n){var i=n.name;if(n.global&&t&&t.has(i))i=t.get(i);else if(!n.unmangleable(e))return;r(i)}})),Oe.DEFMETHOD("expand_names",(function(e){Xn.reset(),Xn.sort(),e=this._default_mangler_options(e);var t=this.find_colliding_names(e),n=0;function r(r){if(r.global&&e.cache)return;if(r.unmangleable(e))return;if(e.reserved.has(r.name))return;const i=Kn(r),s=r.name=i?i.name:function(){var e;do{e=Xn(n++)}while(t.has(e)||w.has(e));return e}();r.orig.forEach((function(e){e.name=s})),r.references.forEach((function(e){e.name=s}))}this.globals.forEach(r),this.walk(new wn((function(e){e instanceof ke&&e.variables.forEach(r),e instanceof Jt&&r(e.definition())})))})),he.DEFMETHOD("tail_node",l),_t.DEFMETHOD("tail_node",(function(){return this.expressions[this.expressions.length-1]})),Oe.DEFMETHOD("compute_char_frequency",(function(e){e=this._default_mangler_options(e);try{he.prototype.print=function(t,n){this._print(t,n),this instanceof Bt&&!this.unmangleable(e)?Xn.consider(this.name,-1):e.properties&&(this instanceof yt?Xn.consider(this.property,-1):this instanceof vt&&function e(t){t instanceof pn?Xn.consider(t.value,-1):t instanceof xt?(e(t.consequent),e(t.alternative)):t instanceof _t&&e(t.tail_node())}(this.property))},Xn.consider(this.print_to_string(),1)}finally{he.prototype.print=he.prototype._print}Xn.sort()}));const Xn=(()=>{const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_".split(""),t="0123456789".split("");let n,r;function i(){r=new Map,e.forEach((function(e){r.set(e,0)})),t.forEach((function(e){r.set(e,0)}))}function s(e,t){return r.get(t)-r.get(e)}function o(e){var t="",r=54;e++;do{e--,t+=n[e%r],e=Math.floor(e/r),r=64}while(e>0);return t}return o.consider=function(e,t){for(var n=e.length;--n>=0;)r.set(e[n],r.get(e[n])+t)},o.sort=function(){n=g(e,s).concat(g(t,s))},o.reset=i,i(),o})();function qn(){const e={};return Object.keys(Yn({0:0})).forEach(t=>{const n=Yn({[t]:{0:0}});n&&(e[t]=n)}),e}function Yn(e){var t=Ei("",e);return t.error&&t.error.defs}let Qn=void 0;he.prototype.size=function(e,t){Qn=qn.mangle;let n=0;return xn(this,(e,t)=>{n+=e._size(t)},t||e&&e.stack),Qn=void 0,n},he.prototype._size=()=>0,fe.prototype._size=()=>8,me.prototype._size=function(){return 2+this.value.length};const Zn=e=>e.length&&e.length-1;ye.prototype._size=function(){return 2+Zn(this.body)},Oe.prototype._size=function(){return Zn(this.body)},Se.prototype._size=()=>1,Ae.prototype._size=()=>2,$e.prototype._size=()=>9,we.prototype._size=()=>7,Te.prototype._size=()=>8,Re.prototype._size=()=>8,De.prototype._size=()=>6,Ie.prototype._size=()=>3;const Jn=e=>(e.is_generator?1:0)+(e.async?6:0);Me.prototype._size=function(){return Jn(this)+4+Zn(this.argnames)+Zn(this.body)},Fe.prototype._size=function(e){return 2*!!Pn(e)+Jn(this)+12+Zn(this.argnames)+Zn(this.body)},Be.prototype._size=function(){return Jn(this)+13+Zn(this.argnames)+Zn(this.body)},Le.prototype._size=function(){let e=2+Zn(this.argnames);return 1===this.argnames.length&&this.argnames[0]instanceof Bt||(e+=2),Jn(this)+e+(Array.isArray(this.body)?Zn(this.body):this.body._size())},Ve.prototype._size=()=>2,He.prototype._size=function(){return 2+3*Math.floor(this.segments.length/2)},Ge.prototype._size=function(){return this.value.length},Ke.prototype._size=function(){return this.value?7:6},ze.prototype._size=()=>6,qe.prototype._size=function(){return this.label?6:5},Ye.prototype._size=function(){return this.label?9:8},Je.prototype._size=()=>4,et.prototype._size=function(){return 8+Zn(this.body)},rt.prototype._size=function(){return 5+Zn(this.body)},nt.prototype._size=function(){return 8+Zn(this.body)},it.prototype._size=function(){return 3+Zn(this.body)},st.prototype._size=function(){let e=7+Zn(this.body);return this.argname&&(e+=2),e},ot.prototype._size=function(){return 7+Zn(this.body)};const er=(e,t)=>e+Zn(t.definitions);ct.prototype._size=function(){return er(4,this)},lt.prototype._size=function(){return er(4,this)},ut.prototype._size=function(){return er(6,this)},pt.prototype._size=function(){return this.value?1:0},ht.prototype._size=function(){return this.name?4:0},dt.prototype._size=function(){let e=6;return this.imported_name&&(e+=1),(this.imported_name||this.imported_names)&&(e+=5),this.imported_names&&(e+=2+Zn(this.imported_names)),e},ft.prototype._size=function(){let e=7+(this.is_default?8:0);return this.exported_value&&(e+=this.exported_value._size()),this.exported_names&&(e+=2+Zn(this.exported_names)),this.module_name&&(e+=5),e},mt.prototype._size=function(){return 2+Zn(this.args)},gt.prototype._size=function(){return 6+Zn(this.args)},_t.prototype._size=function(){return Zn(this.expressions)},yt.prototype._size=function(){return this.property.length+1},vt.prototype._size=()=>2,St.prototype._size=function(){return"typeof"===this.operator?7:"void"===this.operator?5:this.operator.length},Ct.prototype._size=function(e){if("in"===this.operator)return 4;let t=this.operator.length;return("+"===this.operator||"-"===this.operator)&&this.right instanceof St&&this.right.operator===this.operator&&(t+=1),this.needs_parens(e)&&(t+=2),t},xt.prototype._size=()=>3,Tt.prototype._size=function(){return 2+Zn(this.elements)},Rt.prototype._size=function(e){let t=2;return Pn(e)&&(t+=2),t+Zn(this.properties)};const tr=e=>"string"==typeof e?e.length:0;Dt.prototype._size=function(){return tr(this.key)+1};const nr=e=>e?7:0;Ot.prototype._size=function(){return 5+nr(this.static)+tr(this.key)},kt.prototype._size=function(){return 5+nr(this.static)+tr(this.key)},It.prototype._size=function(){return nr(this.static)+tr(this.key)+Jn(this)},Pt.prototype._size=function(){return(this.name?8:7)+(this.extends?8:0)},Mt.prototype._size=function(){return nr(this.static)+("string"==typeof this.key?this.key.length+2:0)+(this.value?1:0)},Bt.prototype._size=function(){return!Qn||this.definition().unmangleable(Qn)?this.name.length:2},qt.prototype._size=function(){return this.name.length},rn.prototype._size=function(){const{name:e,thedef:t}=this;return t&&t.global?e.length:"arguments"===e?9:2},Vt.prototype._size=()=>10,tn.prototype._size=function(){return this.name.length},on.prototype._size=function(){return this.name.length},cn.prototype._size=()=>4,ln.prototype._size=()=>5,pn.prototype._size=function(){return this.value.length+2},hn.prototype._size=function(){const{value:e}=this;return 0===e?1:e>0&&Math.floor(e)===e?Math.floor(Math.log10(e)+1):e.toString().length},dn.prototype._size=function(){return this.value.length},fn.prototype._size=function(){return this.value.toString().length},gn.prototype._size=()=>4,_n.prototype._size=()=>3,En.prototype._size=()=>6,yn.prototype._size=()=>0,vn.prototype._size=()=>8,An.prototype._size=()=>4,bn.prototype._size=()=>5,Qe.prototype._size=()=>6,Ze.prototype._size=()=>6;const rr=(e,t)=>e.flags&t,ir=(e,t)=>{e.flags|=t},sr=(e,t)=>{e.flags&=~t};class or extends wn{constructor(e,t){super(),void 0===e.defaults||e.defaults||(t=!0),this.options=s(e,{arguments:!1,arrows:!t,booleans:!t,booleans_as_integers:!1,collapse_vars:!t,comparisons:!t,computed_props:!t,conditionals:!t,dead_code:!t,defaults:!0,directives:!t,drop_console:!1,drop_debugger:!t,ecma:5,evaluate:!t,expression:!1,global_defs:!1,hoist_funs:!1,hoist_props:!t,hoist_vars:!1,ie8:!1,if_return:!t,inline:!t,join_vars:!t,keep_classnames:!1,keep_fargs:!0,keep_fnames:!1,keep_infinity:!1,loops:!t,module:!1,negate_iife:!t,passes:1,properties:!t,pure_getters:!t&&"strict",pure_funcs:null,reduce_funcs:null,reduce_vars:!t,sequences:!t,side_effects:!t,switches:!t,top_retain:null,toplevel:!(!e||!e.top_retain),typeofs:!t,unsafe:!1,unsafe_arrows:!1,unsafe_comps:!1,unsafe_Function:!1,unsafe_math:!1,unsafe_symbols:!1,unsafe_methods:!1,unsafe_proto:!1,unsafe_regexp:!1,unsafe_undefined:!1,unused:!t,warnings:!1},!0);var n=this.options.global_defs;if("object"==typeof n)for(var r in n)"@"===r[0]&&y(n,r)&&(n[r.slice(1)]=le(n[r],{expression:!0}));!0===this.options.inline&&(this.options.inline=3);var i=this.options.pure_funcs;this.pure_funcs="function"==typeof i?i:i?function(e){return!i.includes(e.expression.print_to_string())}:c;var o=this.options.top_retain;o instanceof RegExp?this.top_retain=function(e){return o.test(e.name)}:"function"==typeof o?this.top_retain=o:o&&("string"==typeof o&&(o=o.split(/,/)),this.top_retain=function(e){return o.includes(e.name)}),this.options.module&&(this.directives["use strict"]=!0,this.options.toplevel=!0);var a=this.options.toplevel;this.toplevel="string"==typeof a?{funcs:/funcs/.test(a),vars:/vars/.test(a)}:{funcs:a,vars:a};var l=this.options.sequences;this.sequences_limit=1==l?800:0|l,this.warnings_produced={},this.evaluated_regexps=new Map}option(e){return this.options[e]}exposed(e){if(e.export)return!0;if(e.global)for(var t=0,n=e.orig.length;t0||this.option("reduce_vars"))&&e.reset_opt_flags(this),e=e.transform(this),t>1){let t=0;if(Cn(e,()=>{t++}),this.info("pass "+s+": last_count: "+n+", count: "+t),t=0;){if(!(i[s]instanceof Dt))return;n||i[s].key!==t||(n=i[s].value)}}return n instanceof rn&&n.fixed_value()||n}}function lr(e,t,n,r,i,s){var o=t.parent(i),a=Pr(n,o);if(a)return a;if(!s&&o instanceof mt&&o.expression===n&&!(r instanceof Le)&&!(r instanceof Pt)&&!o.is_expr_pure(e)&&(!(r instanceof Fe)||!(o instanceof gt)&&r.contains_this()))return!0;if(o instanceof Tt)return lr(e,t,o,o,i+1);if(o instanceof Dt&&n===o.value){var c=t.parent(i+1);return lr(e,t,c,c,i+2)}if(o instanceof Et&&o.expression===n){var l=cr(r,o.property);return!s&&lr(e,t,o,l,i+1)}}function ur(e){return e instanceof Le||e instanceof Fe}function pr(e){if(e instanceof cn)return!0;if(e instanceof rn)return e.definition().orig[0]instanceof Yt;if(e instanceof Et){if((e=e.expression)instanceof rn){if(e.is_immutable())return!1;e=e.fixed_value()}return!e||!(e instanceof fn)&&(e instanceof un||pr(e))}return!1}function hr(e,t){if(!(e instanceof rn))return!1;for(var n=e.definition().orig,r=n.length;--r>=0;)if(n[r]instanceof t)return!0}function dr(e){for(let t=0;;t++){const n=e.parent(t);if(n instanceof Oe)return n;if(n instanceof Pe)return n;if(n.block_scope)return n.block_scope}}function fr(e,t){for(var n,r=0;(n=e.parent(r++))&&!(n instanceof ke);)if(n instanceof st&&n.argname){n=n.argname.definition().scope;break}return n.find_variable(t)}function mr(e,t){if(1==t.length)return t[0];if(0==t.length)throw new Error("trying to create a sequence with length zero!");return h(_t,e,{expressions:t.reduce(Er,[])})}function gr(e,t){switch(typeof e){case"string":return h(pn,t,{value:e});case"number":return isNaN(e)?h(_n,t):isFinite(e)?1/e<0?h(bt,t,{operator:"-",expression:h(hn,t,{value:-e})}):h(hn,t,{value:e}):e<0?h(bt,t,{operator:"-",expression:h(vn,t)}):h(vn,t);case"boolean":return h(e?An:bn,t);case"undefined":return h(En,t);default:if(null===e)return h(gn,t,{value:null});if(e instanceof RegExp)return h(fn,t,{value:{source:b(e.source),flags:e.flags}});throw new Error(f("Can't handle constant of type: {type}",{type:typeof e}))}}function _r(e,t,n){return e instanceof bt&&"delete"==e.operator||e instanceof mt&&e.expression===t&&(n instanceof Et||n instanceof rn&&"eval"==n.name)?mr(t,[h(hn,t,{value:0}),n]):n}function Er(e,t){return t instanceof _t?e.push(...t.expressions):e.push(t),e}function yr(e){if(null===e)return[];if(e instanceof ve)return e.body;if(e instanceof Se)return[];if(e instanceof de)return[e];throw new Error("Can't convert thing to statement array")}function vr(e){return null===e||e instanceof Se||e instanceof ve&&0==e.body.length}function Sr(e){return!(e instanceof Ft||e instanceof Be||e instanceof lt||e instanceof ut||e instanceof ft||e instanceof dt)}function br(e){return e instanceof Ce&&e.body instanceof ve?e.body:e}function Ar(e){return"Call"==e.TYPE&&(e.expression instanceof Fe||Ar(e.expression))}function Cr(e){return e instanceof rn&&e.definition().undeclared}ar(he,(function(e){return e})),Oe.DEFMETHOD("drop_console",(function(){return this.transform(new Tn((function(e){if("Call"==e.TYPE){var t=e.expression;if(t instanceof Et){for(var n=t.expression;n.expression;)n=n.expression;if(Cr(n)&&"console"==n.name)return h(En,e)}}})))})),he.DEFMETHOD("equivalent_to",(function(e){return((e,t)=>{if(!Vn(e,t))return!1;const n=[e],r=[t],i=n.push.bind(n),s=r.push.bind(r);for(;n.length&&r.length;){const e=n.pop(),t=r.pop();if(!Vn(e,t))return!1;if(e._children_backwards(i),t._children_backwards(s),n.length!==r.length)return!1}return 0==n.length&&0==r.length})(this,e)})),ke.DEFMETHOD("process_expression",(function(e,t){var n=this,r=new Tn((function(i){if(e&&i instanceof ge)return h(Ke,i,{value:i.body});if(!e&&i instanceof Ke){if(t){var s=i.value&&i.value.drop_side_effect_free(t,!0);return s?h(ge,i,{body:s}):h(Se,i)}return h(ge,i,{body:i.value||h(bt,i,{operator:"void",expression:h(hn,i,{value:0})})})}if(i instanceof Pt||i instanceof Pe&&i!==n)return i;if(i instanceof ye){var o=i.body.length-1;o>=0&&(i.body[o]=i.body[o].transform(r))}else i instanceof Je?(i.body=i.body.transform(r),i.alternative&&(i.alternative=i.alternative.transform(r))):i instanceof De&&(i.body=i.body.transform(r));return i}));n.transform(r)})),function(e){function t(e,t){t.assignments=0,t.chained=!1,t.direct_access=!1,t.escaped=0,t.recursive_refs=0,t.references=[],t.should_replace=void 0,t.single_use=void 0,t.scope.pinned()?t.fixed=!1:t.orig[0]instanceof jt||!e.exposed(t)?t.fixed=t.init:t.fixed=!1}function n(e,n,r){r.variables.forEach((function(r){t(n,r),null===r.fixed?(e.defs_to_safe_ids.set(r.id,e.safe_ids),a(e,r,!0)):r.fixed&&(e.loop_ids.set(r.id,e.in_loop),a(e,r,!0))}))}function r(e,n){n.block_scope&&n.block_scope.variables.forEach(n=>{t(e,n)})}function i(e){e.safe_ids=Object.create(e.safe_ids)}function s(e){e.safe_ids=Object.getPrototypeOf(e.safe_ids)}function a(e,t,n){e.safe_ids[t.id]=n}function c(e,t){if("m"==t.single_use)return!1;if(e.safe_ids[t.id]){if(null==t.fixed){var n=t.orig[0];if(n instanceof Kt||"arguments"==n.name)return!1;t.fixed=h(En,n)}return!0}return t.fixed instanceof Be}function l(e,t,n,r){if(void 0===t.fixed)return!0;let i;return null===t.fixed&&(i=e.defs_to_safe_ids.get(t.id))?(i[t.id]=!1,e.defs_to_safe_ids.delete(t.id),!0):!!y(e.safe_ids,t.id)&&!!c(e,t)&&!1!==t.fixed&&!(null!=t.fixed&&(!r||t.references.length>t.assignments))&&(t.fixed instanceof Be?r instanceof he&&t.fixed.parent_scope===n:t.orig.every(e=>!(e instanceof jt||e instanceof zt||e instanceof Yt)))}function u(e,t,n,r,i,s,o){var a=e.parent(s);if(i){if(i.is_constant())return;if(i instanceof Lt)return}if(a instanceof $t&&"="==a.operator&&r===a.right||a instanceof mt&&(r!==a.expression||a instanceof gt)||a instanceof We&&r===a.value&&r.scope!==t.scope||a instanceof pt&&r===a.value||a instanceof Ze&&r===a.value&&r.scope!==t.scope)return!(o>1)||i&&i.is_constant_expression(n)||(o=1),void((!t.escaped||t.escaped>o)&&(t.escaped=o));if(a instanceof Tt||a instanceof Qe||a instanceof Ct&&Or.has(a.operator)||a instanceof xt&&r!==a.condition||a instanceof Ie||a instanceof _t&&r===a.tail_node())u(e,t,n,a,a,s+1,o);else if(a instanceof Dt&&r===a.value){var c=e.parent(s+1);u(e,t,n,c,c,s+2,o)}else if(a instanceof Et&&r===a.expression&&(u(e,t,n,a,i=cr(i,a.property),s+1,o+1),i))return;s>0||a instanceof _t&&r!==a.tail_node()||a instanceof ge||(t.direct_access=!0)}e(he,o);const p=e=>Cn(e,e=>{if(e instanceof Bt){var t=e.definition();t&&(e instanceof rn&&t.references.push(e),t.fixed=!1)}});e(Me,(function(e,t,r){return i(e),n(e,r,this),t(),s(e),!0})),e($t,(function(e,t,n){var r=this;if(r.left instanceof Ve)p(r.left);else{var i=r.left;if(i instanceof rn){var s=i.definition(),o=l(e,s,i.scope,r.right);if(s.assignments++,o){var c=s.fixed;if(c||"="==r.operator){var d="="==r.operator,f=d?r.right:r;if(!lr(n,e,r,f,0))return s.references.push(i),d||(s.chained=!0),s.fixed=d?function(){return r.right}:function(){return h(Ct,r,{operator:r.operator.slice(0,-1),left:c instanceof he?c:c(),right:r.right})},a(e,s,!1),r.right.walk(e),a(e,s,!0),u(e,s,i.scope,r,f,0,1),!0}}}}})),e(Ct,(function(e){if(Or.has(this.operator))return this.left.walk(e),i(e),this.right.walk(e),s(e),!0})),e(ye,(function(e,t,n){r(n,this)})),e(rt,(function(e){return i(e),this.expression.walk(e),s(e),i(e),_e(this,e),s(e),!0})),e(Pt,(function(e,t){return sr(this,16),i(e),t(),s(e),!0})),e(xt,(function(e){return this.condition.walk(e),i(e),this.consequent.walk(e),s(e),i(e),this.alternative.walk(e),s(e),!0})),e(nt,(function(e,t){return i(e),t(),s(e),!0})),e(Pe,(function(e,t,r){return sr(this,16),i(e),n(e,r,this),this.uses_arguments?(t(),void s(e)):(!this.name&&(o=e.parent())instanceof mt&&o.expression===this&&!o.args.some(e=>e instanceof Ie)&&this.argnames.every(e=>e instanceof Bt)&&this.argnames.forEach((t,n)=>{if(t.definition){var r=t.definition();r.orig.length>1||(void 0!==r.fixed||this.uses_arguments&&!e.has_directive("use strict")?r.fixed=!1:(r.fixed=function(){return o.args[n]||h(En,o)},e.loop_ids.set(r.id,e.in_loop),a(e,r,!0)))}}),t(),s(e),!0);var o})),e($e,(function(e,t,n){r(n,this);const o=e.in_loop;return e.in_loop=this,i(e),this.body.walk(e),qr(this)&&(s(e),i(e)),this.condition.walk(e),s(e),e.in_loop=o,!0})),e(Te,(function(e,t,n){r(n,this),this.init&&this.init.walk(e);const o=e.in_loop;return e.in_loop=this,i(e),this.condition&&this.condition.walk(e),this.body.walk(e),this.step&&(qr(this)&&(s(e),i(e)),this.step.walk(e)),s(e),e.in_loop=o,!0})),e(Re,(function(e,t,n){r(n,this),p(this.init),this.object.walk(e);const o=e.in_loop;return e.in_loop=this,i(e),this.body.walk(e),s(e),e.in_loop=o,!0})),e(Je,(function(e){return this.condition.walk(e),i(e),this.body.walk(e),s(e),this.alternative&&(i(e),this.alternative.walk(e),s(e)),!0})),e(Ae,(function(e){return i(e),this.body.walk(e),s(e),!0})),e(Jt,(function(){this.definition().fixed=!1})),e(rn,(function(e,t,n){var r,i,s=this.definition();s.references.push(this),1==s.references.length&&!s.fixed&&s.orig[0]instanceof zt&&e.loop_ids.set(s.id,e.in_loop),void 0!==s.fixed&&c(e,s)?s.fixed&&((r=this.fixed_value())instanceof Pe&&Zr(e,s)?s.recursive_refs++:r&&!n.exposed(s)&&function(e,t,n){return t.option("unused")&&!n.scope.pinned()&&n.references.length-n.recursive_refs==1&&e.loop_ids.get(n.id)===e.in_loop}(e,n,s)?s.single_use=r instanceof Pe&&!r.pinned()||r instanceof Pt||s.scope===this.scope&&r.is_constant_expression():s.single_use=!1,lr(n,e,this,r,0,!!(i=r)&&(i.is_constant()||i instanceof Pe||i instanceof cn))&&(s.single_use?s.single_use="m":s.fixed=!1)):s.fixed=!1,u(e,s,this.scope,this,r,0,1)})),e(Oe,(function(e,r,i){this.globals.forEach((function(e){t(i,e)})),n(e,i,this)})),e(it,(function(e,t,n){return r(n,this),i(e),_e(this,e),s(e),this.bcatch&&(i(e),this.bcatch.walk(e),s(e)),this.bfinally&&this.bfinally.walk(e),!0})),e(St,(function(e){var t=this;if("++"===t.operator||"--"===t.operator){var n=t.expression;if(n instanceof rn){var r=n.definition(),i=l(e,r,n.scope,!0);if(r.assignments++,i){var s=r.fixed;if(s)return r.references.push(n),r.chained=!0,r.fixed=function(){return h(Ct,t,{operator:t.operator.slice(0,-1),left:h(bt,t,{operator:"+",expression:s instanceof he?s:s()}),right:h(hn,t,{value:1})})},a(e,r,!0),!0}}}})),e(pt,(function(e,t){var n=this;if(n.name instanceof Ve)p(n.name);else{var r=n.name.definition();if(n.value){if(l(e,r,n.name.scope,n.value))return r.fixed=function(){return n.value},e.loop_ids.set(r.id,e.in_loop),a(e,r,!1),t(),a(e,r,!0),!0;r.fixed=!1}}})),e(we,(function(e,t,n){r(n,this);const o=e.in_loop;return e.in_loop=this,i(e),t(),s(e),e.in_loop=o,!0}))}((function(e,t){e.DEFMETHOD("reduce_vars",t)})),Oe.DEFMETHOD("reset_opt_flags",(function(e){const t=this,n=e.option("reduce_vars"),r=new wn((function(i,s){if(sr(i,1792),n)return e.top_retain&&i instanceof Be&&r.parent()===t&&ir(i,1024),i.reduce_vars(r,s,e)}));r.safe_ids=Object.create(null),r.in_loop=null,r.loop_ids=new Map,r.defs_to_safe_ids=new Map,t.walk(r)})),Bt.DEFMETHOD("fixed_value",(function(){var e=this.thedef.fixed;return!e||e instanceof he?e:e()})),rn.DEFMETHOD("is_immutable",(function(){var e=this.definition().orig;return 1==e.length&&e[0]instanceof Yt}));var xr=_("Array Boolean clearInterval clearTimeout console Date decodeURI decodeURIComponent encodeURI encodeURIComponent Error escape eval EvalError Function isFinite isNaN JSON Math Number parseFloat parseInt RangeError ReferenceError RegExp Object setInterval setTimeout String SyntaxError TypeError unescape URIError");rn.DEFMETHOD("is_declared",(function(e){return!this.definition().undeclared||e.option("unsafe")&&xr.has(this.name)}));var $r,wr=_("Infinity NaN undefined");function Tr(e){return e instanceof vn||e instanceof _n||e instanceof En}function Rr(e,t){var n,i,s=t.find_parent(ke).get_defun_scope();!function(){var e=t.self(),r=0;do{if(e instanceof st||e instanceof ot)r++;else if(e instanceof Ce)n=!0;else{if(e instanceof ke){s=e;break}e instanceof it&&(i=!0)}}while(e=t.parent(r++))}();var o,a=10;do{o=!1,l(e),t.option("dead_code")&&d(e,t),t.option("if_return")&&u(e,t),t.sequences_limit>0&&(g(e,t),E(e,t)),t.option("join_vars")&&v(e),t.option("collapse_vars")&&c(e,t)}while(o&&a-- >0);function c(e,t){if(s.pinned())return e;for(var a,c=[],l=e.length,u=new Tn((function(e){if(R)return e;if(!T)return e!==f[m]?e:++m=0;){0==l&&t.option("unused")&&F();var f=[];for(L(e[l]);c.length>0;){f=c.pop();var m=0,g=f[f.length-1],_=null,E=null,y=null,v=B(g);if(v&&!pr(v)&&!v.has_side_effects(t)){var S=U(g),b=G(v);v instanceof rn&&S.set(v.name,!1);var C=j(g),x=W(),$=g.may_throw(t),w=g.name instanceof Kt,T=w,R=!1,N=0,D=!a||!T;if(!D){for(var k=t.self().argnames.lastIndexOf(g.name)+1;!R&&kN)N=!1;else{for(R=!1,m=0,T=w,O=l;!R&&O!(e instanceof Ie))){var i=t.has_directive("use strict");i&&!r(i,n.body)&&(i=!1);var s=n.argnames.length;a=e.args.slice(s);for(var o=new Set,l=s;--l>=0;){var u=n.argnames[l],p=e.args[l];const r=u.definition&&u.definition();if(!(r&&r.orig.length>1||(a.unshift(h(pt,u,{name:u,value:p})),o.has(u.name))))if(o.add(u.name),u instanceof Ie){var d=e.args.slice(l);d.every(e=>!M(n,e,i))&&c.unshift([h(pt,u,{name:u.expression,value:h(Tt,e,{elements:d})})])}else p?(p instanceof Pe&&p.pinned()||M(n,p,i))&&(p=null):p=h(En,u).transform(t),p&&c.unshift([h(pt,u,{name:u,value:p})])}}}function L(e){if(f.push(e),e instanceof $t)e.left.has_side_effects(t)||c.push(f.slice()),L(e.right);else if(e instanceof Ct)L(e.left),L(e.right);else if(e instanceof mt&&!A(e,Dn))L(e.expression),e.args.forEach(L);else if(e instanceof rt)L(e.expression);else if(e instanceof xt)L(e.condition),L(e.consequent),L(e.alternative);else if(e instanceof at){var n=e.definitions.length,r=n-200;for(r<0&&(r=0);r1&&!(e.name instanceof Kt)||(i>1?function(e){var t=e.value;if(t instanceof rn&&"arguments"!=t.name){var n=t.definition();if(!n.undeclared)return _=n}}(e):!t.exposed(n))?h(rn,e.name,e.name):void 0}}function V(e){return e[e instanceof $t?"right":"value"]}function U(e){var n=new Map;if(e instanceof St)return n;var r=new wn((function(e){for(var i=e;i instanceof Et;)i=i.expression;(i instanceof rn||i instanceof cn)&&n.set(i.name,n.get(i.name)||lr(t,r,e,e,0))}));return V(e).walk(r),n}function H(n){if(n.name instanceof Kt){var r=t.parent(),i=t.self().argnames,s=i.indexOf(n.name);if(s<0)r.args.length=Math.min(r.args.length,i.length-1);else{var o=r.args;o[s]&&(o[s]=h(hn,o[s],{value:0}))}return!0}var a=!1;return e[l].transform(new Tn((function(e,t,r){return a?e:e===n||e.body===n?(a=!0,e instanceof pt?(e.value=e.name instanceof jt?h(En,e.value):null,e):r?p.skip:null):void 0}),(function(e){if(e instanceof _t)switch(e.expressions.length){case 0:return null;case 1:return e.expressions[0]}})))}function G(e){for(;e instanceof Et;)e=e.expression;return e instanceof rn&&e.definition().scope===s&&!(n&&(S.has(e.name)||g instanceof St||g instanceof $t&&"="!=g.operator))}function j(e){return e instanceof St?Ir.has(e.operator):V(e).has_side_effects(t)}function W(){if(C)return!1;if(_)return!0;if(v instanceof rn){var e=v.definition();if(e.references.length-e.replaced==(g instanceof pt?1:2))return!0}return!1}function K(e){if(!e.definition)return!0;var t=e.definition();return!(1==t.orig.length&&t.orig[0]instanceof zt||t.scope.get_defun_scope()===s&&t.references.every(e=>{var t=e.scope.get_defun_scope();return"Scope"==t.TYPE&&(t=t.parent_scope),t===s}))}}function l(e){for(var t=[],n=0;n=0;){var r=e[n];if(r instanceof Je&&r.body instanceof Ke&&++t>1)return!0}return!1}(e),i=n instanceof Pe,s=e.length;--s>=0;){var a=e[s],c=v(s),l=e[c];if(i&&!l&&a instanceof Ke){if(!a.value){o=!0,e.splice(s,1);continue}if(a.value instanceof bt&&"void"==a.value.operator){o=!0,e[s]=h(ge,a,{body:a.value.expression});continue}}if(a instanceof Je){var u;if(_(u=Wr(a.body))){u.label&&m(u.label.thedef.references,u),o=!0,(a=a.clone()).condition=a.condition.negate(t);var p=y(a.body,u);a.body=h(ve,a,{body:yr(a.alternative).concat(E())}),a.alternative=h(ve,a,{body:p}),e[s]=a.transform(t);continue}if(_(u=Wr(a.alternative))){u.label&&m(u.label.thedef.references,u),o=!0,(a=a.clone()).body=h(ve,a.body,{body:yr(a.body).concat(E())}),p=y(a.alternative,u),a.alternative=h(ve,a.alternative,{body:p}),e[s]=a.transform(t);continue}}if(a instanceof Je&&a.body instanceof Ke){var d=a.body.value;if(!d&&!a.alternative&&(i&&!l||l instanceof Ke&&!l.value)){o=!0,e[s]=h(ge,a.condition,{body:a.condition});continue}if(d&&!a.alternative&&l instanceof Ke&&l.value){o=!0,(a=a.clone()).alternative=l,e[s]=a.transform(t),e.splice(c,1);continue}if(d&&!a.alternative&&(!l&&i&&r||l instanceof Ke)){o=!0,(a=a.clone()).alternative=l||h(Ke,a,{value:null}),e[s]=a.transform(t),l&&e.splice(c,1);continue}var g=e[S(s)];if(t.option("sequences")&&i&&!a.alternative&&g instanceof Je&&g.body instanceof Ke&&v(c)==e.length&&l instanceof ge){o=!0,(a=a.clone()).alternative=h(ve,l,{body:[l,h(Ke,l,{value:null})]}),e[s]=a.transform(t),e.splice(c,1);continue}}}function _(r){if(!r)return!1;for(var o=s+1,a=e.length;o=0;){var r=e[n];if(!(r instanceof ct&&f(r)))break}return n}}function d(e,t){for(var n,r=t.self(),i=0,s=0,a=e.length;i!e.value)}function g(e,t){if(!(e.length<2)){for(var n=[],r=0,i=0,s=e.length;i=t.sequences_limit&&l();var c=a.body;n.length>0&&(c=c.drop_side_effect_free(t)),c&&Er(n,c)}else a instanceof at&&f(a)||a instanceof Be||l(),e[r++]=a}l(),e.length=r,r!=s&&(o=!0)}function l(){if(n.length){var t=mr(n[0],n);e[r++]=h(ge,t,{body:t}),n=[]}}}function _(e,t){if(!(e instanceof ve))return e;for(var n=null,r=0,i=e.body.length;re instanceof ke||(e instanceof Ct&&"in"===e.operator?$n:void 0))||(a.init?a.init=n(a.init):(a.init=r.body,i--,o=!0)):a instanceof Re?a.init instanceof ut||a.init instanceof lt||(a.object=n(a.object)):a instanceof Je?a.condition=n(a.condition):(a instanceof et||a instanceof De)&&(a.expression=n(a.expression))),t.option("conditionals")&&a instanceof Je){var c=[],l=_(a.body,c),u=_(a.alternative,c);if(!1!==l&&!1!==u&&c.length>0){var p=c.length;c.push(h(Je,a,{condition:a.condition,body:l||h(Se,a.body),alternative:u})),c.unshift(i,1),[].splice.apply(e,c),s+=p,i+=p+1,r=null,o=!0;continue}}e[i++]=a,r=a instanceof ge?a:null}e.length=i}function y(e,n){if(e instanceof at){var r,i=e.definitions[e.definitions.length-1];if(i.value instanceof Rt&&(n instanceof $t?r=[n]:n instanceof _t&&(r=n.expressions.slice()),r)){var o=!1;do{var a=r[0];if(!(a instanceof $t))break;if("="!=a.operator)break;if(!(a.left instanceof Et))break;var c=a.left.expression;if(!(c instanceof rn))break;if(i.name.name!=c.name)break;if(!a.right.is_constant_expression(s))break;var l=a.left.property;if(l instanceof he&&(l=l.evaluate(t)),l instanceof he)break;l=""+l;var u=t.option("ecma")<2015&&t.has_directive("use strict")?function(e){return e.key!=l&&e.key&&e.key.name!=l}:function(e){return e.key&&e.key.name!=l};if(!i.value.properties.every(u))break;var p=i.value.properties.filter((function(e){return e.key===l}))[0];p?p.value=new _t({start:p.start,expressions:[p.value.clone(),a.right.clone()],end:p.end}):i.value.properties.push(h(Dt,a,{key:l,value:a.right})),r.shift(),o=!0}while(r.length);return o&&r}}}function v(e){for(var t,n=0,r=-1,i=e.length;nr instanceof ct?(e.warn("Declarations in unreachable code! [{file}:{line},{col}]",r.start),r.remove_initializers(),n.push(r),!0):r instanceof Be&&(r===t||!e.has_directive("use strict"))?(n.push(r===t?r:h(ct,r,{definitions:[h(pt,r,{name:h(Ht,r.name,r.name),value:null})]})),!0):r instanceof ke||void 0)}function Dr(e){return e instanceof un?e.getValue():e instanceof bt&&"void"==e.operator&&e.expression instanceof un?void 0:e}function kr(e,t){return rr(e,8)||e instanceof En||e instanceof bt&&"void"==e.operator&&!e.expression.has_side_effects(t)}!function(e){function t(e){return/strict/.test(e.option("pure_getters"))}he.DEFMETHOD("may_throw_on_access",(function(e){return!e.option("pure_getters")||this._dot_throw(e)})),e(he,t),e(gn,c),e(En,c),e(un,a),e(Tt,a),e(Rt,(function(e){if(!t(e))return!1;for(var n=this.properties.length;--n>=0;)if(this.properties[n]._dot_throw(e))return!0;return!1})),e(Pt,a),e(Nt,a),e(Ot,c),e(Ie,(function(e){return this.expression._dot_throw(e)})),e(Fe,a),e(Le,a),e(At,a),e(bt,(function(){return"void"==this.operator})),e(Ct,(function(e){return("&&"==this.operator||"||"==this.operator||"??"==this.operator)&&(this.left._dot_throw(e)||this.right._dot_throw(e))})),e($t,(function(e){return"="==this.operator&&this.right._dot_throw(e)})),e(xt,(function(e){return this.consequent._dot_throw(e)||this.alternative._dot_throw(e)})),e(yt,(function(e){return!(!t(e)||this.expression instanceof Fe&&"prototype"==this.property)})),e(_t,(function(e){return this.tail_node()._dot_throw(e)})),e(rn,(function(e){if("arguments"===this.name)return!1;if(rr(this,8))return!0;if(!t(e))return!1;if(Cr(this)&&this.is_declared(e))return!1;if(this.is_immutable())return!1;var n=this.fixed_value();return!n||n._dot_throw(e)}))}((function(e,t){e.DEFMETHOD("_dot_throw",t)})),function(e){const t=_("! delete"),n=_("in instanceof == != === !== < <= >= >");e(he,a),e(bt,(function(){return t.has(this.operator)})),e(Ct,(function(){return n.has(this.operator)||Or.has(this.operator)&&this.left.is_boolean()&&this.right.is_boolean()})),e(xt,(function(){return this.consequent.is_boolean()&&this.alternative.is_boolean()})),e($t,(function(){return"="==this.operator&&this.right.is_boolean()})),e(_t,(function(){return this.tail_node().is_boolean()})),e(An,c),e(bn,c)}((function(e,t){e.DEFMETHOD("is_boolean",t)})),function(e){e(he,a),e(hn,c);var t=_("+ - ~ ++ --");e(St,(function(){return t.has(this.operator)}));var n=_("- * / % & | ^ << >> >>>");e(Ct,(function(e){return n.has(this.operator)||"+"==this.operator&&this.left.is_number(e)&&this.right.is_number(e)})),e($t,(function(e){return n.has(this.operator.slice(0,-1))||"="==this.operator&&this.right.is_number(e)})),e(_t,(function(e){return this.tail_node().is_number(e)})),e(xt,(function(e){return this.consequent.is_number(e)&&this.alternative.is_number(e)}))}((function(e,t){e.DEFMETHOD("is_number",t)})),($r=function(e,t){e.DEFMETHOD("is_string",t)})(he,a),$r(pn,c),$r(He,c),$r(bt,(function(){return"typeof"==this.operator})),$r(Ct,(function(e){return"+"==this.operator&&(this.left.is_string(e)||this.right.is_string(e))})),$r($t,(function(e){return("="==this.operator||"+="==this.operator)&&this.right.is_string(e)})),$r(_t,(function(e){return this.tail_node().is_string(e)})),$r(xt,(function(e){return this.consequent.is_string(e)&&this.alternative.is_string(e)}));var Or=_("&& || ??"),Ir=_("delete ++ --");function Pr(e,t){return t instanceof St&&Ir.has(t.operator)?t.expression:t instanceof $t&&t.left===e?e:void 0}function Mr(e,t){return e.size()>t.size()?t:e}function Fr(e,t){return Mr(h(ge,e,{body:e}),h(ge,t,{body:t})).body}function Lr(e,t,n){return(Pn(e)?Fr:Mr)(t,n)}function Br(e){const t=new Map;for(var n of Object.keys(e))t.set(n,_(e[n]));return t}!function(e){function t(e,t){e.warn("global_defs "+t.print_to_string()+" redefined [{file}:{line},{col}]",t.start)}Oe.DEFMETHOD("resolve_defines",(function(e){return e.option("global_defs")?(this.figure_out_scope({ie8:e.option("ie8")}),this.transform(new Tn((function(n){var r=n._find_defs(e,"");if(r){for(var i,s=0,o=n;(i=this.parent(s++))&&i instanceof Et&&i.expression===o;)o=i;if(!Pr(o,i))return r;t(e,n)}})))):this})),e(he,o),e(yt,(function(e,t){return this.expression._find_defs(e,"."+this.property+t)})),e(Ut,(function(e){this.global()&&y(e.option("global_defs"),this.name)&&t(e,this)})),e(rn,(function(e,t){if(this.global()){var n=e.option("global_defs"),r=this.name+t;return y(n,r)?function e(t,n){if(t instanceof he)return h(t.CTOR,n,t);if(Array.isArray(t))return h(Tt,n,{elements:t.map((function(t){return e(t,n)}))});if(t&&"object"==typeof t){var r=[];for(var i in t)y(t,i)&&r.push(h(Dt,n,{key:i,value:e(t[i],n)}));return h(Rt,n,{properties:r})}return gr(t,n)}(n[r],this):void 0}}))}((function(e,t){e.DEFMETHOD("_find_defs",t)}));var Vr=["constructor","toString","valueOf"],Ur=Br({Array:["indexOf","join","lastIndexOf","slice"].concat(Vr),Boolean:Vr,Function:Vr,Number:["toExponential","toFixed","toPrecision"].concat(Vr),Object:Vr,RegExp:["test"].concat(Vr),String:["charAt","charCodeAt","concat","indexOf","italics","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","trim"].concat(Vr)}),Hr=Br({Array:["isArray"],Math:["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan","atan2","pow","max","min"],Number:["isFinite","isNaN"],Object:["create","getOwnPropertyDescriptor","getOwnPropertyNames","getPrototypeOf","isExtensible","isFrozen","isSealed","keys"],String:["fromCharCode"]});!function(e){he.DEFMETHOD("evaluate",(function(e){if(!e.option("evaluate"))return this;var t=this._eval(e,1);return!t||t instanceof RegExp?t:"function"==typeof t||"object"==typeof t?this:t}));var t=_("! ~ - + void");he.DEFMETHOD("is_constant",(function(){return this instanceof un?!(this instanceof fn):this instanceof bt&&this.expression instanceof un&&t.has(this.operator)})),e(de,(function(){throw new Error(f("Cannot evaluate a statement [{file}:{line},{col}]",this.start))})),e(Pe,l),e(Pt,l),e(he,l),e(un,(function(){return this.getValue()})),e(dn,l),e(fn,(function(e){let t=e.evaluated_regexps.get(this);if(void 0===t){try{t=(0,eval)(this.print_to_string())}catch(e){t=null}e.evaluated_regexps.set(this,t)}return t||this})),e(He,(function(){return 1!==this.segments.length?this:this.segments[0].value})),e(Fe,(function(e){if(e.option("unsafe")){var t=function(){};return t.node=this,t.toString=function(){return this.node.print_to_string()},t}return this})),e(Tt,(function(e,t){if(e.option("unsafe")){for(var n=[],r=0,i=this.elements.length;r>":i=n>>s;break;case">>>":i=n>>>s;break;case"==":i=n==s;break;case"===":i=n===s;break;case"!=":i=n!=s;break;case"!==":i=n!==s;break;case"<":i=n":i=n>s;break;case">=":i=n>=s;break;default:return this}return isNaN(i)&&e.find_parent(De)?this:i})),e(xt,(function(e,t){var n=this.condition._eval(e,t);if(n===this.condition)return this;var r=n?this.consequent:this.alternative,i=r._eval(e,t);return i===r?this:i})),e(rn,(function(e,t){var n,r=this.fixed_value();if(!r)return this;if(y(r,"_eval"))n=r._eval();else{if(this._eval=l,n=r._eval(e,t),delete this._eval,n===r)return this;r._eval=function(){return n}}if(n&&"object"==typeof n){var i=this.definition().escaped;if(i&&t>i)return this}return n}));var i={Array,Math,Number,Object,String},s=Br({Math:["E","LN10","LN2","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"],Number:["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"]});e(Et,(function(e,t){if(e.option("unsafe")){var n=this.property;if(n instanceof he&&(n=n._eval(e,t))===this.property)return this;var r,o=this.expression;if(Cr(o)){var a,c="hasOwnProperty"===o.name&&"call"===n&&(a=e.parent()&&e.parent().args)&&a&&a[0]&&a[0].evaluate(e);if(null==(c=c instanceof yt?c.expression:c)||c.thedef&&c.thedef.undeclared)return this.clone();var l=s.get(o.name);if(!l||!l.has(n))return this;r=i[o.name]}else{if(!(r=o._eval(e,t+1))||r===o||!y(r,n))return this;if("function"==typeof r)switch(n){case"name":return r.node.name?r.node.name.name:"";case"length":return r.node.argnames.length;default:return this}}return r[n]}return this})),e(mt,(function(e,t){var n=this.expression;if(e.option("unsafe")&&n instanceof Et){var r,s=n.property;if(s instanceof he&&(s=s._eval(e,t))===n.property)return this;var o=n.expression;if(Cr(o)){var a="hasOwnProperty"===o.name&&"call"===s&&this.args[0]&&this.args[0].evaluate(e);if(null==(a=a instanceof yt?a.expression:a)||a.thedef&&a.thedef.undeclared)return this.clone();var c=Hr.get(o.name);if(!c||!c.has(s))return this;r=i[o.name]}else{if((r=o._eval(e,t+1))===o||!r)return this;var l=Ur.get(r.constructor.name);if(!l||!l.has(s))return this}for(var u=[],p=0,h=this.args.length;p=":return i.operator="<",i;case">":return i.operator="<=",i}switch(s){case"==":return i.operator="!=",i;case"!=":return i.operator="==",i;case"===":return i.operator="!==",i;case"!==":return i.operator="===",i;case"&&":return i.operator="||",i.left=i.left.negate(e,r),i.right=i.right.negate(e),n(this,i,r);case"||":return i.operator="&&",i.left=i.left.negate(e,r),i.right=i.right.negate(e),n(this,i,r);case"??":return i.right=i.right.negate(e),n(this,i,r)}return t(this)}))}((function(e,t){e.DEFMETHOD("negate",(function(e,n){return t.call(this,e,n)}))}));var Gr=_("Boolean decodeURI decodeURIComponent Date encodeURI encodeURIComponent Error escape EvalError isFinite isNaN Number Object parseFloat parseInt RangeError ReferenceError String SyntaxError TypeError unescape URIError");mt.DEFMETHOD("is_expr_pure",(function(e){if(e.option("unsafe")){var t=this.expression,n=this.args&&this.args[0]&&this.args[0].evaluate(e);if(t.expression&&"hasOwnProperty"===t.expression.name&&(null==n||n.thedef&&n.thedef.undeclared))return!1;if(Cr(t)&&Gr.has(t.name))return!0;let r;if(t instanceof yt&&Cr(t.expression)&&(r=Hr.get(t.expression.name))&&r.has(t.property))return!0}return!!A(this,Rn)||!e.pure_funcs(this)})),he.DEFMETHOD("is_call_pure",a),yt.DEFMETHOD("is_call_pure",(function(e){if(!e.option("unsafe"))return;const t=this.expression;let n;return t instanceof Tt?n=Ur.get("Array"):t.is_boolean()?n=Ur.get("Boolean"):t.is_number(e)?n=Ur.get("Number"):t instanceof fn?n=Ur.get("RegExp"):t.is_string(e)?n=Ur.get("String"):this.may_throw_on_access(e)||(n=Ur.get("Object")),n&&n.has(this.property)}));const jr=new Set(["Number","String","Array","Object","Function","Promise"]);function Wr(e){return e&&e.aborts()}!function(e){function t(e,t){for(var n=e.length;--n>=0;)if(e[n].has_side_effects(t))return!0;return!1}e(he,c),e(Se,a),e(un,a),e(cn,a),e(ye,(function(e){return t(this.body,e)})),e(mt,(function(e){return!(this.is_expr_pure(e)||this.expression.is_call_pure(e)&&!this.expression.has_side_effects(e))||t(this.args,e)})),e(et,(function(e){return this.expression.has_side_effects(e)||t(this.body,e)})),e(rt,(function(e){return this.expression.has_side_effects(e)||t(this.body,e)})),e(it,(function(e){return t(this.body,e)||this.bcatch&&this.bcatch.has_side_effects(e)||this.bfinally&&this.bfinally.has_side_effects(e)})),e(Je,(function(e){return this.condition.has_side_effects(e)||this.body&&this.body.has_side_effects(e)||this.alternative&&this.alternative.has_side_effects(e)})),e(Ae,(function(e){return this.body.has_side_effects(e)})),e(ge,(function(e){return this.body.has_side_effects(e)})),e(Pe,a),e(Pt,(function(e){return!(!this.extends||!this.extends.has_side_effects(e))||t(this.properties,e)})),e(Ct,(function(e){return this.left.has_side_effects(e)||this.right.has_side_effects(e)})),e($t,c),e(xt,(function(e){return this.condition.has_side_effects(e)||this.consequent.has_side_effects(e)||this.alternative.has_side_effects(e)})),e(St,(function(e){return Ir.has(this.operator)||this.expression.has_side_effects(e)})),e(rn,(function(e){return!this.is_declared(e)&&!jr.has(this.name)})),e(qt,a),e(Ut,a),e(Rt,(function(e){return t(this.properties,e)})),e(Nt,(function(e){return this.computed_key()&&this.key.has_side_effects(e)||this.value.has_side_effects(e)})),e(Mt,(function(e){return this.computed_key()&&this.key.has_side_effects(e)||this.static&&this.value&&this.value.has_side_effects(e)})),e(It,(function(e){return this.computed_key()&&this.key.has_side_effects(e)})),e(Ot,(function(e){return this.computed_key()&&this.key.has_side_effects(e)})),e(kt,(function(e){return this.computed_key()&&this.key.has_side_effects(e)})),e(Tt,(function(e){return t(this.elements,e)})),e(yt,(function(e){return this.expression.may_throw_on_access(e)||this.expression.has_side_effects(e)})),e(vt,(function(e){return this.expression.may_throw_on_access(e)||this.expression.has_side_effects(e)||this.property.has_side_effects(e)})),e(_t,(function(e){return t(this.expressions,e)})),e(at,(function(e){return t(this.definitions,e)})),e(pt,(function(){return this.value})),e(Ge,a),e(He,(function(e){return t(this.segments,e)}))}((function(e,t){e.DEFMETHOD("has_side_effects",t)})),function(e){function t(e,t){for(var n=e.length;--n>=0;)if(e[n].may_throw(t))return!0;return!1}e(he,c),e(un,a),e(Se,a),e(Pe,a),e(Ut,a),e(cn,a),e(Pt,(function(e){return!(!this.extends||!this.extends.may_throw(e))||t(this.properties,e)})),e(Tt,(function(e){return t(this.elements,e)})),e($t,(function(e){return!!this.right.may_throw(e)||!(!e.has_directive("use strict")&&"="==this.operator&&this.left instanceof rn)&&this.left.may_throw(e)})),e(Ct,(function(e){return this.left.may_throw(e)||this.right.may_throw(e)})),e(ye,(function(e){return t(this.body,e)})),e(mt,(function(e){return!!t(this.args,e)||!this.is_expr_pure(e)&&(!!this.expression.may_throw(e)||!(this.expression instanceof Pe)||t(this.expression.body,e))})),e(rt,(function(e){return this.expression.may_throw(e)||t(this.body,e)})),e(xt,(function(e){return this.condition.may_throw(e)||this.consequent.may_throw(e)||this.alternative.may_throw(e)})),e(at,(function(e){return t(this.definitions,e)})),e(yt,(function(e){return this.expression.may_throw_on_access(e)||this.expression.may_throw(e)})),e(Je,(function(e){return this.condition.may_throw(e)||this.body&&this.body.may_throw(e)||this.alternative&&this.alternative.may_throw(e)})),e(Ae,(function(e){return this.body.may_throw(e)})),e(Rt,(function(e){return t(this.properties,e)})),e(Nt,(function(e){return this.value.may_throw(e)})),e(Mt,(function(e){return this.computed_key()&&this.key.may_throw(e)||this.static&&this.value&&this.value.may_throw(e)})),e(It,(function(e){return this.computed_key()&&this.key.may_throw(e)})),e(Ot,(function(e){return this.computed_key()&&this.key.may_throw(e)})),e(kt,(function(e){return this.computed_key()&&this.key.may_throw(e)})),e(Ke,(function(e){return this.value&&this.value.may_throw(e)})),e(_t,(function(e){return t(this.expressions,e)})),e(ge,(function(e){return this.body.may_throw(e)})),e(vt,(function(e){return this.expression.may_throw_on_access(e)||this.expression.may_throw(e)||this.property.may_throw(e)})),e(et,(function(e){return this.expression.may_throw(e)||t(this.body,e)})),e(rn,(function(e){return!this.is_declared(e)&&!jr.has(this.name)})),e(qt,a),e(it,(function(e){return this.bcatch?this.bcatch.may_throw(e):t(this.body,e)||this.bfinally&&this.bfinally.may_throw(e)})),e(St,(function(e){return!("typeof"==this.operator&&this.expression instanceof rn)&&this.expression.may_throw(e)})),e(pt,(function(e){return!!this.value&&this.value.may_throw(e)}))}((function(e,t){e.DEFMETHOD("may_throw",t)})),function(e){function t(e){let t=!0;return Cn(this,n=>{if(n instanceof rn){if(rr(this,16))return t=!1,$n;var i=n.definition();if(r(i,this.enclosed)&&!this.variables.has(i.name)){if(e){var s=e.find_variable(n);if(i.undeclared?!s:s===i)return t="f",!0}return t=!1,$n}return!0}if(n instanceof cn&&this instanceof Le)return t=!1,$n}),t}e(he,a),e(un,c),e(Pt,(function(e){if(this.extends&&!this.extends.is_constant_expression(e))return!1;for(const t of this.properties){if(t.computed_key()&&!t.key.is_constant_expression(e))return!1;if(t.static&&t.value&&!t.value.is_constant_expression(e))return!1}return t.call(this,e)})),e(Pe,t),e(St,(function(){return this.expression.is_constant_expression()})),e(Ct,(function(){return this.left.is_constant_expression()&&this.right.is_constant_expression()})),e(Tt,(function(){return this.elements.every(e=>e.is_constant_expression())})),e(Rt,(function(){return this.properties.every(e=>e.is_constant_expression())})),e(Nt,(function(){return!(this.key instanceof he)&&this.value.is_constant_expression()}))}((function(e,t){e.DEFMETHOD("is_constant_expression",t)})),function(e){function t(){for(var e=0;e{if(e instanceof Ut){const n=e.definition();!t&&!n.global||s.has(n.id)||s.set(n.id,n)}}),n.value){if(n.name instanceof Ve)n.walk(d);else{var i=n.name.definition();E(l,i.id,n.value),i.chained||n.name.fixed_value()!==n.value||o.set(i.id,n)}n.value.has_side_effects(e)&&n.value.walk(d)}})),!0}return g(i,a)}}));t.walk(d),d=new wn(g),s.forEach((function(e){var t=l.get(e.id);t&&t.forEach((function(e){e.walk(d)}))}));var f=new Tn((function(a,l,d){var g=f.parent();if(r){const e=i(a);if(e instanceof rn){var _=e.definition(),E=s.has(_.id);if(a instanceof $t){if(!E||o.has(_.id)&&o.get(_.id)!==a)return _r(g,a,a.right.transform(f))}else if(!E)return d?p.skip:h(hn,a,{value:0})}}if(u===t){if(a.name&&(a instanceof Lt&&!v(e.option("keep_classnames"),(_=a.name.definition()).name)||a instanceof Fe&&!v(e.option("keep_fnames"),(_=a.name.definition()).name))&&(!s.has(_.id)||_.orig.length>1)&&(a.name=null),a instanceof Pe&&!(a instanceof Me))for(var y=!e.option("keep_fargs"),S=a.argnames,b=S.length;--b>=0;){var A=S[b];A instanceof Ie&&(A=A.expression),A instanceof wt&&(A=A.left),A instanceof Ve||s.has(A.definition().id)?y=!1:(ir(A,1),y&&(S.pop(),e[A.unreferenced()?"warn":"info"]("Dropping unused function argument {name} [{file}:{line},{col}]",N(A))))}if((a instanceof Be||a instanceof Ft)&&a!==t){const t=a.name.definition();if(!(t.global&&!n||s.has(t.id))){if(e[a.name.unreferenced()?"warn":"info"]("Dropping unused function {name} [{file}:{line},{col}]",N(a.name)),t.eliminated++,a instanceof Ft){const t=a.drop_side_effect_free(e);if(t)return h(ge,a,{body:t})}return d?p.skip:h(Se,a)}}if(a instanceof at&&!(g instanceof Re&&g.init===a)){var C=!(g instanceof Oe||a instanceof ct),x=[],$=[],w=[],T=[];switch(a.definitions.forEach((function(t){t.value&&(t.value=t.value.transform(f));var n=t.name instanceof Ve,i=n?new Wn(null,{name:""}):t.name.definition();if(C&&i.global)return w.push(t);if(!r&&!C||n&&(t.name.names.length||t.name.is_array||1!=e.option("pure_getters"))||s.has(i.id)){if(t.value&&o.has(i.id)&&o.get(i.id)!==t&&(t.value=t.value.drop_side_effect_free(e)),t.name instanceof Ht){var l=c.get(i.id);if(l.length>1&&(!t.value||i.orig.indexOf(t.name)>i.eliminated)){if(e.warn("Dropping duplicated definition of variable {name} [{file}:{line},{col}]",N(t.name)),t.value){var u=h(rn,t.name,t.name);i.references.push(u);var p=h($t,t,{operator:"=",left:u,right:t.value});o.get(i.id)===t&&o.set(i.id,p),T.push(p.transform(f))}return m(l,t),void i.eliminated++}}t.value?(T.length>0&&(w.length>0?(T.push(t.value),t.value=mr(t.value,T)):x.push(h(ge,a,{body:mr(a,T)})),T=[]),w.push(t)):$.push(t)}else if(i.orig[0]instanceof Jt)(d=t.value&&t.value.drop_side_effect_free(e))&&T.push(d),t.value=null,$.push(t);else{var d;(d=t.value&&t.value.drop_side_effect_free(e))?(n||e.warn("Side effects in initialization of unused variable {name} [{file}:{line},{col}]",N(t.name)),T.push(d)):n||e[t.name.unreferenced()?"warn":"info"]("Dropping unused variable {name} [{file}:{line},{col}]",N(t.name)),i.eliminated++}})),($.length>0||w.length>0)&&(a.definitions=$.concat(w),x.push(a)),T.length>0&&x.push(h(ge,a,{body:mr(a,T)})),x.length){case 0:return d?p.skip:h(Se,a);case 1:return x[0];default:return d?p.splice(x):h(ve,a,{body:x})}}if(a instanceof Te)return l(a,this),a.init instanceof ve&&(R=a.init,a.init=R.body.pop(),R.body.push(a)),a.init instanceof ge?a.init=a.init.body:vr(a.init)&&(a.init=null),R?d?p.splice(R.body):R:a;if(a instanceof Ae&&a.body instanceof Te){if(l(a,this),a.body instanceof ve){var R=a.body;return a.body=R.body.pop(),R.body.push(a),d?p.splice(R.body):R}return a}if(a instanceof ve)return l(a,this),d&&a.body.every(Sr)?p.splice(a.body):a;if(a instanceof ke){const e=u;return u=a,l(a,this),u=e,a}}function N(e){return{name:e.name,file:e.start.file,line:e.start.line,col:e.start.col}}}));function g(e,n){var r;const a=i(e);if(a instanceof rn&&!hr(e.left,Gt)&&t.variables.get(a.name)===(r=a.definition()))return e instanceof $t&&(e.right.walk(d),r.chained||e.left.fixed_value()!==e.right||o.set(r.id,e)),!0;if(e instanceof rn){if(r=e.definition(),!s.has(r.id)&&(s.set(r.id,r),r.orig[0]instanceof Jt)){const e=r.scope.is_block_scope()&&r.scope.get_defun_scope().variables.get(r.name);e&&s.set(e.id,e)}return!0}if(e instanceof ke){var c=u;return u=e,n(),u=c,!0}}t.transform(f)})),ke.DEFMETHOD("hoist_declarations",(function(e){var t=this;if(e.has_directive("use asm"))return t;if(!Array.isArray(t.body))return t;var n=e.option("hoist_funs"),r=e.option("hoist_vars");if(n||r){var i=[],s=[],o=new Map,a=0,c=0;Cn(t,e=>e instanceof ke&&e!==t||(e instanceof ct?(++c,!0):void 0)),r=r&&c>1;var l=new Tn((function(c){if(c!==t){if(c instanceof me)return i.push(c),h(Se,c);if(n&&c instanceof Be&&!(l.parent()instanceof ft)&&l.parent()===t)return s.push(c),h(Se,c);if(r&&c instanceof ct){c.definitions.forEach((function(e){e.name instanceof Ve||(o.set(e.name.name,e),++a)}));var u=c.to_assignments(e),p=l.parent();if(p instanceof Re&&p.init===c){if(null==u){var d=c.definitions[0].name;return h(rn,d,d)}return u}return p instanceof Te&&p.init===c?u:u?h(ge,c,{body:u}):h(Se,c)}if(c instanceof ke)return c}}));if(t=t.transform(l),a>0){var u=[];const e=t instanceof Pe,n=e?t.args_as_names():null;if(o.forEach((t,r)=>{e&&n.some(e=>e.name===t.name.name)?o.delete(r):((t=t.clone()).value=null,u.push(t),o.set(r,t))}),u.length>0){for(var p=0;p"string"==typeof e.key)){o(s,this);const e=new Map,t=[];return l.properties.forEach((function(n){t.push(h(pt,s,{name:a(i,n.key,e),value:n.value}))})),r.set(c.id,e),p.splice(t)}}else if(s instanceof Et&&s.expression instanceof rn){const e=r.get(s.expression.definition().id);if(e){const t=e.get(String(Dr(s.property))),n=h(rn,s,{name:t.name,scope:s.expression.scope,thedef:t});return n.reference({}),n}}function a(e,n,r){const i=h(e.CTOR,e,{name:t.make_var_name(e.name+"_"+n),scope:t}),s=t.def_variable(i);return r.set(String(n),s),t.enclosed.push(s),i}}));return t.transform(i)})),function(e){function t(e,t,n){var r=e.length;if(!r)return null;for(var i=[],s=!1,o=0;o0&&(c[0].body=a.concat(c[0].body)),e.body=c;n=c[c.length-1];){var f=n.body[n.body.length-1];if(f instanceof qe&&t.loopcontrol_target(f)===e&&n.body.pop(),n.body.length||n instanceof rt&&(s||n.expression.has_side_effects(t)))break;c.pop()===s&&(s=null)}if(0==c.length)return h(ve,e,{body:a.concat(h(ge,e.expression,{body:e.expression}))}).optimize(t);if(1==c.length&&(c[0]===o||c[0]===s)){var m=!1,g=new wn((function(t){if(m||t instanceof Pe||t instanceof ge)return!0;t instanceof qe&&g.loopcontrol_target(t)===e&&(m=!0)}));if(e.walk(g),!m){var _,E=c[0].body.slice();return(_=c[0].expression)&&E.unshift(h(ge,_,{body:_})),E.unshift(h(ge,e.expression,{body:e.expression})),h(ve,e,{body:E}).optimize(t)}}return e;function y(e,n){n&&!Wr(n)?n.body=n.body.concat(e.body):Nr(t,e,a)}})),ar(it,(function(e,t){if(Rr(e.body,t),e.bcatch&&e.bfinally&&e.bfinally.body.every(vr)&&(e.bfinally=null),t.option("dead_code")&&e.body.every(vr)){var n=[];return e.bcatch&&Nr(t,e.bcatch,n),e.bfinally&&n.push(...e.bfinally.body),h(ve,e,{body:n}).optimize(t)}return e})),at.DEFMETHOD("remove_initializers",(function(){var e=[];this.definitions.forEach((function(t){t.name instanceof Ut?(t.value=null,e.push(t)):Cn(t.name,n=>{n instanceof Ut&&e.push(h(pt,t,{name:n,value:null}))})})),this.definitions=e})),at.DEFMETHOD("to_assignments",(function(e){var t=e.option("reduce_vars"),n=this.definitions.reduce((function(e,n){if(!n.value||n.name instanceof Ve){if(n.value){var r=h(pt,n,{name:n.name,value:n.value}),i=h(ct,n,{definitions:[r]});e.push(i)}}else{var s=h(rn,n.name,n.name);e.push(h($t,n,{operator:"=",left:s,right:n.value})),t&&(s.definition().fixed=!1)}return(n=n.name.definition()).eliminated++,n.replaced--,e}),[]);return 0==n.length?null:mr(this,n)})),ar(at,(function(e){return 0==e.definitions.length?h(Se,e):e})),ar(dt,(function(e){return e})),ar(mt,(function(e,t){var n=e.expression,r=n;ai(e,0,e.args);var i=e.args.every(e=>!(e instanceof Ie));if(t.option("reduce_vars")&&r instanceof rn&&!A(e,Dn)){const e=r.fixed_value();Yr(e,t)||(r=e)}var s=r instanceof Pe;if(t.option("unused")&&i&&s&&!r.uses_arguments&&!r.pinned()){for(var o=0,a=0,c=0,l=e.args.length;c=r.argnames.length;if(u||rr(r.argnames[c],1)){if(m=e.args[c].drop_side_effect_free(t))e.args[o++]=m;else if(!u){e.args[o++]=h(hn,e.args[c],{value:0});continue}}else e.args[o++]=e.args[c];a=o}e.args.length=a}if(t.option("unsafe"))if(Cr(n))switch(n.name){case"Array":if(1!=e.args.length)return h(Tt,e,{elements:e.args}).optimize(t);if(e.args[0]instanceof hn&&e.args[0].value<=11){const t=[];for(let n=0;n=1&&e.args.length<=2&&e.args.every(e=>{var n=e.evaluate(t);return p.push(n),e!==n})){let[n,r]=p;n=b(new RegExp(n).source);const i=h(fn,e,{value:{source:n,flags:r}});if(i._eval(t)!==i)return i;t.warn("Error converting {expr} [{file}:{line},{col}]",{expr:e.print_to_string(),file:e.start.file,line:e.start.line,col:e.start.col})}}else if(n instanceof yt)switch(n.property){case"toString":if(0==e.args.length&&!n.expression.may_throw_on_access(t))return h(Ct,e,{left:h(pn,e,{value:""}),operator:"+",right:n.expression}).optimize(t);break;case"join":if(n.expression instanceof Tt)e:{var d;if(!(e.args.length>0&&(d=e.args[0].evaluate(t))===e.args[0])){var f,m,g=[],_=[];for(c=0,l=n.expression.elements.length;c0&&(g.push(h(pn,e,{value:_.join(d)})),_.length=0),g.push(E))}return _.length>0&&g.push(h(pn,e,{value:_.join(d)})),0==g.length?h(pn,e,{value:""}):1==g.length?g[0].is_string(t)?g[0]:h(Ct,g[0],{operator:"+",left:h(pn,e,{value:""}),right:g[0]}):""==d?(f=g[0].is_string(t)||g[1].is_string(t)?g.shift():h(pn,e,{value:""}),g.reduce((function(e,t){return h(Ct,t,{operator:"+",left:e,right:t})}),f).optimize(t)):((m=e.clone()).expression=m.expression.clone(),m.expression.expression=m.expression.expression.clone(),m.expression.expression.elements=g,Lr(t,e,m))}}break;case"charAt":if(n.expression.is_string(t)){var v=e.args[0],S=v?v.evaluate(t):0;if(S!==v)return h(vt,n,{expression:n.expression,property:gr(0|S,v||n)}).optimize(t)}break;case"apply":if(2==e.args.length&&e.args[1]instanceof Tt)return(M=e.args[1].elements.slice()).unshift(e.args[0]),h(mt,e,{expression:h(yt,n,{expression:n.expression,property:"call"}),args:M}).optimize(t);break;case"call":var C=n.expression;if(C instanceof rn&&(C=C.fixed_value()),C instanceof Pe&&!C.contains_this())return(e.args.length?mr(this,[e.args[0],h(mt,e,{expression:n.expression,args:e.args.slice(1)})]):h(mt,e,{expression:n.expression,args:[]})).optimize(t)}if(t.option("unsafe_Function")&&Cr(n)&&"Function"==n.name){if(0==e.args.length)return h(Fe,e,{argnames:[],body:[]}).optimize(t);if(e.args.every(e=>e instanceof pn))try{var x=le(R="n(function("+e.args.slice(0,-1).map((function(e){return e.value})).join(",")+"){"+e.args[e.args.length-1].value+"})"),$={ie8:t.option("ie8")};x.figure_out_scope($);var w,T=new or(t.options);(x=x.transform(T)).figure_out_scope($),Xn.reset(),x.compute_char_frequency($),x.mangle_names($),Cn(x,e=>{if(ur(e))return w=e,$n});var R=Bn();return ve.prototype._codegen.call(w,w,R),e.args=[h(pn,e,{value:w.argnames.map((function(e){return e.print_to_string()})).join(",")}),h(pn,e.args[e.args.length-1],{value:R.get().replace(/^{|}$/g,"")})],e}catch(n){if(!(n instanceof J))throw n;t.warn("Error parsing code passed to new Function [{file}:{line},{col}]",e.args[e.args.length-1].start),t.warn(n.toString())}}var N=s&&r.body[0],D=s&&!r.is_generator&&!r.async,k=D&&t.option("inline")&&!e.is_expr_pure(t);if(k&&N instanceof Ke){let n=N.value;if(!n||n.is_constant_expression()){n=n?n.clone(!0):h(En,e);const r=e.args.concat(n);return mr(e,r).optimize(t)}if(1===r.argnames.length&&r.argnames[0]instanceof Kt&&e.args.length<2&&n instanceof rn&&n.name===r.argnames[0].name){let n;return e.args[0]instanceof Et&&(n=t.parent())instanceof mt&&n.expression===e?mr(e,[h(hn,e,{value:0}),e.args[0].optimize(t)]):(e.args[0]||h(En)).optimize(t)}}if(k){var O,I,P=-1;let s,o,a;if(i&&!r.uses_arguments&&!r.pinned()&&!(t.parent()instanceof Pt)&&!(r.name&&r instanceof Fe)&&(o=function(e){var n=r.body,i=n.length;if(t.option("inline")<3)return 1==i&&L(e);e=null;for(var s=0;s!e.value))return!1}else{if(e)return!1;o instanceof Se||(e=o)}}return L(e)}(N))&&(n===r||A(e,Nn)||t.option("unused")&&1==(s=n.definition()).references.length&&!Zr(t,s)&&r.is_constant_expression(n.scope))&&!A(e,Rn|Dn)&&!r.contains_this()&&function(){var n=new Set;do{if((O=t.parent(++P)).is_block_scope()&&O.block_scope&&O.block_scope.variables.forEach((function(e){n.add(e.name)})),O instanceof st)O.argname&&n.add(O.argname.name);else if(O instanceof Ce)I=[];else if(O instanceof rn&&O.fixed_value()instanceof ke)return!1}while(!(O instanceof ke));var i=!(O instanceof Oe)||t.toplevel.vars,s=t.option("inline");return!(!function(e,t){for(var n=r.body.length,i=0;i=0;){var a=s.definitions[o].name;if(a instanceof Ve||e.has(a.name)||wr.has(a.name)||O.var_names().has(a.name))return!1;I&&I.push(a.definition())}}}return!0}(n,s>=3&&i)||!function(e,t){for(var n=0,i=r.argnames.length;n=2&&i)||!function(){var t=new Set;const n=e=>{if(e instanceof ke){var n=new Set;return e.enclosed.forEach((function(e){n.add(e.name)})),e.variables.forEach((function(e){n.delete(e)})),n.forEach((function(e){t.add(e)})),!0}};for(let t=0;t=0;){var a=s.definitions[o].name;if(a instanceof Ve||t.has(a.name))return!1}}return!0}()||I&&0!=I.length&&ti(r,I))}()&&(a=dr(t))&&!Jr(a,r)&&!function(){let e,n=0;for(;e=t.parent(n++);){if(e instanceof wt)return!0;if(e instanceof ye)break}return!1}()&&!(O instanceof Pt))return ir(r,256),a.add_child_scope(r),mr(e,function(n){var i=[],s=[];if(function(t,n){for(var i=r.argnames.length,s=e.args.length;--s>=i;)n.push(e.args[s]);for(s=i;--s>=0;){var o=r.argnames[s],a=e.args[s];if(rr(o,1)||!o.name||O.var_names().has(o.name))a&&n.push(a);else{var c=h(Ht,o,o);o.definition().orig.push(c),!a&&I&&(a=h(En,e)),B(t,n,c,a)}}t.reverse(),n.reverse()}(i,s),function(e,t){for(var n=t.length,i=0,s=r.body.length;ie.name!=u.name)){var p=r.variables.get(u.name),d=h(rn,u,u);p.references.push(d),t.splice(n++,0,h($t,l,{operator:"=",left:d,right:h(En,u)}))}}}}(i,s),s.push(n),i.length){const e=O.body.indexOf(t.parent(P-1))+1;O.body.splice(e,0,h(ct,r,{definitions:i}))}return s.map(e=>e.clone(!0))}(o)).optimize(t)}if(D&&t.option("side_effects")&&r.body.every(vr)){var M=e.args.concat(h(En,e));return mr(e,M).optimize(t)}if(t.option("negate_iife")&&t.parent()instanceof ge&&Ar(e))return e.negate(t,!0);var F=e.evaluate(t);return F!==e?(F=gr(F,e).optimize(t),Lr(t,F,e)):e;function L(t){return t?t instanceof Ke?t.value?t.value.clone(!0):h(En,e):t instanceof ge?h(bt,t,{operator:"void",expression:t.body.clone(!0)}):void 0:h(En,e)}function B(t,n,r,i){var s=r.definition();O.variables.set(r.name,s),O.enclosed.push(s),O.var_names().has(r.name)||(O.add_var_name(r.name),t.push(h(pt,r,{name:r,value:null})));var o=h(rn,r,r);s.references.push(o),i&&n.push(h($t,e,{operator:"=",left:o,right:i.clone()}))}})),ar(gt,(function(e,t){return t.option("unsafe")&&Cr(e.expression)&&["Object","RegExp","Function","Error","Array"].includes(e.expression.name)?h(mt,e,e).transform(t):e})),ar(_t,(function(e,t){if(!t.option("side_effects"))return e;var n,r,i=[];n=Pn(t),r=e.expressions.length-1,e.expressions.forEach((function(e,s){s0&&kr(i[s],t);)s--;s0)return(n=this.clone()).right=mr(this.right,t.slice(s)),(t=t.slice(0,s)).push(n),mr(this,t).optimize(e)}}return this}));var Qr=_("== === != !== * & | ^");function Zr(e,t){for(var n,r=0;n=e.parent(r);r++)if(n instanceof Pe||n instanceof Pt){var i=n.name;if(i&&i.definition()===t)break}return n}function Jr(e,t){for(const n of t.enclosed){if(t.variables.has(n.name))continue;const r=e.find_variable(n.name);if(r){if(r===n)continue;return!0}}return!1}function ei(e,t){return e instanceof rn||e.TYPE===t.TYPE}function ti(e,t){const n=e=>{if(e instanceof rn&&r(e.definition(),t))return $n};return xn(e,(t,r)=>{if(t instanceof ke&&t!==e){var i=r.parent();if(i instanceof mt&&i.expression===t)return;return!Cn(t,n)||$n}})}ar(Ct,(function(e,t){function n(){return e.left.is_constant()||e.right.is_constant()||!e.left.has_side_effects(t)&&!e.right.has_side_effects(t)}function r(t){if(n()){t&&(e.operator=t);var r=e.left;e.left=e.right,e.right=r}}if(Qr.has(e.operator)&&e.right.is_constant()&&!e.left.is_constant()&&(e.left instanceof Ct&&ae[e.left.operator]>=ae[e.operator]||r()),e=e.lift_sequences(t),t.option("comparisons"))switch(e.operator){case"===":case"!==":var i=!0;(e.left.is_string(t)&&e.right.is_string(t)||e.left.is_number(t)&&e.right.is_number(t)||e.left.is_boolean()&&e.right.is_boolean()||e.left.equivalent_to(e.right))&&(e.operator=e.operator.substr(0,2));case"==":case"!=":if(!i&&kr(e.left,t))e.left=h(gn,e.left);else if(t.option("typeofs")&&e.left instanceof pn&&"undefined"==e.left.value&&e.right instanceof bt&&"typeof"==e.right.operator){var s=e.right.expression;(s instanceof rn?!s.is_declared(t):s instanceof Et&&t.option("ie8"))||(e.right=s,e.left=h(En,e.left).optimize(t),2==e.operator.length&&(e.operator+="="))}else if(e.left instanceof rn&&e.right instanceof rn&&e.left.definition()===e.right.definition()&&((c=e.left.fixed_value())instanceof Tt||c instanceof Pe||c instanceof Rt||c instanceof Pt))return h("="==e.operator[0]?An:bn,e);break;case"&&":case"||":var o=e.left;if(o.operator==e.operator&&(o=o.right),o instanceof Ct&&o.operator==("&&"==e.operator?"!==":"===")&&e.right instanceof Ct&&o.operator==e.right.operator&&(kr(o.left,t)&&e.right.left instanceof gn||o.left instanceof gn&&kr(e.right.left,t))&&!o.right.has_side_effects(t)&&o.right.equivalent_to(e.right.right)){var a=h(Ct,e,{operator:o.operator.slice(0,-1),left:h(gn,e),right:o.right});return o!==e.left&&(a=h(Ct,e,{operator:e.operator,left:e.left.left,right:a})),a}}var c;if("+"==e.operator&&t.in_boolean_context()){var l=e.left.evaluate(t),u=e.right.evaluate(t);if(l&&"string"==typeof l)return t.warn("+ in boolean context always true [{file}:{line},{col}]",e.start),mr(e,[e.right,h(An,e)]).optimize(t);if(u&&"string"==typeof u)return t.warn("+ in boolean context always true [{file}:{line},{col}]",e.start),mr(e,[e.left,h(An,e)]).optimize(t)}if(t.option("comparisons")&&e.is_boolean()){if(!(t.parent()instanceof Ct)||t.parent()instanceof $t){var p=h(bt,e,{operator:"!",expression:e.negate(t,Pn(t))});e=Lr(t,e,p)}if(t.option("unsafe_comps"))switch(e.operator){case"<":r(">");break;case"<=":r(">=")}}if("+"==e.operator){if(e.right instanceof pn&&""==e.right.getValue()&&e.left.is_string(t))return e.left;if(e.left instanceof pn&&""==e.left.getValue()&&e.right.is_string(t))return e.right;if(e.left instanceof Ct&&"+"==e.left.operator&&e.left.left instanceof pn&&""==e.left.left.getValue()&&e.right.is_string(t))return e.left=e.left.right,e.transform(t)}if(t.option("evaluate")){switch(e.operator){case"&&":if(!(l=!!rr(e.left,2)||!rr(e.left,4)&&e.left.evaluate(t)))return t.warn("Condition left of && always false [{file}:{line},{col}]",e.start),_r(t.parent(),t.self(),e.left).optimize(t);if(!(l instanceof he))return t.warn("Condition left of && always true [{file}:{line},{col}]",e.start),mr(e,[e.left,e.right]).optimize(t);if(u=e.right.evaluate(t)){if(!(u instanceof he)&&("&&"==(d=t.parent()).operator&&d.left===t.self()||t.in_boolean_context()))return t.warn("Dropping side-effect-free && [{file}:{line},{col}]",e.start),e.left.optimize(t)}else{if(t.in_boolean_context())return t.warn("Boolean && always false [{file}:{line},{col}]",e.start),mr(e,[e.left,h(bn,e)]).optimize(t);ir(e,4)}if("||"==e.left.operator&&!(f=e.left.right.evaluate(t)))return h(xt,e,{condition:e.left.left,consequent:e.right,alternative:e.left.right}).optimize(t);break;case"||":var d,f;if(!(l=!!rr(e.left,2)||!rr(e.left,4)&&e.left.evaluate(t)))return t.warn("Condition left of || always false [{file}:{line},{col}]",e.start),mr(e,[e.left,e.right]).optimize(t);if(!(l instanceof he))return t.warn("Condition left of || always true [{file}:{line},{col}]",e.start),_r(t.parent(),t.self(),e.left).optimize(t);if(u=e.right.evaluate(t)){if(!(u instanceof he)){if(t.in_boolean_context())return t.warn("Boolean || always true [{file}:{line},{col}]",e.start),mr(e,[e.left,h(An,e)]).optimize(t);ir(e,2)}}else if("||"==(d=t.parent()).operator&&d.left===t.self()||t.in_boolean_context())return t.warn("Dropping side-effect-free || [{file}:{line},{col}]",e.start),e.left.optimize(t);if("&&"==e.left.operator&&(f=e.left.right.evaluate(t))&&!(f instanceof he))return h(xt,e,{condition:e.left.left,consequent:e.left.right,alternative:e.right}).optimize(t);break;case"??":if(ii(e.left))return e.right;if(!((l=e.left.evaluate(t))instanceof he))return null==l?e.right:e.left;if(t.in_boolean_context()){const n=e.right.evaluate(t);if(!(n instanceof he||n))return e.left}}var m=!0;switch(e.operator){case"+":if(e.left instanceof un&&e.right instanceof Ct&&"+"==e.right.operator&&e.right.is_string(t)){var g=(E=h(Ct,e,{operator:"+",left:e.left,right:e.right.left})).optimize(t);E!==g&&(e=h(Ct,e,{operator:"+",left:g,right:e.right.right}))}if(e.right instanceof un&&e.left instanceof Ct&&"+"==e.left.operator&&e.left.is_string(t)){var _=(E=h(Ct,e,{operator:"+",left:e.left.right,right:e.right})).optimize(t);E!==_&&(e=h(Ct,e,{operator:"+",left:e.left.left,right:_}))}if(e.left instanceof Ct&&"+"==e.left.operator&&e.left.is_string(t)&&e.right instanceof Ct&&"+"==e.right.operator&&e.right.is_string(t)){var E,y=(E=h(Ct,e,{operator:"+",left:e.left.right,right:e.right.left})).optimize(t);E!==y&&(e=h(Ct,e,{operator:"+",left:h(Ct,e.left,{operator:"+",left:e.left.left,right:y}),right:e.right.right}))}if(e.right instanceof bt&&"-"==e.right.operator&&e.left.is_number(t)){e=h(Ct,e,{operator:"-",left:e.left,right:e.right.expression});break}if(e.left instanceof bt&&"-"==e.left.operator&&n()&&e.right.is_number(t)){e=h(Ct,e,{operator:"-",left:e.right,right:e.left.expression});break}if(e.left instanceof He&&(g=e.left,(_=e.right.evaluate(t))!=e.right))return g.segments[g.segments.length-1].value+=_.toString(),g;if(e.right instanceof He&&(_=e.right,(g=e.left.evaluate(t))!=e.left))return _.segments[0].value=g.toString()+_.segments[0].value,_;if(e.left instanceof He&&e.right instanceof He){var v=(g=e.left).segments;_=e.right,v[v.length-1].value+=_.segments[0].value;for(var S=1;S<_.segments.length;S++)v.push(_.segments[S]);return g}case"*":m=t.option("unsafe_math");case"&":case"|":case"^":if(e.left.is_number(t)&&e.right.is_number(t)&&n()&&!(e.left instanceof Ct&&e.left.operator!=e.operator&&ae[e.left.operator]>=ae[e.operator])){var b=h(Ct,e,{operator:e.operator,left:e.right,right:e.left});e=e.right instanceof un&&!(e.left instanceof un)?Lr(t,b,e):Lr(t,e,b)}m&&e.is_number(t)&&(e.right instanceof Ct&&e.right.operator==e.operator&&(e=h(Ct,e,{operator:e.operator,left:h(Ct,e.left,{operator:e.operator,left:e.left,right:e.right.left,start:e.left.start,end:e.right.left.end}),right:e.right.right})),e.right instanceof un&&e.left instanceof Ct&&e.left.operator==e.operator&&(e.left.left instanceof un?e=h(Ct,e,{operator:e.operator,left:h(Ct,e.left,{operator:e.operator,left:e.left.left,right:e.right,start:e.left.left.start,end:e.right.end}),right:e.left.right}):e.left.right instanceof un&&(e=h(Ct,e,{operator:e.operator,left:h(Ct,e.left,{operator:e.operator,left:e.left.right,right:e.right,start:e.left.right.start,end:e.right.end}),right:e.left.left}))),e.left instanceof Ct&&e.left.operator==e.operator&&e.left.right instanceof un&&e.right instanceof Ct&&e.right.operator==e.operator&&e.right.left instanceof un&&(e=h(Ct,e,{operator:e.operator,left:h(Ct,e.left,{operator:e.operator,left:h(Ct,e.left.left,{operator:e.operator,left:e.left.right,right:e.right.left,start:e.left.right.start,end:e.right.left.end}),right:e.left.left}),right:e.right.right})))}}if(e.right instanceof Ct&&e.right.operator==e.operator&&(Or.has(e.operator)||"+"==e.operator&&(e.right.left.is_string(t)||e.left.is_string(t)&&e.right.right.is_string(t))))return e.left=h(Ct,e.left,{operator:e.operator,left:e.left,right:e.right.left}),e.right=e.right.right,e.transform(t);var A=e.evaluate(t);return A!==e?(A=gr(A,e).optimize(t),Lr(t,A,e)):e})),ar(sn,(function(e){return e})),ar(rn,(function(e,t){if(!t.option("ie8")&&Cr(e)&&(!e.scope.uses_with||!t.find_parent(De)))switch(e.name){case"undefined":return h(En,e).optimize(t);case"NaN":return h(_n,e).optimize(t);case"Infinity":return h(vn,e).optimize(t)}var n=t.parent();if(t.option("reduce_vars")&&Pr(e,n)!==e){const p=e.definition();if(t.top_retain&&p.global&&t.top_retain(p))return p.fixed=!1,p.should_replace=!1,p.single_use=!1,e;var r=e.fixed_value(),i=p.single_use&&!(n instanceof mt&&n.is_expr_pure(t)||A(n,Dn));if(i&&(r instanceof Pe||r instanceof Pt))if(Yr(r,t))i=!1;else if(p.scope!==e.scope&&(1==p.escaped||rr(r,16)||function(e){for(var t,n=0;t=e.parent(n++);){if(t instanceof de)return!1;if(t instanceof Tt||t instanceof Dt||t instanceof Rt)return!0}return!1}(t)))i=!1;else if(Zr(t,p))i=!1;else if((p.scope!==e.scope||p.orig[0]instanceof Kt)&&"f"==(i=r.is_constant_expression(e.scope))){var s=e.scope;do{(s instanceof Be||ur(s))&&ir(s,16)}while(s=s.parent_scope)}if(i&&r instanceof Pe){const s=dr(t);i=p.scope===e.scope&&!Jr(s,r)||n instanceof mt&&n.expression===e&&!Jr(s,r)}if(i&&r instanceof Pt&&(i=!(r.extends&&(r.extends.may_throw(t)||r.extends.has_side_effects(t))||r.properties.some(e=>e.may_throw(t)||e.has_side_effects(t)))),i&&r){if(r instanceof Ft&&(ir(r,256),r=h(Lt,r,r)),r instanceof Be&&(ir(r,256),r=h(Fe,r,r)),p.recursive_refs>0&&r.name instanceof zt){const e=r.name.definition();let t=r.variables.get(r.name.name),n=t&&t.orig[0];n instanceof Yt||(n=h(Yt,r.name,r.name),n.scope=r,r.name=n,t=r.def_function(n)),Cn(r,n=>{n instanceof rn&&n.definition()===e&&(n.thedef=t,t.references.push(n))})}return(r instanceof Pe||r instanceof Pt)&&dr(t).add_child_scope(r),r.optimize(t)}if(r&&void 0===p.should_replace){let e;if(r instanceof cn)p.orig[0]instanceof Kt||!p.references.every(e=>p.scope===e.scope)||(e=r);else{var o=r.evaluate(t);o===r||!t.option("unsafe_regexp")&&o instanceof RegExp||(e=gr(o,r))}if(e){var a,c=e.optimize(t).size();Cn(r,e=>{if(e instanceof rn)return $n})?a=function(){var n=e.optimize(t);return n===e?n.clone(!0):n}:(c=Math.min(c,r.size()),a=function(){var n=Mr(e.optimize(t),r);return n===e||n===r?n.clone(!0):n});var l=p.name.length,u=0;t.option("unused")&&!t.exposed(p)&&(u=(l+2+c)/(p.references.length-p.assignments)),p.should_replace=c<=l+u&&a}else p.should_replace=!1}if(p.should_replace)return p.should_replace()}return e})),ar(En,(function(e,t){if(t.option("unsafe_undefined")){var n=fr(t,"undefined");if(n){var r=h(rn,e,{name:"undefined",scope:n.scope,thedef:n});return ir(r,8),r}}var i=Pr(t.self(),t.parent());return i&&ei(i,e)?e:h(bt,e,{operator:"void",expression:h(hn,e,{value:0})})})),ar(vn,(function(e,t){var n=Pr(t.self(),t.parent());return n&&ei(n,e)?e:!t.option("keep_infinity")||n&&!ei(n,e)||fr(t,"Infinity")?h(Ct,e,{operator:"/",left:h(hn,e,{value:1}),right:h(hn,e,{value:0})}):e})),ar(_n,(function(e,t){var n=Pr(t.self(),t.parent());return n&&!ei(n,e)||fr(t,"NaN")?h(Ct,e,{operator:"/",left:h(hn,e,{value:0}),right:h(hn,e,{value:0})}):e}));const ni=_("+ - / * % >> << >>> | ^ &"),ri=_("* | ^ &");function ii(e){let t;return e instanceof gn||kr(e)||e instanceof rn&&(t=e.definition().fixed)instanceof he&&ii(t)}function si(e,t){return e instanceof rn&&(e=e.fixed_value()),!!e&&(!(e instanceof Pe||e instanceof Pt)||!(e instanceof Pe&&e.contains_this())||t.parent()instanceof gt)}function oi(e,t){return t.in_boolean_context()?Lr(t,e,mr(e,[e,h(An,e)]).optimize(t)):e}function ai(e,t,n){for(var r=0;r0&&a.args.length==c.args.length&&a.expression.equivalent_to(c.expression)&&!e.condition.has_side_effects(t)&&!a.expression.has_side_effects(t)&&"number"==typeof(s=function(){for(var e=a.args,t=c.args,n=0,r=e.length;n=2020&&function(e,t,n){if(t.may_throw(n))return!1;let r;if(e instanceof Ct&&"=="===e.operator&&((r=ii(e.left)&&e.left)||(r=ii(e.right)&&e.right))&&(r===e.left?e.right:e.left).equivalent_to(t))return!0;if(e instanceof Ct&&"||"===e.operator){let n,r;const i=e=>{if(!(e instanceof Ct)||"==="!==e.operator&&"=="!==e.operator)return!1;let i,s=0;return e.left instanceof gn&&(s++,n=e,i=e.right),e.right instanceof gn&&(s++,n=e,i=e.left),kr(e.left)&&(s++,r=e,i=e.right),kr(e.right)&&(s++,r=e,i=e.left),1===s&&!!i.equivalent_to(t)};if(!i(e.left))return!1;if(!i(e.right))return!1;if(n&&r&&n!==r)return!0}return!1}(o,c,t))return h(Ct,e,{operator:"??",left:c,right:a}).optimize(t);if(c instanceof _t&&a.equivalent_to(c.expressions[c.expressions.length-1]))return mr(e,[h(Ct,e,{operator:"||",left:o,right:mr(e,c.expressions.slice(0,-1))}),a]).optimize(t);if(c instanceof Ct&&"&&"==c.operator&&a.equivalent_to(c.right))return h(Ct,e,{operator:"&&",left:h(Ct,e,{operator:"||",left:o,right:c.left}),right:a}).optimize(t);if(a instanceof xt&&a.alternative.equivalent_to(c))return h(xt,e,{condition:h(Ct,e,{left:e.condition,operator:"&&",right:a.condition}),consequent:a.consequent,alternative:c});if(a.equivalent_to(c))return mr(e,[e.condition,a]).optimize(t);if(a instanceof Ct&&"||"==a.operator&&a.right.equivalent_to(c))return h(Ct,e,{operator:"||",left:h(Ct,e,{operator:"&&",left:e.condition,right:a.left}),right:c}).optimize(t);var u=t.in_boolean_context();return d(e.consequent)?f(e.alternative)?p(e.condition):h(Ct,e,{operator:"||",left:p(e.condition),right:e.alternative}):f(e.consequent)?d(e.alternative)?p(e.condition.negate(t)):h(Ct,e,{operator:"&&",left:p(e.condition.negate(t)),right:e.alternative}):d(e.alternative)?h(Ct,e,{operator:"||",left:p(e.condition.negate(t)),right:e.consequent}):f(e.alternative)?h(Ct,e,{operator:"&&",left:p(e.condition),right:e.consequent}):e;function p(e){return e.is_boolean()?e:h(bt,e,{operator:"!",expression:e.negate(t)})}function d(e){return e instanceof An||u&&e instanceof un&&e.getValue()||e instanceof bt&&"!"==e.operator&&e.expression instanceof un&&!e.expression.getValue()}function f(e){return e instanceof bn||u&&e instanceof un&&!e.getValue()||e instanceof bt&&"!"==e.operator&&e.expression instanceof un&&e.expression.getValue()}})),ar(Sn,(function(e,t){if(t.in_boolean_context())return h(hn,e,{value:+e.value});var n=t.parent();return t.option("booleans_as_integers")?(n instanceof Ct&&("==="==n.operator||"!=="==n.operator)&&(n.operator=n.operator.replace(/=$/,"")),h(hn,e,{value:+e.value})):t.option("booleans")?n instanceof Ct&&("=="==n.operator||"!="==n.operator)?(t.warn("Non-strict equality against boolean: {operator} {value} [{file}:{line},{col}]",{operator:n.operator,value:e.value,file:n.start.file,line:n.start.line,col:n.start.col}),h(hn,e,{value:+e.value})):h(bt,e,{operator:"!",expression:h(hn,e,{value:1-e.value})}):e})),ar(vt,(function(e,t){var n,r=e.expression,i=e.property;if(t.option("properties")){var s=i.evaluate(t);if(s!==i){"string"==typeof s&&("undefined"==s?s=void 0:(b=parseFloat(s)).toString()==s&&(s=b)),i=e.property=Mr(i,gr(s,i).transform(t));var o=""+s;if(Y(o)&&o.length<=i.size()+1)return h(yt,e,{expression:r,property:o,quote:i.quote}).optimize(t)}}e:if(t.option("arguments")&&r instanceof rn&&"arguments"==r.name&&1==r.definition().orig.length&&(n=r.scope)instanceof Pe&&n.uses_arguments&&!(n instanceof Le)&&i instanceof hn){for(var a=i.getValue(),c=new Set,l=n.argnames,u=0;u1)&&(d=null)}else if(!d&&!t.option("keep_fargs")&&a=n.argnames.length;)d=h(Kt,n,{name:n.make_var_name("argument_"+n.argnames.length),scope:n}),n.argnames.push(d),n.enclosed.push(n.def_variable(d));if(d){var m=h(rn,e,d);return m.reference({}),sr(d,1),m}}if(Pr(e,t.parent()))return e;if(s!==i){var g=e.flatten_object(o,t);g&&(r=e.expression=g.expression,i=e.property=g.property)}if(t.option("properties")&&t.option("side_effects")&&i instanceof hn&&r instanceof Tt){a=i.getValue();var _=r.elements,E=_[a];e:if(si(E,t)){for(var y=!0,v=[],S=_.length;--S>a;)(b=_[S].drop_side_effect_free(t))&&(v.unshift(b),y&&b.has_side_effects(t)&&(y=!1));if(E instanceof Ie)break e;for(E=E instanceof yn?h(En,E):E,y||v.unshift(E);--S>=0;){var b;if((b=_[S])instanceof Ie)break e;(b=b.drop_side_effect_free(t))?v.unshift(b):a--}return y?(v.push(E),mr(e,v).optimize(t)):h(vt,e,{expression:h(Tt,r,{elements:v}),property:h(hn,i,{value:a})})}}var A=e.evaluate(t);return A!==e?Lr(t,A=gr(A,e).optimize(t),e):e})),Pe.DEFMETHOD("contains_this",(function(){return Cn(this,e=>e instanceof cn?$n:e!==this&&e instanceof ke&&!(e instanceof Le)||void 0)})),Et.DEFMETHOD("flatten_object",(function(e,t){if(t.option("properties")){var n=t.option("unsafe_arrows")&&t.option("ecma")>=2015,r=this.expression;if(r instanceof Rt)for(var i=r.properties,s=i.length;--s>=0;){var o=i[s];if(""+(o instanceof It?o.key.name:o.key)==e){if(!i.every(e=>e instanceof Dt||n&&e instanceof It&&!e.is_generator))break;if(!si(o.value,t))break;return h(vt,this,{expression:h(Tt,r,{elements:i.map((function(e){var t=e.value;t instanceof Me&&(t=h(Fe,t,t));var n=e.key;return n instanceof he&&!(n instanceof Xt)?mr(e,[n,t]):t}))}),property:h(hn,this,{value:s})})}}}})),ar(yt,(function(e,t){"arguments"!=e.property&&"caller"!=e.property||t.warn("Function.prototype.{prop} not supported [{file}:{line},{col}]",{prop:e.property,file:e.start.file,line:e.start.line,col:e.start.col});const n=t.parent();if(Pr(e,n))return e;if(t.option("unsafe_proto")&&e.expression instanceof yt&&"prototype"==e.expression.property){var r=e.expression.expression;if(Cr(r))switch(r.name){case"Array":e.expression=h(Tt,e.expression,{elements:[]});break;case"Function":e.expression=h(Fe,e.expression,{argnames:[],body:[]});break;case"Number":e.expression=h(hn,e.expression,{value:0});break;case"Object":e.expression=h(Rt,e.expression,{properties:[]});break;case"RegExp":e.expression=h(fn,e.expression,{value:{source:"t",flags:""}});break;case"String":e.expression=h(pn,e.expression,{value:""})}}if(!(n instanceof mt&&A(n,Dn))){const n=e.flatten_object(e.property,t);if(n)return n.optimize(t)}let i=e.evaluate(t);return i!==e?(i=gr(i,e).optimize(t),Lr(t,i,e)):e})),ar(Tt,(function(e,t){var n=oi(e,t);return n!==e?n:ai(e,0,e.elements)})),ar(Rt,(function(e,t){var n=oi(e,t);if(n!==e)return n;for(var r=e.properties,i=0;i=2015)||e.name||e.is_generator||e.uses_arguments||e.pinned()||Cn(e,e=>{if(e instanceof cn)return $n})?e:h(Le,e,e).optimize(t)})),ar(Pt,(function(e){return e})),ar(Ze,(function(e,t){return e.expression&&!e.is_star&&kr(e.expression,t)&&(e.expression=null),e})),ar(He,(function(e,t){if(!t.option("evaluate")||t.parent()instanceof Ue)return e;for(var n=[],r=0;r=2015&&(!(n instanceof RegExp)||n.test(e.key+""))){var r=e.key,i=e.value;if((i instanceof Le&&Array.isArray(i.body)&&!i.contains_this()||i instanceof Fe)&&!i.name)return h(It,e,{async:i.async,is_generator:i.is_generator,key:r instanceof he?r:h(Xt,e,{name:r}),value:h(Me,i,i),quote:e.quote})}return e})),ar(Ve,(function(e,t){if(1==t.option("pure_getters")&&t.option("unused")&&!e.is_array&&Array.isArray(e.names)&&!function(e){for(var t=[/^VarDef$/,/^(Const|Let|Var)$/,/^Export$/],n=0,r=0,i=t.length;n1)throw new Error("inline source map only works with singular input");n.sourceMap.content=(r=e[p],(i=/(?:^|[^.])\/\/# sourceMappingURL=data:application\/json(;[\w=-]*)?;base64,([+/0-9A-Za-z]*=*)\s*$/.exec(r))?di(i[2]):(he.warn("inline source map not found"),null))}l=n.parse.toplevel}a&&"strict"!==n.mangle.properties.keep_quoted&&ui(l,a),n.wrap&&(l=l.wrap_commonjs(n.wrap)),n.enclose&&(l=l.wrap_enclose(n.enclose)),c&&(c.rename=Date.now()),c&&(c.compress=Date.now()),n.compress&&(l=new or(n.compress).compress(l)),c&&(c.scope=Date.now()),n.mangle&&l.figure_out_scope(n.mangle),c&&(c.mangle=Date.now()),n.mangle&&(Xn.reset(),l.compute_char_frequency(n.mangle),l.mangle_names(n.mangle)),c&&(c.properties=Date.now()),n.mangle&&n.mangle.properties&&(l=hi(l,n.mangle.properties)),c&&(c.output=Date.now());var h={};if(n.output.ast&&(h.ast=l),!y(n.output,"code")||n.output.code){if(n.sourceMap&&("string"==typeof n.sourceMap.content&&(n.sourceMap.content=JSON.parse(n.sourceMap.content)),n.output.source_map=function(e){e=s(e,{file:null,root:null,orig:null,orig_line_diff:0,dest_line_diff:0});var n=new t.SourceMapGenerator({file:e.file,sourceRoot:e.root}),r=e.orig&&new t.SourceMapConsumer(e.orig);return r&&r.sources.forEach((function(e){var t=r.sourceContentFor(e,!0);t&&n.setSourceContent(e,t)})),{add:function(t,i,s,o,a,c){if(r){var l=r.originalPositionFor({line:o,column:a});if(null===l.source)return;t=l.source,o=l.line,a=l.column,c=l.name||c}n.addMapping({generated:{line:i+e.dest_line_diff,column:s},original:{line:o+e.orig_line_diff,column:a},source:t,name:c})},get:function(){return n},toString:function(){return JSON.stringify(n.toJSON())}}}({file:n.sourceMap.filename,orig:n.sourceMap.content,root:n.sourceMap.root}),n.sourceMap.includeSources)){if(e instanceof Oe)throw new Error("original source content unavailable");for(var p in e)y(e,p)&&n.output.source_map.get().setSourceContent(p,e[p])}delete n.output.ast,delete n.output.code;var d=Bn(n.output);if(l.print(d),h.code=d.get(),n.sourceMap)if(n.sourceMap.asObject?h.map=n.output.source_map.get().toJSON():h.map=n.output.source_map.toString(),"inline"==n.sourceMap.url){var f="object"==typeof h.map?JSON.stringify(h.map):h.map;h.code+="\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,"+fi(f)}else n.sourceMap.url&&(h.code+="\n//# sourceMappingURL="+n.sourceMap.url)}return n.nameCache&&n.mangle&&(n.mangle.cache&&(n.nameCache.vars=_i(n.mangle.cache)),n.mangle.properties&&n.mangle.properties.cache&&(n.nameCache.props=_i(n.mangle.properties.cache))),c&&(c.end=Date.now(),h.timings={parse:.001*(c.rename-c.parse),rename:.001*(c.compress-c.rename),compress:.001*(c.scope-c.compress),scope:.001*(c.mangle-c.scope),mangle:.001*(c.properties-c.mangle),properties:.001*(c.output-c.properties),output:.001*(c.end-c.output),total:.001*(c.end-c.start)}),u.length&&(h.warnings=u),h}catch(e){return{error:e}}finally{he.warn_function=o}}!function(){var e=function(e){for(var t=!0,n=0;n1||e.guardedHandlers&&e.guardedHandlers.length)throw new Error("Multiple catch clauses are not supported.");return new it({start:r(e),end:i(e),body:a(e.block).body,bcatch:a(t[0]),bfinally:e.finalizer?new ot(a(e.finalizer)):null})},Property:function(e){var t=e.key,n={start:r(t||e.value),end:i(e.value),key:"Identifier"==t.type?t.name:t.value,value:a(e.value)};return e.computed&&(n.key=a(e.key)),e.method?(n.is_generator=e.value.generator,n.async=e.value.async,e.computed?n.key=a(e.key):n.key=new Xt({name:n.key}),new It(n)):"init"==e.kind?("Identifier"!=t.type&&"Literal"!=t.type&&(n.key=a(t)),new Dt(n)):("string"!=typeof n.key&&"number"!=typeof n.key||(n.key=new Xt({name:n.key})),n.value=new Me(n.value),"get"==e.kind?new Ot(n):"set"==e.kind?new kt(n):"method"==e.kind?(n.async=e.value.async,n.is_generator=e.value.generator,n.quote=e.computed?'"':null,new It(n)):void 0)},MethodDefinition:function(e){var t={start:r(e),end:i(e),key:e.computed?a(e.key):new Xt({name:e.key.name||e.key.value}),value:a(e.value),static:e.static};return"get"==e.kind?new Ot(t):"set"==e.kind?new kt(t):(t.is_generator=e.value.generator,t.async=e.value.async,new It(t))},FieldDefinition:function(e){let t;if(e.computed)t=a(e.key);else{if("Identifier"!==e.key.type)throw new Error("Non-Identifier key in FieldDefinition");t=a(e.key)}return new Mt({start:r(e),end:i(e),key:t,value:a(e.value),static:e.static})},ArrayExpression:function(e){return new Tt({start:r(e),end:i(e),elements:e.elements.map((function(e){return null===e?new yn:a(e)}))})},ObjectExpression:function(e){return new Rt({start:r(e),end:i(e),properties:e.properties.map((function(e){return"SpreadElement"===e.type||(e.type="Property"),a(e)}))})},SequenceExpression:function(e){return new _t({start:r(e),end:i(e),expressions:e.expressions.map(a)})},MemberExpression:function(e){return new(e.computed?vt:yt)({start:r(e),end:i(e),property:e.computed?a(e.property):e.property.name,expression:a(e.object)})},SwitchCase:function(e){return new(e.test?rt:nt)({start:r(e),end:i(e),expression:a(e.test),body:e.consequent.map(a)})},VariableDeclaration:function(e){return new("const"===e.kind?ut:"let"===e.kind?lt:ct)({start:r(e),end:i(e),definitions:e.declarations.map(a)})},ImportDeclaration:function(e){var t=null,n=null;return e.specifiers.forEach((function(e){"ImportSpecifier"===e.type?(n||(n=[]),n.push(new ht({start:r(e),end:i(e),foreign_name:a(e.imported),name:a(e.local)}))):"ImportDefaultSpecifier"===e.type?t=a(e.local):"ImportNamespaceSpecifier"===e.type&&(n||(n=[]),n.push(new ht({start:r(e),end:i(e),foreign_name:new tn({name:"*"}),name:a(e.local)})))})),new dt({start:r(e),end:i(e),imported_name:t,imported_names:n,module_name:a(e.source)})},ExportAllDeclaration:function(e){return new ft({start:r(e),end:i(e),exported_names:[new ht({name:new on({name:"*"}),foreign_name:new on({name:"*"})})],module_name:a(e.source)})},ExportNamedDeclaration:function(e){return new ft({start:r(e),end:i(e),exported_definition:a(e.declaration),exported_names:e.specifiers&&e.specifiers.length?e.specifiers.map((function(e){return new ht({foreign_name:a(e.exported),name:a(e.local)})})):null,module_name:a(e.source)})},ExportDefaultDeclaration:function(e){return new ft({start:r(e),end:i(e),exported_value:a(e.declaration),is_default:!0})},Literal:function(e){var t=e.value,n={start:r(e),end:i(e)},s=e.regex;if(s&&s.pattern)return n.value={source:s.pattern,flags:s.flags},new fn(n);if(s){const r=e.raw||t,i=r.match(/^\/(.*)\/(\w*)$/);if(!i)throw new Error("Invalid regex source "+r);const[s,o,a]=i;return n.value={source:o,flags:a},new fn(n)}if(null===t)return new gn(n);switch(typeof t){case"string":return n.value=t,new pn(n);case"number":return n.value=t,new hn(n);case"boolean":return new(t?An:bn)(n)}},MetaProperty:function(e){if("new"===e.meta.name&&"target"===e.property.name)return new Vt({start:r(e),end:i(e)})},Identifier:function(e){var t=o[o.length-2];return new("LabeledStatement"==t.type?nn:"VariableDeclarator"==t.type&&t.id===e?"const"==t.kind?jt:"let"==t.kind?Wt:Ht:/Import.*Specifier/.test(t.type)?t.local===e?en:tn:"ExportSpecifier"==t.type?t.local===e?sn:on:"FunctionExpression"==t.type?t.id===e?Yt:Kt:"FunctionDeclaration"==t.type?t.id===e?zt:Kt:"ArrowFunctionExpression"==t.type?t.params.includes(e)?Kt:rn:"ClassExpression"==t.type?t.id===e?Zt:rn:"Property"==t.type?t.key===e&&t.computed||t.value===e?rn:Xt:"FieldDefinition"==t.type?t.key===e&&t.computed||t.value===e?rn:qt:"ClassDeclaration"==t.type?t.id===e?Qt:rn:"MethodDefinition"==t.type?t.computed?rn:Xt:"CatchClause"==t.type?Jt:"BreakStatement"==t.type||"ContinueStatement"==t.type?an:rn)({start:r(e),end:i(e),name:e.name})},BigIntLiteral:e=>new dn({start:r(e),end:i(e),value:e.value})};function n(e){if("Literal"==e.type)return null!=e.raw?e.raw:e.value+""}function r(e){var t=e.loc,r=t&&t.start,i=e.range;return new pe({file:t&&t.source,line:r&&r.line,col:r&&r.column,pos:i?i[0]:e.start,endline:r&&r.line,endcol:r&&r.column,endpos:i?i[0]:e.start,raw:n(e)})}function i(e){var t=e.loc,r=t&&t.end,i=e.range;return new pe({file:t&&t.source,line:r&&r.line,col:r&&r.column,pos:i?i[1]:e.end,endline:r&&r.line,endcol:r&&r.column,endpos:i?i[1]:e.end,raw:n(e)})}function s(e,n,s){var o="function From_Moz_"+e+"(M){\n";o+="return new U2."+n.name+"({\nstart: my_start_token(M),\nend: my_end_token(M)";var l="function To_Moz_"+e+"(M){\n";l+="return {\ntype: "+JSON.stringify(e),s&&s.split(/\s*,\s*/).forEach((function(e){var t=/([a-z0-9$_]+)([=@>%])([a-z0-9$_]+)/i.exec(e);if(!t)throw new Error("Can't understand property map: "+e);var n=t[1],r=t[2],i=t[3];switch(o+=",\n"+i+": ",l+=",\n"+n+": ",r){case"@":o+="M."+n+".map(from_moz)",l+="M."+i+".map(to_moz)";break;case">":o+="from_moz(M."+n+")",l+="to_moz(M."+i+")";break;case"=":o+="M."+n,l+="M."+i;break;case"%":o+="from_moz(M."+n+").body",l+="to_moz_block(M)";break;default:throw new Error("Can't understand operator in propmap: "+e)}})),o+="\n})\n}",l+="\n}\n}",o=new Function("U2","my_start_token","my_end_token","from_moz","return("+o+")")(kn,r,i,a),l=new Function("to_moz","to_moz_block","to_moz_scope","return("+l+")")(u,d,f),t[e]=o,c(n,l)}t.UpdateExpression=t.UnaryExpression=function(e){return new(("prefix"in e?e.prefix:"UnaryExpression"==e.type)?bt:At)({start:r(e),end:i(e),operator:e.operator,expression:a(e.argument)})},t.ClassDeclaration=t.ClassExpression=function(e){return new("ClassDeclaration"===e.type?Ft:Lt)({start:r(e),end:i(e),name:a(e.id),extends:a(e.superClass),properties:e.body.body.map(a)})},s("EmptyStatement",Se),s("BlockStatement",ve,"body@body"),s("IfStatement",Je,"test>condition, consequent>body, alternate>alternative"),s("LabeledStatement",Ae,"label>label, body>body"),s("BreakStatement",qe,"label>label"),s("ContinueStatement",Ye,"label>label"),s("WithStatement",De,"object>expression, body>body"),s("SwitchStatement",et,"discriminant>expression, cases@body"),s("ReturnStatement",Ke,"argument>value"),s("ThrowStatement",ze,"argument>value"),s("WhileStatement",we,"test>condition, body>body"),s("DoWhileStatement",$e,"test>condition, body>body"),s("ForStatement",Te,"init>init, test>condition, update>step, body>body"),s("ForInStatement",Re,"left>init, right>object, body>body"),s("ForOfStatement",Ne,"left>init, right>object, body>body, await=await"),s("AwaitExpression",Qe,"argument>expression"),s("YieldExpression",Ze,"argument>expression, delegate=is_star"),s("DebuggerStatement",fe),s("VariableDeclarator",pt,"id>name, init>value"),s("CatchClause",st,"param>argname, body%body"),s("ThisExpression",cn),s("Super",ln),s("BinaryExpression",Ct,"operator=operator, left>left, right>right"),s("LogicalExpression",Ct,"operator=operator, left>left, right>right"),s("AssignmentExpression",$t,"operator=operator, left>left, right>right"),s("ConditionalExpression",xt,"test>condition, consequent>consequent, alternate>alternative"),s("NewExpression",gt,"callee>expression, arguments@args"),s("CallExpression",mt,"callee>expression, arguments@args"),c(Oe,(function(e){return f("Program",e)})),c(Ie,(function(e){return{type:p()?"RestElement":"SpreadElement",argument:u(e.expression)}})),c(Ue,(function(e){return{type:"TaggedTemplateExpression",tag:u(e.prefix),quasi:u(e.template_string)}})),c(He,(function(e){for(var t=[],n=[],r=0;r({type:"BigIntLiteral",value:e.value})),Sn.DEFMETHOD("to_mozilla_ast",un.prototype.to_mozilla_ast),gn.DEFMETHOD("to_mozilla_ast",un.prototype.to_mozilla_ast),yn.DEFMETHOD("to_mozilla_ast",(function(){return null})),ye.DEFMETHOD("to_mozilla_ast",ve.prototype.to_mozilla_ast),Pe.DEFMETHOD("to_mozilla_ast",Fe.prototype.to_mozilla_ast);var o=null;function a(e){o.push(e);var n=null!=e?t[e.type](e):null;return o.pop(),n}function c(e,t){e.DEFMETHOD("to_mozilla_ast",(function(e){return n=t(this,e),r=this.start,i=this.end,r&&i?(null!=r.pos&&null!=i.endpos&&(n.range=[r.pos,i.endpos]),r.line&&(n.loc={start:{line:r.line,column:r.col},end:i.endline?{line:i.endline,column:i.endcol}:null},r.file&&(n.loc.source=r.file)),n):n;var n,r,i}))}he.from_mozilla_ast=function(e){var t=o;o=[];var n=a(e);return o=t,n};var l=null;function u(e){null===l&&(l=[]),l.push(e);var t=null!=e?e.to_mozilla_ast(l[l.length-2]):null;return l.pop(),0===l.length&&(l=null),t}function p(){for(var e=l.length;e--;)if(l[e]instanceof Ve)return!0;return!1}function d(e){return{type:"BlockStatement",body:e.body.map(u)}}function f(e,t){var n=t.body.map(u);return t.body[0]instanceof ge&&t.body[0].body instanceof pn&&n.unshift(u(new Se(t.body[0]))),{type:e,body:n}}}(),e.AST_Accessor=Me,e.AST_Array=Tt,e.AST_Arrow=Le,e.AST_Assign=$t,e.AST_Atom=mn,e.AST_Await=Qe,e.AST_Binary=Ct,e.AST_Block=ye,e.AST_BlockStatement=ve,e.AST_Boolean=Sn,e.AST_Break=qe,e.AST_Call=mt,e.AST_Case=rt,e.AST_Catch=st,e.AST_Class=Pt,e.AST_ClassExpression=Lt,e.AST_ConciseMethod=It,e.AST_Conditional=xt,e.AST_Const=ut,e.AST_Constant=un,e.AST_Continue=Ye,e.AST_DWLoop=xe,e.AST_Debugger=fe,e.AST_DefClass=Ft,e.AST_Default=nt,e.AST_DefaultAssign=wt,e.AST_Definitions=at,e.AST_Defun=Be,e.AST_Destructuring=Ve,e.AST_Directive=me,e.AST_Do=$e,e.AST_Dot=yt,e.AST_EmptyStatement=Se,e.AST_Exit=We,e.AST_Expansion=Ie,e.AST_Export=ft,e.AST_False=bn,e.AST_Finally=ot,e.AST_For=Te,e.AST_ForIn=Re,e.AST_ForOf=Ne,e.AST_Function=Fe,e.AST_Hole=yn,e.AST_If=Je,e.AST_Import=dt,e.AST_Infinity=vn,e.AST_IterationStatement=Ce,e.AST_Jump=je,e.AST_Label=nn,e.AST_LabelRef=an,e.AST_LabeledStatement=Ae,e.AST_Lambda=Pe,e.AST_Let=lt,e.AST_LoopControl=Xe,e.AST_NaN=_n,e.AST_NameMapping=ht,e.AST_New=gt,e.AST_NewTarget=Vt,e.AST_Node=he,e.AST_Null=gn,e.AST_Number=hn,e.AST_Object=Rt,e.AST_ObjectGetter=Ot,e.AST_ObjectKeyVal=Dt,e.AST_ObjectProperty=Nt,e.AST_ObjectSetter=kt,e.AST_PrefixedTemplateString=Ue,e.AST_PropAccess=Et,e.AST_RegExp=fn,e.AST_Return=Ke,e.AST_Scope=ke,e.AST_Sequence=_t,e.AST_SimpleStatement=ge,e.AST_Statement=de,e.AST_StatementWithBody=be,e.AST_String=pn,e.AST_Sub=vt,e.AST_Super=ln,e.AST_Switch=et,e.AST_SwitchBranch=tt,e.AST_Symbol=Bt,e.AST_SymbolBlockDeclaration=Gt,e.AST_SymbolCatch=Jt,e.AST_SymbolClass=Zt,e.AST_SymbolConst=jt,e.AST_SymbolDeclaration=Ut,e.AST_SymbolDefClass=Qt,e.AST_SymbolDefun=zt,e.AST_SymbolExport=sn,e.AST_SymbolExportForeign=on,e.AST_SymbolFunarg=Kt,e.AST_SymbolImport=en,e.AST_SymbolImportForeign=tn,e.AST_SymbolLambda=Yt,e.AST_SymbolLet=Wt,e.AST_SymbolMethod=Xt,e.AST_SymbolRef=rn,e.AST_SymbolVar=Ht,e.AST_TemplateSegment=Ge,e.AST_TemplateString=He,e.AST_This=cn,e.AST_Throw=ze,e.AST_Token=pe,e.AST_Toplevel=Oe,e.AST_True=An,e.AST_Try=it,e.AST_Unary=St,e.AST_UnaryPostfix=At,e.AST_UnaryPrefix=bt,e.AST_Undefined=En,e.AST_Var=ct,e.AST_VarDef=pt,e.AST_While=we,e.AST_With=De,e.AST_Yield=Ze,e.Compressor=or,e.OutputStream=Bn,e.TreeTransformer=Tn,e.TreeWalker=wn,e._INLINE=Nn,e._JS_Parse_Error=J,e._NOINLINE=Dn,e._PURE=Rn,e._has_annotation=A,e._tokenizer=re,e.base54=Xn,e.default_options=qn,e.defaults=s,e.mangle_properties=hi,e.minify=Ei,e.parse=le,e.push_uniq=d,e.reserve_quoted_keys=ui,e.string_template=f,e.to_ascii=di}(t,sourceMap)}));function fastMinifyPlugin({sourcemap:e=!1,warnThreshold:t=50,compress:n=!1}={}){return{name:"fast-minify",renderChunk(r,i){const s=Date.now(),o=bundle_min.minify(r,{sourceMap:e,mangle:!0,compress:n,module:!0,ecma:9,safari10:!0,output:{comments:!1}}),a=Date.now()-s;if(o.error&&this.error(o.error),o.warnings)for(const e of o.warnings)this.warn(e);a>t&&this.warn(`minify(${i.fileName}) took ${a}ms`);const c="string"==typeof o.map?JSON.parse(o.map):o.map||null;return{code:o.code,map:c}}}}function getJson(e,t){return getStream(e,t).then(streamToString).then(JSON.parse)}function getStream(e,t){return new Promise((n,r)=>{https$2.get(e,t||{},t=>{const i=t.statusCode;i<200||i>=400?r(Error(`${t.statusMessage}: ${e}`)):n(t)})})}function streamToString(e){return new Promise((t,n)=>{let r="";e.setEncoding("utf-8"),e.on("data",e=>{"string"!=typeof e&&(e=e.toString("utf-8")),r+=e}),e.on("end",()=>{t(r)}),e.on("error",n)})}function memo(e,t){const n=new Map;return function(...r){const i=t?t(...r):r[0];let s=n.get(i);return void 0===s&&(s=e(...r),n.set(i,s)),s}}const{Buffer:Buffer$1}=require("buffer"),symbol=Symbol.for("BufferList");function BufferList(e){if(!(this instanceof BufferList))return new BufferList(e);BufferList._init.call(this,e)}BufferList._init=function(e){Object.defineProperty(this,symbol,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)},BufferList.prototype._new=function(e){return new BufferList(e)},BufferList.prototype._offset=function(e){if(0===e)return[0,0];let t=0;for(let n=0;nthis.length||e<0)return;const t=this._offset(e);return this._bufs[t[0]][t[1]]},BufferList.prototype.slice=function(e,t){return"number"==typeof e&&e<0&&(e+=this.length),"number"==typeof t&&t<0&&(t+=this.length),this.copy(null,0,e,t)},BufferList.prototype.copy=function(e,t,n,r){if(("number"!=typeof n||n<0)&&(n=0),("number"!=typeof r||r>this.length)&&(r=this.length),n>=this.length)return e||Buffer$1.alloc(0);if(r<=0)return e||Buffer$1.alloc(0);const i=!!e,s=this._offset(n),o=r-n;let a=o,c=i&&t||0,l=s[1];if(0===n&&r===this.length){if(!i)return 1===this._bufs.length?this._bufs[0]:Buffer$1.concat(this._bufs,this.length);for(let t=0;tn)){this._bufs[t].copy(e,c,l,l+a);break}this._bufs[t].copy(e,c,l),c+=n,a-=n,l&&(l=0)}return e},BufferList.prototype.shallowSlice=function(e,t){if(e=e||0,t="number"!=typeof t?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return this._new();const n=this._offset(e),r=this._offset(t),i=this._bufs.slice(n[0],r[0]+1);return 0===r[1]?i.pop():i[i.length-1]=i[i.length-1].slice(0,r[1]),0!==n[1]&&(i[0]=i[0].slice(n[1])),this._new(i)},BufferList.prototype.toString=function(e,t,n){return this.slice(t,n).toString(e)},BufferList.prototype.consume=function(e){for(;this._bufs.length;){if(!(e>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},BufferList.prototype.duplicate=function(){const e=this._new();for(let t=0;tthis.length?this.length:t;const r=this._offset(t);let i=r[0],s=r[1];for(;i=e.length){const n=t.indexOf(e,s);if(-1!==n)return this._reverseOffset([i,n]);s=t.length-e.length+1}else{const t=this._reverseOffset([i,s]);if(this._match(t,e))return t;s++}}s=0}return-1},BufferList.prototype._match=function(e,t){if(this.length-e=t?t:e>=0||(e+=t)>=0?e:0},toType=function(e){switch(e){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null},toTypeflag=function(e){switch(e){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0},indexOf=function(e,t,n,r){for(;nt?SEVENS.slice(0,t)+" ":ZEROS.slice(0,t-e.length)+e+" "};function parse256(e){var t;if(128===e[0])t=!0;else{if(255!==e[0])return null;t=!1}for(var n=[],r=e.length-1;r>0;r--){var i=e[r];t?n.push(i):n.push(255-i)}var s=0,o=n.length;for(r=0;r=Math.pow(10,n)&&n++,t+n+e},decodeLongPath=function(e,t){return decodeStr(e,0,e.length,t)},encodePax=function(e){var t="";e.name&&(t+=addLength(" path="+e.name+"\n")),e.linkname&&(t+=addLength(" linkpath="+e.linkname+"\n"));var n=e.pax;if(n)for(var r in n)t+=addLength(" "+r+"="+n[r]+"\n");return Buffer.from(t)},decodePax=function(e){for(var t={};e.length;){for(var n=0;n100;){var i=n.indexOf("/");if(-1===i)return null;r+=r?"/"+n.slice(0,i):n.slice(0,i),n=n.slice(i+1)}return Buffer.byteLength(n)>100||Buffer.byteLength(r)>155||e.linkname&&Buffer.byteLength(e.linkname)>100?null:(t.write(n),t.write(encodeOct(e.mode&MASK,6),100),t.write(encodeOct(e.uid,6),108),t.write(encodeOct(e.gid,6),116),t.write(encodeOct(e.size,11),124),t.write(encodeOct(e.mtime.getTime()/1e3|0,11),136),t[156]=ZERO_OFFSET+toTypeflag(e.type),e.linkname&&t.write(e.linkname,157),USTAR_MAGIC.copy(t,MAGIC_OFFSET),USTAR_VER.copy(t,VERSION_OFFSET),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(encodeOct(e.devmajor||0,6),329),t.write(encodeOct(e.devminor||0,6),337),r&&t.write(r,345),t.write(encodeOct(cksum(t),6),148),t)},decode$3=function(e,t){var n=0===e[156]?0:e[156]-ZERO_OFFSET,r=decodeStr(e,0,100,t),i=decodeOct(e,100,8),s=decodeOct(e,108,8),o=decodeOct(e,116,8),a=decodeOct(e,124,12),c=decodeOct(e,136,12),l=toType(n),u=0===e[157]?null:decodeStr(e,157,100,t),p=decodeStr(e,265,32),h=decodeStr(e,297,32),d=decodeOct(e,329,8),f=decodeOct(e,337,8),m=cksum(e);if(256===m)return null;if(m!==decodeOct(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(0===USTAR_MAGIC.compare(e,MAGIC_OFFSET,MAGIC_OFFSET+6))e[345]&&(r=decodeStr(e,345,155,t)+"/"+r);else if(0!==GNU_MAGIC.compare(e,MAGIC_OFFSET,MAGIC_OFFSET+6)||0!==GNU_VER.compare(e,VERSION_OFFSET,VERSION_OFFSET+2))throw new Error("Invalid tar header: unknown format.");return 0===n&&r&&"/"===r[r.length-1]&&(n=5),{name:r,mode:i,uid:s,gid:o,size:a,mtime:new Date(1e3*c),type:l,linkname:u,uname:p,gname:h,devmajor:d,devminor:f}},headers={decodeLongPath,encodePax,decodePax,encode:encode$4,decode:decode$3},util$1=require("util"),Writable=Stream.Writable,PassThrough=Stream.PassThrough,noop$1=function(){},overflow=function(e){return(e&=511)&&512-e},emptyStream=function(e,t){var n=new Source$1(e,t);return n.end(),n},mixinPax=function(e,t){return t.path&&(e.name=t.path),t.linkpath&&(e.linkname=t.linkpath),t.size&&(e.size=parseInt(t.size,10)),e.pax=t,e},Source$1=function(e,t){this._parent=e,this.offset=t,PassThrough.call(this)};util$1.inherits(Source$1,PassThrough),Source$1.prototype.destroy=function(e){this._parent.destroy(e)};var Extract=function(e){if(!(this instanceof Extract))return new Extract(e);Writable.call(this,e),e=e||{},this._offset=0,this._buffer=bl(),this._missing=0,this._partial=!1,this._onparse=noop$1,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var t=this,n=t._buffer,r=function(){t._continue()},i=function(e){if(t._locked=!1,e)return t.destroy(e);t._stream||r()},s=function(){t._stream=null;var e=overflow(t._header.size);e?t._parse(e,o):t._parse(512,p),t._locked||r()},o=function(){t._buffer.consume(overflow(t._header.size)),t._parse(512,p),r()},a=function(){var e=t._header.size;t._paxGlobal=headers.decodePax(n.slice(0,e)),n.consume(e),s()},c=function(){var e=t._header.size;t._pax=headers.decodePax(n.slice(0,e)),t._paxGlobal&&(t._pax=Object.assign({},t._paxGlobal,t._pax)),n.consume(e),s()},l=function(){var r=t._header.size;this._gnuLongPath=headers.decodeLongPath(n.slice(0,r),e.filenameEncoding),n.consume(r),s()},u=function(){var r=t._header.size;this._gnuLongLinkPath=headers.decodeLongPath(n.slice(0,r),e.filenameEncoding),n.consume(r),s()},p=function(){var o,h=t._offset;try{o=t._header=headers.decode(n.slice(0,512),e.filenameEncoding)}catch(e){t.emit("error",e)}return n.consume(512),o?"gnu-long-path"===o.type?(t._parse(o.size,l),void r()):"gnu-long-link-path"===o.type?(t._parse(o.size,u),void r()):"pax-global-header"===o.type?(t._parse(o.size,a),void r()):"pax-header"===o.type?(t._parse(o.size,c),void r()):(t._gnuLongPath&&(o.name=t._gnuLongPath,t._gnuLongPath=null),t._gnuLongLinkPath&&(o.linkname=t._gnuLongLinkPath,t._gnuLongLinkPath=null),t._pax&&(t._header=o=mixinPax(o,t._pax),t._pax=null),t._locked=!0,o.size&&"directory"!==o.type?(t._stream=new Source$1(t,h),t.emit("entry",o,t._stream,i),t._parse(o.size,s),void r()):(t._parse(512,p),void t.emit("entry",o,emptyStream(t,h),i))):(t._parse(512,p),void r())};this._onheader=p,this._parse(512,p)};util$1.inherits(Extract,Writable),Extract.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))},Extract.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)},Extract.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=noop$1,this._overflow?this._write(this._overflow,void 0,e):e()}},Extract.prototype._write=function(e,t,n){if(!this._destroyed){var r=this._stream,i=this._buffer,s=this._missing;if(e.length&&(this._partial=!0),e.lengths&&(o=e.slice(s),e=e.slice(0,s)),r?r.end(e):i.append(e),this._overflow=o,this._onparse()}},Extract.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};var extract=Extract,fsConstants=require("fs").constants||require("constants"),wrappy_1=wrappy;function wrappy(e,t){if(e&&t)return wrappy(e)(t);if("function"!=typeof e)throw new TypeError("need wrapper function");return Object.keys(e).forEach((function(t){n[t]=e[t]})),n;function n(){for(var t=new Array(arguments.length),n=0;n>>=0;var r=e.byteLength-t;if(r<0)throw new RangeError("'offset' is out of bounds");if(void 0===n)n=r;else if((n>>>=0)>r)throw new RangeError("'length' is out of bounds");return isModern?Buffer.from(e.slice(t,t+n)):new Buffer(new Uint8Array(e.slice(t,t+n)))}function fromString(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!Buffer.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');return isModern?Buffer.from(e,t):new Buffer(e,t)}function bufferFrom(e,t,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return isArrayBuffer(e)?fromArrayBuffer(e,t,n):"string"==typeof e?fromString(e,t):isModern?Buffer.from(e):new Buffer(e)}var bufferFrom_1=bufferFrom,isObject$3=function(e){return!Buffer.isBuffer(e)&&"string"!=typeof e},peek=function(e,t){if("number"==typeof e&&(e={maxBuffer:e}),"function"==typeof e)return peek(null,e);e||(e={});var n="number"==typeof e.maxBuffer?e.maxBuffer:65535,r=e.strict,i=!1!==e.newline,s=[],o=0,a=duplexify.obj(),c=through2_1.obj({highWaterMark:1},(function(e,t,a){if(isObject$3(e))return u(e,null,a);if(Buffer.isBuffer(e)||(e=bufferFrom_1(e)),i){var c=Array.prototype.indexOf.call(e,10);if(c>0&&13===e[c-1]&&c--,c>-1)return s.push(e.slice(0,c)),u(Buffer.concat(s),e.slice(c),a)}return s.push(e),(o+=e.length)0,(function(t){e||(e=t),t&&r.forEach(call),o||(r.forEach(call),n(e))}))}));t.reduce(pipe)},pump_1=pump,inherits$4=require("inherits"),toArray=function(e){return e.length?Array.isArray(e[0])?e[0]:Array.prototype.slice.call(e):[]},define=function(e){var t=function(){var n=toArray(arguments);if(!(this instanceof t))return new t(n);duplexify.call(this,null,null,e),n.length&&this.setPipeline(n)};return inherits$4(t,duplexify),t.prototype.setPipeline=function(){var e=toArray(arguments),t=this,n=!1,r=e[0],i=e[e.length-1];i=i.readable?i:null,r=r.writable?r:null;var s=function(){e[0].emit("error",new Error("stream was destroyed"))};if(this.on("close",s),this.on("prefinish",(function(){n||t.cork()})),pump_1(e,(function(e){if(t.removeListener("close",s),e)return t.destroy("premature close"===e.message?null:e);n=!0,!1===t._autoDestroy&&(t._autoDestroy=!0),t.uncork()})),this.destroyed)return s();this.setWritable(r),this.setReadable(i)},t},pumpify=define({autoDestroy:!1,destroy:!1}),obj$1=define({autoDestroy:!1,destroy:!1,objectMode:!0,highWaterMark:16}),ctor$1=define;pumpify.obj=obj$1,pumpify.ctor=ctor$1;var isGzip=function(e){return!(!e||e.length<3)&&(31===e[0]&&139===e[1]&&8===e[2])},isDeflate=function(e){return!(!e||e.length<2)&&(120===e[0]&&(1===e[1]||156===e[1]||218===e[1]))},zlib=require("zlib"),isCompressed=function(e){return isGzip(e)?1:isDeflate(e)?2:0},gunzip=function(e){return void 0===e&&(e=3),peekStream({newline:!1,maxBuffer:10},(function(t,n){if(e<0)return n(new Error("Maximum recursion reached"));switch(isCompressed(t)){case 1:n(null,pumpify(zlib.createGunzip(),gunzip(e-1)));break;case 2:n(null,pumpify(zlib.createInflate(),gunzip(e-1)));break;default:n(null,through2_1())}}))},gunzipMaybe=gunzip;const debug="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var debug_1=debug;const SEMVER_SPEC_VERSION="2.0.0",MAX_LENGTH$1=256,MAX_SAFE_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH=16;var constants$1={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER,MAX_SAFE_COMPONENT_LENGTH:16},re_1=createCommonjsModule$1((function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n}=constants$1,r=(t=e.exports={}).re=[],i=t.src=[],s=t.t={};let o=0;const a=(e,t,n)=>{const a=o++;debug_1(a,t),s[e]=a,i[a]=t,r[a]=new RegExp(t,n?"g":void 0)};a("NUMERICIDENTIFIER","0|[1-9]\\d*"),a("NUMERICIDENTIFIERLOOSE","[0-9]+"),a("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),a("MAINVERSION",`(${i[s.NUMERICIDENTIFIER]})\\.(${i[s.NUMERICIDENTIFIER]})\\.(${i[s.NUMERICIDENTIFIER]})`),a("MAINVERSIONLOOSE",`(${i[s.NUMERICIDENTIFIERLOOSE]})\\.(${i[s.NUMERICIDENTIFIERLOOSE]})\\.(${i[s.NUMERICIDENTIFIERLOOSE]})`),a("PRERELEASEIDENTIFIER",`(?:${i[s.NUMERICIDENTIFIER]}|${i[s.NONNUMERICIDENTIFIER]})`),a("PRERELEASEIDENTIFIERLOOSE",`(?:${i[s.NUMERICIDENTIFIERLOOSE]}|${i[s.NONNUMERICIDENTIFIER]})`),a("PRERELEASE",`(?:-(${i[s.PRERELEASEIDENTIFIER]}(?:\\.${i[s.PRERELEASEIDENTIFIER]})*))`),a("PRERELEASELOOSE",`(?:-?(${i[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${i[s.PRERELEASEIDENTIFIERLOOSE]})*))`),a("BUILDIDENTIFIER","[0-9A-Za-z-]+"),a("BUILD",`(?:\\+(${i[s.BUILDIDENTIFIER]}(?:\\.${i[s.BUILDIDENTIFIER]})*))`),a("FULLPLAIN",`v?${i[s.MAINVERSION]}${i[s.PRERELEASE]}?${i[s.BUILD]}?`),a("FULL",`^${i[s.FULLPLAIN]}$`),a("LOOSEPLAIN",`[v=\\s]*${i[s.MAINVERSIONLOOSE]}${i[s.PRERELEASELOOSE]}?${i[s.BUILD]}?`),a("LOOSE",`^${i[s.LOOSEPLAIN]}$`),a("GTLT","((?:<|>)?=?)"),a("XRANGEIDENTIFIERLOOSE",i[s.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*"),a("XRANGEIDENTIFIER",i[s.NUMERICIDENTIFIER]+"|x|X|\\*"),a("XRANGEPLAIN",`[v=\\s]*(${i[s.XRANGEIDENTIFIER]})(?:\\.(${i[s.XRANGEIDENTIFIER]})(?:\\.(${i[s.XRANGEIDENTIFIER]})(?:${i[s.PRERELEASE]})?${i[s.BUILD]}?)?)?`),a("XRANGEPLAINLOOSE",`[v=\\s]*(${i[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[s.XRANGEIDENTIFIERLOOSE]})(?:${i[s.PRERELEASELOOSE]})?${i[s.BUILD]}?)?)?`),a("XRANGE",`^${i[s.GTLT]}\\s*${i[s.XRANGEPLAIN]}$`),a("XRANGELOOSE",`^${i[s.GTLT]}\\s*${i[s.XRANGEPLAINLOOSE]}$`),a("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),a("COERCERTL",i[s.COERCE],!0),a("LONETILDE","(?:~>?)"),a("TILDETRIM",`(\\s*)${i[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",a("TILDE",`^${i[s.LONETILDE]}${i[s.XRANGEPLAIN]}$`),a("TILDELOOSE",`^${i[s.LONETILDE]}${i[s.XRANGEPLAINLOOSE]}$`),a("LONECARET","(?:\\^)"),a("CARETTRIM",`(\\s*)${i[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",a("CARET",`^${i[s.LONECARET]}${i[s.XRANGEPLAIN]}$`),a("CARETLOOSE",`^${i[s.LONECARET]}${i[s.XRANGEPLAINLOOSE]}$`),a("COMPARATORLOOSE",`^${i[s.GTLT]}\\s*(${i[s.LOOSEPLAIN]})$|^$`),a("COMPARATOR",`^${i[s.GTLT]}\\s*(${i[s.FULLPLAIN]})$|^$`),a("COMPARATORTRIM",`(\\s*)${i[s.GTLT]}\\s*(${i[s.LOOSEPLAIN]}|${i[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",a("HYPHENRANGE",`^\\s*(${i[s.XRANGEPLAIN]})\\s+-\\s+(${i[s.XRANGEPLAIN]})\\s*$`),a("HYPHENRANGELOOSE",`^\\s*(${i[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${i[s.XRANGEPLAINLOOSE]})\\s*$`),a("STAR","(<|>)?=?\\s*\\*"),a("GTE0","^\\s*>=\\s*0.0.0\\s*$"),a("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}));const numeric=/^[0-9]+$/,compareIdentifiers=(e,t)=>{const n=numeric.test(e),r=numeric.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:ecompareIdentifiers(t,e);var identifiers={compareIdentifiers,rcompareIdentifiers};const{MAX_LENGTH:MAX_LENGTH$2,MAX_SAFE_INTEGER:MAX_SAFE_INTEGER$1}=constants$1,{re,t}=re_1,{compareIdentifiers:compareIdentifiers$1}=identifiers;class SemVer{constructor(e,n){if(n&&"object"==typeof n||(n={loose:!!n,includePrerelease:!1}),e instanceof SemVer){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>MAX_LENGTH$2)throw new TypeError(`version is longer than ${MAX_LENGTH$2} characters`);debug_1("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=e.trim().match(n.loose?re[t.LOOSE]:re[t.FULL]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>MAX_SAFE_INTEGER$1||this.major<0)throw new TypeError("Invalid major version");if(this.minor>MAX_SAFE_INTEGER$1||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>MAX_SAFE_INTEGER$1||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this}}var semver=SemVer;const compare=(e,t,n)=>new semver(e,n).compare(new semver(t,n));var compare_1=compare;const eq=(e,t,n)=>0===compare_1(e,t,n);var eq_1=eq;const neq=(e,t,n)=>0!==compare_1(e,t,n);var neq_1=neq;const gt=(e,t,n)=>compare_1(e,t,n)>0;var gt_1=gt;const gte=(e,t,n)=>compare_1(e,t,n)>=0;var gte_1=gte;const lt=(e,t,n)=>compare_1(e,t,n)<0;var lt_1=lt;const lte=(e,t,n)=>compare_1(e,t,n)<=0;var lte_1=lte;const cmp=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return eq_1(e,n,r);case"!=":return neq_1(e,n,r);case">":return gt_1(e,n,r);case">=":return gte_1(e,n,r);case"<":return lt_1(e,n,r);case"<=":return lte_1(e,n,r);default:throw new TypeError("Invalid operator: "+t)}};var cmp_1=cmp;const ANY=Symbol("SemVer ANY");class Comparator{static get ANY(){return ANY}constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof Comparator){if(e.loose===!!t.loose)return e;e=e.value}debug_1("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===ANY?this.value="":this.value=this.operator+this.semver.version,debug_1("comp",this)}parse(e){const t=this.options.loose?re$1[t$1.COMPARATORLOOSE]:re$1[t$1.COMPARATOR],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new semver(n[2],this.options.loose):this.semver=ANY}toString(){return this.value}test(e){if(debug_1("Comparator.test",e,this.options.loose),this.semver===ANY||e===ANY)return!0;if("string"==typeof e)try{e=new semver(e,this.options)}catch(e){return!1}return cmp_1(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Comparator))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new range(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new range(this.value,t).test(e.semver);const n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),r=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),o=cmp_1(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),a=cmp_1(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||r||i&&s||o||a}}var comparator=Comparator;const{re:re$1,t:t$1}=re_1;class Range{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof Range)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new Range(e.raw,t);if(e instanceof comparator)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=this.options.loose;e=e.trim();const n=t?re$2[t$2.HYPHENRANGELOOSE]:re$2[t$2.HYPHENRANGE];e=e.replace(n,hyphenReplace(this.options.includePrerelease)),debug_1("hyphen replace",e),e=e.replace(re$2[t$2.COMPARATORTRIM],comparatorTrimReplace),debug_1("comparator trim",e,re$2[t$2.COMPARATORTRIM]),e=(e=(e=e.replace(re$2[t$2.TILDETRIM],tildeTrimReplace)).replace(re$2[t$2.CARETTRIM],caretTrimReplace)).split(/\s+/).join(" ");const r=t?re$2[t$2.COMPARATORLOOSE]:re$2[t$2.COMPARATOR];return e.split(" ").map(e=>parseComparator(e,this.options)).join(" ").split(/\s+/).map(e=>replaceGTE0(e,this.options)).filter(this.options.loose?e=>!!e.match(r):()=>!0).map(e=>new comparator(e,this.options))}intersects(e,t){if(!(e instanceof Range))throw new TypeError("a Range is required");return this.set.some(n=>isSatisfiable(n,t)&&e.set.some(e=>isSatisfiable(e,t)&&n.every(n=>e.every(e=>n.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new semver(e,this.options)}catch(e){return!1}for(let t=0;t{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},parseComparator=(e,t)=>(debug_1("comp",e,t),e=replaceCarets(e,t),debug_1("caret",e),e=replaceTildes(e,t),debug_1("tildes",e),e=replaceXRanges(e,t),debug_1("xrange",e),e=replaceStars(e,t),debug_1("stars",e),e),isX=e=>!e||"x"===e.toLowerCase()||"*"===e,replaceTildes=(e,t)=>e.trim().split(/\s+/).map(e=>replaceTilde(e,t)).join(" "),replaceTilde=(e,t)=>{const n=t.loose?re$2[t$2.TILDELOOSE]:re$2[t$2.TILDE];return e.replace(n,(t,n,r,i,s)=>{let o;return debug_1("tilde",e,t,n,r,i,s),isX(n)?o="":isX(r)?o=`>=${n}.0.0 <${+n+1}.0.0-0`:isX(i)?o=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:s?(debug_1("replaceTilde pr",s),o=`>=${n}.${r}.${i}-${s} <${n}.${+r+1}.0-0`):o=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,debug_1("tilde return",o),o})},replaceCarets=(e,t)=>e.trim().split(/\s+/).map(e=>replaceCaret(e,t)).join(" "),replaceCaret=(e,t)=>{debug_1("caret",e,t);const n=t.loose?re$2[t$2.CARETLOOSE]:re$2[t$2.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(t,n,i,s,o)=>{let a;return debug_1("caret",e,t,n,i,s,o),isX(n)?a="":isX(i)?a=`>=${n}.0.0${r} <${+n+1}.0.0-0`:isX(s)?a="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?(debug_1("replaceCaret pr",o),a="0"===n?"0"===i?`>=${n}.${i}.${s}-${o} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s}-${o} <${+n+1}.0.0-0`):(debug_1("no pr"),a="0"===n?"0"===i?`>=${n}.${i}.${s}${r} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s} <${+n+1}.0.0-0`),debug_1("caret return",a),a})},replaceXRanges=(e,t)=>(debug_1("replaceXRanges",e,t),e.split(/\s+/).map(e=>replaceXRange(e,t)).join(" ")),replaceXRange=(e,t)=>{e=e.trim();const n=t.loose?re$2[t$2.XRANGELOOSE]:re$2[t$2.XRANGE];return e.replace(n,(n,r,i,s,o,a)=>{debug_1("xRange",e,n,r,i,s,o,a);const c=isX(i),l=c||isX(s),u=l||isX(o),p=u;return"="===r&&p&&(r=""),a=t.includePrerelease?"-0":"",c?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&p?(l&&(s=0),o=0,">"===r?(r=">=",l?(i=+i+1,s=0,o=0):(s=+s+1,o=0)):"<="===r&&(r="<",l?i=+i+1:s=+s+1),"<"===r&&(a="-0"),n=`${r+i}.${s}.${o}${a}`):l?n=`>=${i}.0.0${a} <${+i+1}.0.0-0`:u&&(n=`>=${i}.${s}.0${a} <${i}.${+s+1}.0-0`),debug_1("xRange return",n),n})},replaceStars=(e,t)=>(debug_1("replaceStars",e,t),e.trim().replace(re$2[t$2.STAR],"")),replaceGTE0=(e,t)=>(debug_1("replaceGTE0",e,t),e.trim().replace(re$2[t.includePrerelease?t$2.GTE0PRE:t$2.GTE0],"")),hyphenReplace=e=>(t,n,r,i,s,o,a,c,l,u,p,h,d)=>`${n=isX(r)?"":isX(i)?`>=${r}.0.0${e?"-0":""}`:isX(s)?`>=${r}.${i}.0${e?"-0":""}`:o?">="+n:`>=${n}${e?"-0":""}`} ${c=isX(l)?"":isX(u)?`<${+l+1}.0.0-0`:isX(p)?`<${l}.${+u+1}.0-0`:h?`<=${l}.${u}.${p}-${h}`:e?`<${l}.${u}.${+p+1}-0`:"<="+c}`.trim(),testSet=(e,t,n)=>{for(let n=0;n0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0},maxSatisfying=(e,t,n)=>{let r=null,i=null,s=null;try{s=new range(t,n)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(r&&-1!==i.compare(e)||(r=e,i=new semver(r,n)))}),r};var maxSatisfying_1=maxSatisfying;const USELESS_PROPERTIES=["jest","eslintConfig","eslintIgnore","prettier","babel","scripts","devDependencies","peerDependencies","files","keywords","husky","lint-staged"];function stripPackageProperties(){return{name:"strip-package-properties",transform(e,t){if(!/(^|\/)package\.json$/.test(t))return;let n;try{n=JSON.parse(e)}catch(e){console.warn("Invalid package.json")}for(const e of USELESS_PROPERTIES)e in n&&delete n[e];return JSON.stringify(n,null,2)}}}function sizeWarningPlugin({threshold:e=1e4,factor:t=3}={}){return{name:"size-warning-plugin",transform(n,r){n.length/t>e&&console.log(`Warning: large file ${r} (${n.length/1e3}kb)`)}}}const FILES_INCLUDE=/\.(js|mjs|cjs|json|ts)$/i,FILES_EXCLUDE=/([._-]test\.|__tests?|\/tests?\/|\/node_modules\/)/i;let NODE_MODULES="./node_modules";function setCwd(e){NODE_MODULES=path$n.resolve(e||".","./node_modules")}const plugins=[stripPackageProperties(),sizeWarningPlugin()],API="https://registry.npmjs.org",DIST_TAG_TTL=6e4,DIST_TAG_CACHE=new Map;async function resolvePackageVersion(e){const t=e.module+"@"+e.version,n=DIST_TAG_CACHE.get(t);if(n&&Date.now()-n.time<=6e4)return e.version=n.version,e;try{const n=JSON.parse(await fs$n.promises.readFile(path$n.resolve(NODE_MODULES,e.module,"package.json"),"utf-8"));return DIST_TAG_CACHE.set(t,{time:Date.now(),version:n.version}),e.version=n.version,e}catch(e){}const r=await manuallyResolvePackageVersion(e);return DIST_TAG_CACHE.set(t,{time:Date.now(),version:e.version}),r}async function manuallyResolvePackageVersion(e){const{module:t,version:n}=e,r=resolveVersion(await getPackageMeta(t),n);if(!r)throw Error(`Unknown package version: ${t}@${n}`);return e.version=r,e}function resolveVersion(e,t){const n=e["dist-tags"];if(n.hasOwnProperty(t))return n[t];if(e.versions.hasOwnProperty(t))return t;const r=Object.keys(e.versions);return maxSatisfying_1(r,t)}const SLIM_REQ={headers:{accept:"application/vnd.npm.install-v1+json"}},getPackageMeta=memo(e=>getJson(`${API}/${e}`,SLIM_REQ));async function loadPackageFiles({module:e,version:t}){const n=await getPackageMeta(e),r=resolveVersion(n,t);if(!r)throw Error(`Unknown package version: ${e}@${t}`);const i=n.versions[r];return await getTarFiles(i.dist.tarball,e,t)}const DISK_CACHE=new Map;async function loadPackageFile({module:e,version:t,path:n=""}){const r=tarFiles.get(e+"/"+t);if(r){const i=r.get(n);return i||whenFile({module:e,version:t,path:n})}const i=path$n.resolve(NODE_MODULES,e,n);try{let r=DISK_CACHE.get(e+"/"+t);if(r||(r=new Map,DISK_CACHE.set(e+"/"+t,r)),r.has(n))return r.get(n);const s=await fs$n.promises.readFile(i,"utf-8");return r.set(n,s),s}catch(t){if(await fs$n.promises.stat(path$n.resolve(NODE_MODULES,e)).catch(()=>null))throw Error("File not found")}return loadPackageFiles({module:e,version:t}),whenFile({module:e,version:t,path:n})}const tarFiles=new Map,whenFiles=new Map;function whenFile({module:e,version:t,path:n}){const r=e+"/"+t;let i=tarFiles.get(r),s=whenFiles.get(r);if(i){if(i.has(n))return Promise.resolve(i.get(n));if(!s)return Promise.reject("no such file")}return s||(s=new Set,whenFiles.set(r,s)),new Promise((e,t)=>{s.add({path:n,resolve:e,reject:t})})}const getTarFiles=memo(async(e,t,n)=>{const r=t+"/"+n;let i=whenFiles.get(r);i||whenFiles.set(r,i=new Set);const s=new Map;tarFiles.set(r,s);const o=await getStream(e);await parseTarball(o,async(e,n)=>{let r=await streamToString(n);for(const t of plugins){if(!t.transform)continue;const n=t.transform(r,e);n&&(r=n)}writeNpmFile(t,e,r),s.set(e,r),Array.from(i).forEach(t=>{t.path===e&&(t.resolve(r),i.delete(t))})});const a=Array.from(i);return whenFiles.delete(r),a.forEach(e=>{e.reject(Error(`Package ${t} does not contain file ${e.path}`))}),s});async function writeNpmFile(e,t,n){await fs$n.promises.mkdir(path$n.resolve(NODE_MODULES,e,path$n.dirname(t)),{recursive:!0}),await fs$n.promises.writeFile(path$n.resolve(NODE_MODULES,e,t),n)}function parseTarball(e,t){return new Promise((n,r)=>{const i=tarStream.extract();i.on("entry",(e,n,r)=>{let{type:i,name:s}=e;if(s=s.replace(/^package\//,""),"file"!==i||!FILES_INCLUDE.test(s)||FILES_EXCLUDE.test(s))return n.resume(),r();t(s,n).then(r)}),i.on("finish",n),i.on("error",r),e.pipe(gunzipMaybe()).pipe(i)})}async function resolveModule(e,{readFile:t,hasFile:n,module:r}){let i;try{i=JSON.parse(await t("package.json"))}catch(e){throw Error(`Invalid package.json for ${r}: ${e.message}`)}if(i.exports){const t=e?"./"+e:".",n=resolveExportMap(i.exports,t,ENV_KEYS);if(!n)throw Error(`Unknown package export ${t} in ${r}.\n\n${JSON.stringify(i.exports,null,2)}`);if(!0!==n)return n.replace(/^\./,"")}if(!e)return getLegacyEntry(i);if(/\.([mc]js|[tj]sx?)$/i.test(e))return e;if(await n(e+".js"))return e+".js";try{return e+getLegacyEntry(JSON.parse(await t(e+"/package.json")))}catch(e){}return await n(e+"/index.js")?e+"/index.js":e}function getLegacyEntry(e){return String(e.esmodules||e.modern||e.module||e["jsnext:main"]||e.browser||e.main).replace(/^\/?/,"/")}const ENV_KEYS=["esmodules","import","require","browser","node","default"];function resolveExportMap(e,t,n){if("string"==typeof e)return e;let r,i=!1;for(let s in e)if(void 0===r&&(r="."===s[0]),r){if(s===t)return resolveExportMap(e[s],t,n);!i&&s.endsWith("/")&&t.startsWith(s)&&(i=!0)}else if(n.includes(s))return resolveExportMap(e[s],t,n);return i}function npmPlugin({publicPath:e="/@npm",prefix:t="\0npm/",external:n=!0}={}){return{name:"npm-plugin",async resolveId(r,i){if(r.startsWith(e))return{id:r,external:n};let s;r.startsWith(t)&&(r=r.substring(t.length)),i&&i.startsWith(t)&&(i=i.substring(t.length));const o=i&&!isDiskPath(i)&&normalizeSpecifier(i);if(isDiskPath(r)){if(!o)return;s=Object.assign({},o),s.path=path$n.join(path$n.dirname(s.path||""),r)}else if(s=normalizeSpecifier(r),n&&o&&s.specifier!==o.specifier)return{id:`${e}/${r}`,external:!0};await resolvePackageVersion(s);const{module:a,version:c,path:l}=s,u=(e="")=>loadPackageFile({module:a,version:c,path:e}),p=await resolveModule(l,{readFile:u,hasFile:e=>u(e).then(()=>!0).catch(()=>!1),module:a});return t+s.module+"@"+s.version+"/"+p.replace(/^\//,"")},load(e){if(!e.startsWith(t))return;e=e.substring(t.length);return loadPackageFile(normalizeSpecifier(e))}}}const PACKAGE_SPECIFIER=/^((?:@[a-z0-9-]{1,200}\/)?[a-z0-9-]{1,200})(?:@([a-z0-9^.~>=<-]{1,50}))?(?:\/(.*))?$/i,normalizeSpecifier=memo(e=>{let[,t="",n="",r=""]=e.match(PACKAGE_SPECIFIER)||[];if(!t)throw Error("Invalid specifier: "+e);n=(n||"latest").toLowerCase(),t=t.toLowerCase();return{module:t,version:n,path:r,specifier:t+(r?"/"+r:"")}});function isDiskPath(e){return/^(\/|\.\.?(\/|$))/.test(e)}function publicPathPlugin({publicPath:e,filter:t}={}){return{name:"public-path",resolveFileUrl(n){if(!e||t&&!t(n))return null;const{fileName:r}=n;return JSON.stringify(path$n.posix.join(e,r))}}}function dynamicImportNamesPlugin({prefix:e="",suffix:t=""}={}){return{name:"dynamic-import-names",async resolveDynamicImport(n,r){if("string"!=typeof n)return;const i=e+n.replace(/(^\.?\/|\.([cm]js|[tj]sx?)$)/gi,"")+t,{id:s}=await this.resolve(n,r);return this.emitFile({type:"chunk",id:s,name:i}),s}}}function bundleDev({cwd:e,out:t,sourcemap:n,onError:r,onBuild:i,profile:s}){e=e||"";const o=new Set,a=watch({input:"./"+path$n.relative(".",path$n.join(e,"index.js")),output:{sourcemap:n,sourcemapPathTransform:t=>"source://"+path$n.resolve(e,t).replace(/^(.\/)?/g,"/"),preferConst:!0,minifyInternalExports:!1,dir:t,entryFileNames:"[name].js",chunkFileNames:"[name].js",assetFileNames:"[name][extname]"},perf:!!s,treeshake:!1,preserveEntrySignatures:"allow-extension",manualChunks:t=>(t="\0"===t[0]?"_"+t.substring(1):path$n.relative(e,t)).replace(/(^[\\/]|\.([cm]js|[tj]sx?)$)/gi,""),plugins:[dynamicImportNamesPlugin({}),watcherPlugin({cwd:e,watchedFiles:"**/*.!({js,cjs,mjs,ts,tsx})",onChange(e){o.add(e)}}),wmrStylesPlugin({hot:!0,cwd:e}),wmrPlugin(),htmPlugin(),json(),localNpmPlugin()].filter(Boolean)});let c=[];return a.on("event",t=>{switch(t.code){case"ERROR":!function(t){let{code:i,plugin:s,message:o}=t,a="Error";"PLUGIN_ERROR"===i?a+=`(${s}): `:i&&(a+=`(${i.replace("_ERROR","")}): `);let c=`${a}${o}`;t.message=c,t.clientMessage=c.replace(/ \(([^(]+):(\d+):(\d+)\)/,(t,r,i,s)=>{let o="/"+path$n.relative(e,r);return n&&(o="source://"+o),` (${o}:${i}:${s})`}),r&&r(t)}(t.error);break;case"START":c=[...o],o.clear();break;case"BUNDLE_END":console.info(`Bundled in ${t.duration}ms`),s&&console.info(Object.entries(t.result.getTimings()).reduce((e,[t,n])=>`${e}\n${t.replace(/^(#*)/g,e=>" ".repeat(2*(e.length||3)-2))}: ${0|n[0]}ms`,"")),i&&i({changes:c,...t})}}),a}async function bundleProd({cwd:e,out:t,sourcemap:n,profile:r,npmChunks:i=!1}){e=e||"";const s="./"+path$n.relative(".",path$n.join(e,"index.js")),o=await rollup({input:s,perf:!!r,preserveEntrySignatures:"allow-extension",manualChunks:i?extractNpmChunks:void 0,plugins:[publicPathPlugin({publicPath:"/"}),wmrStylesPlugin({hot:!1}),wmrPlugin({hot:!1}),htmPlugin(),json(),npmPlugin({external:!1})]});return await o.write({entryFileNames:"[name].[hash].js",chunkFileNames:"chunks/[name].[hash].js",assetFileNames:"assets/[name].[hash][extname]",compact:!0,plugins:[fastMinifyPlugin({compress:!1,sourcemap:n})],sourcemap:n,sourcemapPathTransform:t=>"source://"+path$n.resolve(e,t).replace(/^(.\/)?/g,"/"),preferConst:!0,dir:t||"dist"})}function extractNpmChunks(e,{getModuleIds:t,getModuleInfo:n}){const r=n(e);if(/^\0npm\//.test(r.id)){if(r.importers.every(e=>/^\0npm\//.test(e)))return null;if(r.importers.length+r.dynamicImporters.length>1){let e=r.id;const n=Array.from(t()).filter(t=>t!==e);for(;e.length>1;){const t=path$n.dirname(e);if(n.find(e=>e.startsWith(t)))break;e=t}return e.replace(/^\0npm\/((?:@[^/]+\/)?[^/]+)@[^/]+/,"@npm/$1")}}return null}function bundleStats(e){let t=0;const n=e.output.slice().sort((e,t)=>scoreAsset(t)-scoreAsset(e)),r=n.reduce((e,n)=>{const r="asset"===n.type?n.source:n.code,i=r.length;return t+=r.length,`${e}\n ${n.fileName} ${prettyBytes(i)}`},""),i=prettyBytes(t);return{assets:n,total:t,totalText:i,assetsText:r}}function scoreAsset(e){return"chunk"===e.type?e.isEntry?10:e.isDynamicEntry?8:6:1}function prettyBytes(e){let t="b";return e>1500&&(e/=1e3,t="Kb"),e>1500&&(e/=1e3,t="Mb"),`${e<1?e.toFixed(2):e<10?e.toFixed(1):e}${t}`}async function normalizeOptions(e){e.cwd=path$n.resolve(e.cwd||""),e.out=path$n.resolve(e.cwd,e.out||".dist"),e.overlayDir=e.out;const t=fs$n.promises.mkdir(e.out,{recursive:!0});await isDirectory(path$n.join(e.cwd,"public"))&&(e.cwd=path$n.join(e.cwd,"public"));try{await t}catch(e){}return e}function isDirectory(e){return fs$n.promises.stat(e).then(e=>e.isDirectory()).catch(()=>!1)}async function build(e={}){e.out=e.out||"dist",setCwd(e.cwd),e=await normalizeOptions(e);const t=bundleStats(await bundleProd(e));console.log(`Wrote ${t.totalText} to disk:${t.assetsText}`)}var extendStatics=function(e,t){return(extendStatics=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)};function __extends(e,t){function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}function __param(e,t){return function(n,r){t(n,r,e)}}function __metadata(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function __awaiter(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){e.done?i(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(o,a)}c((r=r.apply(e,t||[])).next())}))}function __generator(e,t){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,s=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return o}function __spread(){for(var e=[],t=0;t1||a(e,t)}))})}function a(e,t){try{(n=i[e](t)).value instanceof __await?Promise.resolve(n.value.v).then(c,l):u(s[0][2],n)}catch(e){u(s[0][3],e)}var n}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function __asyncDelegator(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:__await(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function __asyncValues(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}function __makeTemplateObject(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function __importStar(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function __importDefault(e){return e&&e.__esModule?e:{default:e}}function __classPrivateFieldGet(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function __classPrivateFieldSet(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}var tslib_es6=Object.freeze({__proto__:null,__extends,get __assign(){return __assign},__rest,__decorate,__param,__metadata,__awaiter,__generator,__createBinding,__exportStar,__values,__read,__spread,__spreadArrays,__await,__asyncGenerator,__asyncDelegator,__asyncValues,__makeTemplateObject,__importStar,__importDefault,__classPrivateFieldGet,__classPrivateFieldSet}),s=1e3,m=60*s,h=60*m,d=24*h,w=7*d,y=365.25*d,ms=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return parse$4(e);if("number"===n&&isFinite(e))return t.long?fmtLong(e):fmtShort(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse$4(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"weeks":case"week":case"w":return n*w;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function fmtShort(e){var t=Math.abs(e);return t>=d?Math.round(e/d)+"d":t>=h?Math.round(e/h)+"h":t>=m?Math.round(e/m)+"m":t>=s?Math.round(e/s)+"s":e+"ms"}function fmtLong(e){var t=Math.abs(e);return t>=d?plural(e,t,d,"day"):t>=h?plural(e,t,h,"hour"):t>=m?plural(e,t,m,"minute"):t>=s?plural(e,t,s,"second"):e+" ms"}function plural(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}function setup(e){function t(e){for(var t=0,r=0;r=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=common(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}})),hasFlag=(e,t=process.argv)=>{const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),i=t.indexOf("--");return-1!==r&&(-1===i||r=2,has16m:e>=3}}function supportsColor(e,t){if(0===forceColor)return 0;if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor"))return 3;if(hasFlag("color=256"))return 2;if(e&&!t&&void 0===forceColor)return 0;const n=forceColor||0;if("dumb"===env.TERM)return n;if("win32"===process.platform){const e=os.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in env)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in env)||"codeship"===env.CI_NAME?1:n;if("TEAMCITY_VERSION"in env)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION)?1:0;if("GITHUB_ACTIONS"in env)return 1;if("truecolor"===env.COLORTERM)return 3;if("TERM_PROGRAM"in env){const e=parseInt((env.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(env.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(env.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)||"COLORTERM"in env?1:n}function getSupportLevel(e){return translateLevel(supportsColor(e,e&&e.isTTY))}hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")?forceColor=0:(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always"))&&(forceColor=1),"FORCE_COLOR"in env&&(forceColor="true"===env.FORCE_COLOR?1:"false"===env.FORCE_COLOR?0:0===env.FORCE_COLOR.length?1:Math.min(parseInt(env.FORCE_COLOR,10),3));var supportsColor_1={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(!0,tty.isatty(1))),stderr:translateLevel(supportsColor(!0,tty.isatty(2)))},node=createCommonjsModule$1((function(e,t){var n=require("tty"),r=require("util");t.init=function(e){e.inspectOpts={};for(var n=Object.keys(t.inspectOpts),r=0;r=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((function(e){return/^debug_/i.test(e)})).reduce((function(e,t){var n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(function(e,t){return t.toUpperCase()})),r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=common(t);var s=e.exports.formatters;s.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).replace(/\s*\n\s*/g," ")},s.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}})),src$1=createCommonjsModule$1((function(e){"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=browser:e.exports=node})),exec=require("child_process").exec,execSync=require("child_process").execSync,fs$2=require("fs"),path$3=require("path"),access=fs$2.access,accessSync=fs$2.accessSync,constants$2=fs$2.constants||fs$2,isUsingWindows="win32"==process.platform,fileNotExists=function(e,t){access(e,constants$2.F_OK,(function(e){t(!e)}))},fileNotExistsSync=function(e){try{return accessSync(e,constants$2.F_OK),!1}catch(e){return!0}},localExecutable=function(e,t){access(e,constants$2.F_OK|constants$2.X_OK,(function(e){t(null,!e)}))},localExecutableSync=function(e){try{return accessSync(e,constants$2.F_OK|constants$2.X_OK),!0}catch(e){return!1}},commandExistsUnix=function(e,t,n){fileNotExists(e,(function(r){if(r)localExecutable(e,n);else exec("command -v "+t+" 2>/dev/null && { echo >&1 "+t+"; exit 0; }",(function(e,t,r){n(null,!!t)}))}))},commandExistsWindows=function(e,t,n){if(/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e))exec("where "+t,(function(e){n(null,null===e)}));else n(null,!1)},commandExistsUnixSync=function(e,t){if(fileNotExistsSync(e))try{return!!execSync("command -v "+t+" 2>/dev/null && { echo >&1 "+t+"; exit 0; }")}catch(e){return!1}return localExecutableSync(e)},commandExistsWindowsSync=function(e,t,n){if(!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e))return!1;try{return!!execSync("where "+t,{stdio:[]})}catch(e){return!1}},cleanInput=function(e){return/[^A-Za-z0-9_\/:=-]/.test(e)&&(e=(e="'"+e.replace(/'/g,"'\\''")+"'").replace(/^(?:'')+/g,"").replace(/\\'''/g,"\\'")),e};isUsingWindows&&(cleanInput=function(e){return/[\\]/.test(e)?'"'+path$3.dirname(e)+'"'+":"+('"'+path$3.basename(e)+'"'):'"'+e+'"'});var commandExists=function e(t,n){var r=cleanInput(t);if(!n&&"undefined"!=typeof Promise)return new Promise((function(n,r){e(t,(function(e,i){i?n(t):r(e)}))}));isUsingWindows?commandExistsWindows(t,r,n):commandExistsUnix(t,r,n)},sync=function(e){var t=cleanInput(e);return isUsingWindows?commandExistsWindowsSync(e,t):commandExistsUnixSync(e,t)};commandExists.sync=sync;var commandExists$1=commandExists,pathModule=require("path"),isWindows="win32"===process.platform,fs$3=require("fs"),DEBUG=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function rethrow(){var e;if(DEBUG){var t=new Error;e=function(e){e&&(t.message=e.message,n(e=t))}}else e=n;return e;function n(e){if(e){if(process.throwDeprecation)throw e;if(!process.noDeprecation){var t="fs: missing callback "+(e.stack||e.message);process.traceDeprecation?console.trace(t):console.error(t)}}}}function maybeCallback(e){return"function"==typeof e?e:rethrow()}var normalize$2=pathModule.normalize;if(isWindows)var nextPartRe=/(.*?)(?:[\/\\]+|$)/g;else nextPartRe=/(.*?)(?:[\/]+|$)/g;if(isWindows)var splitRootRe=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;else splitRootRe=/^[\/]*/;var realpathSync=function(e,t){if(e=pathModule.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return t[e];var n,r,i,s,o=e,a={},c={};function l(){var t=splitRootRe.exec(e);n=t[0].length,r=t[0],i=t[0],s="",isWindows&&!c[i]&&(fs$3.lstatSync(i),c[i]=!0)}for(l();n=e.length)return t&&(t[a]=e),n(null,e);nextPartRe.lastIndex=r;var c=nextPartRe.exec(e);return o=i,i+=c[0],s=o+c[1],r=nextPartRe.lastIndex,l[s]||t&&t[s]===s?process.nextTick(p):t&&Object.prototype.hasOwnProperty.call(t,s)?f(t[s]):fs$3.lstat(s,h)}function h(e,r){if(e)return n(e);if(!r.isSymbolicLink())return l[s]=!0,t&&(t[s]=s),process.nextTick(p);if(!isWindows){var i=r.dev.toString(32)+":"+r.ino.toString(32);if(c.hasOwnProperty(i))return d(null,c[i],s)}fs$3.stat(s,(function(e){if(e)return n(e);fs$3.readlink(s,(function(e,t){isWindows||(c[i]=t),d(e,t)}))}))}function d(e,r,i){if(e)return n(e);var s=pathModule.resolve(o,r);t&&(t[i]=s),f(s)}function f(t){e=pathModule.resolve(t,e.slice(r)),u()}u()},old={realpathSync,realpath},fs_realpath=realpath$1;realpath$1.realpath=realpath$1,realpath$1.sync=realpathSync$1,realpath$1.realpathSync=realpathSync$1,realpath$1.monkeypatch=monkeypatch,realpath$1.unmonkeypatch=unmonkeypatch;var fs$4=require("fs"),origRealpath=fs$4.realpath,origRealpathSync=fs$4.realpathSync,version$3=process.version,ok=/^v[0-5]\./.test(version$3);function newError(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function realpath$1(e,t,n){if(ok)return origRealpath(e,t,n);"function"==typeof t&&(n=t,t=null),origRealpath(e,t,(function(r,i){newError(r)?old.realpath(e,t,n):n(r,i)}))}function realpathSync$1(e,t){if(ok)return origRealpathSync(e,t);try{return origRealpathSync(e,t)}catch(n){if(newError(n))return old.realpathSync(e,t);throw n}}function monkeypatch(){fs$4.realpath=realpath$1,fs$4.realpathSync=realpathSync$1}function unmonkeypatch(){fs$4.realpath=origRealpath,fs$4.realpathSync=origRealpathSync}var concatMap=function(e,t){for(var n=[],r=0;r=0&&l>0){for(r=[],s=n.length;u>=0&&!a;)u==c?(r.push(u),c=n.indexOf(e,u+1)):1==r.length?a=[r.pop(),l]:((i=r.pop())=0?c:l;r.length&&(a=[s,o])}return a}balanced.range=range$1;var braceExpansion=expandTop,escSlash="\0SLASH"+Math.random()+"\0",escOpen="\0OPEN"+Math.random()+"\0",escClose="\0CLOSE"+Math.random()+"\0",escComma="\0COMMA"+Math.random()+"\0",escPeriod="\0PERIOD"+Math.random()+"\0";function numeric$1(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function escapeBraces(e){return e.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod)}function unescapeBraces(e){return e.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".")}function parseCommaParts(e){if(!e)return[""];var t=[],n=balancedMatch("{","}",e);if(!n)return e.split(",");var r=n.pre,i=n.body,s=n.post,o=r.split(",");o[o.length-1]+="{"+i+"}";var a=parseCommaParts(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}function expandTop(e){return e?("{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2)),expand(escapeBraces(e),!0).map(unescapeBraces)):[]}function embrace(e){return"{"+e+"}"}function isPadded(e){return/^-?0\d/.test(e)}function lte$1(e,t){return e<=t}function gte$1(e,t){return e>=t}function expand(e,t){var n=[],r=balancedMatch("{","}",e);if(!r||/\$$/.test(r.pre))return[e];var i,s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),a=s||o,c=r.body.indexOf(",")>=0;if(!a&&!c)return r.post.match(/,.*\}/)?expand(e=r.pre+"{"+r.body+escClose+r.post):[e];if(a)i=r.body.split(/\.\./);else if(1===(i=parseCommaParts(r.body)).length&&1===(i=expand(i[0],!1).map(embrace)).length)return(p=r.post.length?expand(r.post,!1):[""]).map((function(e){return r.pre+i[0]+e}));var l,u=r.pre,p=r.post.length?expand(r.post,!1):[""];if(a){var h=numeric$1(i[0]),d=numeric$1(i[1]),f=Math.max(i[0].length,i[1].length),m=3==i.length?Math.abs(numeric$1(i[2])):1,g=lte$1;d0){var S=new Array(v+1).join("0");y=E<0?"-"+S+y.slice(1):S+y}}l.push(y)}}else l=concatMap(i,(function(e){return expand(e,!1)}));for(var b=0;b65536)throw new TypeError("pattern is too long");var n=this.options;if(!n.noglobstar&&"**"===e)return GLOBSTAR$1;if(""===e)return"";var r,i="",s=!!n.nocase,o=!1,a=[],c=[],l=!1,u=-1,p=-1,h="."===e.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",d=this;function f(){if(r){switch(r){case"*":i+=star,s=!0;break;case"?":i+=qmark,s=!0;break;default:i+="\\"+r}d.debug("clearStateChar %j %j",r,i),r=!1}}for(var m,g=0,_=e.length;g<_&&(m=e.charAt(g));g++)if(this.debug("%s\t%s %s %j",e,g,i,m),o&&reSpecials[m])i+="\\"+m,o=!1;else switch(m){case"/":return!1;case"\\":f(),o=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",e,g,i,m),l){this.debug(" in class"),"!"===m&&g===p+1&&(m="^"),i+=m;continue}d.debug("call clearStateChar %j",r),f(),r=m,n.noext&&f();continue;case"(":if(l){i+="(";continue}if(!r){i+="\\(";continue}a.push({type:r,start:g-1,reStart:i.length,open:plTypes[r].open,close:plTypes[r].close}),i+="!"===r?"(?:(?!(?:":"(?:",this.debug("plType %j %j",r,i),r=!1;continue;case")":if(l||!a.length){i+="\\)";continue}f(),s=!0;var E=a.pop();i+=E.close,"!"===E.type&&c.push(E),E.reEnd=i.length;continue;case"|":if(l||!a.length||o){i+="\\|",o=!1;continue}f(),i+="|";continue;case"[":if(f(),l){i+="\\"+m;continue}l=!0,p=g,u=i.length,i+=m;continue;case"]":if(g===p+1||!l){i+="\\"+m,o=!1;continue}if(l){var y=e.substring(p+1,g);try{RegExp("["+y+"]")}catch(e){var v=this.parse(y,SUBPARSE);i=i.substr(0,u)+"\\["+v[0]+"\\]",s=s||v[1],l=!1;continue}}s=!0,l=!1,i+=m;continue;default:f(),o?o=!1:!reSpecials[m]||"^"===m&&l||(i+="\\"),i+=m}for(l&&(y=e.substr(p+1),v=this.parse(y,SUBPARSE),i=i.substr(0,u)+"\\["+v[0],s=s||v[1]),E=a.pop();E;E=a.pop()){var S=i.slice(E.reStart+E.open.length);this.debug("setting tail",i,E),S=S.replace(/((?:\\{2}){0,64})(\\?)\|/g,(function(e,t,n){return n||(n="\\"),t+t+n+"|"})),this.debug("tail=%j\n %s",S,S,E,i);var b="*"===E.type?star:"?"===E.type?qmark:"\\"+E.type;s=!0,i=i.slice(0,E.reStart)+b+"\\("+S}f(),o&&(i+="\\\\");var A=!1;switch(i.charAt(0)){case".":case"[":case"(":A=!0}for(var C=c.length-1;C>-1;C--){var x=c[C],$=i.slice(0,x.reStart),w=i.slice(x.reStart,x.reEnd-8),T=i.slice(x.reEnd-8,x.reEnd),R=i.slice(x.reEnd);T+=R;var N=$.split("(").length-1,D=R;for(g=0;g=0&&!(r=e[i]);i--);for(i=0;i>> no match, partial?",e,p,t,h),p!==o))}if("string"==typeof l?(c=r.nocase?u.toLowerCase()===l.toLowerCase():u===l,this.debug("string match",l,u,c)):(c=u.match(l),this.debug("pattern match",l,u,c)),!c)return!1}if(i===o&&s===a)return!0;if(i===o)return n;if(s===a)return i===o-1&&""===e[i];throw new Error("wtf?")};var pathIsAbsolute="win32"===process.platform?win32:posix,posix_1=posix,win32_1=win32;pathIsAbsolute.posix=posix_1,pathIsAbsolute.win32=win32_1;var alphasort_1=alphasort,alphasorti_1=alphasorti,setopts_1=setopts,ownProp_1=ownProp,makeAbs_1=makeAbs,finish_1=finish,mark_1=mark,isIgnored_1=isIgnored,childrenIgnored_1=childrenIgnored;function ownProp(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var path$5=require("path"),Minimatch$1=minimatch_1.Minimatch;function alphasorti(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}function alphasort(e,t){return e.localeCompare(t)}function setupIgnores(e,t){e.ignore=t.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]),e.ignore.length&&(e.ignore=e.ignore.map(ignoreMap))}function ignoreMap(e){var t=null;if("/**"===e.slice(-3)){var n=e.replace(/(\/\*\*)+$/,"");t=new Minimatch$1(n,{dot:!0})}return{matcher:new Minimatch$1(e,{dot:!0}),gmatcher:t}}function setopts(e,t,n){if(n||(n={}),n.matchBase&&-1===t.indexOf("/")){if(n.noglobstar)throw new Error("base matching requires globstar");t="**/"+t}e.silent=!!n.silent,e.pattern=t,e.strict=!1!==n.strict,e.realpath=!!n.realpath,e.realpathCache=n.realpathCache||Object.create(null),e.follow=!!n.follow,e.dot=!!n.dot,e.mark=!!n.mark,e.nodir=!!n.nodir,e.nodir&&(e.mark=!0),e.sync=!!n.sync,e.nounique=!!n.nounique,e.nonull=!!n.nonull,e.nosort=!!n.nosort,e.nocase=!!n.nocase,e.stat=!!n.stat,e.noprocess=!!n.noprocess,e.absolute=!!n.absolute,e.maxLength=n.maxLength||1/0,e.cache=n.cache||Object.create(null),e.statCache=n.statCache||Object.create(null),e.symlinks=n.symlinks||Object.create(null),setupIgnores(e,n),e.changedCwd=!1;var r=process.cwd();ownProp(n,"cwd")?(e.cwd=path$5.resolve(n.cwd),e.changedCwd=e.cwd!==r):e.cwd=r,e.root=n.root||path$5.resolve(e.cwd,"/"),e.root=path$5.resolve(e.root),"win32"===process.platform&&(e.root=e.root.replace(/\\/g,"/")),e.cwdAbs=pathIsAbsolute(e.cwd)?e.cwd:makeAbs(e,e.cwd),"win32"===process.platform&&(e.cwdAbs=e.cwdAbs.replace(/\\/g,"/")),e.nomount=!!n.nomount,n.nonegate=!0,n.nocomment=!0,e.minimatch=new Minimatch$1(t,n),e.options=e.minimatch.options}function finish(e){for(var t=e.nounique,n=t?[]:Object.create(null),r=0,i=e.matches.length;rthis.maxLength)return!1;if(!this.stat&&ownProp$1(this.cache,t)){var r=this.cache[t];if(Array.isArray(r)&&(r="DIR"),!n||"DIR"===r)return r;if(n&&"FILE"===r)return!1}var i=this.statCache[t];if(!i){var s;try{s=fs$5.lstatSync(t)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return this.statCache[t]=!1,!1}if(s&&s.isSymbolicLink())try{i=fs$5.statSync(t)}catch(e){i=s}else i=s}this.statCache[t]=i;r=!0;return i&&(r=i.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||r,(!n||"FILE"!==r)&&r},GlobSync.prototype._mark=function(e){return common$1.mark(this,e)},GlobSync.prototype._makeAbs=function(e){return common$1.makeAbs(this,e)};var reqs=Object.create(null),inflight_1=wrappy_1(inflight);function inflight(e,t){return reqs[e]?(reqs[e].push(t),null):(reqs[e]=[t],makeres(e))}function makeres(e){return once_1((function t(){var n=reqs[e],r=n.length,i=slice(arguments);try{for(var s=0;sr?(n.splice(0,r),process.nextTick((function(){t.apply(null,i)}))):delete reqs[e]}}))}function slice(e){for(var t=e.length,n=[],r=0;r1)return!0;for(var i=0;ithis.maxLength)return t();if(!this.stat&&ownProp$2(this.cache,n)){var i=this.cache[n];if(Array.isArray(i)&&(i="DIR"),!r||"DIR"===i)return t(null,i);if(r&&"FILE"===i)return t()}var s=this.statCache[n];if(void 0!==s){if(!1===s)return t(null,s);var o=s.isDirectory()?"DIR":"FILE";return r&&"FILE"===o?t():t(null,o,s)}var a=this,c=inflight_1("stat\0"+n,(function(r,i){if(i&&i.isSymbolicLink())return fs$6.stat(n,(function(r,s){r?a._stat2(e,n,null,i,t):a._stat2(e,n,r,s,t)}));a._stat2(e,n,r,i,t)}));c&&fs$6.lstat(n,c)},Glob.prototype._stat2=function(e,t,n,r,i){if(n&&("ENOENT"===n.code||"ENOTDIR"===n.code))return this.statCache[t]=!1,i();var s="/"===e.slice(-1);if(this.statCache[t]=r,"/"===t.slice(-1)&&r&&!r.isDirectory())return i(null,!1,r);var o=!0;return r&&(o=r.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||o,s&&"FILE"===o?i():i(null,o,r)};var rimraf_1=rimraf;rimraf.sync=rimrafSync;var assert$2=require("assert"),path$8=require("path"),fs$7=require("fs"),glob$1=void 0;try{glob$1=glob_1}catch(e){}var _0666=parseInt("666",8),defaultGlobOpts={nosort:!0,silent:!0},timeout=0,isWindows$1="win32"===process.platform;function defaults(e){if(["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((function(t){e[t]=e[t]||fs$7[t],e[t+="Sync"]=e[t]||fs$7[t]})),e.maxBusyTries=e.maxBusyTries||3,e.emfileWait=e.emfileWait||1e3,!1===e.glob&&(e.disableGlob=!0),!0!==e.disableGlob&&void 0===glob$1)throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");e.disableGlob=e.disableGlob||!1,e.glob=e.glob||defaultGlobOpts}function rimraf(e,t,n){"function"==typeof t&&(n=t,t={}),assert$2(e,"rimraf: missing path"),assert$2.equal(typeof e,"string","rimraf: path should be a string"),assert$2.equal(typeof n,"function","rimraf: callback function required"),assert$2(t,"rimraf: invalid options argument provided"),assert$2.equal(typeof t,"object","rimraf: options should be object"),defaults(t);var r=0,i=null,s=0;if(t.disableGlob||!glob$1.hasMagic(e))return o(null,[e]);function o(e,o){return e?n(e):0===(s=o.length)?n():void o.forEach((function(e){rimraf_(e,t,(function o(a){if(a){if(("EBUSY"===a.code||"ENOTEMPTY"===a.code||"EPERM"===a.code)&&r"']/g,P=RegExp(O.source),M=RegExp(I.source),F=/<%-([\s\S]+?)%>/g,L=/<%([\s\S]+?)%>/g,B=/<%=([\s\S]+?)%>/g,V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,U=/^\w*$/,H=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,G=/[\\^$.*+?()[\]{}|]/g,j=RegExp(G.source),W=/^\s+|\s+$/g,K=/^\s+/,z=/\s+$/,X=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,q=/\{\n\/\* \[wrapped with (.+)\] \*/,Y=/,? & /,Q=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Z=/\\(\\)?/g,J=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ee=/\w*$/,te=/^[-+]0x[0-9a-f]+$/i,ne=/^0b[01]+$/i,re=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,se=/^(?:0|[1-9]\d*)$/,oe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ae=/($^)/,ce=/['\n\r\u2028\u2029\\]/g,le="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ue="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="[\\ud800-\\udfff]",he="["+ue+"]",de="["+le+"]",fe="\\d+",me="[\\u2700-\\u27bf]",ge="[a-z\\xdf-\\xf6\\xf8-\\xff]",_e="[^\\ud800-\\udfff"+ue+fe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",Ee="\\ud83c[\\udffb-\\udfff]",ye="[^\\ud800-\\udfff]",ve="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",be="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ae="(?:"+ge+"|"+_e+")",Ce="(?:"+be+"|"+_e+")",xe="(?:"+de+"|"+Ee+")"+"?",$e="[\\ufe0e\\ufe0f]?"+xe+("(?:\\u200d(?:"+[ye,ve,Se].join("|")+")[\\ufe0e\\ufe0f]?"+xe+")*"),we="(?:"+[me,ve,Se].join("|")+")"+$e,Te="(?:"+[ye+de+"?",de,ve,Se,pe].join("|")+")",Re=RegExp("['’]","g"),Ne=RegExp(de,"g"),De=RegExp(Ee+"(?="+Ee+")|"+Te+$e,"g"),ke=RegExp([be+"?"+ge+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[he,be,"$"].join("|")+")",Ce+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[he,be+Ae,"$"].join("|")+")",be+"?"+Ae+"+(?:['’](?:d|ll|m|re|s|t|ve))?",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",fe,we].join("|"),"g"),Oe=RegExp("[\\u200d\\ud800-\\udfff"+le+"\\ufe0e\\ufe0f]"),Ie=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Pe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Me=-1,Fe={};Fe[b]=Fe[A]=Fe[C]=Fe[x]=Fe[$]=Fe[w]=Fe["[object Uint8ClampedArray]"]=Fe[T]=Fe[R]=!0,Fe[s]=Fe[o]=Fe[v]=Fe[a]=Fe[S]=Fe[c]=Fe[l]=Fe[u]=Fe[h]=Fe[d]=Fe[f]=Fe[m]=Fe[g]=Fe[_]=Fe[y]=!1;var Le={};Le[s]=Le[o]=Le[v]=Le[S]=Le[a]=Le[c]=Le[b]=Le[A]=Le[C]=Le[x]=Le[$]=Le[h]=Le[d]=Le[f]=Le[m]=Le[g]=Le[_]=Le[E]=Le[w]=Le["[object Uint8ClampedArray]"]=Le[T]=Le[R]=!0,Le[l]=Le[u]=Le[y]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ve=parseFloat,Ue=parseInt,He="object"==typeof global&&global&&global.Object===Object&&global,Ge="object"==typeof self&&self&&self.Object===Object&&self,je=He||Ge||Function("return this")(),We=t&&!t.nodeType&&t,Ke=We&&e&&!e.nodeType&&e,ze=Ke&&Ke.exports===We,Xe=ze&&He.process,qe=function(){try{var e=Ke&&Ke.require&&Ke.require("util").types;return e||Xe&&Xe.binding&&Xe.binding("util")}catch(e){}}(),Ye=qe&&qe.isArrayBuffer,Qe=qe&&qe.isDate,Ze=qe&&qe.isMap,Je=qe&&qe.isRegExp,et=qe&&qe.isSet,tt=qe&&qe.isTypedArray;function nt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function rt(e,t,n,r){for(var i=-1,s=null==e?0:e.length;++i-1}function lt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function Dt(e,t){for(var n=e.length;n--&&Et(t,e[n],0)>-1;);return n}function kt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Ot=At({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),It=At({"&":"&","<":"<",">":">",'"':""","'":"'"});function Pt(e){return"\\"+Be[e]}function Mt(e){return Oe.test(e)}function Ft(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Lt(e,t){return function(n){return e(t(n))}}function Bt(e,t){for(var n=-1,i=e.length,s=0,o=[];++n",""":'"',"'":"'"});var Wt=function e(t){var le,ue=(t=null==t?je:Wt.defaults(je.Object(),t,Wt.pick(je,Pe))).Array,pe=t.Date,he=t.Error,de=t.Function,fe=t.Math,me=t.Object,ge=t.RegExp,_e=t.String,Ee=t.TypeError,ye=ue.prototype,ve=de.prototype,Se=me.prototype,be=t["__core-js_shared__"],Ae=ve.toString,Ce=Se.hasOwnProperty,xe=0,$e=(le=/[^.]+$/.exec(be&&be.keys&&be.keys.IE_PROTO||""))?"Symbol(src)_1."+le:"",we=Se.toString,Te=Ae.call(me),De=je._,Oe=ge("^"+Ae.call(Ce).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=ze?t.Buffer:void 0,He=t.Symbol,Ge=t.Uint8Array,We=Be?Be.allocUnsafe:void 0,Ke=Lt(me.getPrototypeOf,me),Xe=me.create,qe=Se.propertyIsEnumerable,mt=ye.splice,At=He?He.isConcatSpreadable:void 0,Kt=He?He.iterator:void 0,zt=He?He.toStringTag:void 0,Xt=function(){try{var e=Ji(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),qt=t.clearTimeout!==je.clearTimeout&&t.clearTimeout,Yt=pe&&pe.now!==je.Date.now&&pe.now,Qt=t.setTimeout!==je.setTimeout&&t.setTimeout,Zt=fe.ceil,Jt=fe.floor,en=me.getOwnPropertySymbols,tn=Be?Be.isBuffer:void 0,nn=t.isFinite,rn=ye.join,sn=Lt(me.keys,me),on=fe.max,an=fe.min,cn=pe.now,ln=t.parseInt,un=fe.random,pn=ye.reverse,hn=Ji(t,"DataView"),dn=Ji(t,"Map"),fn=Ji(t,"Promise"),mn=Ji(t,"Set"),gn=Ji(t,"WeakMap"),_n=Ji(me,"create"),En=gn&&new gn,yn={},vn=$s(hn),Sn=$s(dn),bn=$s(fn),An=$s(mn),Cn=$s(gn),xn=He?He.prototype:void 0,$n=xn?xn.valueOf:void 0,wn=xn?xn.toString:void 0;function Tn(e){if(jo(e)&&!Oo(e)&&!(e instanceof kn)){if(e instanceof Dn)return e;if(Ce.call(e,"__wrapped__"))return ws(e)}return new Dn(e)}var Rn=function(){function e(){}return function(t){if(!Go(t))return{};if(Xe)return Xe(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Nn(){}function Dn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function kn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function On(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Yn(e,t,n,r,i,o){var l,y=1&t,N=2&t,D=4&t;if(n&&(l=i?n(e,r,i,o):n(e)),void 0!==l)return l;if(!Go(e))return e;var k=Oo(e);if(k){if(l=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Ce.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!y)return _i(e,l)}else{var O=ns(e),I=O==u||O==p;if(Fo(e))return pi(e,y);if(O==f||O==s||I&&!i){if(l=N||I?{}:is(e),!y)return N?function(e,t){return Ei(e,ts(e),t)}(e,function(e,t){return e&&Ei(t,Sa(t),e)}(l,e)):function(e,t){return Ei(e,es(e),t)}(e,Kn(l,e))}else{if(!Le[O])return i?e:{};l=function(e,t,n){var r=e.constructor;switch(t){case v:return hi(e);case a:case c:return new r(+e);case S:return function(e,t){var n=t?hi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case b:case A:case C:case x:case $:case w:case"[object Uint8ClampedArray]":case T:case R:return di(e,n);case h:return new r;case d:case _:return new r(e);case m:return function(e){var t=new e.constructor(e.source,ee.exec(e));return t.lastIndex=e.lastIndex,t}(e);case g:return new r;case E:return function(e){return $n?me($n.call(e)):{}}(e)}}(e,O,y)}}o||(o=new Fn);var P=o.get(e);if(P)return P;o.set(e,l),qo(e)?e.forEach((function(r){l.add(Yn(r,t,n,r,e,o))})):Wo(e)&&e.forEach((function(r,i){l.set(i,Yn(r,t,n,i,e,o))}));var M=k?void 0:(D?N?Ki:Wi:N?Sa:va)(e);return it(M||e,(function(r,i){M&&(r=e[i=r]),Gn(l,i,Yn(r,t,n,i,e,o))})),l}function Qn(e,t,n){var r=n.length;if(null==e)return!r;for(e=me(e);r--;){var i=n[r],s=t[i],o=e[i];if(void 0===o&&!(i in e)||!s(o))return!1}return!0}function Zn(e,t,r){if("function"!=typeof e)throw new Ee(n);return ys((function(){e.apply(void 0,r)}),t)}function Jn(e,t,n,r){var i=-1,s=ct,o=!0,a=e.length,c=[],l=t.length;if(!a)return c;n&&(t=ut(t,wt(n))),r?(s=lt,o=!1):t.length>=200&&(s=Rt,o=!1,t=new Mn(t));e:for(;++i-1},In.prototype.set=function(e,t){var n=this.__data__,r=jn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Pn.prototype.clear=function(){this.size=0,this.__data__={hash:new On,map:new(dn||In),string:new On}},Pn.prototype.delete=function(e){var t=Qi(this,e).delete(e);return this.size-=t?1:0,t},Pn.prototype.get=function(e){return Qi(this,e).get(e)},Pn.prototype.has=function(e){return Qi(this,e).has(e)},Pn.prototype.set=function(e,t){var n=Qi(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Mn.prototype.add=Mn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Mn.prototype.has=function(e){return this.__data__.has(e)},Fn.prototype.clear=function(){this.__data__=new In,this.size=0},Fn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Fn.prototype.get=function(e){return this.__data__.get(e)},Fn.prototype.has=function(e){return this.__data__.has(e)},Fn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof In){var r=n.__data__;if(!dn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pn(r)}return n.set(e,t),this.size=n.size,this};var er=Si(cr),tr=Si(lr,!0);function nr(e,t){var n=!0;return er(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function rr(e,t,n){for(var r=-1,i=e.length;++r0&&n(a)?t>1?sr(a,t-1,n,r,i):pt(i,a):r||(i[i.length]=a)}return i}var or=bi(),ar=bi(!0);function cr(e,t){return e&&or(e,t,va)}function lr(e,t){return e&&ar(e,t,va)}function ur(e,t){return at(t,(function(t){return Vo(e[t])}))}function pr(e,t){for(var n=0,r=(t=ai(t,e)).length;null!=e&&nt}function mr(e,t){return null!=e&&Ce.call(e,t)}function gr(e,t){return null!=e&&t in me(e)}function _r(e,t,n){for(var r=n?lt:ct,i=e[0].length,s=e.length,o=s,a=ue(s),c=1/0,l=[];o--;){var u=e[o];o&&t&&(u=ut(u,wt(t))),c=an(u.length,c),a[o]=!n&&(t||i>=120&&u.length>=120)?new Mn(o&&u):void 0}u=e[0];var p=-1,h=a[0];e:for(;++p=a)return c;var l=n[r];return c*("desc"==l?-1:1)}}return e.index-t.index}(e,t,n)}))}function Or(e,t,n){for(var r=-1,i=t.length,s={};++r-1;)a!==e&&mt.call(a,c,1),mt.call(e,c,1);return e}function Pr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==s){var s=i;os(i)?mt.call(e,i,1):Jr(e,i)}}return e}function Mr(e,t){return e+Jt(un()*(t-e+1))}function Fr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Jt(t/2))&&(e+=e)}while(t);return n}function Lr(e,t){return vs(fs(e,t,Ka),e+"")}function Br(e){return Bn(Ra(e))}function Vr(e,t){var n=Ra(e);return As(n,qn(t,0,n.length))}function Ur(e,t,n,r){if(!Go(e))return e;for(var i=-1,s=(t=ai(t,e)).length,o=s-1,a=e;null!=a&&++ii?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=ue(i);++r>>1,o=e[s];null!==o&&!Qo(o)&&(n?o<=t:o=200){var l=t?null:Fi(e);if(l)return Vt(l);o=!1,i=Rt,c=new Mn}else c=t?[]:a;e:for(;++r=r?e:Wr(e,t,n)}var ui=qt||function(e){return je.clearTimeout(e)};function pi(e,t){if(t)return e.slice();var n=e.length,r=We?We(n):new e.constructor(n);return e.copy(r),r}function hi(e){var t=new e.constructor(e.byteLength);return new Ge(t).set(new Ge(e)),t}function di(e,t){var n=t?hi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function fi(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,s=Qo(e),o=void 0!==t,a=null===t,c=t==t,l=Qo(t);if(!a&&!l&&!s&&e>t||s&&o&&c&&!a&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!s&&!l&&e1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(s=e.length>3&&"function"==typeof s?(i--,s):void 0,o&&as(n[0],n[1],o)&&(s=i<3?void 0:s,i=1),t=me(t);++r-1?i[s?t[o]:o]:void 0}}function wi(e){return ji((function(t){var r=t.length,i=r,s=Dn.prototype.thru;for(e&&t.reverse();i--;){var o=t[i];if("function"!=typeof o)throw new Ee(n);if(s&&!a&&"wrapper"==Xi(o))var a=new Dn([],!0)}for(i=a?i:r;++i1&&E.reverse(),u&&c<_&&(E.length=c),this&&this!==je&&this instanceof g&&(C=m||xi(C)),C.apply(A,E)}}function Ri(e,t){return function(n,r){return function(e,t,n,r){return cr(e,(function(e,i,s){t(r,n(e),i,s)})),r}(n,e,t(r),{})}}function Ni(e,t){return function(n,r){var i;if(void 0===n&&void 0===r)return t;if(void 0!==n&&(i=n),void 0!==r){if(void 0===i)return r;"string"==typeof n||"string"==typeof r?(n=Qr(n),r=Qr(r)):(n=Yr(n),r=Yr(r)),i=e(n,r)}return i}}function Di(e){return ji((function(t){return t=ut(t,wt(Yi())),Lr((function(n){var r=this;return e(t,(function(e){return nt(e,r,n)}))}))}))}function ki(e,t){var n=(t=void 0===t?" ":Qr(t)).length;if(n<2)return n?Fr(t,e):t;var r=Fr(t,Zt(e/Ht(t)));return Mt(t)?li(Gt(r),0,e).join(""):r.slice(0,e)}function Oi(e){return function(t,n,r){return r&&"number"!=typeof r&&as(t,n,r)&&(n=r=void 0),t=na(t),void 0===n?(n=t,t=0):n=na(n),function(e,t,n,r){for(var i=-1,s=on(Zt((t-e)/(n||1)),0),o=ue(s);s--;)o[r?s:++i]=e,e+=n;return o}(t,n,r=void 0===r?ta))return!1;var l=s.get(e);if(l&&s.get(t))return l==t;var u=-1,p=!0,h=2&n?new Mn:void 0;for(s.set(e,t),s.set(t,e);++u-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(X,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return it(i,(function(n){var r="_."+n[0];t&n[1]&&!ct(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(q);return t?t[1].split(Y):[]}(r),n)))}function bs(e){var t=0,n=0;return function(){var r=cn(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function As(e,t){var n=-1,r=e.length,i=r-1;for(t=void 0===t?r:t;++n1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,zs(e,n)}));function eo(e){var t=Tn(e);return t.__chain__=!0,t}function to(e,t){return t(e)}var no=ji((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return Xn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof kn&&os(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:to,args:[i],thisArg:void 0}),new Dn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(i)}));var ro=yi((function(e,t,n){Ce.call(e,n)?++e[n]:zn(e,n,1)}));var io=$i(Ds),so=$i(ks);function oo(e,t){return(Oo(e)?it:er)(e,Yi(t,3))}function ao(e,t){return(Oo(e)?st:tr)(e,Yi(t,3))}var co=yi((function(e,t,n){Ce.call(e,n)?e[n].push(t):zn(e,n,[t])}));var lo=Lr((function(e,t,n){var r=-1,i="function"==typeof t,s=Po(e)?ue(e.length):[];return er(e,(function(e){s[++r]=i?nt(t,e,n):Er(e,t,n)})),s})),uo=yi((function(e,t,n){zn(e,n,t)}));function po(e,t){return(Oo(e)?ut:wr)(e,Yi(t,3))}var ho=yi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var fo=Lr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&as(e,t[0],t[1])?t=[]:n>2&&as(t[0],t[1],t[2])&&(t=[t[0]]),kr(e,sr(t,1),[])})),mo=Yt||function(){return je.Date.now()};function go(e,t,n){return t=n?void 0:t,Bi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function _o(e,t){var r;if("function"!=typeof t)throw new Ee(n);return e=ra(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}var Eo=Lr((function(e,t,n){var r=1;if(n.length){var i=Bt(n,qi(Eo));r|=32}return Bi(e,r,t,n,i)})),yo=Lr((function(e,t,n){var r=3;if(n.length){var i=Bt(n,qi(yo));r|=32}return Bi(t,r,e,n,i)}));function vo(e,t,r){var i,s,o,a,c,l,u=0,p=!1,h=!1,d=!0;if("function"!=typeof e)throw new Ee(n);function f(t){var n=i,r=s;return i=s=void 0,u=t,a=e.apply(r,n)}function m(e){return u=e,c=ys(_,t),p?f(e):a}function g(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-u>=o}function _(){var e=mo();if(g(e))return E(e);c=ys(_,function(e){var n=t-(e-l);return h?an(n,o-(e-u)):n}(e))}function E(e){return c=void 0,d&&i?f(e):(i=s=void 0,a)}function y(){var e=mo(),n=g(e);if(i=arguments,s=this,l=e,n){if(void 0===c)return m(l);if(h)return ui(c),c=ys(_,t),f(l)}return void 0===c&&(c=ys(_,t)),a}return t=sa(t)||0,Go(r)&&(p=!!r.leading,o=(h="maxWait"in r)?on(sa(r.maxWait)||0,t):o,d="trailing"in r?!!r.trailing:d),y.cancel=function(){void 0!==c&&ui(c),u=0,i=l=s=c=void 0},y.flush=function(){return void 0===c?a:E(mo())},y}var So=Lr((function(e,t){return Zn(e,1,t)})),bo=Lr((function(e,t,n){return Zn(e,sa(t)||0,n)}));function Ao(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=e.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(Ao.Cache||Pn),r}function Co(e){if("function"!=typeof e)throw new Ee(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ao.Cache=Pn;var xo=ci((function(e,t){var n=(t=1==t.length&&Oo(t[0])?ut(t[0],wt(Yi())):ut(sr(t,1),wt(Yi()))).length;return Lr((function(r){for(var i=-1,s=an(r.length,n);++i=t})),ko=yr(function(){return arguments}())?yr:function(e){return jo(e)&&Ce.call(e,"callee")&&!qe.call(e,"callee")},Oo=ue.isArray,Io=Ye?wt(Ye):function(e){return jo(e)&&dr(e)==v};function Po(e){return null!=e&&Ho(e.length)&&!Vo(e)}function Mo(e){return jo(e)&&Po(e)}var Fo=tn||sc,Lo=Qe?wt(Qe):function(e){return jo(e)&&dr(e)==c};function Bo(e){if(!jo(e))return!1;var t=dr(e);return t==l||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!zo(e)}function Vo(e){if(!Go(e))return!1;var t=dr(e);return t==u||t==p||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Uo(e){return"number"==typeof e&&e==ra(e)}function Ho(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Go(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function jo(e){return null!=e&&"object"==typeof e}var Wo=Ze?wt(Ze):function(e){return jo(e)&&ns(e)==h};function Ko(e){return"number"==typeof e||jo(e)&&dr(e)==d}function zo(e){if(!jo(e)||dr(e)!=f)return!1;var t=Ke(e);if(null===t)return!0;var n=Ce.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ae.call(n)==Te}var Xo=Je?wt(Je):function(e){return jo(e)&&dr(e)==m};var qo=et?wt(et):function(e){return jo(e)&&ns(e)==g};function Yo(e){return"string"==typeof e||!Oo(e)&&jo(e)&&dr(e)==_}function Qo(e){return"symbol"==typeof e||jo(e)&&dr(e)==E}var Zo=tt?wt(tt):function(e){return jo(e)&&Ho(e.length)&&!!Fe[dr(e)]};var Jo=Ii($r),ea=Ii((function(e,t){return e<=t}));function ta(e){if(!e)return[];if(Po(e))return Yo(e)?Gt(e):_i(e);if(Kt&&e[Kt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Kt]());var t=ns(e);return(t==h?Ft:t==g?Vt:Ra)(e)}function na(e){return e?(e=sa(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ra(e){var t=na(e),n=t%1;return t==t?n?t-n:t:0}function ia(e){return e?qn(ra(e),0,4294967295):0}function sa(e){if("number"==typeof e)return e;if(Qo(e))return NaN;if(Go(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Go(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(W,"");var n=ne.test(e);return n||ie.test(e)?Ue(e.slice(2),n?2:8):te.test(e)?NaN:+e}function oa(e){return Ei(e,Sa(e))}function aa(e){return null==e?"":Qr(e)}var ca=vi((function(e,t){if(ps(t)||Po(t))Ei(t,va(t),e);else for(var n in t)Ce.call(t,n)&&Gn(e,n,t[n])})),la=vi((function(e,t){Ei(t,Sa(t),e)})),ua=vi((function(e,t,n,r){Ei(t,Sa(t),e,r)})),pa=vi((function(e,t,n,r){Ei(t,va(t),e,r)})),ha=ji(Xn);var da=Lr((function(e,t){e=me(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&as(t[0],t[1],i)&&(r=1);++n1),t})),Ei(e,Ki(e),n),r&&(n=Yn(n,7,Hi));for(var i=t.length;i--;)Jr(n,t[i]);return n}));var xa=ji((function(e,t){return null==e?{}:function(e,t){return Or(e,t,(function(t,n){return ga(e,n)}))}(e,t)}));function $a(e,t){if(null==e)return{};var n=ut(Ki(e),(function(e){return[e]}));return t=Yi(t),Or(e,n,(function(e,n){return t(e,n[0])}))}var wa=Li(va),Ta=Li(Sa);function Ra(e){return null==e?[]:Tt(e,va(e))}var Na=Ci((function(e,t,n){return t=t.toLowerCase(),e+(n?Da(t):t)}));function Da(e){return Ba(aa(e).toLowerCase())}function ka(e){return(e=aa(e))&&e.replace(oe,Ot).replace(Ne,"")}var Oa=Ci((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ia=Ci((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Pa=Ai("toLowerCase");var Ma=Ci((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Fa=Ci((function(e,t,n){return e+(n?" ":"")+Ba(t)}));var La=Ci((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Ba=Ai("toUpperCase");function Va(e,t,n){return e=aa(e),void 0===(t=n?void 0:t)?function(e){return Ie.test(e)}(e)?function(e){return e.match(ke)||[]}(e):function(e){return e.match(Q)||[]}(e):e.match(t)||[]}var Ua=Lr((function(e,t){try{return nt(e,void 0,t)}catch(e){return Bo(e)?e:new he(e)}})),Ha=ji((function(e,t){return it(t,(function(t){t=xs(t),zn(e,t,Eo(e[t],e))})),e}));function Ga(e){return function(){return e}}var ja=wi(),Wa=wi(!0);function Ka(e){return e}function za(e){return Ar("function"==typeof e?e:Yn(e,1))}var Xa=Lr((function(e,t){return function(n){return Er(n,e,t)}})),qa=Lr((function(e,t){return function(n){return Er(e,n,t)}}));function Ya(e,t,n){var r=va(t),i=ur(t,r);null!=n||Go(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=ur(t,va(t)));var s=!(Go(n)&&"chain"in n&&!n.chain),o=Vo(e);return it(i,(function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(s||t){var n=e(this.__wrapped__),i=n.__actions__=_i(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,pt([this.value()],arguments))})})),e}function Qa(){}var Za=Di(ut),Ja=Di(ot),ec=Di(ft);function tc(e){return cs(e)?bt(xs(e)):function(e){return function(t){return pr(t,e)}}(e)}var nc=Oi(),rc=Oi(!0);function ic(){return[]}function sc(){return!1}var oc=Ni((function(e,t){return e+t}),0),ac=Mi("ceil"),cc=Ni((function(e,t){return e/t}),1),lc=Mi("floor");var uc=Ni((function(e,t){return e*t}),1),pc=Mi("round"),hc=Ni((function(e,t){return e-t}),0);return Tn.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=ra(e),function(){if(--e<1)return t.apply(this,arguments)}},Tn.ary=go,Tn.assign=ca,Tn.assignIn=la,Tn.assignInWith=ua,Tn.assignWith=pa,Tn.at=ha,Tn.before=_o,Tn.bind=Eo,Tn.bindAll=Ha,Tn.bindKey=yo,Tn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Oo(e)?e:[e]},Tn.chain=eo,Tn.chunk=function(e,t,n){t=(n?as(e,t,n):void 0===t)?1:on(ra(t),0);var r=null==e?0:e.length;if(!r||t<1)return[];for(var i=0,s=0,o=ue(Zt(r/t));ii?0:i+n),(r=void 0===r||r>i?i:ra(r))<0&&(r+=i),r=n>r?0:ia(r);n>>0)?(e=aa(e))&&("string"==typeof t||null!=t&&!Xo(t))&&!(t=Qr(t))&&Mt(e)?li(Gt(e),0,n):e.split(t,n):[]},Tn.spread=function(e,t){if("function"!=typeof e)throw new Ee(n);return t=null==t?0:on(ra(t),0),Lr((function(n){var r=n[t],i=li(n,0,t);return r&&pt(i,r),nt(e,this,i)}))},Tn.tail=function(e){var t=null==e?0:e.length;return t?Wr(e,1,t):[]},Tn.take=function(e,t,n){return e&&e.length?Wr(e,0,(t=n||void 0===t?1:ra(t))<0?0:t):[]},Tn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Wr(e,(t=r-(t=n||void 0===t?1:ra(t)))<0?0:t,r):[]},Tn.takeRightWhile=function(e,t){return e&&e.length?ti(e,Yi(t,3),!1,!0):[]},Tn.takeWhile=function(e,t){return e&&e.length?ti(e,Yi(t,3)):[]},Tn.tap=function(e,t){return t(e),e},Tn.throttle=function(e,t,r){var i=!0,s=!0;if("function"!=typeof e)throw new Ee(n);return Go(r)&&(i="leading"in r?!!r.leading:i,s="trailing"in r?!!r.trailing:s),vo(e,t,{leading:i,maxWait:t,trailing:s})},Tn.thru=to,Tn.toArray=ta,Tn.toPairs=wa,Tn.toPairsIn=Ta,Tn.toPath=function(e){return Oo(e)?ut(e,xs):Qo(e)?[e]:_i(Cs(aa(e)))},Tn.toPlainObject=oa,Tn.transform=function(e,t,n){var r=Oo(e),i=r||Fo(e)||Zo(e);if(t=Yi(t,4),null==n){var s=e&&e.constructor;n=i?r?new s:[]:Go(e)&&Vo(s)?Rn(Ke(e)):{}}return(i?it:cr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Tn.unary=function(e){return go(e,1)},Tn.union=Gs,Tn.unionBy=js,Tn.unionWith=Ws,Tn.uniq=function(e){return e&&e.length?Zr(e):[]},Tn.uniqBy=function(e,t){return e&&e.length?Zr(e,Yi(t,2)):[]},Tn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Zr(e,void 0,t):[]},Tn.unset=function(e,t){return null==e||Jr(e,t)},Tn.unzip=Ks,Tn.unzipWith=zs,Tn.update=function(e,t,n){return null==e?e:ei(e,t,oi(n))},Tn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:ei(e,t,oi(n),r)},Tn.values=Ra,Tn.valuesIn=function(e){return null==e?[]:Tt(e,Sa(e))},Tn.without=Xs,Tn.words=Va,Tn.wrap=function(e,t){return $o(oi(t),e)},Tn.xor=qs,Tn.xorBy=Ys,Tn.xorWith=Qs,Tn.zip=Zs,Tn.zipObject=function(e,t){return ii(e||[],t||[],Gn)},Tn.zipObjectDeep=function(e,t){return ii(e||[],t||[],Ur)},Tn.zipWith=Js,Tn.entries=wa,Tn.entriesIn=Ta,Tn.extend=la,Tn.extendWith=ua,Ya(Tn,Tn),Tn.add=oc,Tn.attempt=Ua,Tn.camelCase=Na,Tn.capitalize=Da,Tn.ceil=ac,Tn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=sa(n))==n?n:0),void 0!==t&&(t=(t=sa(t))==t?t:0),qn(sa(e),t,n)},Tn.clone=function(e){return Yn(e,4)},Tn.cloneDeep=function(e){return Yn(e,5)},Tn.cloneDeepWith=function(e,t){return Yn(e,5,t="function"==typeof t?t:void 0)},Tn.cloneWith=function(e,t){return Yn(e,4,t="function"==typeof t?t:void 0)},Tn.conformsTo=function(e,t){return null==t||Qn(e,t,va(t))},Tn.deburr=ka,Tn.defaultTo=function(e,t){return null==e||e!=e?t:e},Tn.divide=cc,Tn.endsWith=function(e,t,n){e=aa(e),t=Qr(t);var r=e.length,i=n=void 0===n?r:qn(ra(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},Tn.eq=Ro,Tn.escape=function(e){return(e=aa(e))&&M.test(e)?e.replace(I,It):e},Tn.escapeRegExp=function(e){return(e=aa(e))&&j.test(e)?e.replace(G,"\\$&"):e},Tn.every=function(e,t,n){var r=Oo(e)?ot:nr;return n&&as(e,t,n)&&(t=void 0),r(e,Yi(t,3))},Tn.find=io,Tn.findIndex=Ds,Tn.findKey=function(e,t){return gt(e,Yi(t,3),cr)},Tn.findLast=so,Tn.findLastIndex=ks,Tn.findLastKey=function(e,t){return gt(e,Yi(t,3),lr)},Tn.floor=lc,Tn.forEach=oo,Tn.forEachRight=ao,Tn.forIn=function(e,t){return null==e?e:or(e,Yi(t,3),Sa)},Tn.forInRight=function(e,t){return null==e?e:ar(e,Yi(t,3),Sa)},Tn.forOwn=function(e,t){return e&&cr(e,Yi(t,3))},Tn.forOwnRight=function(e,t){return e&&lr(e,Yi(t,3))},Tn.get=ma,Tn.gt=No,Tn.gte=Do,Tn.has=function(e,t){return null!=e&&rs(e,t,mr)},Tn.hasIn=ga,Tn.head=Is,Tn.identity=Ka,Tn.includes=function(e,t,n,r){e=Po(e)?e:Ra(e),n=n&&!r?ra(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),Yo(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Et(e,t,n)>-1},Tn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ra(n);return i<0&&(i=on(r+i,0)),Et(e,t,i)},Tn.inRange=function(e,t,n){return t=na(t),void 0===n?(n=t,t=0):n=na(n),function(e,t,n){return e>=an(t,n)&&e=-9007199254740991&&e<=9007199254740991},Tn.isSet=qo,Tn.isString=Yo,Tn.isSymbol=Qo,Tn.isTypedArray=Zo,Tn.isUndefined=function(e){return void 0===e},Tn.isWeakMap=function(e){return jo(e)&&ns(e)==y},Tn.isWeakSet=function(e){return jo(e)&&"[object WeakSet]"==dr(e)},Tn.join=function(e,t){return null==e?"":rn.call(e,t)},Tn.kebabCase=Oa,Tn.last=Ls,Tn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=ra(n))<0?on(r+i,0):an(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):_t(e,vt,i,!0)},Tn.lowerCase=Ia,Tn.lowerFirst=Pa,Tn.lt=Jo,Tn.lte=ea,Tn.max=function(e){return e&&e.length?rr(e,Ka,fr):void 0},Tn.maxBy=function(e,t){return e&&e.length?rr(e,Yi(t,2),fr):void 0},Tn.mean=function(e){return St(e,Ka)},Tn.meanBy=function(e,t){return St(e,Yi(t,2))},Tn.min=function(e){return e&&e.length?rr(e,Ka,$r):void 0},Tn.minBy=function(e,t){return e&&e.length?rr(e,Yi(t,2),$r):void 0},Tn.stubArray=ic,Tn.stubFalse=sc,Tn.stubObject=function(){return{}},Tn.stubString=function(){return""},Tn.stubTrue=function(){return!0},Tn.multiply=uc,Tn.nth=function(e,t){return e&&e.length?Dr(e,ra(t)):void 0},Tn.noConflict=function(){return je._===this&&(je._=De),this},Tn.noop=Qa,Tn.now=mo,Tn.pad=function(e,t,n){e=aa(e);var r=(t=ra(t))?Ht(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return ki(Jt(i),n)+e+ki(Zt(i),n)},Tn.padEnd=function(e,t,n){e=aa(e);var r=(t=ra(t))?Ht(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var i=un();return an(e+i*(t-e+Ve("1e-"+((i+"").length-1))),t)}return Mr(e,t)},Tn.reduce=function(e,t,n){var r=Oo(e)?ht:Ct,i=arguments.length<3;return r(e,Yi(t,4),n,i,er)},Tn.reduceRight=function(e,t,n){var r=Oo(e)?dt:Ct,i=arguments.length<3;return r(e,Yi(t,4),n,i,tr)},Tn.repeat=function(e,t,n){return t=(n?as(e,t,n):void 0===t)?1:ra(t),Fr(aa(e),t)},Tn.replace=function(){var e=arguments,t=aa(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Tn.result=function(e,t,n){var r=-1,i=(t=ai(t,e)).length;for(i||(i=1,e=void 0);++r9007199254740991)return[];var n=4294967295,r=an(e,4294967295);e-=4294967295;for(var i=$t(r,t=Yi(t));++n=s)return e;var a=n-Ht(r);if(a<1)return r;var c=o?li(o,0,a).join(""):e.slice(0,a);if(void 0===i)return c+r;if(o&&(a+=c.length-a),Xo(i)){if(e.slice(a).search(i)){var l,u=c;for(i.global||(i=ge(i.source,aa(ee.exec(i))+"g")),i.lastIndex=0;l=i.exec(u);)var p=l.index;c=c.slice(0,void 0===p?a:p)}}else if(e.indexOf(Qr(i),a)!=a){var h=c.lastIndexOf(i);h>-1&&(c=c.slice(0,h))}return c+r},Tn.unescape=function(e){return(e=aa(e))&&P.test(e)?e.replace(O,jt):e},Tn.uniqueId=function(e){var t=++xe;return aa(e)+t},Tn.upperCase=La,Tn.upperFirst=Ba,Tn.each=oo,Tn.eachRight=ao,Tn.first=Is,Ya(Tn,function(){var e={};return cr(Tn,(function(t,n){Ce.call(Tn.prototype,n)||(e[n]=t)})),e}(),{chain:!1}),Tn.VERSION="4.17.15",it(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Tn[e].placeholder=Tn})),it(["drop","take"],(function(e,t){kn.prototype[e]=function(n){n=void 0===n?1:on(ra(n),0);var r=this.__filtered__&&!t?new kn(this):this.clone();return r.__filtered__?r.__takeCount__=an(n,r.__takeCount__):r.__views__.push({size:an(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},kn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),it(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;kn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Yi(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),it(["head","last"],(function(e,t){var n="take"+(t?"Right":"");kn.prototype[e]=function(){return this[n](1).value()[0]}})),it(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");kn.prototype[e]=function(){return this.__filtered__?new kn(this):this[n](1)}})),kn.prototype.compact=function(){return this.filter(Ka)},kn.prototype.find=function(e){return this.filter(e).head()},kn.prototype.findLast=function(e){return this.reverse().find(e)},kn.prototype.invokeMap=Lr((function(e,t){return"function"==typeof e?new kn(this):this.map((function(n){return Er(n,e,t)}))})),kn.prototype.reject=function(e){return this.filter(Co(Yi(e)))},kn.prototype.slice=function(e,t){e=ra(e);var n=this;return n.__filtered__&&(e>0||t<0)?new kn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ra(t))<0?n.dropRight(-t):n.take(t-e)),n)},kn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},kn.prototype.toArray=function(){return this.take(4294967295)},cr(kn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=Tn[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);i&&(Tn.prototype[t]=function(){var t=this.__wrapped__,o=r?[1]:arguments,a=t instanceof kn,c=o[0],l=a||Oo(t),u=function(e){var t=i.apply(Tn,pt([e],o));return r&&p?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(a=l=!1);var p=this.__chain__,h=!!this.__actions__.length,d=s&&!p,f=a&&!h;if(!s&&l){t=f?t:new kn(this);var m=e.apply(t,o);return m.__actions__.push({func:to,args:[u],thisArg:void 0}),new Dn(m,p)}return d&&f?e.apply(this,o):(m=this.thru(u),d?r?m.value()[0]:m.value():m)})})),it(["pop","push","shift","sort","splice","unshift"],(function(e){var t=ye[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Tn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Oo(i)?i:[],e)}return this[n]((function(n){return t.apply(Oo(n)?n:[],e)}))}})),cr(kn.prototype,(function(e,t){var n=Tn[t];if(n){var r=n.name+"";Ce.call(yn,r)||(yn[r]=[]),yn[r].push({name:t,func:n})}})),yn[Ti(void 0,2).name]=[{name:"wrapper",func:void 0}],kn.prototype.clone=function(){var e=new kn(this.__wrapped__);return e.__actions__=_i(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=_i(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=_i(this.__views__),e},kn.prototype.reverse=function(){if(this.__filtered__){var e=new kn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},kn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Oo(e),r=t<0,i=n?e.length:0,s=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Tn.prototype.plant=function(e){for(var t,n=this;n instanceof Nn;){var r=ws(n);r.__index__=0,r.__values__=void 0,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},Tn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof kn){var t=e;return this.__actions__.length&&(t=new kn(this)),(t=t.reverse()).__actions__.push({func:to,args:[Hs],thisArg:void 0}),new Dn(t,this.__chain__)}return this.thru(Hs)},Tn.prototype.toJSON=Tn.prototype.valueOf=Tn.prototype.value=function(){return ni(this.__wrapped__,this.__actions__)},Tn.prototype.first=Tn.prototype.head,Kt&&(Tn.prototype[Kt]=function(){return this}),Tn}();Ke?((Ke.exports=Wt)._=Wt,We._=Wt):je._=Wt}).call(this)})),os$1=require("os"),path$a=require("path");function darwin(e){return path$a.join(process.env.HOME,"Library","Application Support",e)}function linux(e){return process.env.XDG_CONFIG_HOME?path$a.join(process.env.XDG_CONFIG_HOME,e):path$a.join(process.env.HOME,".config",e)}function win32$1(e){return process.env.LOCALAPPDATA?path$a.join(process.env.LOCALAPPDATA,e):path$a.join(process.env.USERPROFILE,"Local Settings","Application Data",e)}function applicationConfigPath(e){if("string"!=typeof e)throw new TypeError("`name` must be string");switch(os$1.platform()){case"darwin":return darwin(e);case"linux":return linux(e);case"win32":return win32$1(e)}throw new Error("Platform not supported")}var applicationConfigPath_1=applicationConfigPath,eol=createCommonjsModule$1((function(e){!function(t,n,r){e.exports?e.exports=r():t.eol=r()}(this,0,(function(){var e={},t="undefined"!=typeof process&&"win32"===process.platform?"\r\n":"\n",n=/\r\n|\r|\n/g;function r(e){function t(t){return t.replace(n,e)}return t.toString=function(){return e},t}return e.lf=r("\n"),e.cr=r("\r"),e.crlf=r("\r\n"),e.auto=r(t),e.before=function(e){return t+e},e.after=function(e){return e+t},e.split=function(e){return e.split(n)},e}))})),isWindows$2="win32"===process.platform,trailingSlashRe=isWindows$2?/[^:]\\$/:/.\/$/,osTmpdir=function(){var e;return e=isWindows$2?process.env.TEMP||process.env.TMP||(process.env.SystemRoot||process.env.windir)+"\\temp":process.env.TMPDIR||process.env.TMP||process.env.TEMP||"/tmp",trailingSlashRe.test(e)&&(e=e.slice(0,-1)),e};const fs$9=require("fs"),path$b=require("path"),crypto=require("crypto"),_c=process.binding("constants"),tmpDir=osTmpdir(),RANDOM_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",TEMPLATE_PATTERN=/XXXXXX/,DEFAULT_TRIES=3,CREATE_FLAGS=(_c.O_CREAT||_c.fs.O_CREAT)|(_c.O_EXCL||_c.fs.O_EXCL)|(_c.O_RDWR||_c.fs.O_RDWR),EBADF=_c.EBADF||_c.os.errno.EBADF,ENOENT=_c.ENOENT||_c.os.errno.ENOENT,DIR_MODE=448,FILE_MODE=384,_removeObjects=[];var _gracefulCleanup=!1,_uncaughtException=!1;function _randomChars(e){var t=[],n=null;try{n=crypto.randomBytes(e)}catch(t){n=crypto.pseudoRandomBytes(e)}for(var r=0;r0?e():i(new Error("Could not get a unique tmp filename, max tries reached "+t));i(null,t)}))}()}function tmpNameSync(e){var t=_parseArguments(e)[0],n=t.name?1:t.tries||3;if(isNaN(n)||n<0)throw new Error("Invalid tries");if(t.template&&!t.template.match(TEMPLATE_PATTERN))throw new Error("Invalid template provided");do{const e=_generateTmpName(t);try{fs$9.statSync(e)}catch(t){return e}}while(n-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(e,t){var n=_parseArguments(e,t),r=n[0],i=n[1];r.postfix=_isUndefined(r.postfix)?".tmp":r.postfix,tmpName(r,(function(e,t){if(e)return i(e);fs$9.open(t,CREATE_FLAGS,r.mode||384,(function(e,n){return e?i(e):r.discardDescriptor?fs$9.close(n,(function(e){if(e){try{fs$9.unlinkSync(t)}catch(t){isENOENT(t)||(e=t)}return i(e)}i(null,t,void 0,_prepareTmpFileRemoveCallback(t,-1,r))})):r.detachDescriptor?i(null,t,n,_prepareTmpFileRemoveCallback(t,-1,r)):void i(null,t,n,_prepareTmpFileRemoveCallback(t,n,r))}))}))}function fileSync(e){var t=_parseArguments(e)[0];t.postfix=t.postfix||".tmp";const n=t.discardDescriptor||t.detachDescriptor,r=tmpNameSync(t);var i=fs$9.openSync(r,CREATE_FLAGS,t.mode||384);return t.discardDescriptor&&(fs$9.closeSync(i),i=void 0),{name:r,fd:i,removeCallback:_prepareTmpFileRemoveCallback(r,n?-1:i,t)}}function _rmdirRecursiveSync(e){const t=[e];do{for(var n=t.pop(),r=!1,i=fs$9.readdirSync(n),s=0,o=i.length;s=0&&_removeObjects.splice(i,1),n=!0,e(t)}i&&i(null)}}function _garbageCollector(){if(!_uncaughtException||_gracefulCleanup)for(;_removeObjects.length;)try{_removeObjects[0].call(null)}catch(e){}}function isEBADF(e){return isExpectedError(e,-EBADF,"EBADF")}function isENOENT(e){return isExpectedError(e,-ENOENT,"ENOENT")}function isExpectedError(e,t,n){return e.code==t||e.code==n}function setGracefulCleanup(){_gracefulCleanup=!0}const version$4=process.versions.node.split(".").map((function(e){return parseInt(e,10)}));0===version$4[0]&&(version$4[1]<9||9===version$4[1]&&version$4[2]<5)&&process.addListener("uncaughtException",(function(e){throw _uncaughtException=!0,_garbageCollector(),e})),process.addListener("exit",(function(e){e&&(_uncaughtException=!0),_garbageCollector()}));var tmpdir=tmpDir,dir_1=dir,dirSync_1=dirSync,file_1=file,fileSync_1=fileSync,tmpName_1=tmpName,tmpNameSync_1=tmpNameSync,setGracefulCleanup_1=setGracefulCleanup,tmp={tmpdir,dir:dir_1,dirSync:dirSync_1,file:file_1,fileSync:fileSync_1,tmpName:tmpName_1,tmpNameSync:tmpNameSync_1,setGracefulCleanup:setGracefulCleanup_1},Node$2={child:require("child_process"),crypto:require("crypto"),fs:require("fs"),os:require("os"),path:require("path"),process,util:require("util")};function Attempt(e,t){var n=Node$2.process.platform;return"darwin"===n?Mac(e,t):"linux"===n?Linux(e,t):"win32"===n?Windows(e,t):void t(new Error("Platform not yet supported."))}function EscapeDoubleQuotes(e){if("string"!=typeof e)throw new Error("Expected a string.");return e.replace(/"/g,'\\"')}function Exec(){if(arguments.length<1||arguments.length>3)throw new Error("Wrong number of arguments.");var e=arguments[0],t={},n=function(){};if("string"!=typeof e)throw new Error("Command should be a string.");if(2===arguments.length)if(Node$2.util.isObject(arguments[1]))t=arguments[1];else{if(!Node$2.util.isFunction(arguments[1]))throw new Error("Expected options or callback.");n=arguments[1]}else if(3===arguments.length){if(!Node$2.util.isObject(arguments[1]))throw new Error("Expected options to be an object.");if(t=arguments[1],!Node$2.util.isFunction(arguments[2]))throw new Error("Expected callback to be a function.");n=arguments[2]}if(/^sudo/i.test(e))return n(new Error('Command should not be prefixed with "sudo".'));if(void 0===t.name){var r=Node$2.process.title;if(!ValidName(r))return n(new Error("process.title cannot be used as a valid name."));t.name=r}else if(!ValidName(t.name)){var i="";return i+="options.name must be alphanumeric only ",i+="(spaces are allowed) and <= 70 characters.",n(new Error(i))}if(void 0!==t.icns){if("string"!=typeof t.icns)return n(new Error("options.icns must be a string if provided."));if(0===t.icns.trim().length)return n(new Error("options.icns must not be empty if provided."))}var s=Node$2.process.platform;if("darwin"!==s&&"linux"!==s&&"win32"!==s)return n(new Error("Platform not yet supported."));var o={command:e,options:t,uuid:void 0,path:void 0};Attempt(o,n)}function Linux(e,t){LinuxBinary(e,(function(n,r){if(n)return t(n);var i=[];if(i.push('"'+EscapeDoubleQuotes(r)+'"'),/kdesudo/i.test(r)){i.push("--comment",'"'+e.options.name+' needs administrative privileges. Please enter your password."'),i.push("--")}else/pkexec/i.test(r)&&i.push("--disable-internal-agent");i.push(e.command),i=i.join(" "),Node$2.child.exec(i,{maxBuffer:MAX_BUFFER},(function(e,n,r){e&&(/No authentication agent found/.test(r)?e=new Error(NO_POLKIT_AGENT):/Request dismissed|Command failed/i.test(e)&&(e=new Error(PERMISSION_DENIED))),t(e,n,r)}))}))}function LinuxBinary(e,t){var n=0,r=["/usr/bin/kdesudo","/usr/bin/pkexec"];!function e(){if(n===r.length)return t(new Error("Unable to find pkexec or kdesudo."));var i=r[n++];Node$2.fs.stat(i,(function(n){if(n){if("ENOTDIR"===n.code)return e();if("ENOENT"===n.code)return e();t(n)}else t(void 0,i)}))}()}function Mac(e,t){var n=Node$2.os.tmpdir();return n?Node$2.process.env.USER?void UUID(e,(function(r,i){if(r)return t(r);function s(n,r,i){Remove(Node$2.path.dirname(e.path),(function(e){return n?t(n):e?t(e):void t(void 0,r,i)}))}e.uuid=i,e.path=Node$2.path.join(n,e.uuid,e.options.name+".app"),MacApplet(e,(function(t){if(t)return s(t);MacIcon(e,(function(t){if(t)return s(t);MacPropertyList(e,(function(t){if(t)return s(t);MacCommand(e,(function(t){if(t)return s(t);MacOpen(e,(function(t){if(t)return s(t);MacResult(e,s)}))}))}))}))}))})):t(new Error("env['USER'] not defined.")):t(new Error("os.tmpdir() not defined."))}function MacApplet(e,t){var n=Node$2.path.dirname(e.path);Node$2.fs.mkdir(n,(function(r){if(r)return t(r);var i=Node$2.path.join(n,"sudo-prompt-applet.zip");Node$2.fs.writeFile(i,APPLET,"base64",(function(n){if(n)return t(n);var r=[];r.push("/usr/bin/unzip"),r.push("-o"),r.push('"'+EscapeDoubleQuotes(i)+'"'),r.push('-d "'+EscapeDoubleQuotes(e.path)+'"'),r=r.join(" "),Node$2.child.exec(r,t)}))}))}function MacCommand(e,t){var n=Node$2.path.join(e.path,"Contents","MacOS","sudo-prompt-command"),r=[],i=Node$2.process.cwd();r.push('cd "'+EscapeDoubleQuotes(i)+'"'),r.push(e.command),r=r.join("\n"),Node$2.fs.writeFile(n,r,"utf-8",t)}function MacIcon(e,t){if(!e.options.icns)return t();Node$2.fs.readFile(e.options.icns,(function(n,r){if(n)return t(n);var i=Node$2.path.join(e.path,"Contents","Resources","applet.icns");Node$2.fs.writeFile(i,r,t)}))}function MacOpen(e,t){var n=Node$2.path.join(e.path,"Contents","MacOS","applet"),r={cwd:Node$2.path.dirname(n)};Node$2.child.exec("./"+Node$2.path.basename(n),r,t)}function MacPropertyList(e,t){var n=EscapeDoubleQuotes(Node$2.path.join(e.path,"Contents","Info.plist")),r=EscapeDoubleQuotes("CFBundleName"),i=e.options.name+" Password Prompt";if(/'/.test(i))return t(new Error("Value should not contain single quotes."));var s=[];s.push("/usr/bin/defaults"),s.push("write"),s.push('"'+n+'"'),s.push('"'+r+'"'),s.push("'"+i+"'"),s=s.join(" "),Node$2.child.exec(s,t)}function MacResult(e,t){var n=Node$2.path.join(e.path,"Contents","MacOS");Node$2.fs.readFile(Node$2.path.join(n,"code"),"utf-8",(function(r,i){if(r){if("ENOENT"===r.code)return t(new Error(PERMISSION_DENIED));t(r)}else Node$2.fs.readFile(Node$2.path.join(n,"stdout"),"utf-8",(function(r,s){if(r)return t(r);Node$2.fs.readFile(Node$2.path.join(n,"stderr"),"utf-8",(function(n,r){if(n)return t(n);0===(i=parseInt(i.trim(),10))?t(void 0,s,r):((n=new Error("Command failed: "+e.command+"\n"+r)).code=i,t(n,s,r))}))}))}))}function Remove(e,t){if("string"!=typeof e||!e.trim())return t(new Error("Argument path not defined."));var n=[];if("win32"===Node$2.process.platform){if(/"/.test(e))return t(new Error("Argument path cannot contain double-quotes."));n.push('rmdir /s /q "'+e+'"')}else n.push("/bin/rm"),n.push("-rf"),n.push('"'+EscapeDoubleQuotes(Node$2.path.normalize(e))+'"');n=n.join(" "),Node$2.child.exec(n,t)}function UUID(e,t){Node$2.crypto.randomBytes(256,(function(n,r){n&&(r=Date.now()+""+Math.random());var i=Node$2.crypto.createHash("SHA256");i.update("sudo-prompt-3"),i.update(e.options.name),i.update(e.command),i.update(r);var s=i.digest("hex").slice(-32);if(!s||"string"!=typeof s||32!==s.length)return t(new Error("Expected a valid UUID."));t(void 0,s)}))}function ValidName(e){return!!/^[a-z0-9 ]+$/i.test(e)&&(0!==e.trim().length&&!(e.length>70))}function Windows(e,t){var n=Node$2.os.tmpdir();if(!n)return t(new Error("os.tmpdir() not defined."));UUID(e,(function(r,i){return r?t(r):(e.uuid=i,e.path=Node$2.path.join(n,e.uuid),/"/.test(e.path)?t(new Error("instance.path cannot contain double-quotes.")):(e.pathElevate=Node$2.path.join(e.path,"elevate.vbs"),e.pathExecute=Node$2.path.join(e.path,"execute.bat"),e.pathCommand=Node$2.path.join(e.path,"command.bat"),e.pathStdout=Node$2.path.join(e.path,"stdout"),e.pathStderr=Node$2.path.join(e.path,"stderr"),e.pathStatus=Node$2.path.join(e.path,"status"),void Node$2.fs.mkdir(e.path,(function(n){if(n)return t(n);function r(n,r,i){Remove(e.path,(function(e){return n?t(n):e?t(e):void t(void 0,r,i)}))}WindowsWriteElevateScript(e,(function(t){if(t)return r(t);WindowsWriteExecuteScript(e,(function(t){if(t)return r(t);WindowsWriteCommandScript(e,(function(t){if(t)return r(t);WindowsElevate(e,(function(t){if(t)return r(t);WindowsWaitForStatus(e,(function(t){if(t)return r(t);WindowsResult(e,r)}))}))}))}))}))}))))}))}function WindowsElevate(e,t){var n=[];n.push("powershell.exe"),n.push("Start-Process"),n.push("-FilePath"),n.push("\"'"+e.pathExecute.replace(/'/g,"`'")+"'\""),n.push("-WindowStyle hidden"),n.push("-Verb runAs"),n=n.join(" "),Node$2.child.exec(n,(function(e,n,r){e?/canceled by the user/i.test(e)?t(PERMISSION_DENIED):t(e):t()})).stdin.end()}function WindowsResult(e,t){Node$2.fs.readFile(e.pathStatus,"utf-8",(function(n,r){if(n)return t(n);Node$2.fs.readFile(e.pathStdout,"utf-8",(function(n,i){if(n)return t(n);Node$2.fs.readFile(e.pathStderr,"utf-8",(function(n,s){if(n)return t(n);0===(r=parseInt(r.trim(),10))?t(void 0,i,s):((n=new Error("Command failed: "+e.command+"\r\n"+s)).code=r,t(n,i,s))}))}))}))}function WindowsWaitForStatus(e,t){Node$2.fs.stat(e.pathStatus,(function(n,r){n&&"ENOENT"===n.code||r.size<2?setTimeout((function(){Node$2.fs.stat(e.pathStdout,(function(n){if(n)return t(PERMISSION_DENIED);WindowsWaitForStatus(e,t)}))}),1e3):n?t(n):t()}))}function WindowsWriteCommandScript(e,t){var n=Node$2.process.cwd();if(/"/.test(n))return t(new Error("process.cwd() cannot contain double-quotes."));var r=[];r.push("@echo off"),r.push("chcp 65001>nul"),r.push('cd /d "'+n+'"'),r.push(e.command),r=r.join("\r\n"),Node$2.fs.writeFile(e.pathCommand,r,"utf-8",t)}function WindowsWriteElevateScript(e,t){t()}function WindowsWriteExecuteScript(e,t){var n=[];n.push("@echo off"),n.push('call "'+e.pathCommand+'" > "'+e.pathStdout+'" 2> "'+e.pathStderr+'"'),n.push('(echo %ERRORLEVEL%) > "'+e.pathStatus+'"'),n=n.join("\r\n"),Node$2.fs.writeFile(e.pathExecute,n,"utf-8",t)}var exec$1=Exec,APPLET="UEsDBAoAAAAAAO1YcEcAAAAAAAAAAAAAAAAJABwAQ29udGVudHMvVVQJAAPNnElWLZEQV3V4CwABBPUBAAAEFAAAAFBLAwQUAAAACACgeXBHlHaGqKEBAAC+AwAAEwAcAENvbnRlbnRzL0luZm8ucGxpc3RVVAkAA1zWSVYtkRBXdXgLAAEE9QEAAAQUAAAAfZNRb5swFIWfl1/BeA9OpSmqJkqVBCJFop1VyKQ9Ta59S6wa27NNCfv1M0naJWTsEXO+c8+9vo7v97UI3sBYruRdeBPNwgAkVYzL6i7cluvpbXifTOLP6bdV+QNngRbcugBvl/lmFYRThBZaC0AoLdMA55uiDLwHQtljGIQ75/RXhNq2jUiviqiqe6FF2CgNxnW5N5t6IGKOhb7M0f0ijj9lnLpk8il+hS5ZrZeNZAIWQqj2ge+B5YoSwX8T5xEbo17ktc40gIZQCm8glK5BuieovP5Dbp3xHSeZrHyCXYxO3wM+2wNtHHkWMAQP/bkxbkOVXPMxKuK0Dz6CMh+Wv3AwQ9gPM7INU1NtVK3Ha8sXlfoB+m6J6b4fRzv0mkezMf6R1Fe5MbG2VYYF+L+lMaGvpIKy01cOC4zzMazYKeNOQYuDYkjfjMcteCWJa8w/Zi2ugubFA5e8buqisw7qU81ltzB0xx3QC5/TFh7J/e385/zL+7+/wWbR/LwIOl/dvHiCXw03YFfEPJ9dwsWu5sV2kwnod3QoeLeL0eGdJJM/UEsDBAoAAAAAAHSBjkgAAAAAAAAAAAAAAAAPABwAQ29udGVudHMvTWFjT1MvVVQJAAMbpQ9XLZEQV3V4CwABBPUBAAAEFAAAAFBLAwQUAAAACABVHBdH7Dk4KTIIAADIYQAAFQAcAENvbnRlbnRzL01hY09TL2FwcGxldFVUCQADMiPZVVOlD1d1eAsAAQT1AQAABBQAAADtnG9sHEcVwGfti7M1/rONLNVtXHqpzsipis+pHOSWFOzEm25at3XrJI2ozbK+W/suuds79vaSuCKSpaOIxRy1+NSPRPAhlWj7AVRaQCWpTRz+CEo+RSKCCho4K67kVhUyAeV4b3fWt17fXZqKFgHvp8zO3/dmdmfPmtl5L7+8/uPXGWMNELZCaGRMgmjHIlxaBCibdcoGsewCljGCIAiCIAiCIAiCIP7r+M21d67zjb/zEaAdwr1bGHuWMQH2/2wAgqqODj0kf0F+8nGfoFRbJ8p9U0C5g/KRgwEZqZLGfrfwwJx+LP2kVWkelD9zJ2NfBr1nWt2xrhNisxWZ3Ex6MpNSc1Z+soqOO+5i7JMYt7vj9BC5jiZXBwirCT2V1c0qOgZAxwMYt9cbRyxnmUljusa9mKBjGON2tgG/PlXNGyeSRlxNGlOZKjpeBR0KxsFx+MB7VJy5GB46OOSrCLPKfEjrH3/gFry+4zOpuH8sm+VF5srW6ltVjZQ3HVnL3KRDDLsflMSADpyDyjuR0urp6AAdHRgHdOD9iOs6Ypl0OmPUupeecOW19OsQAmn3tzBy4LFH5OED3jz0MbYouM8D460BOdTXCaEF6tsgLkF8GeJPQBj16Rb4PTf5xl2NH4J8a5Vy1N3F3OcZzefMaCo5GeVTuJ2P4cUf/aH5qbbP73/utpfeevdbLzwfYfy+Q80woGan/1E+ljo/703g77IaOJY479t5rqFLDag9OjaTs/R0dCQ5aWrmTHS/qaX1ExnzWC66L2PqY7p5PBnTc71TXnn0sG7mkhkjFx3a0IL30e/rQxB+EXL68J4BBLe73r298DySk5tlGPtJY1BmOhZTc727PBH2Ke+ZhF35nTyP80oQBEEQBPFRcJTZVwpvrxZWpLmJkN0VKT4q2iORUGFBOPfnBuFX9nhELOG67f1D9pWxpw4XVrrmTklz+ZY5Wfwurm/t3ffi9cE+uM41vYbbj2fP5kNXt9sXiopwVRj6xhPlr160mttfuVi4Fs2vXv2rfc5u7UeZfxQ+y4pPh/JrpyUUBjmrofzmadGXKf0eui7KK/ZwJLQUiuRAe+mLUFQ+tFKUV3npd7AU9ytz8iqIiXYoUnoBsqdxDbXk3CXcRov9lYhoW5EQjBxb4NoSY9iQsvn5+QSuusrduAybL3eHIIIbLqyIS9CHlY3loB8rldVKuLfyOsE1+a6zhUVxYsFp3Amqz8tr7Lz8dza1JF8TmC3/syivYVtcfxcWOycWQDvuLcrdnc61y7mGnWsErgmsXDbK5TKkscnypJvGhsuH3TQ2X37YTaPQ8ucw7W6t1LR2TFfjekqb0SGTiedTOmz0klZSSyWf0U01pqVSufXGmThsjs20OpU3Yrjuxbnu4u+GP8b1LO6PcX2L4Q6+v8Q07u9aQFLy71Ckt54TIfjfNdzfDkMYhTAOIXHXh39vCYIgCIIgCIIgCIL4z3Nm+84/Ci1Nn8b0ryHsgbBX1rbgOXD7LZJzNtrC0/gFqYOn8csQ/GONguQchPXzcvy+9CBzvk84HxkO+tJH3bRz5Fb0pb/nS3/fl/6BL/2aL43faLzz3Wbmju8W5p6pttaoR9THjgyZ0zEeH2eqqmbNzLShpXVIpxOqflKP5S1dTehaXDeZqhvHk2bGYOo+LZXal0lnM4ZuWMPJXFazYgmmPp7VjWF9SsunrPVa1HpMn0lPm2r8hGZO3aea+nQyZ+mmmtNjFp5i4oG0lTChE+eDj2pm8lbSgDFoln4yCRp00zQyEDmZtBZLbGxnanHzgWh092d29e/uv+/f+DIQBEEQBEEQBEEQ/7P81rX/FxoZm/Xs/5UmtP8PO/W3M9fGvKoPAEfYXLQJ1HOpmk+AJx80OOb5m/URGG9z9c378rVs9F15tPXP1dS3wvVtC+Q9/H4DFX21fQcY9zvo9eXrj6++D0Af1zfqy9eyx3f16QnVMayufr+zXN+sL99YRx/O69er+RdIgXkNxJv9DfBTDIxLPa6Zudr6enz5euO6ke9Bj7TRzr0noK+JbczfyA9hgOvr9OX98t57XNFX3ydhlOsL+2T8+oK/ucrvNOCfEHbbXhAqeebLB/0V7oYp7+Pt8PsZWnl1+urRpAn7SUCcYBX/hkth95kd2cFYllX3bxB4+xCrzcCO6v4PbXzo1fwbEM/H4ds/f/nCgZH+8k+j0vNPv7Jlz7qPQ1PFx+FVPoZ76ozj42K87YP9/cT7xuf9UfpSeP0MsJvzp0A8/4g3w+78ef4R+F4QBEEQBPH/w1Gm2FeUwturytwpUSnmJfta4Q3h3J8aFeE9xf7d1ZBSOCcqhftZ/m+YKuG6wV4qaQzdGED0Z2jJ/zpa9ZcegjIF7fkVaIBrt11nJxYOOepXpPPyKjsvvytOLcnvCWxJfh87V+xTa0rx1Kpj0a8UFqWJhXL3fgHt9xXn+rCz7Bop3rkTEkNj5e7bIZ7HNRZb/ku5XE6g58HyZUzdj6mLjh1/Pbt7XMt5dvfvtLl1Fbv7BtbhrtyEPW6V038H1yE88yQTTkqC1LJVnIeaCNe7dr3sEPEe6lCb9LWGfa3efvNG8pe5fF8NeW8g3n7jCI+/xOOEVH19KvF9oudHH2n/YOtYgiAIgiAIgiAIgiA+fm69mx3aO8bYtkHn/xlwDq8nkwaavz9h9swzc+DWwRrm71A5CJVVjeChTtk26Fqwu0fxQjUL+9vqHVV/KC53OUd+bJxVfBkw7/gzCO5pr3dOK/g+WUQDeZlV/A2QRwJ5THjn1/xcd9BfhlT1KbgpVwLn+W2amGr2//8CUEsDBBQAAAAIAAVHj0ga7FYjfQEAAKoCAAAhABwAQ29udGVudHMvTWFjT1Mvc3Vkby1wcm9tcHQtc2NyaXB0VVQJAAOJkBBXipAQV3V4CwABBPUBAAAEFAAAAI1SO08cMRDu91cMHIKGxUB5xSGEUqTlFKWMvPYca+EXnjGXy6/PeNcg0qVay+PvObs5U5OLatI0DxvYIwNVm4BdQGIdMhxSkauJ8K1i7FOjvSdwB2A+/WJnXpEJdEGwjvTk0W6HhTW8WldgzKDedVF2Ug2tLn7svz3DDpTFdxWr93C/u7wbVKWyoDhVM/8XZAOPOXvcm+IyXxGcizeaUca0XJ1D0CfQnlEysE2VwbuII0br4gvdCMF37m9IoC39+oxTO2EpS8oZJdtRS0aIKY5/sCQoyLVEMMki6Ghl0BGN9SeuICkPIctXDHDDSB9oGEQi1yZWUAda8EZnIcR/eIOOVao+9TrbkpYFjLmkkHk0KYSGvdt12/e71cP6Hs2c4OJBemtsYusplVX+GLHQ7DKkQ098/ZF38dLEpRCeNUMlMW90BIseeQkWtuu2qKmIyDHCuqFuo1N11Ud/1Cf6CHb7Sfxld2ATklQoUGEDActfZ5326WU74G/HcDv8BVBLAwQKAAAAAADtWHBHqiAGewgAAAAIAAAAEAAcAENvbnRlbnRzL1BrZ0luZm9VVAkAA82cSVYqkRBXdXgLAAEE9QEAAAQUAAAAQVBQTGFwbHRQSwMECgAAAAAAm3lwRwAAAAAAAAAAAAAAABMAHABDb250ZW50cy9SZXNvdXJjZXMvVVQJAANW1klWLZEQV3V4CwABBPUBAAAEFAAAAFBLAwQUAAAACACAeXBHfrnysfYGAAAf3AAAHgAcAENvbnRlbnRzL1Jlc291cmNlcy9hcHBsZXQuaWNuc1VUCQADH9ZJVnGlD1d1eAsAAQT1AQAABBQAAADt3Xk81Hkcx/Hvb5yVo5bGsVlKbcpRRqFlGZGS5JikRBIdI0OZttMZloqiYwrVjD1UqJaUokTRubG72bZVjqR1VZNjp2XEGo9H+9gt+9h/9tHx8H7N4/fw5MHjYeaPz+P7+P7x/bL9griEPNBm+001J0S+ZbvL/NmKwzWHE0IUHebYuRFCEckjL9v/xSvk2EpCpBXZtrYuDra2Oi4hwSvZgSsIMU9MdPdePcZd1aqQu0p3fDkrcFrs+mPWihMU9y6clp5XEFFdbRrEczCtGtfkL3pWfvBGublJ4ct051kuocYtaaqll/IjdfR+V75vlTdl//AJVZU6elZ5f0S7NO3MaE2xMElhF+TUrHgW2nFYeGTrs/OrhDJN5zMX8ZJVKXrqSUM1Rj03bnf85/pJMXECNdl0D1ctfe/j82imziM2nllSa3t5q8+vP1f38k/k22uN1lmnvfz0b8dGxO+mnh91v7WB2tKdrG3d4vmJaHlTvjGzdMqWcw/9frnCtQpPZK9sMKi/Ey/jzgqIPzBy9/dlf9griI2/u+sjcApozWx6/NXytC+qBTlrhb69fE7J6tgOzpWjFSl8qxihr5dYf/qExoeupY6Ze/j2PfL1azhhZ8fU3eelJY+ylk16UJN6KmOU0M4r+75cZhH/mxNndowNb4wx7TCoN4yvMGu8ySq5l5W5t+xQyYbS/Ome7e0W0sXbC5aktl0LEXNYR9obH7dMT721dbNdT/eFzXNEYSH8GU+bQ5s6YniGcj3fHtgXPbo0Oj4i3d5G1Fjfm/Ng7kgpjQDNxw4RRnu+Vloy5ZE3J6OpwlFBzaxS25He2h3lJuizO70zJPLUYtks14RE5yrD8y2tXa5l5Wqh/NBY06yoiCLF08Nk9A5Ojbs43GmR1Ch/PaZsLf3e6uPRSrIM1ROqGjt80leqfdxYbNn+WV7K7ZKiy/t6r1/3ie46V5432T/Oahs9V7NnVzb9zoq2rFgvPxXrcAMzmvWnGjof/RpdsZThIEpex6DGbd5h6STaOyZXxV/YfW9u4KyllmZ3X15IMHHLSJtVPSOvULCsz2TyPC/WL9kGSme/1L01SSzjfbHnqk+OV7OBmevZeo3DBR7lXT5drT0MkX5PwDd1EQ0ebfkh1zy/L8ydd+VJ4CLuRndNjuwj+vMfU8q2l2l1rGtr8FC2D+fdSGk81eltuTjYSMk++4BMd0DXQo35iXbZndGdcXkGFyeG6b28evF22M2w22HlYSXetGSLW4cfFT00WqvN9bkqCujQ9KzdSt+snr+qmbcme+5Y3cDRn9BDLps+dPVltE9UkPeb6XovineiVUznTznyuZaSn/ZvR8VeRUYLqe3iHFqnU6+7+4LmtfsmaS0MdjIvslFJGG/rn7DPdMGLcx4d6eP2Oz92Y49kWbBUjudU2ijHnc7YIODQxD1aPx8PynVr+cmvJoy2+M5nQa2Kt0dvdPxp73LNU6aTeaktTfHH1L+8Pm/XalZcFcfzYxlhTefuzjRGobLKEqPZh8QKxUXWbU/ERvW78ghvTGTUNd0g9YqbcjUy5h0xVbn3S7SS54SOqKt88UR0qZuxKfxlZfODUm52o2HkGTOLw5dqhevvWjH7ssiqxAhKwA91d1nWG9w/GJIc7GwWbKKe/mAsGRqXBb87P10jH8/0LY6kpGQV1KcuAwAAeCt4LiVFWRJKs4DJ6p9GxGHWfLuTM5dt61/pzCCE7vLmSodGJM/ASqdzU2U3VjpY6WClg5XOICudUaI3VjocuWCsdAAAAAAAAAAAAAAAAD5o1Gmr054TSoqWxPvnfrLxVEIc29/cT5YmkmdgPzlCSz8a+8nYT8Z+MvaTB9lPZpJX+8lRktFyRdDF0m6IdcF2MgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC8ddD8G5oJkUuQnAXwnvxLAAAAADDkEFURRckVE6rIv+Tb1078MiZEetubJ34RHckzcOIXd8uWTpz4hRO/cOIXTvwa5MQvoidZ5S8a9h8nfl1QVhipQ6jyyWeuvTaBGP3D5fwgE4gpeQYmUCZ7XQ0mECYQJhAm0GATyOfVmYOU4sAdNi+cOUpm/9cdNv2Di8kkFN3mYOtrg8sE14xicGFwYXDhmlEAAD5w/Os1o8bTcM0oVjpY6WClg2tGAQAAAAAAAAAAAAAAgL/wb9eMBpow+r817yN/fwnJf33P5g78nWofEZNXD3u95GdSkh3o135/aL2i3vl/gHf/7t59oDlnDSHS8gQhNGQL8uWs6P+iwPYLDuIOzARqyM+E9QOfA3PIfw4IIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhND70J9QSwMEFAAAAAgA7VhwR/dYplZAAAAAagEAAB4AHABDb250ZW50cy9SZXNvdXJjZXMvYXBwbGV0LnJzcmNVVAkAA82cSVZTpQ9XdXgLAAEE9QEAAAQUAAAAY2BgZGBgYFQBEiDsxjDygJQDPlkmEIEaRpJAQg8kLAMML8bi5OIqIFuouKA4A0jLMTD8/w+S5AdrB7PlBIAEAFBLAwQKAAAAAADtWHBHAAAAAAAAAAAAAAAAJAAcAENvbnRlbnRzL1Jlc291cmNlcy9kZXNjcmlwdGlvbi5ydGZkL1VUCQADzZxJVi2REFd1eAsAAQT1AQAABBQAAABQSwMEFAAAAAgA7VhwRzPLNU9TAAAAZgAAACsAHABDb250ZW50cy9SZXNvdXJjZXMvZGVzY3JpcHRpb24ucnRmZC9UWFQucnRmVVQJAAPNnElWU6UPV3V4CwABBPUBAAAEFAAAACWJOw6AIBAFe08DCBVX2QbWhZgQ1vCpCHcXtHkzkzegtCDB5Xp/g0+UyihARnb70kL/UbvffYpjQODcmk9zKXListxCoUsZA7EQ5S0+dVq085gvUEsDBAoAAAAAAIeBjkgAAAAAAAAAAAAAAAAbABwAQ29udGVudHMvUmVzb3VyY2VzL1NjcmlwdHMvVVQJAAM9pQ9XLZEQV3V4CwABBPUBAAAEFAAAAFBLAwQUAAAACAAJgI5ICl5liTUBAADMAQAAJAAcAENvbnRlbnRzL1Jlc291cmNlcy9TY3JpcHRzL21haW4uc2NwdFVUCQADcaIPV1OlD1d1eAsAAQT1AQAABBQAAAB9UMtOAkEQrNldd9dhH3Dz6NGYiPIJHjTxLCZeF9iDcXEJC0RvfoI/4sEfIvoHPEQEhbIHvOok01U16emu7vOkaF2dXu7XqrUTcyMATkxCwYKthCAUbmciAQ8O11yFcGBfbF/4jR24WmCvWjwUeXqfNutn13XyEeYYHkqKam+kghdJGfUCvwIfB6jiGAX6aCHHETroCrYFe6IKNEXfGOXChc0v7HKpBRzdSFrtELvbumKVC80F/FIjzwe9bj91uZRuXJuwAiLjNi7DlsxPaJSUAMrCFOeac3GfpINennQ6d/0sA4z7JxzKiVCCV+YHAs74LuuIONUi//4RIoC63czrIbYQS3PFicWJcTMTv1JHmocmROLJ45gjzfHvXJqjf7ZZ4RT+61uaBbDipGh2ZanBcjh8/gFQSwECHgMKAAAAAADtWHBHAAAAAAAAAAAAAAAACQAYAAAAAAAAABAA7UEAAAAAQ29udGVudHMvVVQFAAPNnElWdXgLAAEE9QEAAAQUAAAAUEsBAh4DFAAAAAgAoHlwR5R2hqihAQAAvgMAABMAGAAAAAAAAQAAAKSBQwAAAENvbnRlbnRzL0luZm8ucGxpc3RVVAUAA1zWSVZ1eAsAAQT1AQAABBQAAABQSwECHgMKAAAAAAB0gY5IAAAAAAAAAAAAAAAADwAYAAAAAAAAABAA7UExAgAAQ29udGVudHMvTWFjT1MvVVQFAAMbpQ9XdXgLAAEE9QEAAAQUAAAAUEsBAh4DFAAAAAgAVRwXR+w5OCkyCAAAyGEAABUAGAAAAAAAAAAAAO2BegIAAENvbnRlbnRzL01hY09TL2FwcGxldFVUBQADMiPZVXV4CwABBPUBAAAEFAAAAFBLAQIeAxQAAAAIAAVHj0ga7FYjfQEAAKoCAAAhABgAAAAAAAEAAADtgfsKAABDb250ZW50cy9NYWNPUy9zdWRvLXByb21wdC1zY3JpcHRVVAUAA4mQEFd1eAsAAQT1AQAABBQAAABQSwECHgMKAAAAAADtWHBHqiAGewgAAAAIAAAAEAAYAAAAAAABAAAApIHTDAAAQ29udGVudHMvUGtnSW5mb1VUBQADzZxJVnV4CwABBPUBAAAEFAAAAFBLAQIeAwoAAAAAAJt5cEcAAAAAAAAAAAAAAAATABgAAAAAAAAAEADtQSUNAABDb250ZW50cy9SZXNvdXJjZXMvVVQFAANW1klWdXgLAAEE9QEAAAQUAAAAUEsBAh4DFAAAAAgAgHlwR3658rH2BgAAH9wAAB4AGAAAAAAAAAAAAKSBcg0AAENvbnRlbnRzL1Jlc291cmNlcy9hcHBsZXQuaWNuc1VUBQADH9ZJVnV4CwABBPUBAAAEFAAAAFBLAQIeAxQAAAAIAO1YcEf3WKZWQAAAAGoBAAAeABgAAAAAAAAAAACkgcAUAABDb250ZW50cy9SZXNvdXJjZXMvYXBwbGV0LnJzcmNVVAUAA82cSVZ1eAsAAQT1AQAABBQAAABQSwECHgMKAAAAAADtWHBHAAAAAAAAAAAAAAAAJAAYAAAAAAAAABAA7UFYFQAAQ29udGVudHMvUmVzb3VyY2VzL2Rlc2NyaXB0aW9uLnJ0ZmQvVVQFAAPNnElWdXgLAAEE9QEAAAQUAAAAUEsBAh4DFAAAAAgA7VhwRzPLNU9TAAAAZgAAACsAGAAAAAAAAQAAAKSBthUAAENvbnRlbnRzL1Jlc291cmNlcy9kZXNjcmlwdGlvbi5ydGZkL1RYVC5ydGZVVAUAA82cSVZ1eAsAAQT1AQAABBQAAABQSwECHgMKAAAAAACHgY5IAAAAAAAAAAAAAAAAGwAYAAAAAAAAABAA7UFuFgAAQ29udGVudHMvUmVzb3VyY2VzL1NjcmlwdHMvVVQFAAM9pQ9XdXgLAAEE9QEAAAQUAAAAUEsBAh4DFAAAAAgACYCOSApeZYk1AQAAzAEAACQAGAAAAAAAAAAAAKSBwxYAAENvbnRlbnRzL1Jlc291cmNlcy9TY3JpcHRzL21haW4uc2NwdFVUBQADcaIPV3V4CwABBPUBAAAEFAAAAFBLBQYAAAAADQANANwEAABWGAAAAAA=",PERMISSION_DENIED="User did not grant permission.",NO_POLKIT_AGENT="No polkit authentication agent found.",MAX_BUFFER=134217728,sudoPrompt={exec:exec$1},utils$2=createCommonjsModule$1((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=require("child_process"),r=tslib_es6.__importDefault(tmp),i=tslib_es6.__importDefault(src$1),s=tslib_es6.__importDefault(require("path")),o=tslib_es6.__importDefault(sudoPrompt),a=i.default("devcert:util");function c(e,t={}){return a(`exec: \`${e}\``),n.execSync(e,t)}t.openssl=function(e){return c("openssl "+e,{stdio:"pipe",env:Object.assign({RANDFILE:s.default.join(constants$3.configPath(".rnd"))},process.env)})},t.run=c,t.waitForUser=function(){return new Promise(e=>{process.stdin.resume(),process.stdin.on("data",e)})},t.reportableError=function(e){return new Error(e+" | This is a bug in devcert, please report the issue at https://github.com/davewasmer/devcert/issues")},t.mktmp=function(){return r.default.fileSync({discardDescriptor:!0}).name},t.sudo=function(e){return new Promise((t,n)=>{o.default.exec(e,{name:"devcert"},(e,r,i)=>{let s=e||"string"==typeof i&&i.trim().length>0&&new Error(i);s?n(s):t(r)})})}})),constants$3=createCommonjsModule$1((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=tslib_es6.__importDefault(require("path")),r=require("fs"),i=tslib_es6.__importDefault(eol);function s(){mkdirp.sync(t.configDir),mkdirp.sync(t.domainsDir),mkdirp.sync(t.rootCADir)}t.isMac="darwin"===process.platform,t.isLinux="linux"===process.platform,t.isWindows="win32"===process.platform,t.configDir=applicationConfigPath_1("devcert"),t.configPath=n.default.join.bind(n.default,t.configDir),t.domainsDir=t.configPath("domains"),t.pathForDomain=n.default.join.bind(n.default,t.domainsDir),t.caVersionFile=t.configPath("devcert-ca-version"),t.opensslSerialFilePath=t.configPath("certificate-authority","serial"),t.opensslDatabaseFilePath=t.configPath("certificate-authority","index.txt"),t.caSelfSignConfig=n.default.join(__dirname,"../openssl-configurations/certificate-authority-self-signing.conf"),t.withDomainSigningRequestConfig=function(e,t){let s=utils$2.mktmp(),o=r.readFileSync(n.default.join(__dirname,"../openssl-configurations/domain-certificate-signing-requests.conf"),"utf-8"),a=lodash.template(o)({domain:e});r.writeFileSync(s,i.default.auto(a)),t(s),r.unlinkSync(s)},t.withDomainCertificateConfig=function(e,s){let o=utils$2.mktmp(),a=r.readFileSync(n.default.join(__dirname,"../openssl-configurations/domain-certificates.conf"),"utf-8"),c=lodash.template(a)({domain:e,serialFile:t.opensslSerialFilePath,databaseFile:t.opensslDatabaseFilePath,domainDir:t.pathForDomain(e)});r.writeFileSync(o,i.default.auto(c)),s(o),r.unlinkSync(o)},t.rootCADir=t.configPath("certificate-authority"),t.rootCAKeyPath=t.configPath("certificate-authority","private-key.key"),t.rootCACertPath=t.configPath("certificate-authority","certificate.cert"),t.getLegacyConfigDir=function(){if(t.isWindows&&process.env.LOCALAPPDATA)return n.default.join(process.env.LOCALAPPDATA,"devcert","config");{let e=process.getuid&&process.getuid(),r=t.isLinux&&0===e?n.default.resolve("/usr/local/share"):require("os").homedir();return n.default.join(r,".config","devcert")}},t.ensureConfigDirs=s,s()}));const net=require("net"),getPort=e=>new Promise((t,n)=>{"number"==typeof e&&(e={port:e});const r=net.createServer();r.unref(),r.on("error",n),r.listen(e,()=>{const e=r.address().port;r.close(()=>{t(e)})})});var getPort_1=e=>e?getPort(e).catch(()=>getPort(0)):getPort(0),ansiEscapes=createCommonjsModule$1((function(e){const t=e.exports,n="[",r="]",i="",s=";",o="Apple_Terminal"===process.env.TERM_PROGRAM;t.cursorTo=(e,t)=>{if("number"!=typeof e)throw new TypeError("The `x` argument is required");return"number"!=typeof t?n+(e+1)+"G":n+(t+1)+";"+(e+1)+"H"},t.cursorMove=(e,t)=>{if("number"!=typeof e)throw new TypeError("The `x` argument is required");let r="";return e<0?r+=n+-e+"D":e>0&&(r+=n+e+"C"),t<0?r+=n+-t+"A":t>0&&(r+=n+t+"B"),r},t.cursorUp=e=>n+("number"==typeof e?e:1)+"A",t.cursorDown=e=>n+("number"==typeof e?e:1)+"B",t.cursorForward=e=>n+("number"==typeof e?e:1)+"C",t.cursorBackward=e=>n+("number"==typeof e?e:1)+"D",t.cursorLeft="",t.cursorSavePosition=n+(o?"7":"s"),t.cursorRestorePosition=n+(o?"8":"u"),t.cursorGetPosition="",t.cursorNextLine="",t.cursorPrevLine="",t.cursorHide="[?25l",t.cursorShow="[?25h",t.eraseLines=e=>{let n="";for(let r=0;r[r,"8",s,s,t,i,e,r,"8",s,s,i].join(""),t.image=(e,t)=>{let n=r+"1337;File=inline=1";return(t=t||{}).width&&(n+=";width="+t.width),t.height&&(n+=";height="+t.height),!1===t.preserveAspectRatio&&(n+=";preserveAspectRatio=0"),n+":"+e.toString("base64")+i},t.iTerm={},t.iTerm.setCwd=e=>r+"50;CurrentDir="+(e||process.cwd())+i})),src$2=function(e){try{return e()}catch(e){}},windows=isexe;isexe.sync=sync$2;var fs$a=require("fs");function checkPathExt(e,t){var n=void 0!==t.pathExt?t.pathExt:process.env.PATHEXT;if(!n)return!0;if(-1!==(n=n.split(";")).indexOf(""))return!0;for(var r=0;r{const t=(e=e||{}).env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).find(e=>"PATH"===e.toUpperCase())||"Path"};const path$d=require("path"),pathKey$1=pathKey();function resolveCommandAttempt(e,t){const n=process.cwd(),r=null!=e.options.cwd;if(r)try{process.chdir(e.options.cwd)}catch(e){}let i;try{i=which_1.sync(e.command,{path:(e.options.env||process.env)[pathKey$1],pathExt:t?path$d.delimiter:void 0})}catch(e){}finally{process.chdir(n)}return i&&(i=path$d.resolve(r?e.options.cwd:"",i)),i}function resolveCommand(e){return resolveCommandAttempt(e)||resolveCommandAttempt(e,!0)}var resolveCommand_1=resolveCommand;const metaCharsRegExp=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(e){return e=e.replace(metaCharsRegExp,"^$1")}function escapeArgument(e,t){return e=(e=`"${e=(e=(e=""+e).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(metaCharsRegExp,"^$1"),t&&(e=e.replace(metaCharsRegExp,"^$1")),e}var command=escapeCommand,argument=escapeArgument,_escape={command,argument},shebangRegex=/^#!.*/,shebangCommand=function(e){var t=e.match(shebangRegex);if(!t)return null;var n=t[0].replace(/#! ?/,"").split(" "),r=n[0].split("/").pop(),i=n[1];return"env"===r?i:r+(i?" "+i:"")};const fs$d=require("fs");function readShebang(e){let t,n;Buffer.alloc?t=Buffer.alloc(150):(t=new Buffer(150),t.fill(0));try{n=fs$d.openSync(e,"r"),fs$d.readSync(n,t,0,150,0),fs$d.closeSync(n)}catch(e){}return shebangCommand(t.toString())}var readShebang_1=readShebang,semver$1=createCommonjsModule$1((function(e,t){var n;t=e.exports=K,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=Number.MAX_SAFE_INTEGER||9007199254740991,i=t.re=[],s=t.src=[],o=0,a=o++;s[a]="0|[1-9]\\d*";var c=o++;s[c]="[0-9]+";var l=o++;s[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=o++;s[u]="("+s[a]+")\\.("+s[a]+")\\.("+s[a]+")";var p=o++;s[p]="("+s[c]+")\\.("+s[c]+")\\.("+s[c]+")";var h=o++;s[h]="(?:"+s[a]+"|"+s[l]+")";var d=o++;s[d]="(?:"+s[c]+"|"+s[l]+")";var f=o++;s[f]="(?:-("+s[h]+"(?:\\."+s[h]+")*))";var m=o++;s[m]="(?:-?("+s[d]+"(?:\\."+s[d]+")*))";var g=o++;s[g]="[0-9A-Za-z-]+";var _=o++;s[_]="(?:\\+("+s[g]+"(?:\\."+s[g]+")*))";var E=o++,y="v?"+s[u]+s[f]+"?"+s[_]+"?";s[E]="^"+y+"$";var v="[v=\\s]*"+s[p]+s[m]+"?"+s[_]+"?",S=o++;s[S]="^"+v+"$";var b=o++;s[b]="((?:<|>)?=?)";var A=o++;s[A]=s[c]+"|x|X|\\*";var C=o++;s[C]=s[a]+"|x|X|\\*";var x=o++;s[x]="[v=\\s]*("+s[C]+")(?:\\.("+s[C]+")(?:\\.("+s[C]+")(?:"+s[f]+")?"+s[_]+"?)?)?";var $=o++;s[$]="[v=\\s]*("+s[A]+")(?:\\.("+s[A]+")(?:\\.("+s[A]+")(?:"+s[m]+")?"+s[_]+"?)?)?";var w=o++;s[w]="^"+s[b]+"\\s*"+s[x]+"$";var T=o++;s[T]="^"+s[b]+"\\s*"+s[$]+"$";var R=o++;s[R]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var N=o++;s[N]="(?:~>?)";var D=o++;s[D]="(\\s*)"+s[N]+"\\s+",i[D]=new RegExp(s[D],"g");var k=o++;s[k]="^"+s[N]+s[x]+"$";var O=o++;s[O]="^"+s[N]+s[$]+"$";var I=o++;s[I]="(?:\\^)";var P=o++;s[P]="(\\s*)"+s[I]+"\\s+",i[P]=new RegExp(s[P],"g");var M=o++;s[M]="^"+s[I]+s[x]+"$";var F=o++;s[F]="^"+s[I]+s[$]+"$";var L=o++;s[L]="^"+s[b]+"\\s*("+v+")$|^$";var B=o++;s[B]="^"+s[b]+"\\s*("+y+")$|^$";var V=o++;s[V]="(\\s*)"+s[b]+"\\s*("+v+"|"+s[x]+")",i[V]=new RegExp(s[V],"g");var U=o++;s[U]="^\\s*("+s[x]+")\\s+-\\s+("+s[x]+")\\s*$";var H=o++;s[H]="^\\s*("+s[$]+")\\s+-\\s+("+s[$]+")\\s*$";var G=o++;s[G]="(<|>)?=?\\s*\\*";for(var j=0;j<35;j++)n(j,s[j]),i[j]||(i[j]=new RegExp(s[j]));function W(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K)return e;if("string"!=typeof e)return null;if(e.length>256)return null;if(!(t.loose?i[S]:i[E]).test(e))return null;try{return new K(e,t)}catch(e){return null}}function K(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof K){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof K))return new K(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var s=e.trim().match(t.loose?i[S]:i[E]);if(!s)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new K(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(Z(e,t))return null;var n=W(e),r=W(t),i="";if(n.prerelease.length||r.prerelease.length){i="pre";var s="prerelease"}for(var o in n)if(("major"===o||"minor"===o||"patch"===o)&&n[o]!==r[o])return i+o;return s},t.compareIdentifiers=X;var z=/^[0-9]+$/;function X(e,t){var n=z.test(e),r=z.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e0}function Q(e,t,n){return q(e,t,n)<0}function Z(e,t,n){return 0===q(e,t,n)}function J(e,t,n){return 0!==q(e,t,n)}function ee(e,t,n){return q(e,t,n)>=0}function te(e,t,n){return q(e,t,n)<=0}function ne(e,t,n,r){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Z(e,n,r);case"!=":return J(e,n,r);case">":return Y(e,n,r);case">=":return ee(e,n,r);case"<":return Q(e,n,r);case"<=":return te(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}function re(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof re){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof re))return new re(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===ie?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return X(t,e)},t.major=function(e,t){return new K(e,t).major},t.minor=function(e,t){return new K(e,t).minor},t.patch=function(e,t){return new K(e,t).patch},t.compare=q,t.compareLoose=function(e,t){return q(e,t,!0)},t.rcompare=function(e,t,n){return q(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compare(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.rcompare(e,r,n)}))},t.gt=Y,t.lt=Q,t.eq=Z,t.neq=J,t.gte=ee,t.lte=te,t.cmp=ne,t.Comparator=re;var ie={};function se(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof se)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new se(e.raw,t);if(e instanceof re)return new se(e.value,t);if(!(this instanceof se))return new se(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function oe(e){return!e||"x"===e.toLowerCase()||"*"===e}function ae(e,t,n,r,i,s,o,a,c,l,u,p,h){return((t=oe(n)?"":oe(r)?">="+n+".0.0":oe(i)?">="+n+"."+r+".0":">="+t)+" "+(a=oe(c)?"":oe(l)?"<"+(+c+1)+".0.0":oe(u)?"<"+c+"."+(+l+1)+".0":p?"<="+c+"."+l+"."+u+"-"+p:"<="+a)).trim()}function ce(e,t,r){for(var i=0;i0){var s=e[i].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new se(t,n)}catch(e){return!1}return t.test(e)}function ue(e,t,n,r){var i,s,o,a,c;switch(e=new K(e,r),t=new se(t,r),n){case">":i=Y,s=te,o=Q,a=">",c=">=";break;case"<":i=Q,s=ee,o=Y,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var l=0;l=0.0.0")),p=p||e,h=h||e,i(e.semver,p.semver,r)?p=e:o(e.semver,h.semver,r)&&(h=e)})),p.operator===a||p.operator===c)return!1;if((!h.operator||h.operator===a)&&s(e,h.semver))return!1;if(h.operator===c&&o(e,h.semver))return!1}return!0}re.prototype.parse=function(e){var t=this.options.loose?i[L]:i[B],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new K(n[2],this.options.loose):this.semver=ie},re.prototype.toString=function(){return this.value},re.prototype.test=function(e){return n("Comparator.test",e,this.options.loose),this.semver===ie||("string"==typeof e&&(e=new K(e,this.options)),ne(e,this.operator,this.semver,this.options))},re.prototype.intersects=function(e,t){if(!(e instanceof re))throw new TypeError("a Comparator is required");var n;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return n=new se(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new se(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),s=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=ne(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=ne(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||i||s&&o||a||c},t.Range=se,se.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},se.prototype.toString=function(){return this.range},se.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?i[H]:i[U];e=e.replace(r,ae),n("hyphen replace",e),e=e.replace(i[V],"$1$2$3"),n("comparator trim",e,i[V]),e=(e=(e=e.replace(i[D],"$1~")).replace(i[P],"$1^")).split(/\s+/).join(" ");var s=t?i[L]:i[B],o=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var r=t.loose?i[F]:i[M];return e.replace(r,(function(t,r,i,s,o){var a;return n("caret",e,t,r,i,s,o),oe(r)?a="":oe(i)?a=">="+r+".0.0 <"+(+r+1)+".0.0":oe(s)?a="0"===r?">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":">="+r+"."+i+".0 <"+(+r+1)+".0.0":o?(n("replaceCaret pr",o),a="0"===r?"0"===i?">="+r+"."+i+"."+s+"-"+o+" <"+r+"."+i+"."+(+s+1):">="+r+"."+i+"."+s+"-"+o+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+s+"-"+o+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===i?">="+r+"."+i+"."+s+" <"+r+"."+i+"."+(+s+1):">="+r+"."+i+"."+s+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+s+" <"+(+r+1)+".0.0"),n("caret return",a),a}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var r=t.loose?i[O]:i[k];return e.replace(r,(function(t,r,i,s,o){var a;return n("tilde",e,t,r,i,s,o),oe(r)?a="":oe(i)?a=">="+r+".0.0 <"+(+r+1)+".0.0":oe(s)?a=">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":o?(n("replaceTilde pr",o),a=">="+r+"."+i+"."+s+"-"+o+" <"+r+"."+(+i+1)+".0"):a=">="+r+"."+i+"."+s+" <"+r+"."+(+i+1)+".0",n("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var r=t.loose?i[T]:i[w];return e.replace(r,(function(t,r,i,s,o,a){n("xRange",e,t,r,i,s,o,a);var c=oe(i),l=c||oe(s),u=l||oe(o);return"="===r&&u&&(r=""),c?t=">"===r||"<"===r?"<0.0.0":"*":r&&u?(l&&(s=0),o=0,">"===r?(r=">=",l?(i=+i+1,s=0,o=0):(s=+s+1,o=0)):"<="===r&&(r="<",l?i=+i+1:s=+s+1),t=r+i+"."+s+"."+o):l?t=">="+i+".0.0 <"+(+i+1)+".0.0":u&&(t=">="+i+"."+s+".0 <"+i+"."+(+s+1)+".0"),n("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(i[G],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter((function(e){return!!e.match(s)}))),o=o.map((function(e){return new re(e,this.options)}),this)},se.prototype.intersects=function(e,t){if(!(e instanceof se))throw new TypeError("a Range is required");return this.set.some((function(n){return n.every((function(n){return e.set.some((function(e){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new se(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},se.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new K(e,this.options));for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!Y(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(n&&e.test(n))return n;return null},t.validRange=function(e,t){try{return new se(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return ue(e,t,"<",n)},t.gtr=function(e,t,n){return ue(e,t,">",n)},t.outside=ue,t.prerelease=function(e,t){var n=W(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new se(e,n),t=new se(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof K)return e;if("string"!=typeof e)return null;var t=e.match(i[R]);if(null==t)return null;return W(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}}));const path$e=require("path"),isWin$1="win32"===process.platform,isExecutableRegExp=/\.(?:com|exe)$/i,isCmdShimRegExp=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i,supportsShellOption=src$2(()=>semver$1.satisfies(process.version,"^4.8.0 || ^5.7.0 || >= 6.0.0",!0))||!1;function detectShebang(e){e.file=resolveCommand_1(e);const t=e.file&&readShebang_1(e.file);return t?(e.args.unshift(e.file),e.command=t,resolveCommand_1(e)):e.file}function parseNonShell(e){if(!isWin$1)return e;const t=detectShebang(e),n=!isExecutableRegExp.test(t);if(e.options.forceShell||n){const n=isCmdShimRegExp.test(t);e.command=path$e.normalize(e.command),e.command=_escape.command(e.command),e.args=e.args.map(e=>_escape.argument(e,n));const r=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${r}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function parseShell(e){if(supportsShellOption)return e;const t=[e.command].concat(e.args).join(" ");return isWin$1?(e.command="string"==typeof e.options.shell?e.options.shell:process.env.comspec||"cmd.exe",e.args=["/d","/s","/c",`"${t}"`],e.options.windowsVerbatimArguments=!0):("string"==typeof e.options.shell?e.command=e.options.shell:"android"===process.platform?e.command="/system/bin/sh":e.command="/bin/sh",e.args=["-c",t]),e}function parse$6(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null);const r={command:e,args:t=t?t.slice(0):[],options:n=Object.assign({},n),file:void 0,original:{command:e,args:t}};return n.shell?parseShell(r):parseNonShell(r)}var parse_1$1=parse$6;const isWin$2="win32"===process.platform;function notFoundError(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function hookChildProcess(e,t){if(!isWin$2)return;const n=e.emit;e.emit=function(r,i){if("exit"===r){const r=verifyENOENT(i,t);if(r)return n.call(e,"error",r)}return n.apply(e,arguments)}}function verifyENOENT(e,t){return isWin$2&&1===e&&!t.file?notFoundError(t.original,"spawn"):null}function verifyENOENTSync(e,t){return isWin$2&&1===e&&!t.file?notFoundError(t.original,"spawnSync"):null}var enoent={hookChildProcess,verifyENOENT,verifyENOENTSync,notFoundError};const cp=require("child_process");function spawn(e,t,n){const r=parse_1$1(e,t,n),i=cp.spawn(r.command,r.args,r.options);return enoent.hookChildProcess(i,r),i}function spawnSync(e,t,n){const r=parse_1$1(e,t,n),i=cp.spawnSync(r.command,r.args,r.options);return i.error=i.error||enoent.verifyENOENTSync(i.status,r),i}var crossSpawn=spawn,spawn_1=spawn,sync$5=spawnSync,_parse=parse_1$1,_enoent=enoent;crossSpawn.spawn=spawn_1,crossSpawn.sync=sync$5,crossSpawn._parse=_parse,crossSpawn._enoent=_enoent;const stdin=process.stdin,stderr=process.stderr;let read={hide:(e,t={})=>read.raw(e,!1,t),mask:(e,t={})=>read.raw(e,!0,t),raw:(e,t,n={})=>stdin.setRawMode&&"dumb"!==process.env.TERM?new Promise((function(r,i){const s=ansiEscapes;let o="";function a(){t?stderr.write(s.cursorHide+s.cursorLeft+e+o.replace(/./g,"*")+"\n"+s.cursorShow):stderr.write("\n"),stdin.removeListener("data",c),stdin.setRawMode(!1),stdin.pause()}stderr.write(s.eraseLine),stderr.write(s.cursorLeft),stderr.write(e),stdin.resume(),stdin.setRawMode(!0);let c=function(e){switch(e){case"":case"\r":case"\n":return void(n.required&&0===o.length||(a(),o=o.replace(/\r$/,""),o=o||n.default,r(o)));case"":return i(new Error("SIGINT")),void a();default:return 127===e.charCodeAt(0)?void(0!==o.length&&(o=o.substr(0,o.length-1),stderr.write(s.cursorBackward(1)),stderr.write(s.eraseEndLine))):function(e){o+=e,stderr.write(t?e:"*".repeat(e.length))}(e)}};stdin.on("data",c)})):read.notty(e),notty:e=>new Promise((t,n)=>{const r=crossSpawn;stderr.write(e);let i=r.sync("sh",["-c","read -s PASS && echo $PASS"],{stdio:["inherit","pipe","inherit"],encoding:"utf8"});if(stderr.write("\n"),i.error)return n(i.error);t(i.stdout.trim())})};function prompt(e,t={}){return t=Object.assign({method:"mask",required:void 0===t.default,default:""},t),stdin.setEncoding("utf8"),read[t.method](e,t).then(n=>n||(t.required?prompt(e):""))}var passwordPrompt=prompt,userInterface=createCommonjsModule$1((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=tslib_es6.__importDefault(passwordPrompt),r={getWindowsEncryptionPassword(){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){return yield n.default("devcert password (http://bit.ly/devcert-what-password?):")}))},warnChromeOnLinuxWithoutCertutil(){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){console.warn("\n WARNING: It looks like you have Chrome installed, but you specified\n 'skipCertutilInstall: true'. Unfortunately, without installing\n certutil, it's impossible get Chrome to trust devcert's certificates\n The certificates will work, but Chrome will continue to warn you that\n they are untrusted.\n ")}))},closeFirefoxBeforeContinuing(){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){console.log("Please close Firefox before continuing")}))},startFirefoxWizard(e){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){console.log(`\n devcert was unable to automatically configure Firefox. You'll need to\n complete this process manually. Don't worry though - Firefox will walk\n you through it.\n\n When you're ready, hit any key to continue. Firefox will launch and\n display a wizard to walk you through how to trust the devcert\n certificate. When you are finished, come back here and we'll finish up.\n\n (If Firefox doesn't start, go ahead and start it and navigate to\n ${e} in a new tab.)\n\n If you are curious about why all this is necessary, check out\n https://github.com/davewasmer/devcert#how-it-works\n\n \n `),yield utils$2.waitForUser()}))},firefoxWizardPromptPage(e){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){return`\n \n \n \n \n \n `}))},waitForFirefoxWizard(){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){console.log("\n Launching Firefox ...\n\n Great! Once you've finished the Firefox wizard for adding the devcert\n certificate, just hit any key here again and we'll wrap up.\n\n \n "),yield utils$2.waitForUser()}))}};t.default=r})),shared=createCommonjsModule$1((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=tslib_es6.__importDefault(require("path")),r=tslib_es6.__importDefault(require("url")),i=tslib_es6.__importDefault(src$1),s=tslib_es6.__importDefault(require("assert")),o=tslib_es6.__importDefault(getPort_1),a=tslib_es6.__importDefault(require("http")),c=require("fs"),l=tslib_es6.__importDefault(userInterface),u=require("child_process"),p=i.default("devcert:platforms:shared");function h(e,t){glob_1.sync(e).forEach(e=>{p(`checking to see if ${e} is a valid NSS database directory`),c.existsSync(n.default.join(e,"cert8.db"))&&(p(`Found legacy NSS database in ${e}, running callback...`),t(e,"legacy")),c.existsSync(n.default.join(e,"cert9.db"))&&(p(`Found modern NSS database in ${e}, running callback...`),t(e,"modern"))})}function d(){return s.default(constants$3.isMac||constants$3.isLinux,"checkForOpenFirefox was invoked on a platform other than Mac or Linux"),u.execSync("ps aux").indexOf("firefox")>-1}function f(e){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){return new Promise(t=>setTimeout(t,e))}))}t.addCertificateToNSSCertDB=function(e,t,n){p("trying to install certificate into NSS databases in "+e),h(e,(e,r)=>{const i="modern"===r?"sql:"+e:e;utils$2.run(`${n} -A -d "${i}" -t 'C,,' -i "${t}" -n devcert`)}),p("finished scanning & installing certificate in NSS databases in "+e)},t.removeCertificateFromNSSCertDB=function(e,t,n){p("trying to remove certificates from NSS databases in "+e),h(e,(e,r)=>{const i="modern"===r?"sql:"+e:e;try{utils$2.run(`${n} -A -d "${i}" -t 'C,,' -i "${t}" -n devcert`)}catch(n){p(`failed to remove ${t} from ${e}, continuing. ${n.toString()}`)}}),p("finished scanning & installing certificate in NSS databases in "+e)},t.closeFirefox=function(){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){if(d())for(yield l.default.closeFirefoxBeforeContinuing();d();)yield f(50)}))},t.openCertificateInFirefox=function(e,t){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){p("Adding devert to Firefox trust stores manually. Launching a webserver to host our certificate temporarily ...");let n=yield o.default(),i=a.default.createServer((e,i)=>tslib_es6.__awaiter(this,void 0,void 0,(function*(){let{pathname:s}=r.default.parse(e.url);"/certificate"===s?(i.writeHead(200,{"Content-type":"application/x-x509-ca-cert"}),i.write(c.readFileSync(t)),i.end()):(i.writeHead(200),i.write(yield l.default.firefoxWizardPromptPage(`http://localhost:${n}/certificate`)),i.end())}))).listen(n);p("Certificate server is up. Printing instructions for user and launching Firefox with hosted certificate URL"),yield l.default.startFirefoxWizard("http://localhost:"+n),utils$2.run(`${e} http://localhost:${n}`),yield l.default.waitForFirefoxWizard(),i.close()}))},t.assertNotTouchingFiles=function(e,t){if(!e.startsWith(constants$3.configDir)&&!e.startsWith(constants$3.getLegacyConfigDir()))throw new Error(`Devcert cannot ${t} ${e}; it is outside known devcert config directories!`)}})),darwin$1=createCommonjsModule$1((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=tslib_es6.__importDefault(require("path")),r=require("fs"),i=tslib_es6.__importDefault(src$1).default("devcert:platforms:macos"),s=()=>n.default.join(utils$2.run("brew --prefix nss").toString().trim(),"bin","certutil");t.default=class{constructor(){this.FIREFOX_BUNDLE_PATH="/Applications/Firefox.app",this.FIREFOX_BIN_PATH=n.default.join(this.FIREFOX_BUNDLE_PATH,"Contents/MacOS/firefox"),this.FIREFOX_NSS_DIR=n.default.join(process.env.HOME,"Library/Application Support/Firefox/Profiles/*"),this.HOST_FILE_PATH="/etc/hosts"}addToTrustStores(e,t={}){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){if(i("Adding devcert root CA to macOS system keychain"),utils$2.run(`sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain -p ssl -p basic "${e}"`),this.isFirefoxInstalled()){if(i("Firefox install detected. Adding devcert root CA to Firefox trust store"),!this.isNSSInstalled()){if(t.skipCertutilInstall)return i("certutil is not already installed, and skipCertutilInstall is true, so we have to fall back to a manual install"),yield shared.openCertificateInFirefox(this.FIREFOX_BIN_PATH,e);if(!commandExists$1.sync("brew"))return i("Homebrew isn't installed, so we can't try to install certutil. Falling back to manual certificate install"),yield shared.openCertificateInFirefox(this.FIREFOX_BIN_PATH,e);i("certutil is not already installed, but Homebrew is detected. Trying to install certutil via Homebrew..."),utils$2.run("brew install nss")}yield shared.closeFirefox(),yield shared.addCertificateToNSSCertDB(this.FIREFOX_NSS_DIR,e,s())}else i("Firefox does not appear to be installed, skipping Firefox-specific steps...")}))}removeFromTrustStores(e){i("Removing devcert root CA from macOS system keychain");try{utils$2.run(`sudo security remove-trusted-cert -d "${e}"`)}catch(t){i(`failed to remove ${e} from macOS cert store, continuing. ${t.toString()}`)}this.isFirefoxInstalled()&&this.isNSSInstalled()&&(i("Firefox install and certutil install detected. Trying to remove root CA from Firefox NSS databases"),shared.removeCertificateFromNSSCertDB(this.FIREFOX_NSS_DIR,e,s()))}addDomainToHostFileIfMissing(e){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){r.readFileSync(this.HOST_FILE_PATH,"utf8").includes(e)||utils$2.run(`echo '\n127.0.0.1 ${e}' | sudo tee -a "${this.HOST_FILE_PATH}" > /dev/null`)}))}deleteProtectedFiles(e){shared.assertNotTouchingFiles(e,"delete"),utils$2.run(`sudo rm -rf "${e}"`)}readProtectedFile(e){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){return shared.assertNotTouchingFiles(e,"read"),(yield utils$2.run(`sudo cat "${e}"`)).toString().trim()}))}writeProtectedFile(e,t){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){shared.assertNotTouchingFiles(e,"write"),r.existsSync(e)&&(yield utils$2.run(`sudo rm "${e}"`)),r.writeFileSync(e,t),yield utils$2.run(`sudo chown 0 "${e}"`),yield utils$2.run(`sudo chmod 600 "${e}"`)}))}isFirefoxInstalled(){return r.existsSync(this.FIREFOX_BUNDLE_PATH)}isNSSInstalled(){try{return utils$2.run("brew list -1").toString().includes("\nnss\n")}catch(e){return!1}}}})),linux$1=createCommonjsModule$1((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=tslib_es6.__importDefault(require("path")),r=require("fs"),i=tslib_es6.__importDefault(src$1),s=tslib_es6.__importDefault(userInterface),o=i.default("devcert:platforms:linux");t.default=class{constructor(){this.FIREFOX_NSS_DIR=n.default.join(process.env.HOME,".mozilla/firefox/*"),this.CHROME_NSS_DIR=n.default.join(process.env.HOME,".pki/nssdb"),this.FIREFOX_BIN_PATH="/usr/bin/firefox",this.CHROME_BIN_PATH="/usr/bin/google-chrome",this.HOST_FILE_PATH="/etc/hosts"}addToTrustStores(e,t={}){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){o("Adding devcert root CA to Linux system-wide trust stores"),utils$2.run(`sudo cp "${e}" /usr/local/share/ca-certificates/devcert.crt`),utils$2.run("sudo update-ca-certificates"),this.isFirefoxInstalled()?(o("Firefox install detected: adding devcert root CA to Firefox-specific trust stores ..."),commandExists$1.sync("certutil")||(t.skipCertutilInstall?(o("NSS tooling is not already installed, and `skipCertutil` is true, so falling back to manual certificate install for Firefox"),shared.openCertificateInFirefox(this.FIREFOX_BIN_PATH,e)):(o("NSS tooling is not already installed. Trying to install NSS tooling now with `apt install`"),utils$2.run("sudo apt install libnss3-tools"),o("Installing certificate into Firefox trust stores using NSS tooling"),yield shared.closeFirefox(),yield shared.addCertificateToNSSCertDB(this.FIREFOX_NSS_DIR,e,"certutil")))):o("Firefox does not appear to be installed, skipping Firefox-specific steps..."),this.isChromeInstalled()?(o("Chrome install detected: adding devcert root CA to Chrome trust store ..."),commandExists$1.sync("certutil")?(yield shared.closeFirefox(),yield shared.addCertificateToNSSCertDB(this.CHROME_NSS_DIR,e,"certutil")):s.default.warnChromeOnLinuxWithoutCertutil()):o("Chrome does not appear to be installed, skipping Chrome-specific steps...")}))}removeFromTrustStores(e){try{utils$2.run("sudo rm /usr/local/share/ca-certificates/devcert.crt"),utils$2.run("sudo update-ca-certificates")}catch(t){o(`failed to remove ${e} from /usr/local/share/ca-certificates, continuing. ${t.toString()}`)}commandExists$1.sync("certutil")&&(this.isFirefoxInstalled()&&shared.removeCertificateFromNSSCertDB(this.FIREFOX_NSS_DIR,e,"certutil"),this.isChromeInstalled()&&shared.removeCertificateFromNSSCertDB(this.CHROME_NSS_DIR,e,"certutil"))}addDomainToHostFileIfMissing(e){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){r.readFileSync(this.HOST_FILE_PATH,"utf8").includes(e)||utils$2.run(`echo '127.0.0.1 ${e}' | sudo tee -a "${this.HOST_FILE_PATH}" > /dev/null`)}))}deleteProtectedFiles(e){shared.assertNotTouchingFiles(e,"delete"),utils$2.run(`sudo rm -rf "${e}"`)}readProtectedFile(e){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){return shared.assertNotTouchingFiles(e,"read"),(yield utils$2.run(`sudo cat "${e}"`)).toString().trim()}))}writeProtectedFile(e,t){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){shared.assertNotTouchingFiles(e,"write"),r.existsSync(e)&&(yield utils$2.run(`sudo rm "${e}"`)),r.writeFileSync(e,t),yield utils$2.run(`sudo chown 0 "${e}"`),yield utils$2.run(`sudo chmod 600 "${e}"`)}))}isFirefoxInstalled(){return r.existsSync(this.FIREFOX_BIN_PATH)}isChromeInstalled(){return r.existsSync(this.CHROME_BIN_PATH)}}})),win32$2=createCommonjsModule$1((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=tslib_es6.__importDefault(src$1),r=tslib_es6.__importDefault(require("crypto")),i=require("fs"),s=tslib_es6.__importDefault(userInterface),o=n.default("devcert:platforms:windows");let a;t.default=class{constructor(){this.HOST_FILE_PATH="C:\\Windows\\System32\\Drivers\\etc\\hosts"}addToTrustStores(e,t={}){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){o("adding devcert root to Windows OS trust store");try{utils$2.run(`certutil -addstore -user root "${e}"`)}catch(e){e.output.map(e=>{e&&console.log(e.toString())})}o("adding devcert root to Firefox trust store");try{yield shared.openCertificateInFirefox("start firefox",e)}catch(e){o("Error opening Firefox, most likely Firefox is not installed")}}))}removeFromTrustStores(e){o("removing devcert root from Windows OS trust store");try{console.warn("Removing old certificates from trust stores. You may be prompted to grant permission for this. It's safe to delete old devcert certificates."),utils$2.run("certutil -delstore -user root devcert")}catch(t){o(`failed to remove ${e} from Windows OS trust store, continuing. ${t.toString()}`)}}addDomainToHostFileIfMissing(e){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){i.readFileSync(this.HOST_FILE_PATH,"utf8").includes(e)||(yield utils$2.sudo(`echo 127.0.0.1 ${e} >> ${this.HOST_FILE_PATH}`))}))}deleteProtectedFiles(e){shared.assertNotTouchingFiles(e,"delete"),rimraf_1.sync(e)}readProtectedFile(e){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){shared.assertNotTouchingFiles(e,"read"),a||(a=yield s.default.getWindowsEncryptionPassword());try{return this.decrypt(i.readFileSync(e,"utf8"),a)}catch(t){if(t.message.indexOf("bad decrypt")>=-1)return a=null,yield this.readProtectedFile(e);throw t}}))}writeProtectedFile(e,t){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){shared.assertNotTouchingFiles(e,"write"),a||(a=yield s.default.getWindowsEncryptionPassword());let n=this.encrypt(t,a);i.writeFileSync(e,n)}))}encrypt(e,t){let n=r.default.createCipher("aes256",new Buffer(t));return n.update(e,"utf8","hex")+n.final("hex")}decrypt(e,t){let n=r.default.createDecipher("aes256",new Buffer(t));return n.update(e,"hex","utf8")+n.final("utf8")}}})),platforms=createCommonjsModule$1((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n={darwin:darwin$1,linux:linux$1,shared,win32:win32$2}[process.platform].default;t.default=new n})),certificates=createCommonjsModule$1((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=tslib_es6.__importDefault(src$1),r=require("fs"),i=n.default("devcert:certificates");function s(e){i("generateKey: "+e),utils$2.openssl(`genrsa -out "${e}" 2048`),r.chmodSync(e,400)}t.default=function(e){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){mkdirp.sync(constants$3.pathForDomain(e)),i("Generating private key for "+e);let t=constants$3.pathForDomain(e,"private-key.key");s(t),i("Generating certificate signing request for "+e);let n=constants$3.pathForDomain(e,"certificate-signing-request.csr");constants$3.withDomainSigningRequestConfig(e,e=>{utils$2.openssl(`req -new -config "${e}" -key "${t}" -out "${n}"`)}),i(`Generating certificate for ${e} from signing request and signing with root CA`);let r=constants$3.pathForDomain(e,"certificate.crt");yield certificateAuthority.withCertificateAuthorityCredentials(({caKeyPath:t,caCertPath:i})=>{constants$3.withDomainCertificateConfig(e,e=>{utils$2.openssl(`ca -config "${e}" -in "${n}" -out "${r}" -keyfile "${t}" -cert "${i}" -days 825 -batch`)})})}))},t.generateKey=s})),certificateAuthority=createCommonjsModule$1((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=require("fs"),r=tslib_es6.__importDefault(src$1),i=tslib_es6.__importDefault(platforms),s=r.default("devcert:certificate-authority");function o(e={}){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){s("Uninstalling existing certificates, which will be void once any existing CA is gone"),c(),constants$3.ensureConfigDirs(),s("Making a temp working directory for files to copied in");let t=utils$2.mktmp();s("Generating the OpenSSL configuration needed to setup the certificate authority"),n.writeFileSync(constants$3.caVersionFile,"2"),n.writeFileSync(constants$3.opensslDatabaseFilePath,""),n.writeFileSync(constants$3.opensslSerialFilePath,"01"),s("Generating a private key"),certificates.generateKey(t),s("Generating a CA certificate"),utils$2.openssl(`req -new -x509 -config "${constants$3.caSelfSignConfig}" -key "${t}" -out "${constants$3.rootCACertPath}" -days 825`),s("Saving certificate authority credentials"),yield function(e){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){s("Saving devcert's certificate authority credentials");let t=n.readFileSync(e,"utf-8");yield i.default.writeProtectedFile(constants$3.rootCAKeyPath,t)}))}(t),s("Adding the root certificate authority to trust stores"),yield i.default.addToTrustStores(constants$3.rootCACertPath,e)}))}function a(){try{return utils$2.openssl(`x509 -in "${constants$3.rootCACertPath}" -noout`),""}catch(e){return e.toString()}}function c(){i.default.removeFromTrustStores(constants$3.rootCACertPath),i.default.deleteProtectedFiles(constants$3.domainsDir),i.default.deleteProtectedFiles(constants$3.rootCADir),i.default.deleteProtectedFiles(constants$3.getLegacyConfigDir())}t.default=o,t.withCertificateAuthorityCredentials=function(e){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){s("Retrieving devcert's certificate authority credentials");let t=utils$2.mktmp(),r=yield i.default.readProtectedFile(constants$3.rootCAKeyPath);n.writeFileSync(t,r),yield e({caKeyPath:t,caCertPath:constants$3.rootCACertPath}),n.unlinkSync(t)}))},t.ensureCACertReadable=function(e={}){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){if(!a())return;try{const e=yield i.default.readProtectedFile(constants$3.rootCACertPath);i.default.deleteProtectedFiles(constants$3.rootCACertPath),n.writeFileSync(constants$3.rootCACertPath,e)}catch(t){return o(e)}return a()?o(e):void 0}))},t.uninstall=c})),dist=createCommonjsModule$1((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=require("fs"),r=tslib_es6.__importDefault(src$1),i=tslib_es6.__importDefault(rimraf_1),s=tslib_es6.__importDefault(platforms),o=tslib_es6.__importStar(certificateAuthority);t.uninstall=o.uninstall;const a=tslib_es6.__importDefault(certificates),c=tslib_es6.__importDefault(userInterface),l=r.default("devcert");t.certificateFor=function(e,t={}){return tslib_es6.__awaiter(this,void 0,void 0,(function*(){if(l(`Certificate requested for ${e}. Skipping certutil install: ${Boolean(t.skipCertutilInstall)}. Skipping hosts file: ${Boolean(t.skipHostsFile)}`),t.ui&&Object.assign(c.default,t.ui),!constants$3.isMac&&!constants$3.isLinux&&!constants$3.isWindows)throw new Error(`Platform not supported: "${process.platform}"`);if(!commandExists$1.sync("openssl"))throw new Error("OpenSSL not found: OpenSSL is required to generate SSL certificates - make sure it is installed and available in your PATH");let r=constants$3.pathForDomain(e,"private-key.key"),i=constants$3.pathForDomain(e,"certificate.crt");n.existsSync(constants$3.rootCAKeyPath)?(t.getCaBuffer||t.getCaPath)&&(l("Root CA is not readable, but it probably is because an earlier version of devcert locked it. Trying to fix..."),yield o.ensureCACertReadable(t)):(l("Root CA is not installed yet, so it must be our first run. Installing root CA ..."),yield o.default(t)),n.existsSync(constants$3.pathForDomain(e,"certificate.crt"))||(l(`Can't find certificate file for ${e}, so it must be the first request for ${e}. Generating and caching ...`),yield a.default(e)),t.skipHostsFile||(yield s.default.addDomainToHostFileIfMissing(e)),l("Returning domain certificate");const u={key:n.readFileSync(r),cert:n.readFileSync(i)};return t.getCaBuffer&&(u.ca=n.readFileSync(constants$3.rootCACertPath)),t.getCaPath&&(u.caPath=constants$3.rootCACertPath),u}))},t.hasCertificateFor=function(e){return n.existsSync(constants$3.pathForDomain(e,"certificate.crt"))},t.configuredDomains=function(){return n.readdirSync(constants$3.domainsDir)},t.removeDomain=function(e){return i.default.sync(constants$3.pathForDomain(e))}})),devcert=unwrapExports(dist);async function createHttp2Server(e={}){const t=process.env.HOST||"localhost",{key:n,cert:r}=await devcert.certificateFor(t);return http2$1.createSecureServer({key:n,cert:r,allowHTTP1:!0,...e})}function every(e,t){for(var n=0,r=e.length;n1:0!==t.type&&(n||"").endsWith(t.end))}function match$1(e,t){for(var n,r,i=0,s=split(e),o=s.length,a=isMatch.bind(isMatch,s);io&&3===n[r-1].type)&&every(n,a))return n;return[]}function parse$7(e){if("/"===e)return[{old:e,type:0,val:e,end:""}];for(var t,n,r,i,s=strip(e),o=-1,a=0,c=s.length,l=[];++o1?e.substring(0,t):e}function mutate(e,t){t.url=t.url.substring(e.length)||"/",t.path=t.path.substring(e.length)||"/"}function onError(e,t,n,r){let i=n.statusCode=e.code||e.status||500;n.end(e.length&&e||e.message||http.STATUS_CODES[i])}class Polka extends trouter{constructor(e={}){super(e),this.apps={},this.wares=[],this.bwares={},this.parse=url,this.server=e.server,this.handler=this.handler.bind(this),this.onError=e.onError||onError,this.onNoMatch=e.onNoMatch||this.onError.bind(null,{code:404})}add(e,t,...n){let r=lead(value(t));if(void 0!==this.apps[r])throw new Error(`Cannot mount ".${e.toLowerCase()}('${lead(t)}')" because a Polka application at ".use('${r}')" already exists! You should move this handler into your Polka application instead.`);return super.add(e,t,...n)}use(e,...t){return"function"==typeof e?this.wares=this.wares.concat(e,t):"/"===e?this.wares=this.wares.concat(t):(e=lead(e),t.forEach(t=>{if(t instanceof Polka)this.apps[e]=t;else{let n=this.bwares[e]||[];n.length>0||n.push((t,n,r)=>(mutate(e,t),r())),this.bwares[e]=n.concat(t)}})),this}listen(){return(this.server=this.server||http.createServer()).on("request",this.handler),this.server.listen.apply(this.server,arguments),this}handler(e,t,n){n=n||this.parse(e);let r=[],i=this.wares,s=this.find(e.method,n.pathname);e.originalUrl=e.originalUrl||e.url;let o=value(e.path=n.pathname);void 0!==this.bwares[o]&&(i=i.concat(this.bwares[o])),s?(r=s.handlers,e.params=s.params):void 0!==this.apps[o]?(mutate(o,e),n.pathname=e.path,r.push(this.apps[o].handler.bind(null,e,t,n))):0===r.length&&r.push(this.onNoMatch),e.search=n.search,e.query=parse$9(n.query);let a=0,c=i.length,l=r.length;if(c===a&&1===l)return r[0](e,t);let u=n=>n?this.onError(n,e,t,u):p(),p=n=>t.finished||anew Polka(e);function list(e,t,n=""){e=path$n.resolve(".",e);let r,i,s=fs$n.readdirSync(e),o=0;for(;o1){if(t&&!e._decoded&&~n.indexOf("%",1)){let t=n;try{t=decodeURIComponent(n)}catch(e){}n=e.url=r.href=r.path=r.pathname=r._raw=t,e._decoded=!0}let i=n.indexOf("?",1);-1!==i&&(r.search=n.substring(i),r.query=r.search.substring(1),r.pathname=n.substring(0,i),t&&r.query.length>0&&(r.query=parse$a(r.query)))}return e._parsedUrl=r}function Mime(){this._types=Object.create(null),this._extensions=Object.create(null);for(var e=0;e{};function isMatch$1(e,t){for(let n=0;n=r.size||c>=r.size)return t.setHeader("Content-Range","bytes */"+r.size),t.statusCode=416,t.end();i["Content-Range"]=`bytes ${l}-${c}/${r.size}`,i["Content-Length"]=c-l+1,i["Accept-Ranges"]="bytes"}t.writeHead(o,i),fs$n.createReadStream(n,a).pipe(t)}function isEncoding(e,t,n){n["Content-Encoding"]=t,n["Content-Type"]=lite.getType(e.replace(/\.([^.]*)$/,""))||""}function toHeaders(e,t,n){let r={"Content-Length":t.size,"Content-Type":lite.getType(e)||"","Last-Modified":t.mtime.toUTCString()};return n&&(r.ETag=`W/"${t.size}-${t.mtime.getTime()}"`),/\.br$/.test(e)&&isEncoding(e,"brotli",r),/\.gz$/.test(e)&&isEncoding(e,"gzip",r),r}function sirv(e,t={}){e=path$n.resolve(e||".");let n=t.onNoMatch||is404,r=t.setHeaders||noop$6,i=t.extensions||["html","htm"],s=t.gzip&&i.map(e=>e+".gz").concat("gz"),o=t.brotli&&i.map(e=>e+".br").concat("br"),a="/",c=!!t.etag,l=!!t.single;if("string"==typeof t.single){let e=t.single.lastIndexOf(".");a+=~e?t.single.substring(0,e):t.single}let u=[];!1!==t.ignores&&(u.push(/\w\.\w+$/),t.dotfiles?u.push(/\/\.\w/):u.push(/\/\.well-known/),[].concat(t.ignores||[]).forEach(e=>{u.push(new RegExp(e,"i"))}));let p=null!=t.maxAge&&"public,max-age="+t.maxAge;p&&t.immutable&&(p+=",immutable"),t.dev||list(e,(e,n,r)=>{if(/\.well-known[\\+\/]/.test(e));else if(!t.dotfiles&&/(^\.|[\\+|\/+]\.)/.test(e))return;let i=toHeaders(e,r,c);p&&(i["Cache-Control"]=p),FILES["/"+e.normalize().replace(/\\+/g,"/")]={abs:n,stats:r,headers:i}});let h=t.dev?viaLocal.bind(0,e,c):viaCache;return function(e,t,p){let d=[""],f=e.headers["accept-encoding"]||"";s&&f.includes("gzip")&&d.unshift(...s),o&&/(br|brotli)/i.test(f)&&d.unshift(...o),d.push(...i);let m=e.path||parser(e,!0).pathname,g=h(m,d)||l&&!isMatch$1(m,u)&&h(a,d);return g?c&&e.headers["if-none-match"]===g.headers.ETag?(t.writeHead(304),t.end()):(r(t,m,g.stats),void send(e,t,g.abs,g.stats,g.headers)):p?p():n(e,t)}}function getChunkSize(e,t){return e?Buffer.isBuffer(e)?Buffer.byteLength(e,t):e.length:0}const noop$7=()=>{},MIMES=/text|javascript|xml/i;function compress({threshold:e=1024,level:t=-1,brotli:n=!1,gzip:r=!0,mimes:i=MIMES}={}){const s="object"==typeof n&&n||{},o="object"==typeof r&&r||{};return(a,c,l=noop$7)=>{const u=a.headers["accept-encoding"]+"",p=(n&&u.match(/\bbr\b/)||r&&u.match(/\bgzip\b/)||[])[0];if("HEAD"===a.method||!p)return l();let h,d,f=!1,m=0;function g(){f=!0,m=0|c.getHeader("Content-Length")||m;const n=i.test(c.getHeader("Content-Type")+""),r=!c.getHeader("Content-Encoding");if(n&&r&&m>=e){if(c.setHeader("Content-Encoding",p),c.removeHeader("Content-Length"),"br"===p){const e={[zlib$4.constants.BROTLI_PARAM_QUALITY]:t,[zlib$4.constants.BROTLI_PARAM_SIZE_HINT]:m};h=zlib$4.createBrotliCompress({params:Object.assign(e,s)})}else h=zlib$4.createGzip(Object.assign({level:t},o));h.on("data",e=>!1===E.call(c,e)&&h.pause()),y.call(c,"drain",()=>h.resume()),h.on("end",()=>_.call(c))}S.forEach(e=>y.apply(c,e)),d&&v.call(c,d)}const{end:_,write:E,on:y,writeHead:v}=c;c.writeHead=function(e,t,n){if("string"!=typeof t&&([n,t]=[t,n]),n)for(let e in n)c.setHeader(e,n[e]);return d=e,this},c.write=function(e,t){return m+=getChunkSize(e,t),f||g(),h?h.write(e,t):E.call(this,e,t)},c.end=function(e,t){return m+=getChunkSize(e,t),f||g(),h?h.end(e,t):_.call(this,e,t)};let S=[];c.on=function(e,t){return S?h?h.on(e,t):S.push([e,t]):y.call(this,e,t),this},l()}}var path$f=require("path"),commondir$1=function(e,t){if(t)var n=t.map((function(t){return path$f.resolve(e,t)}));else n=e;var r=n.slice(1).reduce((function(e,t){if(!t.match(/^([A-Za-z]:)?\/|\\/))throw new Error("relative path without a basedir");for(var n=t.split(/\/+|\\+/),r=0;e[r]===n[r]&&r1?r.join("/"):"/"},caller=function(){var e=Error.prepareStackTrace;Error.prepareStackTrace=function(e,t){return t};var t=(new Error).stack;return Error.prepareStackTrace=e,t[2].getFileName()},pathParse=createCommonjsModule$1((function(e){var t="win32"===process.platform,n=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,r=/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/,i={};i.parse=function(e){if("string"!=typeof e)throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var t,i,s,o,a,c=(t=e,i=n.exec(t),s=(i[1]||"")+(i[2]||""),o=i[3]||"",a=r.exec(o),[s,a[1],a[2],a[3]]);if(!c||4!==c.length)throw new TypeError("Invalid path '"+e+"'");return{root:c[0],dir:c[0]+c[1].slice(0,-1),base:c[2],ext:c[3],name:c[2].slice(0,c[2].length-c[3].length)}};var s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o={};o.parse=function(e){if("string"!=typeof e)throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var t,n=(t=e,s.exec(t).slice(1));if(!n||4!==n.length)throw new TypeError("Invalid path '"+e+"'");return n[1]=n[1]||"",n[2]=n[2]||"",n[3]=n[3]||"",{root:n[0],dir:n[0]+n[1].slice(0,-1),base:n[2],ext:n[3],name:n[2].slice(0,n[2].length-n[3].length)}},e.exports=t?i.parse:o.parse,e.exports.posix=o.parse,e.exports.win32=i.parse})),path$g=require("path"),parse$b=path$g.parse||pathParse,getNodeModulesDirs=function(e,t){var n="/";/^([A-Za-z]:)/.test(e)?n="":/^\\\\/.test(e)&&(n="\\\\");for(var r=[e],i=parse$b(e);i.dir!==r[r.length-1];)r.push(i.dir),i=parse$b(i.dir);return r.reduce((function(e,r){return e.concat(t.map((function(e){return path$g.resolve(n,r,e)})))}),[])},nodeModulesPaths=function(e,t,n){var r=t&&t.moduleDirectory?[].concat(t.moduleDirectory):["node_modules"];if(t&&"function"==typeof t.paths)return t.paths(n,e,(function(){return getNodeModulesDirs(e,r)}),t);var i=getNodeModulesDirs(e,r);return t&&t.paths?i.concat(t.paths):i},normalizeOptions$1=function(e,t){return t||{}},assert$3=!0,async_hooks=">= 8",buffer_ieee754="< 0.9.7",buffer=!0,child_process=!0,cluster=!0,console$1=!0,constants$4=!0,crypto$1=!0,_debug_agent=">= 1 && < 8",_debugger="< 8",dgram=!0,dns=!0,domain=!0,events=!0,freelist="< 6",fs$e=!0,_http_agent=">= 0.11.1",_http_client=">= 0.11.1",_http_common=">= 0.11.1",_http_incoming=">= 0.11.1",_http_outgoing=">= 0.11.1",_http_server=">= 0.11.1",http$1=!0,http2=">= 8.8",https=!0,inspector=">= 8.0.0",_linklist="< 8",module$1=!0,net$1=!0,os$2=!0,path$h=!0,perf_hooks=">= 8.5",process$1=">= 1",punycode=!0,querystring=!0,readline=!0,repl=!0,smalloc=">= 0.11.5 && < 3",_stream_duplex=">= 0.9.4",_stream_transform=">= 0.9.4",_stream_wrap=">= 1.4.1",_stream_passthrough=">= 0.9.4",_stream_readable=">= 0.9.4",_stream_writable=">= 0.9.4",stream=!0,string_decoder=!0,sys=!0,timers$1=!0,_tls_common=">= 0.11.13",_tls_legacy=">= 0.11.3 && < 10",_tls_wrap=">= 0.11.3",tls=!0,trace_events=">= 10",tty$1=!0,url$1=!0,util$4=!0,v8=">= 1",vm=!0,wasi=">= 13.4 && < 13.5",worker_threads=">= 11.7",zlib$1=!0,core$1={assert:assert$3,async_hooks,buffer_ieee754,buffer,child_process,cluster,console:console$1,constants:constants$4,crypto:crypto$1,_debug_agent,_debugger,dgram,dns,domain,events,freelist,fs:fs$e,"fs/promises":[">= 10 && < 10.1",">= 14"],_http_agent,_http_client,_http_common,_http_incoming,_http_outgoing,_http_server,http:http$1,http2,https,inspector,_linklist,module:module$1,net:net$1,"node-inspect/lib/_inspect":">= 7.6.0 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6.0 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6.0 && < 12",os:os$2,path:path$h,perf_hooks,process:process$1,punycode,querystring,readline,repl,smalloc,_stream_duplex,_stream_transform,_stream_wrap,_stream_passthrough,_stream_readable,_stream_writable,stream,string_decoder,sys,timers:timers$1,_tls_common,_tls_legacy,_tls_wrap,tls,trace_events,tty:tty$1,url:url$1,util:util$4,"v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/consarray":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/csvparser":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/logreader":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/profile_view":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/splaytree":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],v8,vm,wasi,worker_threads,zlib:zlib$1},core$2=Object.freeze({__proto__:null,assert:assert$3,async_hooks,buffer_ieee754,buffer,child_process,cluster,console:console$1,constants:constants$4,crypto:crypto$1,_debug_agent,_debugger,dgram,dns,domain,events,freelist,fs:fs$e,_http_agent,_http_client,_http_common,_http_incoming,_http_outgoing,_http_server,http:http$1,http2,https,inspector,_linklist,module:module$1,net:net$1,os:os$2,path:path$h,perf_hooks,process:process$1,punycode,querystring,readline,repl,smalloc,_stream_duplex,_stream_transform,_stream_wrap,_stream_passthrough,_stream_readable,_stream_writable,stream,string_decoder,sys,timers:timers$1,_tls_common,_tls_legacy,_tls_wrap,tls,trace_events,tty:tty$1,url:url$1,util:util$4,v8,vm,wasi,worker_threads,zlib:zlib$1,default:core$1}),data$2=getCjsExportFromNamespace$1(core$2),current=process.versions&&process.versions.node&&process.versions.node.split(".")||[];function specifierIncluded(e){for(var t=e.split(" "),n=t.length>1?t[0]:"=",r=(t.length>1?t[1]:t[0]).split("."),i=0;i<3;++i){var s=Number(current[i]||0),o=Number(r[i]||0);if(s!==o)return"<"===n?s="===n&&s>=o}return">="===n}function matchesRange(e){var t=e.split(/ ?&& ?/);if(0===t.length)return!1;for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,s=!0,o=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(o)throw i}}}}var peerDependencies={rollup:"^2.3.4"};const operators={"==":e=>equals(e.left,e.right,!1),"!=":e=>not(operators["=="](e)),"===":e=>equals(e.left,e.right,!0),"!==":e=>not(operators["==="](e)),"!":e=>isFalsy(e.argument),"&&":e=>isTruthy(e.left)&&isTruthy(e.right),"||":e=>isTruthy(e.left)||isTruthy(e.right)};function flatten(e){const t=[];for(;"MemberExpression"===e.type;){if(e.computed)return null;t.unshift(e.property.name),e=e.object}if("Identifier"!==e.type)return null;const n=e.name;return t.unshift(n),{name:n,keypath:t.join(".")}}function isTruthy(e){return"Literal"===e.type?!!e.value:"ParenthesizedExpression"===e.type?isTruthy(e.expression):e.operator in operators?operators[e.operator](e):void 0}function isFalsy(e){return not(isTruthy(e))}function not(e){return void 0===e?e:!e}function equals(e,t,n){if(e.type===t.type)return"Literal"===e.type?n?e.value===t.value:e.value==t.value:void 0}const PROXY_SUFFIX="?commonjs-proxy",getProxyId=e=>`\0${e}?commonjs-proxy`,getIdFromProxyId=e=>e.slice(1,-PROXY_SUFFIX.length),EXTERNAL_SUFFIX="?commonjs-external",getExternalProxyId=e=>`\0${e}?commonjs-external`,getIdFromExternalProxyId=e=>e.slice(1,-EXTERNAL_SUFFIX.length),VIRTUAL_PATH_BASE="/$$rollup_base$$",getVirtualPathForDynamicRequirePath=(e,t)=>e.startsWith(t)?VIRTUAL_PATH_BASE+e.slice(t.length):e,DYNAMIC_REGISTER_PREFIX="\0commonjs-dynamic-register:",DYNAMIC_JSON_PREFIX="\0commonjs-dynamic-json:",DYNAMIC_PACKAGES_ID="\0commonjs-dynamic-packages",HELPERS_ID="\0commonjsHelpers.js",HELPERS="\nexport var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\nexport function unwrapExports (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nexport function createCommonjsModule(fn, basedir, module) {\n\treturn module = {\n\t path: basedir,\n\t exports: {},\n\t require: function (path, base) {\n return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);\n }\n\t}, fn(module, module.exports), module.exports;\n}\n\nexport function getCjsExportFromNamespace (n) {\n\treturn n && n['default'] || n;\n}\n",HELPER_NON_DYNAMIC="\nexport function commonjsRequire () {\n\tthrow new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');\n}\n",HELPERS_DYNAMIC="\nexport function commonjsRegister (path, loader) {\n\tDYNAMIC_REQUIRE_LOADERS[path] = loader;\n}\n\nconst DYNAMIC_REQUIRE_LOADERS = Object.create(null);\nconst DYNAMIC_REQUIRE_CACHE = Object.create(null);\nconst DEFAULT_PARENT_MODULE = {\n\tid: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []\n};\nconst CHECKED_EXTENSIONS = ['', '.js', '.json'];\n\nfunction normalize (path) {\n\tpath = path.replace(/\\\\/g, '/');\n\tconst parts = path.split('/');\n\tconst slashed = parts[0] === '';\n\tfor (let i = 1; i < parts.length; i++) {\n\t\tif (parts[i] === '.' || parts[i] === '') {\n\t\t\tparts.splice(i--, 1);\n\t\t}\n\t}\n\tfor (let i = 1; i < parts.length; i++) {\n\t\tif (parts[i] !== '..') continue;\n\t\tif (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {\n\t\t\tparts.splice(--i, 2);\n\t\t\ti--;\n\t\t}\n\t}\n\tpath = parts.join('/');\n\tif (slashed && path[0] !== '/')\n\t path = '/' + path;\n\telse if (path.length === 0)\n\t path = '.';\n\treturn path;\n}\n\nfunction join () {\n\tif (arguments.length === 0)\n\t return '.';\n\tlet joined;\n\tfor (let i = 0; i < arguments.length; ++i) {\n\t let arg = arguments[i];\n\t if (arg.length > 0) {\n\t\tif (joined === undefined)\n\t\t joined = arg;\n\t\telse\n\t\t joined += '/' + arg;\n\t }\n\t}\n\tif (joined === undefined)\n\t return '.';\n\n\treturn joined;\n}\n\nfunction isPossibleNodeModulesPath (modulePath) {\n\tlet c0 = modulePath[0];\n\tif (c0 === '/' || c0 === '\\\\') return false;\n\tlet c1 = modulePath[1], c2 = modulePath[2];\n\tif ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||\n\t\t(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;\n\tif (c1 === ':' && (c2 === '/' || c2 === '\\\\'))\n\t\treturn false;\n\treturn true;\n}\n\nfunction dirname (path) {\n if (path.length === 0)\n return '.';\n\n let i = path.length - 1;\n while (i > 0) {\n const c = path.charCodeAt(i);\n if ((c === 47 || c === 92) && i !== path.length - 1)\n break;\n i--;\n }\n\n if (i > 0)\n return path.substr(0, i);\n\n if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)\n return path.charAt(0);\n\n return '.';\n}\n\nexport function commonjsRequire (path, originalModuleDir) {\n\tconst shouldTryNodeModules = isPossibleNodeModulesPath(path);\n\tpath = normalize(path);\n\tlet relPath;\n\twhile (true) {\n\t\tif (!shouldTryNodeModules) {\n\t\t\trelPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;\n\t\t} else if (originalModuleDir) {\n\t\t\trelPath = normalize(originalModuleDir + '/node_modules/' + path);\n\t\t} else {\n\t\t\trelPath = normalize(join('node_modules', path));\n\t\t}\n\t\tfor (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {\n\t\t\tconst resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];\n\t\t\tlet cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];\n\t\t\tif (cachedModule) return cachedModule.exports;\n\t\t\tconst loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];\n\t\t\tif (loader) {\n\t\t\t\tDYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {\n\t\t\t\t\tid: resolvedPath,\n\t\t\t\t\tfilename: resolvedPath,\n\t\t\t\t\tpath: dirname(resolvedPath),\n\t\t\t\t\texports: {},\n\t\t\t\t\tparent: DEFAULT_PARENT_MODULE,\n\t\t\t\t\tloaded: false,\n\t\t\t\t\tchildren: [],\n\t\t\t\t\tpaths: [],\n\t\t\t\t\trequire: function (path, base) {\n\t\t\t\t\t return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\ttry {\n\t\t\t\t\tloader.call(commonjsGlobal, cachedModule, cachedModule.exports);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tdelete DYNAMIC_REQUIRE_CACHE[resolvedPath];\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tcachedModule.loaded = true;\n\t\t\t\treturn cachedModule.exports;\n\t\t\t};\n\t\t}\n\t\tif (!shouldTryNodeModules) break;\n\t\tconst nextDir = normalize(originalModuleDir + '/..');\n\t\tif (nextDir === originalModuleDir) break;\n\t\toriginalModuleDir = nextDir;\n\t}\n\treturn require(path);\n}\n\ncommonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;\n";function getName(e){const t=makeLegalIdentifier(path$n.basename(e,path$n.extname(e)));if("index"!==t)return t;const n=path$n.dirname(e).split(path$n.sep);return makeLegalIdentifier(n[n.length-1])}const reserved="process location abstract arguments boolean break byte case catch char class const continue debugger default delete do double else enum eval export extends false final finally float for from function goto if implements import in instanceof int interface let long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with yield".split(" "),blacklist={__esModule:!0};reserved.forEach(e=>blacklist[e]=!0);const exportsPattern=/^(?:module\.)?exports(?:\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/,firstpassGlobal=/\b(?:require|module|exports|global)\b/,firstpassNoGlobal=/\b(?:require|module|exports)\b/,importExportDeclaration=/^(?:Import|Export(?:Named|Default))Declaration/,functionType=/^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;function deconflict(e,t,n){let r=1,i=makeLegalIdentifier(n);for(;e.contains(i)||t.has(i)||i in blacklist;)i=`${n}_${r}`,r+=1;return e.declarations[i]=!0,i}function tryParse$1(e,t,n){try{return e(t,{allowReturnOutsideFunction:!0})}catch(e){throw e.message+=" in "+n,e}}function normalizePathSlashes(e){return e.replace(/\\/g,"/")}function hasCjsKeywords(e,t){return(t?firstpassNoGlobal:firstpassGlobal).test(e)}function checkEsModule(e,t,n){const r=tryParse$1(e,t,n);let i=!1;var s,o=_createForOfIteratorHelper(r.body);try{for(o.s();!(s=o.n()).done;){const e=s.value;if("ExportDefaultDeclaration"===e.type)return{isEsModule:!0,hasDefaultExport:!0,ast:r};if("ExportNamedDeclaration"===e.type){i=!0;var a,c=_createForOfIteratorHelper(e.specifiers);try{for(c.s();!(a=c.n()).done;){if("default"===a.value.exported.name)return{isEsModule:!0,hasDefaultExport:!0,ast:r}}}catch(e){c.e(e)}finally{c.f()}}else importExportDeclaration.test(e.type)&&(i=!0)}}catch(e){o.e(e)}finally{o.f()}return{isEsModule:i,hasDefaultExport:!1,ast:r}}function getDefinePropertyCallName(e,t){if("CallExpression"!==e.type)return;const n=e.callee,r=n.object,i=n.property;if(!r||"Identifier"!==r.type||"Object"!==r.name)return;if(!i||"Identifier"!==i.type||"defineProperty"!==i.name)return;if(3!==e.arguments.length)return;const s=_slicedToArray(e.arguments,2),o=s[0],a=s[1];return"Identifier"===o.type&&o.name===t?a.value:void 0}function transformCommonjs(e,t,n,r,i,s,o,a,c,l,u,p,h){const d=h||tryParse$1(e,t,n),f=new MagicString$1(t),m={},g=[];let _=0,E=attachScopes(d,"scope");const y={module:!1,exports:!1,global:!1,require:!1};let v=0,S=0;const b=new Set,A=deconflict(E,b,"commonjsHelpers"),C={};let x=/__esModule/.test(t),$=!1;function w(e){return!!e&&("CallExpression"===e.type&&(0!==e.arguments.length&&T(e.callee)))}function T(e){return!!e&&("Identifier"===e.type&&"require"===e.name?!E.contains("require"):"MemberExpression"===e.type&&("Identifier"===e.object.type&&"module"===e.object.name&&(!E.contains("module")&&("Identifier"===e.property.type&&"require"===e.property.name))))}function R(e){return!!w(e)&&!function(e){return e.arguments.length>1||"Literal"!==e.arguments[0].type&&("TemplateLiteral"!==e.arguments[0].type||e.arguments[0].expressions.length>0)}(e)}function N(e){return a(e.arguments[0].value)}function D(e,t){let n=function(e){return"Literal"===e.arguments[0].type?e.arguments[0].value:e.arguments[0].quasis[0].value.cooked}(e);const r=n.startsWith(DYNAMIC_REGISTER_PREFIX);r&&(n=n.substr(DYNAMIC_REGISTER_PREFIX.length));if(void 0===m[n]){const e=k(n);if(!t)do{t="require$$"+_,_+=1}while(E.contains(t));r&&n.endsWith(".json")&&(n=DYNAMIC_JSON_PREFIX+n),(r||!e||n.endsWith(".json"))&&g.push([n,!r]),m[n]={source:n,name:t,importsDefault:!1,isDynamic:e}}return m[n]}function k(e){if(!/[/\\]/.test(e)){try{const t=normalizePathSlashes(resolve$1.sync(e,{basedir:path$n.dirname(n)}));if(u.has(t))return!0}catch(e){return!1}return!1}for(var t=0,r=["",".js",".json"];t{O.add(e)})}}),walk(d,{enter(e,t){if(c&&(f.addSourcemapLocation(e.start),f.addSourcemapLocation(e.end)),t&&("IfStatement"===t.type||"ConditionalExpression"===t.type)){if(e===t.consequent&&isFalsy(t.test))return void this.skip();if(e===t.alternate&&isTruthy(t.test))return void this.skip()}if(e._skip)return void this.skip();if(S+=1,e.scope&&(E=e.scope),functionType.test(e.type)&&(v+=1),"ReturnStatement"===e.type&&0===v&&(x=!0),"ThisExpression"===e.type&&0===v)return y.global=!0,void(o||(f.overwrite(e.start,e.end,A+".commonjsGlobal",{storeName:!0}),$=!0));if("UnaryExpression"===e.type&&"typeof"===e.operator){const t=flatten(e.argument);if(!t)return;if(E.contains(t.name))return;"module.exports"!==t.keypath&&"module"!==t.keypath&&"exports"!==t.keypath||f.overwrite(e.start,e.end,"'object'",{storeName:!1})}if("Identifier"===e.type){if(isReference$1(e,t)&&!E.contains(e.name)){if(e.name in y){if(T(e)){if(!l&&R(t))return;l&&w(t)&&f.appendLeft(t.end-1,","+JSON.stringify("."===path$n.dirname(n)?null:getVirtualPathForDynamicRequirePath(normalizePathSlashes(path$n.dirname(n)),p))),f.overwrite(e.start,e.end,A+".commonjsRequire",{storeName:!0}),$=!0}y[e.name]=!0,"global"!==e.name||o||(f.overwrite(e.start,e.end,A+".commonjsGlobal",{storeName:!0}),$=!0),"module"!==e.name&&"exports"!==e.name||(x=!0)}"define"===e.name&&f.overwrite(e.start,e.end,"undefined",{storeName:!0}),b.add(e.name)}return}if("AssignmentExpression"===e.type){if("MemberExpression"!==e.left.type)return;const t=flatten(e.left);if(!t)return;if(E.contains(t.name))return;const n=exportsPattern.exec(t.keypath);if(!n||"exports"===t.keypath)return;return y[t.name]=!0,S>3&&(x=!0),e.left._skip=!0,"module.exports"===t.keypath&&"ObjectExpression"===e.right.type?void e.right.properties.forEach(e=>{if(e.computed||!("key"in e)||"Identifier"!==e.key.type)return;const t=e.key.name;t===makeLegalIdentifier(t)&&(C[t]=!0)}):void(n[1]&&(C[n[1]]=!0))}const r=getDefinePropertyCallName(e,"exports");if(r&&r===makeLegalIdentifier(r)&&(C[r]=!0),"VariableDeclarator"===e.type&&"Identifier"===e.id.type&&R(e.init)&&!N(e.init)){if(E.parent)return;if(O.has(e.id.name))return;const t=D(e.init,e.id.name);t.importsDefault=!0,t.name!==e.id.name||t.isDynamic||(e._shouldRemove=!0)}if(!R(e)||N(e))return;const i=D(e);"ExpressionStatement"===t.type?f.remove(t.start,t.end):(i.importsDefault=!0,!function(e){return k(e.source)&&(e.source.startsWith(DYNAMIC_REGISTER_PREFIX)||!e.source.endsWith(".json"))}(i)?f.overwrite(e.start,e.end,i.name):(f.overwrite(e.start,e.end,`${A}.commonjsRequire(${JSON.stringify(getVirtualPathForDynamicRequirePath(normalizePathSlashes(i.source),p))}, ${JSON.stringify("."===path$n.dirname(n)?null:getVirtualPathForDynamicRequirePath(normalizePathSlashes(path$n.dirname(n)),p))})`),$=!0)),e.callee._skip=!0},leave(e){if(S-=1,e.scope&&(E=E.parent),functionType.test(e.type)&&(v-=1),"VariableDeclaration"===e.type){let t=!1,n=e.declarations[0].start;for(let r=0;r`import '${e}';`),g.filter(([,e])=>e).map(([e])=>{const t=m[e],n=t.name;return`import ${t.importsDefault?n+" from ":""}'${getProxyId(e)}';`})).join("\n")+"\n\n",P=[];let M="",F="";const L=deconflict(E,b,getName(n));if((!r||i)&&!s){const e={str:`export { ${L} as __moduleExports };`,name:"__moduleExports"};P.push(e)}const B=[];let V=!1;if(x){const e="module"+(y.exports?", exports":"");M=`var ${L} = ${A}.createCommonjsModule(function (${e}) {\n`,F="\n}",l&&(F+=", "+JSON.stringify(getVirtualPathForDynamicRequirePath(normalizePathSlashes(path$n.dirname(n)),p))),F+=");"}else{const e=[];var U,H=_createForOfIteratorHelper(d.body);try{for(H.s();!(U=H.n()).done;){const t=U.value;if("ExpressionStatement"===t.type&&"AssignmentExpression"===t.expression.type){const n=t.expression.left,r=flatten(n);if(!r)continue;const i=exportsPattern.exec(r.keypath);if(!i)continue;if("module.exports"===r.keypath)V=!0,f.overwrite(n.start,n.end,"var "+L);else{const r=_slicedToArray(i,2)[1],s=deconflict(E,b,r);e.push({name:r,deconflicted:s}),f.overwrite(t.start,n.end,"var "+s);const o=r===s?`export { ${r} };`:`export { ${s} as ${r} };`;"default"!==r&&P.push({str:o,name:r}),B.push(`${L}.${r} = ${s};`)}}}}catch(e){H.e(e)}finally{H.f()}V||!e.length&&(r&&!i||s)||(F=`\n\nvar ${L} = {\n${e.map(({name:e,deconflicted:t})=>`\t${e}: ${t}`).join(",\n")}\n};`)}const G=/__esModule/.test(t)?`export default /*@__PURE__*/${A}.unwrapExports(${L});`:`export default ${L};`,j=P.filter(e=>"default"!==e.name||!V).map(e=>e.str),W="\n\n"+(s?[]:[G]).concat(j).concat(V?B:[]).join("\n");f.trim().prepend(I+M).trim().append(F);const K=V||j.length>0||x||!r||i;K&&f.append(W);return{code:t=f.toString(),map:c?f.generateMap():null,syntheticNamedExports:K}}function getDynamicRequirePaths(e){const t=new Set;var n,r=_createForOfIteratorHelper(!e||Array.isArray(e)?e||[]:[e]);try{for(r.s();!(n=r.n()).done;){const e=n.value,r=e.startsWith("!"),o=Set.prototype[r?"delete":"add"].bind(t);var i,s=_createForOfIteratorHelper(glob_1.sync(r?e.substr(1):e));try{for(s.s();!(i=s.n()).done;){const e=i.value;o(normalizePathSlashes(path$n.resolve(e)))}}catch(e){s.e(e)}finally{s.f()}}}catch(e){r.e(e)}finally{r.f()}const o=Array.from(t.values()).filter(e=>{try{if(fs$n.statSync(e).isDirectory())return!0}catch(e){}return!1});return{dynamicRequireModuleSet:t,dynamicRequireModuleDirPaths:o}}const isCjsPromises=new Map;function getIsCjsPromise(e){let t=isCjsPromises.get(e);if(t)return t.promise;const n=new Promise(n=>{t={resolve:n,promise:void 0},isCjsPromises.set(e,t)});return t.promise=n,n}function setIsCjsPromise(e,t){const n=isCjsPromises.get(e);n?n.resolve&&(n.resolve(t),n.resolve=void 0):isCjsPromises.set(e,{promise:Promise.resolve(t),resolve:void 0})}function getCandidatesForExtension(e,t){return[e+t,`${e}${path$n.sep}index${t}`]}function getCandidates(e,t){return t.reduce((t,n)=>t.concat(getCandidatesForExtension(e,n)),[e])}function getResolveId(e){return function(t,n){const r=t.endsWith(PROXY_SUFFIX);if(r)t=getIdFromProxyId(t);else if(t.startsWith("\0"))return t===HELPERS_ID||t===DYNAMIC_PACKAGES_ID||t.startsWith(DYNAMIC_JSON_PREFIX)?t:null;return t.startsWith(DYNAMIC_JSON_PREFIX)?t:(n&&n.endsWith(PROXY_SUFFIX)&&(n=getIdFromProxyId(n)),this.resolve(t,n,{skipSelf:!0}).then(i=>(i||(i=function(t,n){if("."!==t[0]||!n)return;const r=getCandidates(path$n.resolve(path$n.dirname(n),t),e);for(let e=0;e0,c=a?commondir$1(null,Array.from(s).concat(process.cwd())):null,l=new Set,u=new Set,p="function"==typeof e.ignore?e.ignore:Array.isArray(e.ignore)?t=>e.ignore.includes(t):()=>!1,h=getResolveId(t),d=!1!==e.sourceMap;function f(t,n){const i=checkEsModule(this.parse,t,n),o=i.isEsModule,h=i.hasDefaultExport,f=i.ast,m=s.has(normalizePathSlashes(n));if(!o||m&&e.transformMixedEsModules){if(!hasCjsKeywords(t,r))return l.add(n),setIsCjsPromise(n,!1),null}else if((h?u:l).add(n),!e.transformMixedEsModules)return setIsCjsPromise(n,!1),null;const g=this.getModuleInfo(n),_=transformCommonjs(this.parse,t,n,g.isEntry,g.importers&&g.importers.length>0,o,r||o,p,d,a,s,c,f);return setIsCjsPromise(n,!o&&Boolean(_)),_||(o&&!m||l.add(n),null)}return{name:"commonjs",buildStart(){null!=e.namedExports&&this.warn('The namedExports option from "@rollup/plugin-commonjs" is deprecated. Named exports are now handled automatically.');const t=_slicedToArray(this.meta.rollupVersion.split(".").map(Number),2),n=t[0],r=t[1],i=peerDependencies.rollup.slice(2),s=_slicedToArray(i.split(".").map(Number),2),o=s[0],a=s[1];(ns.has(normalizePathSlashes(r))&&!r.endsWith(".json")?`import {commonjsRequire} from '${HELPERS_ID}'; const ${e} = commonjsRequire(${JSON.stringify(getVirtualPathForDynamicRequirePath(normalizePathSlashes(r),c))}); export default (${e} && ${e}['default']) || ${e}`:t?`import { __moduleExports } from ${JSON.stringify(r)}; export default __moduleExports;`:l.has(r)?`import * as ${e} from ${JSON.stringify(r)}; export default ${e};`:u.has(r)?`export {default} from ${JSON.stringify(r)};`:`import * as ${e} from ${JSON.stringify(r)}; import {getCjsExportFromNamespace} from "${HELPERS_ID}"; export default getCjsExportFromNamespace(${e})`)}if(a&&this.getModuleInfo(e).isEntry){let e;try{e=fs$n.readFileSync(r,{encoding:"utf8"})}catch(e){return this.warn(`Failed to read file ${r}, dynamic modules might not work correctly`),null}let t=Array.from(s).map(e=>`require(${JSON.stringify(DYNAMIC_REGISTER_PREFIX+e)});`).join("\n");return o.length&&(t+=`require(${JSON.stringify(DYNAMIC_REGISTER_PREFIX+DYNAMIC_PACKAGES_ID)});`),e=`${t}\n${e}`,e}return null},transform(e,r){if(!(r===DYNAMIC_PACKAGES_ID||r.startsWith(DYNAMIC_JSON_PREFIX)||n(r)&&-1!==t.indexOf(path$n.extname(r))))return setIsCjsPromise(r,null),null;let i;try{i=f.call(this,e,r)}catch(e){i=null,setIsCjsPromise(r,!1),this.error(e,e.loc)}return i}}}const Readable$1=Stream.Readable,BUFFER=Symbol("buffer"),TYPE=Symbol("type");class Blob{constructor(){this[TYPE]="";const e=arguments[0],t=arguments[1],n=[];let r=0;if(e){const t=e,i=Number(t.length);for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{},r=n.size;let i=void 0===r?0:r;var s=n.timeout;let o=void 0===s?0:s;null==e?e=null:isURLSearchParams(e)?e=Buffer.from(e.toString()):isBlob(e)||Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof Stream||(e=Buffer.from(String(e)))),this[INTERNALS]={body:e,disturbed:!1,error:null},this.size=i,this.timeout=o,e instanceof Stream&&e.on("error",(function(e){const n="AbortError"===e.name?e:new FetchError(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[INTERNALS].error=n}))}function consumeBody(){var e=this;if(this[INTERNALS].disturbed)return Body.Promise.reject(new TypeError("body used already for: "+this.url));if(this[INTERNALS].disturbed=!0,this[INTERNALS].error)return Body.Promise.reject(this[INTERNALS].error);let t=this.body;if(null===t)return Body.Promise.resolve(Buffer.alloc(0));if(isBlob(t)&&(t=t.stream()),Buffer.isBuffer(t))return Body.Promise.resolve(t);if(!(t instanceof Stream))return Body.Promise.resolve(Buffer.alloc(0));let n=[],r=0,i=!1;return new Body.Promise((function(s,o){let a;e.timeout&&(a=setTimeout((function(){i=!0,o(new FetchError(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)),t.on("error",(function(t){"AbortError"===t.name?(i=!0,o(t)):o(new FetchError(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))})),t.on("data",(function(t){if(!i&&null!==t){if(e.size&&r+t.length>e.size)return i=!0,void o(new FetchError(`content size at ${e.url} over limit: ${e.size}`,"max-size"));r+=t.length,n.push(t)}})),t.on("end",(function(){if(!i){clearTimeout(a);try{s(Buffer.concat(n,r))}catch(t){o(new FetchError(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}}))}))}function convertBody(e,t){if("function"!=typeof convert)throw new Error("The package `encoding` must be installed to use the textConverted() function");const n=t.get("content-type");let r,i,s="utf-8";return n&&(r=/charset=([^;]*)/i.exec(n)),i=e.slice(0,1024).toString(),!r&&i&&(r=/0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[MAP]=Object.create(null),e instanceof Headers){const t=e.raw(),n=Object.keys(t);for(const e of n)for(const n of t[e])this.append(e,n)}else if(null==e);else{if("object"!=typeof e)throw new TypeError("Provided initializer must be an object");{const t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw new TypeError("Header pairs must be iterable");const n=[];for(const t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Each header pair must be iterable");n.push(Array.from(t))}for(const e of n){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const t of Object.keys(e)){const n=e[t];this.append(t,n)}}}}get(e){validateName(e=""+e);const t=find(this[MAP],e);return void 0===t?null:this[MAP][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=getHeaders(this),r=0;for(;r1&&void 0!==arguments[1]?arguments[1]:"key+value";const n=Object.keys(e[MAP]).sort();return n.map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[MAP][t].join(", ")}:function(t){return[t.toLowerCase(),e[MAP][t].join(", ")]})}Headers.prototype.entries=Headers.prototype[Symbol.iterator],Object.defineProperty(Headers.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(Headers.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const INTERNAL=Symbol("internal");function createHeadersIterator(e,t){const n=Object.create(HeadersIteratorPrototype);return n[INTERNAL]={target:e,kind:t,index:0},n}const HeadersIteratorPrototype=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==HeadersIteratorPrototype)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[INTERNAL];const t=e.target,n=e.kind,r=e.index,i=getHeaders(t,n);return r>=i.length?{value:void 0,done:!0}:(this[INTERNAL].index=r+1,{value:i[r],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function exportNodeCompatibleHeaders(e){const t=Object.assign({__proto__:null},e[MAP]),n=find(e[MAP],"Host");return void 0!==n&&(t[n]=t[n][0]),t}function createHeadersLenient(e){const t=new Headers;for(const n of Object.keys(e))if(!invalidTokenRegex.test(n))if(Array.isArray(e[n]))for(const r of e[n])invalidHeaderCharRegex.test(r)||(void 0===t[MAP][n]?t[MAP][n]=[r]:t[MAP][n].push(r));else invalidHeaderCharRegex.test(e[n])||(t[MAP][n]=[e[n]]);return t}Object.defineProperty(HeadersIteratorPrototype,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const INTERNALS$1=Symbol("Response internals"),STATUS_CODES=http$3__default.STATUS_CODES;class Response{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Body.call(this,e,t);const n=t.status||200,r=new Headers(t.headers);if(null!=e&&!r.has("Content-Type")){const t=extractContentType(e);t&&r.append("Content-Type",t)}this[INTERNALS$1]={url:t.url,status:n,statusText:t.statusText||STATUS_CODES[n],headers:r,counter:t.counter}}get url(){return this[INTERNALS$1].url||""}get status(){return this[INTERNALS$1].status}get ok(){return this[INTERNALS$1].status>=200&&this[INTERNALS$1].status<300}get redirected(){return this[INTERNALS$1].counter>0}get statusText(){return this[INTERNALS$1].statusText}get headers(){return this[INTERNALS$1].headers}clone(){return new Response(clone(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}Body.mixIn(Response.prototype),Object.defineProperties(Response.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(Response.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const INTERNALS$2=Symbol("Request internals"),parse_url=Url.parse,format_url=Url.format,streamDestructionSupported="destroy"in Stream.Readable.prototype;function isRequest$2(e){return"object"==typeof e&&"object"==typeof e[INTERNALS$2]}function isAbortSignal(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}class Request{constructor(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};isRequest$2(e)?t=parse_url(e.url):(t=e&&e.href?parse_url(e.href):parse_url(""+e),e={});let r=n.method||e.method||"GET";if(r=r.toUpperCase(),(null!=n.body||isRequest$2(e)&&null!==e.body)&&("GET"===r||"HEAD"===r))throw new TypeError("Request with GET/HEAD method cannot have body");let i=null!=n.body?n.body:isRequest$2(e)&&null!==e.body?clone(e):null;Body.call(this,i,{timeout:n.timeout||e.timeout||0,size:n.size||e.size||0});const s=new Headers(n.headers||e.headers||{});if(null!=i&&!s.has("Content-Type")){const e=extractContentType(i);e&&s.append("Content-Type",e)}let o=isRequest$2(e)?e.signal:null;if("signal"in n&&(o=n.signal),null!=o&&!isAbortSignal(o))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[INTERNALS$2]={method:r,redirect:n.redirect||e.redirect||"follow",headers:s,parsedURL:t,signal:o},this.follow=void 0!==n.follow?n.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==n.compress?n.compress:void 0===e.compress||e.compress,this.counter=n.counter||e.counter||0,this.agent=n.agent||e.agent}get method(){return this[INTERNALS$2].method}get url(){return format_url(this[INTERNALS$2].parsedURL)}get headers(){return this[INTERNALS$2].headers}get redirect(){return this[INTERNALS$2].redirect}get signal(){return this[INTERNALS$2].signal}clone(){return new Request(this)}}function getNodeRequestOptions(e){const t=e[INTERNALS$2].parsedURL,n=new Headers(e[INTERNALS$2].headers);if(n.has("Accept")||n.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof Stream.Readable&&!streamDestructionSupported)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let r=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(r="0"),null!=e.body){const t=getTotalBytes(e);"number"==typeof t&&(r=String(t))}r&&n.set("Content-Length",r),n.has("User-Agent")||n.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!n.has("Accept-Encoding")&&n.set("Accept-Encoding","gzip,deflate");let i=e.agent;return"function"==typeof i&&(i=i(t)),n.has("Connection")||i||n.set("Connection","close"),Object.assign({},t,{method:e.method,headers:exportNodeCompatibleHeaders(n),agent:i})}function AbortError(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}Body.mixIn(Request.prototype),Object.defineProperty(Request.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(Request.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),AbortError.prototype=Object.create(Error.prototype),AbortError.prototype.constructor=AbortError,AbortError.prototype.name="AbortError";const PassThrough$1$1=Stream.PassThrough,resolve_url=Url.resolve;function fetch(e,t){if(!fetch.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return Body.Promise=fetch.Promise,new fetch.Promise((function(n,r){const i=new Request(e,t),s=getNodeRequestOptions(i),o=("https:"===s.protocol?https$2__default:http$3__default).request,a=i.signal;let c=null;const l=function(){let e=new AbortError("The user aborted a request.");r(e),i.body&&i.body instanceof Stream.Readable&&i.body.destroy(e),c&&c.body&&c.body.emit("error",e)};if(a&&a.aborted)return void l();const u=function(){l(),d()},p=o(s);let h;function d(){p.abort(),a&&a.removeEventListener("abort",u),clearTimeout(h)}a&&a.addEventListener("abort",u),i.timeout&&p.once("socket",(function(e){h=setTimeout((function(){r(new FetchError("network timeout at: "+i.url,"request-timeout")),d()}),i.timeout)})),p.on("error",(function(e){r(new FetchError(`request to ${i.url} failed, reason: ${e.message}`,"system",e)),d()})),p.on("response",(function(e){clearTimeout(h);const t=createHeadersLenient(e.headers);if(fetch.isRedirect(e.statusCode)){const s=t.get("Location"),o=null===s?null:resolve_url(i.url,s);switch(i.redirect){case"error":return r(new FetchError("redirect mode is set to error: "+i.url,"no-redirect")),void d();case"manual":if(null!==o)try{t.set("Location",o)}catch(e){r(e)}break;case"follow":if(null===o)break;if(i.counter>=i.follow)return r(new FetchError("maximum redirect reached at: "+i.url,"max-redirect")),void d();const s={headers:new Headers(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:i.body,signal:i.signal,timeout:i.timeout};return 303!==e.statusCode&&i.body&&null===getTotalBytes(i)?(r(new FetchError("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void d()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==i.method)||(s.method="GET",s.body=void 0,s.headers.delete("content-length")),n(fetch(new Request(o,s))),void d())}}e.once("end",(function(){a&&a.removeEventListener("abort",u)}));let s=e.pipe(new PassThrough$1$1);const o={url:i.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:i.size,timeout:i.timeout,counter:i.counter},l=t.get("Content-Encoding");if(!i.compress||"HEAD"===i.method||null===l||204===e.statusCode||304===e.statusCode)return c=new Response(s,o),void n(c);const p={flush:zlib$4.Z_SYNC_FLUSH,finishFlush:zlib$4.Z_SYNC_FLUSH};if("gzip"==l||"x-gzip"==l)return s=s.pipe(zlib$4.createGunzip(p)),c=new Response(s,o),void n(c);if("deflate"!=l&&"x-deflate"!=l){if("br"==l&&"function"==typeof zlib$4.createBrotliDecompress)return s=s.pipe(zlib$4.createBrotliDecompress()),c=new Response(s,o),void n(c);c=new Response(s,o),n(c)}else{e.pipe(new PassThrough$1$1).once("data",(function(e){s=8==(15&e[0])?s.pipe(zlib$4.createInflate()):s.pipe(zlib$4.createInflateRaw()),c=new Response(s,o),n(c)}))}})),writeToStream(p,i)}))}function callbacksFor(e){var t=e._promiseCallbacks;return t||(t=e._promiseCallbacks={}),t}fetch.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},fetch.Promise=global.Promise;var EventTarget={mixin:function(e){return e.on=this.on,e.off=this.off,e.trigger=this.trigger,e._promiseCallbacks=void 0,e},on:function(e,t){if("function"!=typeof t)throw new TypeError("Callback must be a function");var n=callbacksFor(this),r=n[e];r||(r=n[e]=[]),-1===r.indexOf(t)&&r.push(t)},off:function(e,t){var n=callbacksFor(this);if(t){var r=n[e],i=r.indexOf(t);-1!==i&&r.splice(i,1)}else n[e]=[]},trigger:function(e,t,n){var r=callbacksFor(this)[e];if(r)for(var i=0;i2&&void 0!==arguments[2])||arguments[2],i=arguments[3];return _possibleConstructorReturn$1(this,e.call(this,t,n,r,i))}return _inherits$1(t,e),t.prototype._init=function(e,t){this._result={},this._enumerate(t)},t.prototype._enumerate=function(e){var t=Object.keys(e),n=t.length,r=this.promise;this._remaining=n;for(var i=void 0,s=void 0,o=0;r._state===PENDING&&o{if(["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(t=>{e[t]=e[t]||fs$h[t],e[t+="Sync"]=e[t]||fs$h[t]}),e.maxBusyTries=e.maxBusyTries||3,e.emfileWait=e.emfileWait||1e3,!1===e.glob&&(e.disableGlob=!0),!0!==e.disableGlob&&void 0===glob$2)throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");e.disableGlob=e.disableGlob||!1,e.glob=e.glob||defaultGlobOpts$1},rimraf$1=(e,t,n)=>{"function"==typeof t&&(n=t,t={}),assert$4(e,"rimraf: missing path"),assert$4.equal(typeof e,"string","rimraf: path should be a string"),assert$4.equal(typeof n,"function","rimraf: callback function required"),assert$4(t,"rimraf: invalid options argument provided"),assert$4.equal(typeof t,"object","rimraf: options should be object"),defaults$1(t);let r=0,i=null,s=0;const o=(e,o)=>e?n(e):(s=o.length,0===s?n():void o.forEach(e=>{const o=a=>{if(a){if(("EBUSY"===a.code||"ENOTEMPTY"===a.code||"EPERM"===a.code)&&rrimraf_$1(e,t,o),100*r);if("EMFILE"===a.code&&timeout$1rimraf_$1(e,t,o),timeout$1++);"ENOENT"===a.code&&(a=null)}timeout$1=0,(e=>{i=i||e,0==--s&&n(i)})(a)};rimraf_$1(e,t,o)}));if(t.disableGlob||!glob$2.hasMagic(e))return o(null,[e]);t.lstat(e,(n,r)=>{if(!n)return o(null,[e]);glob$2(e,t.glob,o)})},rimraf_$1=(e,t,n)=>{assert$4(e),assert$4(t),assert$4("function"==typeof n),t.lstat(e,(r,i)=>r&&"ENOENT"===r.code?n(null):(r&&"EPERM"===r.code&&isWindows$4&&fixWinEPERM$1(e,t,r,n),i&&i.isDirectory()?rmdir$1(e,t,r,n):void t.unlink(e,r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return isWindows$4?fixWinEPERM$1(e,t,r,n):rmdir$1(e,t,r,n);if("EISDIR"===r.code)return rmdir$1(e,t,r,n)}return n(r)})))},fixWinEPERM$1=(e,t,n,r)=>{assert$4(e),assert$4(t),assert$4("function"==typeof r),t.chmod(e,438,i=>{i?r("ENOENT"===i.code?null:n):t.stat(e,(i,s)=>{i?r("ENOENT"===i.code?null:n):s.isDirectory()?rmdir$1(e,t,n,r):t.unlink(e,r)})})},fixWinEPERMSync$1=(e,t,n)=>{assert$4(e),assert$4(t);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}let r;try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?rmdirSync$1(e,t,n):t.unlinkSync(e)},rmdir$1=(e,t,n,r)=>{assert$4(e),assert$4(t),assert$4("function"==typeof r),t.rmdir(e,i=>{!i||"ENOTEMPTY"!==i.code&&"EEXIST"!==i.code&&"EPERM"!==i.code?i&&"ENOTDIR"===i.code?r(n):r(i):rmkids$1(e,t,r)})},rmkids$1=(e,t,n)=>{assert$4(e),assert$4(t),assert$4("function"==typeof n),t.readdir(e,(r,i)=>{if(r)return n(r);let s,o=i.length;if(0===o)return t.rmdir(e,n);i.forEach(r=>{rimraf$1(path$k.join(e,r),t,r=>{if(!s)return r?n(s=r):void(0==--o&&t.rmdir(e,n))})})})},rimrafSync$1=(e,t)=>{let n;if(defaults$1(t=t||{}),assert$4(e,"rimraf: missing path"),assert$4.equal(typeof e,"string","rimraf: path should be a string"),assert$4(t,"rimraf: missing options"),assert$4.equal(typeof t,"object","rimraf: options should be object"),t.disableGlob||!glob$2.hasMagic(e))n=[e];else try{t.lstatSync(e),n=[e]}catch(r){n=glob$2.sync(e,t.glob)}if(n.length)for(let e=0;e{assert$4(e),assert$4(t);try{t.rmdirSync(e)}catch(r){if("ENOENT"===r.code)return;if("ENOTDIR"===r.code)throw n;"ENOTEMPTY"!==r.code&&"EEXIST"!==r.code&&"EPERM"!==r.code||rmkidsSync$1(e,t)}},rmkidsSync$1=(e,t)=>{assert$4(e),assert$4(t),t.readdirSync(e).forEach(n=>rimrafSync$1(path$k.join(e,n),t));const n=isWindows$4?100:1;let r=0;for(;;){let i=!0;try{const s=t.rmdirSync(e,t);return i=!1,s}finally{if(++r{if("%%"===r)return r;a++;const s=n.formatters[i];if("function"==typeof s){const n=e[a];r=s.call(t,n),e.splice(a,1),a--}return r}),n.formatArgs.call(t,e);(t.log||n.log).apply(t,e)}return o.namespace=e,o.enabled=n.enabled(e),o.useColors=n.useColors(),o.color=t(e),o.destroy=r,o.extend=i,"function"==typeof n.init&&n.init(o),n.instances.push(o),o}function r(){const e=n.instances.indexOf(this);return-1!==e&&(n.instances.splice(e,1),!0)}function i(e,t){const r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names.map(s),...n.skips.map(s).map(e=>"-"+e)].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.names=[],n.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),i=r.length;for(t=0;t{n[t]=e[t]}),n.instances=[],n.names=[],n.skips=[],n.formatters={},n.selectColor=t,n.enable(n.load()),n}rimraf$1.sync=rimrafSync$1;var common$2=setup$1,browser$1=createCommonjsModule$1((function(e,t){t.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))}),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=common$2(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}})),node$1=createCommonjsModule$1((function(e,t){const n=require("tty"),r=require("util");t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e},{}),e.exports=common$2(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).replace(/\s*\n\s*/g," ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}})),src$3=createCommonjsModule$1((function(e){"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=browser$1:e.exports=node$1})),rsvp$1=createCommonjsModule$1((function(e){(function(){function t(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=Date.now||function(){return(new Date).getTime()};function i(){}var s=Object.create||function(e){if(arguments.length>1)throw new Error("Second argument not supported");if("object"!=typeof e)throw new TypeError("Argument must be an object");return i.prototype=e,new i};function o(e,t){for(var n=0,r=e.length;n0)return;if(this.running<0)throw new Error("Called stop more times than start was called");let e=process.hrtime(this.startTime);this.time+=1e9*e[0]+e[1],this.startTime=void 0}toJSON(){return{count:this.count,time:this.time}}},usernameSync=createCommonjsModule$1((function(e){var t=require("os");require("child_process").execSync;function n(e){if(null===e||"object"!=typeof e||"ENOENT"!==e.code)throw e}e.exports=function(){return e.exports.os()||e.exports.env()||e.exports.execSync()},e.exports.env=function(){var e=process.env;return e.SUDO_USER||e.C9_USER||e.LOGNAME||e.USER||e.LNAME||e.USERNAME},e.exports.os=function(){try{if("function"==typeof t.userInfo)return t.userInfo().username}catch(e){return void n(e)}},e.exports.execSync=function(){try{var e=require("child_process").execSync("whoami").toString().trim();return e?"win32"===process.platform?e.replace(/^.*\\/,""):e:require("child_process").execSync("id",["-un"]).toString().trim()}catch(e){return void n(e)}}})),index$1=["Makefile","Rakefile","ada","adb","ads","applescript","as","ascx","asm","asmx","asp","aspx","atom","bas","bash","bashrc","bat","bbcolors","bdsgroup","bdsproj","bib","bowerrc","c","cbl","cc","cfc","cfg","cfm","cfml","cgi","clj","cls","cmake","cmd","cnf","cob","coffee","coffeekup","conf","cpp","cpt","cpy","crt","cs","csh","cson","csr","css","csslintrc","csv","ctl","curlrc","cxx","dart","dfm","diff","dof","dpk","dproj","dtd","eco","editorconfig","ejs","el","emacs","eml","ent","erb","erl","eslintignore","eslintrc","ex","exs","f","f03","f77","f90","f95","fish","for","fpp","frm","ftn","gemrc","gitattributes","gitconfig","gitignore","gitkeep","gitmodules","go","gpp","gradle","groovy","groupproj","grunit","gtmpl","gvimrc","h","haml","hbs","hgignore","hh","hpp","hrl","hs","hta","htaccess","htc","htm","html","htpasswd","hxx","iced","inc","ini","ino","int","irbrc","itcl","itermcolors","itk","jade","java","jhtm","jhtml","js","jscsrc","jshintignore","jshintrc","json","json5","jsonld","jsp","jspx","jsx","ksh","less","lhs","lisp","log","ls","lsp","lua","m","mak","map","markdown","master","md","mdown","mdwn","mdx","metadata","mht","mhtml","mjs","mk","mkd","mkdn","mkdown","ml","mli","mm","mxml","nfm","nfo","njk","noon","npmignore","npmrc","nvmrc","ops","pas","pasm","patch","pbxproj","pch","pem","pg","php","php3","php4","php5","phpt","phtml","pir","pl","pm","pmc","pod","pot","properties","props","pt","pug","py","r","rake","rb","rdoc","rdoc_options","resx","rhtml","rjs","rlib","ron","rs","rss","rst","rtf","rvmrc","rxml","s","sass","scala","scm","scss","seestyle","sh","shtml","sls","spec","sql","sqlite","ss","sss","st","strings","sty","styl","stylus","sub","sublime-build","sublime-commands","sublime-completions","sublime-keymap","sublime-macro","sublime-menu","sublime-project","sublime-settings","sublime-workspace","sv","svc","svg","t","tcl","tcsh","terminal","tex","text","textile","tg","tmLanguage","tmTheme","tmpl","tpl","ts","tsv","tsx","tt","tt2","ttml","txt","v","vb","vbs","vh","vhd","vhdl","vim","viminfo","vimrc","vue","webapp","wxml","wxss","x-php","xht","xhtml","xml","xs","xsd","xsl","xslt","yaml","yml","zsh","zshrc"],source=Object.freeze({__proto__:null,default:index$1}),index$2=["dds","eot","gif","ico","jar","jpeg","jpg","pdf","png","swf","tga","ttf","zip"],source$1=Object.freeze({__proto__:null,default:index$2}),textExtensions=getCjsExportFromNamespace$1(source),binaryExtensions=getCjsExportFromNamespace$1(source$1),pathUtil=require("path");function isTextSync(e,t){if(e){var n=pathUtil.basename(e).split(".").reverse(),r=!0,i=!1,s=void 0;try{for(var o,a=n[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var c=o.value;if(-1!==textExtensions.indexOf(c))return!0;if(-1!==binaryExtensions.indexOf(c))return!1}}catch(e){i=!0,s=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw s}}}return t?"utf8"===getEncodingSync(t):null}function isTextCallback(e,t,n){var r;try{r=isTextSync(e,t)}catch(e){n(e)}n(null,r)}function isTextPromise(e,t){try{return Promise.resolve(isTextSync(e,t))}catch(e){return Promise.reject(e)}}function isText(e,t,n){return n?isTextCallback(e,t,n):isTextSync(e,t)}function isBinarySync(e,t){var n=isTextSync(e,t);return null==n?null:!n}function isBinaryCallback(e,t,n){var r;try{r=isBinarySync(e,t)}catch(e){n(e)}n(null,r)}function isBinaryPromise(e,t){try{return Promise.resolve(isBinarySync(e,t))}catch(e){return Promise.reject(e)}}function isBinary(e,t,n){return n?isBinaryCallback(e,t,n):isBinarySync(e,t)}function getEncodingSync(e,t){if(!e)return null;if(null==t){var n=getEncodingSync(e,{chunkLength:24});if("utf8"===n){var r=Math.max(0,Math.floor(e.length/2)-24);"utf8"===(n=getEncodingSync(e,{chunkLength:24,chunkBegin:r}))&&(n=getEncodingSync(e,{chunkLength:24,chunkBegin:r=Math.max(0,e.length-24)}))}return n}for(var i=t.chunkLength,s=void 0===i?24:i,o=t.chunkBegin,a=void 0===o?0:o,c=Math.min(e.length,a+s),l=e.toString("utf8",a,c),u=0;ur.stop()):(r.stop(),i)}}function processFile(e,t){return async n=>{let r=await e(n);return!this.supportBuffer||editionNode0_12.isTextSync(!1,r)?(debug$1("convert to string"),r=r.toString()):debug$1("keep data as Buffer"),new cacheEntry(!0,t,r)}}function handleENOENT(e){if(e&&"ENOENT"===e.code)return cacheEntry.MISS;throw e}const COMPRESSIONS={deflate:{in:rsvp.denodeify(zlib$2.deflate),out:rsvp.denodeify(zlib$2.inflate)},deflateRaw:{in:rsvp.denodeify(zlib$2.deflateRaw),out:rsvp.denodeify(zlib$2.inflateRaw)},gzip:{in:rsvp.denodeify(zlib$2.gzip),out:rsvp.denodeify(zlib$2.gunzip)}};class Cache{constructor(e,t){const n=t||{};this.tmpdir=n.location||tmpdir$1,this.compression=n.compression||!1,this.supportBuffer=n.supportBuffer||!1,this.key=e||"default-disk-cache",this.root=path$l.join(this.tmpdir,"if-you-need-to-delete-this-open-an-issue-async-disk-cache",this.key),debug$1("new Cache { root: %s, compression: %s }",this.root,this.compression)}}defineFunction(Cache.prototype,"clear",(function(){return debug$1("clear: %s",this.root),rimraf$2(path$l.join(this.root))})),defineFunction(Cache.prototype,"has",(function(e){const t=this.pathFor(e);return debug$1("has: %s",t),new rsvp.Promise(e=>fs$i.exists(t,e))})),defineFunction(Cache.prototype,"get",(function(e){const t=this.pathFor(e);return debug$1("get: %s",t),readFile$1(t).then(processFile.call(this,this.decompress.bind(this),t),handleENOENT)})),defineFunction(Cache.prototype,"set",(function(e,t){return new rsvp.Promise(n=>{n((async()=>{const n=this.pathFor(e);debug$1("set : %s",n);return await writeP(n,await this.compress(t)),n})())})}));const MAX_DIGITS=Math.pow(10,(Number.MAX_SAFE_INTEGER+"").length);async function writeP(e,t){const n=path$l.dirname(e),r=e+".tmp."+Math.random()*MAX_DIGITS;try{await writeFile$1(r,t)}catch(e){if(!e||"ENOENT"!==e.code)throw e;await mkdirp$1(n,{mode:"0775"}),await writeFile$1(r,t)}await renameFile(r,e),await chmod(e,parseInt("0666",8))}defineFunction(Cache.prototype,"remove",(function(e){return new rsvp.Promise(t=>{t((async()=>{const t=this.pathFor(e);debug$1("remove : %s",t);try{await unlink(t)}catch(e){await handleENOENT(e)}})())})})),defineFunction(Cache.prototype,"pathFor",(function(e){return path$l.join(this.root,crypto$2.createHash("sha1").update(e).digest("hex"))})),defineFunction(Cache.prototype,"decompress",(function(e){return this.compression?COMPRESSIONS[this.compression].out(e):e})),defineFunction(Cache.prototype,"compress",(function(e){return this.compression?COMPRESSIONS[this.compression].in(e):e}));var asyncDiskCache=Cache;const PREFIX="\0npm/",PREFIX_INTERNAL="\0npd/";function unpkgPlugin({resolutions:e=new Map,publicPath:t="@npm/",perPackage:n=!1}={}){const r=new Map;return t=t.replace(/\/$/,"")+"/",{name:"unpkg-plugin",async resolveId(i,s){/^\0np[md]\//.test(i)&&(i=i.substring(5)),s&&/^\0np[md]\//.test(s)&&(s=s.substring(5));const o=s&&/^((?:@[^@/?]+\/)?[^@/?]+)(?:@[^/?]+)?(?:\/([^?]+))?(?:\?.*)?$/.test(s),a=/^\.?\.?(\/|$)/.test(i);if(a){if(!o)return null;i=path$n__default.join(path$n__default.dirname(s),i)}i=i.replace(/^https?:\/\/unpkg\.com\/((?:@[^@/?]+\/)?[^@/?]+)(@[^/?]+)?(\/[^?]+)?\?module/g,"$1$2$3");const c=await unpkgResolve(i);e.set(i,c),r.set(c,i);return a&&s&&o?"\0npd/"+c:n&&s?{id:t+i,external:!0}:PREFIX+c},load(e){if(/^\0np[md]\//.test(e))return unpkg(e.substring(5))},options(e){let n=e.manualChunks;if("object"==typeof n){const e=n;n=t=>{for(const n in e)if(e[n].includes(t))return n}}return{...e,manualChunks(e,i){return/^\0np[md]\//.test(e)?function(e,{getModuleInfo:n}){if(e.startsWith("\0npd/")){e=n(e).importers.find(e=>e.startsWith("\0npm/"))||e}let i=e.substring(5);return i=r.get(i)||i,t+i.replace(/\//g,":").replace(/\.([cm]js|[tj]sx?)$/,"")}(e,i):"function"==typeof n?n.apply(this,arguments):void 0}}}}}const PACKAGE_CACHE=new asyncDiskCache("unpkg-meta"),FILE_CACHE=new asyncDiskCache("unpkg-plugin");function withCache(e,t){const n=new Map;return async(...r)=>{const i=String(r[0]);if(n.has(i))return n.get(i);const s=await e.get(i);if(s.isCached){const e=JSON.parse(s.value);return n.set(i,e),e}const o=t(...r);n.set(i,o);const a=await o;return n.set(i,a),e.set(i,JSON.stringify(a)),a}}const EXPORTMAPS={htm:{".":"./dist/htm.module.js","./preact":"./preact/index.module.js","./":"./"}},USELESS_PROPERTIES$1=["jest","eslintConfig","babel","scripts","devDependencies"],getPackageInfo=withCache(PACKAGE_CACHE,async e=>{const t=await fetch(`https://unpkg.com/${e}/package.json`);if(!t.ok)throw`Module ${e} not found.`;const n=await t.json();for(const e of USELESS_PROPERTIES$1)e in n&&delete n[e];return n});async function unpkgResolve(e){let[,t,n=""]=e.match(/^((?:@[^@/?]+\/)?[^@/?]+)(?:@[^/?]+)?(?:\/([^?]+))?(?:\?.*)?$/);const r=await getPackageInfo(t);if(!r.exports&&EXPORTMAPS.hasOwnProperty(t)&&(r.exports=EXPORTMAPS[t]),r.exports){const e=("./"+n.replace(/^\.?\//,"")).replace(/\/$/g,""),t=r.exports[e];if(t){let r="string"==typeof t&&t||t.browser||t.module||t.umd||t.default;if(!r)throw"Invalid Export Map entry for "+e;n=r.replace(/^\.?\/?/g,"")}else if(!r.exports["./"])throw`No matching Export Map entry for ${e}.`}else n||(n=r.esmodules||r.module||r["jsnext:main"]||r.browser||r.main),n.match(/\.([mc]js|[tj]sx?)$/g)||(n+=".js");return t+(n?"/"+n:"")}const unpkg=withCache(FILE_CACHE,async e=>{const t=await fetch("https://unpkg.com/"+e);if(!t.ok)throw`Module ${e} not found.`;return await t.text()}),CACHE_TTL=6e4,BUNDLE_CACHE=new Map,BROTLI_OPTS={params:{[zlib$4.constants.BROTLI_PARAM_MODE]:zlib$4.constants.BROTLI_DEFAULT_MODE,[zlib$4.constants.BROTLI_PARAM_QUALITY]:zlib$4.constants.BROTLI_MAX_QUALITY,[zlib$4.constants.BROTLI_PARAM_SIZE_HINT]:0}};function upgradeToBrotli(e){return new Promise((t,n)=>{e.upgrading=!0;const r=bundle_min.minify(e.code,{mangle:!0,compress:!0,module:!0,ecma:9,safari10:!0,sourceMap:!1});r.warnings&&console.warn(r.warnings.join("\n")),r.error?console.error(r.error):e.code=r.code;const i=getCachePath(e);fs$n.promises.writeFile(i,r.code),zlib$4.brotliCompress(e.code,BROTLI_OPTS,(s,o)=>{if(e.upgrading=!1,s&&r.error)return n(Error(`Minification and Brotli compression failed for ${e.module}/${e.path}.`));e.brotli=o,fs$n.promises.writeFile(i+".br",o),t()})})}const compressionQueue=new Set;function enqueueCompress(e){compressionQueue.add(e),1===compressionQueue.size&&setTimeout(compressBackground,1e3)}function compressBackground(){const e=compressionQueue.values().next().value;if(!e)return;upgradeToBrotli(BUNDLE_CACHE.get(e)).then(()=>{setTimeout(()=>{compressionQueue.delete(e),compressBackground()},1e3)})}async function getCachedBundle(e,{module:t,path:n,version:r}){if(BUNDLE_CACHE.has(e)){const t=BUNDLE_CACHE.get(e);if(Date.now()-t.modified>6e4)return;return{code:t.code,brotli:t.brotli,cacheStatus:"MEMORY"}}const i=getCachePath({module:t,path:n,version:r}),s=await fs$n.promises.stat(i).catch(()=>null);if(!s||Date.now()-s.mtimeMs>6e4)return;const[o,a]=await Promise.all([fs$n.promises.readFile(i,"utf-8"),fs$n.promises.readFile(i+".br").catch(()=>null)]);return BUNDLE_CACHE.set(e,{module:t,path:n,version:r,brotli:a,upgrading:!1,modified:s.mtimeMs,code:o}),{code:o,brotli:a,cacheStatus:"DISK"}}function setCachedBundle(e,t,{module:n,path:r,version:i}){BUNDLE_CACHE.set(e,{module:n,path:r,version:i,brotli:null,upgrading:!1,modified:Date.now(),code:t});fwrite(getCachePath({module:n,path:r,version:i}),t)}function sendCachedBundle(e,t,{code:n,brotli:r,cacheStatus:i}){const s={"content-length":n.length,"x-cache-status":i};if(r&&/\bbr\b/.test(e.headers["accept-encoding"]+"")){s["content-encoding"]="br",s["content-length"]=r.byteLength;const e=t.getHeader("etag");e&&(s.etag=e+"-br")}else r=null;t.writeHead(200,s),t.end(r||n)}async function fwrite(e,t){await fs$n.promises.mkdir(path$n.dirname(e),{recursive:!0}),await fs$n.promises.writeFile(e,t)}function getCachePath({module:e,version:t,path:n}){return`node_modules/${e}/.cache/${t}--${(n||"").replace(/\//g,"---")}.js`}function npmMiddleware({source:e="npm"}={}){return async(t,n,r)=>{const i=t.path.replace(/^\//,"");try{const r=normalizeSpecifier(i);await resolvePackageVersion(r);const s=Buffer.from(`${r.specifier}${r.version}`).toString("base64");if(t.headers["if-none-match"]===s)return n.writeHead(304).end();n.setHeader("etag",s),n.setHeader("content-type","application/javascript");const o=await getCachedBundle(s,r);if(o)return sendCachedBundle(t,n,o);const a=Date.now(),c=await bundleNpmModule(i,{source:e});console.log(`Bundle dep: ${i}: ${Date.now()-a}ms`),n.writeHead(200,{"content-length":c.length}).end(c),setCachedBundle(s,c,r),enqueueCompress(s)}catch(e){console.error(`Error bundling ${i}: `,e),r(e)}}}let npmCache;async function bundleNpmModule(e,{source:t}){const n=await rollup({input:e,cache:npmCache,plugins:["npm"===t?npmPlugin({publicPath:"/@npm"}):unpkgPlugin({publicPath:"/@npm",perPackage:!0}),commonjs({sourceMap:!1,transformMixedEsModules:!1}),json(),{name:"never-disk",load(e){throw Error("local access not allowed")}}]});npmCache=n.cache;const{output:r}=await n.generate({format:"es",indent:!1,paths:String});return r[0].code}var constants$5={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),EMPTY_BUFFER:Buffer.alloc(0),NOOP:()=>{}};const mask=(e,t,n,r,i)=>{for(var s=0;s{const n=e.length;for(var r=0;r{this.pending--,this[kRun]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[kRun]()}[kRun](){if(this.pending!==this.concurrency&&this.jobs.length){const e=this.jobs.shift();this.pending++,e(this[kDone])}}}var limiter=Limiter;const zlib$3=require("zlib"),{kStatusCode,NOOP:NOOP$1}=constants$5,TRAILER=Buffer.from([0,0,255,255]),kPerMessageDeflate=Symbol("permessage-deflate"),kTotalLength=Symbol("total-length"),kCallback=Symbol("callback"),kBuffers=Symbol("buffers"),kError=Symbol("error");let zlibLimiter;class PerMessageDeflate{constructor(e,t,n){if(this._maxPayload=0|n,this._options=e||{},this._threshold=void 0!==this._options.threshold?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!zlibLimiter){const e=void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10;zlibLimiter=new limiter(e)}}static get extensionName(){return"permessage-deflate"}offer(){const e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:null==this._options.clientMaxWindowBits&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){const e=this._deflate[kCallback];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){const t=this._options,n=e.find(e=>!(!1===t.serverNoContextTakeover&&e.server_no_context_takeover||e.server_max_window_bits&&(!1===t.serverMaxWindowBits||"number"==typeof t.serverMaxWindowBits&&t.serverMaxWindowBits>e.server_max_window_bits)||"number"==typeof t.clientMaxWindowBits&&!e.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),"number"==typeof t.serverMaxWindowBits&&(n.server_max_window_bits=t.serverMaxWindowBits),"number"==typeof t.clientMaxWindowBits?n.client_max_window_bits=t.clientMaxWindowBits:!0!==n.client_max_window_bits&&!1!==t.clientMaxWindowBits||delete n.client_max_window_bits,n}acceptAsClient(e){const t=e[0];if(!1===this._options.clientNoContextTakeover&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(t.client_max_window_bits){if(!1===this._options.clientMaxWindowBits||"number"==typeof this._options.clientMaxWindowBits&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"')}else"number"==typeof this._options.clientMaxWindowBits&&(t.client_max_window_bits=this._options.clientMaxWindowBits);return t}normalizeParams(e){return e.forEach(e=>{Object.keys(e).forEach(t=>{let n=e[t];if(n.length>1)throw new Error(`Parameter "${t}" must have only a single value`);if(n=n[0],"client_max_window_bits"===t){if(!0!==n){const e=+n;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${t}": ${n}`)}else if("server_max_window_bits"===t){const e=+n;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else{if("client_no_context_takeover"!==t&&"server_no_context_takeover"!==t)throw new Error(`Unknown parameter "${t}"`);if(!0!==n)throw new TypeError(`Invalid value for parameter "${t}": ${n}`)}e[t]=n})}),e}decompress(e,t,n){zlibLimiter.add(r=>{this._decompress(e,t,(e,t)=>{r(),n(e,t)})})}compress(e,t,n){zlibLimiter.add(r=>{this._compress(e,t,(e,t)=>{r(),n(e,t)})})}_decompress(e,t,n){const r=this._isServer?"client":"server";if(!this._inflate){const e=r+"_max_window_bits",t="number"!=typeof this.params[e]?zlib$3.Z_DEFAULT_WINDOWBITS:this.params[e];this._inflate=zlib$3.createInflateRaw({...this._options.zlibInflateOptions,windowBits:t}),this._inflate[kPerMessageDeflate]=this,this._inflate[kTotalLength]=0,this._inflate[kBuffers]=[],this._inflate.on("error",inflateOnError),this._inflate.on("data",inflateOnData)}this._inflate[kCallback]=n,this._inflate.write(e),t&&this._inflate.write(TRAILER),this._inflate.flush(()=>{const e=this._inflate[kError];if(e)return this._inflate.close(),this._inflate=null,void n(e);const i=bufferUtil.concat(this._inflate[kBuffers],this._inflate[kTotalLength]);t&&this.params[r+"_no_context_takeover"]?(this._inflate.close(),this._inflate=null):(this._inflate[kTotalLength]=0,this._inflate[kBuffers]=[]),n(null,i)})}_compress(e,t,n){const r=this._isServer?"server":"client";if(!this._deflate){const e=r+"_max_window_bits",t="number"!=typeof this.params[e]?zlib$3.Z_DEFAULT_WINDOWBITS:this.params[e];this._deflate=zlib$3.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:t}),this._deflate[kTotalLength]=0,this._deflate[kBuffers]=[],this._deflate.on("error",NOOP$1),this._deflate.on("data",deflateOnData)}this._deflate[kCallback]=n,this._deflate.write(e),this._deflate.flush(zlib$3.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let e=bufferUtil.concat(this._deflate[kBuffers],this._deflate[kTotalLength]);t&&(e=e.slice(0,e.length-4)),this._deflate[kCallback]=null,t&&this.params[r+"_no_context_takeover"]?(this._deflate.close(),this._deflate=null):(this._deflate[kTotalLength]=0,this._deflate[kBuffers]=[]),n(null,e)})}}var permessageDeflate=PerMessageDeflate;function deflateOnData(e){this[kBuffers].push(e),this[kTotalLength]+=e.length}function inflateOnData(e){this[kTotalLength]+=e.length,this[kPerMessageDeflate]._maxPayload<1||this[kTotalLength]<=this[kPerMessageDeflate]._maxPayload?this[kBuffers].push(e):(this[kError]=new RangeError("Max payload size exceeded"),this[kError][kStatusCode]=1009,this.removeListener("data",inflateOnData),this.reset())}function inflateOnError(e){this[kPerMessageDeflate]._inflate=null,e[kStatusCode]=1007,this[kCallback](e)}const isValidUTF8=e=>{for(var t=e.length,n=0;n=t||128!=(192&e[n+1])||128!=(192&e[n+2])||224===e[n]&&128==(224&e[n+1])||237===e[n]&&160==(224&e[n+1]))return!1;n+=3}else{if(240!=(248&e[n]))return!1;if(n+3>=t||128!=(192&e[n+1])||128!=(192&e[n+2])||128!=(192&e[n+3])||240===e[n]&&128==(240&e[n+1])||244===e[n]&&e[n+1]>143||e[n]>244)return!1;n+=4}return!0};var fallback$1=isValidUTF8,validation=createCommonjsModule$1((function(e,t){try{const e=fallback$1;t.isValidUTF8="object"==typeof e?e.Validation.isValidUTF8:e}catch(e){t.isValidUTF8=()=>!0}t.isValidStatusCode=e=>e>=1e3&&e<=1014&&1004!==e&&1005!==e&&1006!==e||e>=3e3&&e<=4999}));const{Writable:Writable$2}=require("stream"),{BINARY_TYPES,EMPTY_BUFFER,kStatusCode:kStatusCode$1,kWebSocket}=constants$5,{concat,toArrayBuffer,unmask:unmask$1}=bufferUtil,{isValidStatusCode,isValidUTF8:isValidUTF8$1}=validation,GET_INFO=0,GET_PAYLOAD_LENGTH_16=1,GET_PAYLOAD_LENGTH_64=2,GET_MASK=3,GET_DATA=4,INFLATING=5;class Receiver extends Writable$2{constructor(e,t,n,r){super(),this._binaryType=e||BINARY_TYPES[0],this[kWebSocket]=void 0,this._extensions=t||{},this._isServer=!!n,this._maxPayload=0|r,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=0,this._loop=!1}_write(e,t,n){if(8===this._opcode&&0==this._state)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e=n.length?t.set(this._buffers.shift(),r):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),r),this._buffers[0]=n.slice(e)),e-=n.length}while(e>0);return t}startLoop(e){let t;this._loop=!0;do{switch(this._state){case 0:t=this.getInfo();break;case 1:t=this.getPayloadLength16();break;case 2:t=this.getPayloadLength64();break;case 3:this.getMask();break;case 4:t=this.getData(e);break;default:return void(this._loop=!1)}}while(this._loop);e(t)}getInfo(){if(this._bufferedBytes<2)return void(this._loop=!1);const e=this.consume(2);if(0!=(48&e[0]))return this._loop=!1,error$2(RangeError,"RSV2 and RSV3 must be clear",!0,1002);const t=64==(64&e[0]);if(t&&!this._extensions[permessageDeflate.extensionName])return this._loop=!1,error$2(RangeError,"RSV1 must be clear",!0,1002);if(this._fin=128==(128&e[0]),this._opcode=15&e[0],this._payloadLength=127&e[1],0===this._opcode){if(t)return this._loop=!1,error$2(RangeError,"RSV1 must be clear",!0,1002);if(!this._fragmented)return this._loop=!1,error$2(RangeError,"invalid opcode 0",!0,1002);this._opcode=this._fragmented}else if(1===this._opcode||2===this._opcode){if(this._fragmented)return this._loop=!1,error$2(RangeError,"invalid opcode "+this._opcode,!0,1002);this._compressed=t}else{if(!(this._opcode>7&&this._opcode<11))return this._loop=!1,error$2(RangeError,"invalid opcode "+this._opcode,!0,1002);if(!this._fin)return this._loop=!1,error$2(RangeError,"FIN must be set",!0,1002);if(t)return this._loop=!1,error$2(RangeError,"RSV1 must be clear",!0,1002);if(this._payloadLength>125)return this._loop=!1,error$2(RangeError,"invalid payload length "+this._payloadLength,!0,1002)}if(this._fin||this._fragmented||(this._fragmented=this._opcode),this._masked=128==(128&e[1]),this._isServer){if(!this._masked)return this._loop=!1,error$2(RangeError,"MASK must be set",!0,1002)}else if(this._masked)return this._loop=!1,error$2(RangeError,"MASK must be clear",!0,1002);if(126===this._payloadLength)this._state=1;else{if(127!==this._payloadLength)return this.haveLength();this._state=2}}getPayloadLength16(){if(!(this._bufferedBytes<2))return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength();this._loop=!1}getPayloadLength64(){if(this._bufferedBytes<8)return void(this._loop=!1);const e=this.consume(8),t=e.readUInt32BE(0);return t>Math.pow(2,21)-1?(this._loop=!1,error$2(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009)):(this._payloadLength=t*Math.pow(2,32)+e.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,error$2(RangeError,"Max payload size exceeded",!1,1009);this._masked?this._state=3:this._state=4}getMask(){this._bufferedBytes<4?this._loop=!1:(this._mask=this.consume(4),this._state=4)}getData(e){let t=EMPTY_BUFFER;if(this._payloadLength){if(this._bufferedBytes7?this.controlMessage(t):this._compressed?(this._state=5,void this.decompress(t,e)):(t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage())}decompress(e,t){this._extensions[permessageDeflate.extensionName].decompress(e,this._fin,(e,n)=>{if(e)return t(e);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return t(error$2(RangeError,"Max payload size exceeded",!1,1009));this._fragments.push(n)}const r=this.dataMessage();if(r)return t(r);this.startLoop(t)})}dataMessage(){if(this._fin){const e=this._messageLength,t=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],2===this._opcode){let n;n="nodebuffer"===this._binaryType?concat(t,e):"arraybuffer"===this._binaryType?toArrayBuffer(concat(t,e)):t,this.emit("message",n)}else{const n=concat(t,e);if(!isValidUTF8$1(n))return this._loop=!1,error$2(Error,"invalid UTF-8 sequence",!0,1007);this.emit("message",n.toString())}}this._state=0}controlMessage(e){if(8===this._opcode)if(this._loop=!1,0===e.length)this.emit("conclude",1005,""),this.end();else{if(1===e.length)return error$2(RangeError,"invalid payload length 1",!0,1002);{const t=e.readUInt16BE(0);if(!isValidStatusCode(t))return error$2(RangeError,"invalid status code "+t,!0,1002);const n=e.slice(2);if(!isValidUTF8$1(n))return error$2(Error,"invalid UTF-8 sequence",!0,1007);this.emit("conclude",t,n.toString()),this.end()}}else 9===this._opcode?this.emit("ping",e):this.emit("pong",e);this._state=0}}var receiver=Receiver;function error$2(e,t,n,r){const i=new e(n?"Invalid WebSocket frame: "+t:t);return Error.captureStackTrace(i,error$2),i[kStatusCode$1]=r,i}const{randomFillSync}=require("crypto"),{EMPTY_BUFFER:EMPTY_BUFFER$1}=constants$5,{isValidStatusCode:isValidStatusCode$1}=validation,{mask:applyMask,toBuffer}=bufferUtil,mask$1=Buffer.alloc(4);class Sender{constructor(e,t){this._extensions=t||{},this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,t){const n=t.mask&&t.readOnly;let r=t.mask?6:2,i=e.length;e.length>=65536?(r+=8,i=127):e.length>125&&(r+=2,i=126);const s=Buffer.allocUnsafe(n?e.length+r:r);return s[0]=t.fin?128|t.opcode:t.opcode,t.rsv1&&(s[0]|=64),s[1]=i,126===i?s.writeUInt16BE(e.length,2):127===i&&(s.writeUInt32BE(0,2),s.writeUInt32BE(e.length,6)),t.mask?(randomFillSync(mask$1,0,4),s[1]|=128,s[r-4]=mask$1[0],s[r-3]=mask$1[1],s[r-2]=mask$1[2],s[r-1]=mask$1[3],n?(applyMask(e,mask$1,s,r,e.length),[s]):(applyMask(e,mask$1,e,0,e.length),[s,e])):[s,e]}close(e,t,n,r){let i;if(void 0===e)i=EMPTY_BUFFER$1;else{if("number"!=typeof e||!isValidStatusCode$1(e))throw new TypeError("First argument must be a valid error code number");if(void 0===t||""===t)i=Buffer.allocUnsafe(2),i.writeUInt16BE(e,0);else{const n=Buffer.byteLength(t);if(n>123)throw new RangeError("The message must not be greater than 123 bytes");i=Buffer.allocUnsafe(2+n),i.writeUInt16BE(e,0),i.write(t,2)}}this._deflating?this.enqueue([this.doClose,i,n,r]):this.doClose(i,n,r)}doClose(e,t,n){this.sendFrame(Sender.frame(e,{fin:!0,rsv1:!1,opcode:8,mask:t,readOnly:!1}),n)}ping(e,t,n){const r=toBuffer(e);if(r.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPing,r,t,toBuffer.readOnly,n]):this.doPing(r,t,toBuffer.readOnly,n)}doPing(e,t,n,r){this.sendFrame(Sender.frame(e,{fin:!0,rsv1:!1,opcode:9,mask:t,readOnly:n}),r)}pong(e,t,n){const r=toBuffer(e);if(r.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPong,r,t,toBuffer.readOnly,n]):this.doPong(r,t,toBuffer.readOnly,n)}doPong(e,t,n,r){this.sendFrame(Sender.frame(e,{fin:!0,rsv1:!1,opcode:10,mask:t,readOnly:n}),r)}send(e,t,n){const r=toBuffer(e),i=this._extensions[permessageDeflate.extensionName];let s=t.binary?2:1,o=t.compress;if(this._firstFragment?(this._firstFragment=!1,o&&i&&(o=r.length>=i._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0),i){const e={fin:t.fin,rsv1:o,opcode:s,mask:t.mask,readOnly:toBuffer.readOnly};this._deflating?this.enqueue([this.dispatch,r,this._compress,e,n]):this.dispatch(r,this._compress,e,n)}else this.sendFrame(Sender.frame(r,{fin:t.fin,rsv1:!1,opcode:s,mask:t.mask,readOnly:toBuffer.readOnly}),n)}dispatch(e,t,n,r){if(!t)return void this.sendFrame(Sender.frame(e,n),r);const i=this._extensions[permessageDeflate.extensionName];this._deflating=!0,i.compress(e,n.fin,(e,t)=>{if(this._socket.destroyed){const e=new Error("The socket was closed while data was being compressed");"function"==typeof r&&r(e);for(let t=0;t{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(e=>[t].concat(Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(e=>!0===e?t:`${t}=${e}`).join("; ")})).join("; ")).join(", ")}).join(", ")}var extension={format:format$1,parse:parse$c};const EventEmitter=require("events"),https$1=require("https"),http$2=require("http"),net$2=require("net"),tls$1=require("tls"),{randomBytes,createHash:createHash$1}=require("crypto"),{URL}=require("url"),{BINARY_TYPES:BINARY_TYPES$1,EMPTY_BUFFER:EMPTY_BUFFER$2,GUID,kStatusCode:kStatusCode$2,kWebSocket:kWebSocket$1,NOOP:NOOP$2}=constants$5,{addEventListener,removeEventListener}=eventTarget,{format:format$2,parse:parse$d}=extension,{toBuffer:toBuffer$1}=bufferUtil,readyStates=["CONNECTING","OPEN","CLOSING","CLOSED"],protocolVersions=[8,13],closeTimeout=3e4;class WebSocket extends EventEmitter{constructor(e,t,n){super(),this.readyState=WebSocket.CONNECTING,this.protocol="",this._binaryType=BINARY_TYPES$1[0],this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage="",this._closeTimer=null,this._closeCode=1006,this._extensions={},this._receiver=null,this._sender=null,this._socket=null,null!==e?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,Array.isArray(t)?t=t.join(", "):"object"==typeof t&&null!==t&&(n=t,t=void 0),initAsClient(this,e,t,n)):this._isServer=!0}get CONNECTING(){return WebSocket.CONNECTING}get CLOSING(){return WebSocket.CLOSING}get CLOSED(){return WebSocket.CLOSED}get OPEN(){return WebSocket.OPEN}get binaryType(){return this._binaryType}set binaryType(e){BINARY_TYPES$1.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?(this._socket.bufferSize||0)+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}setSocket(e,t,n){const r=new receiver(this._binaryType,this._extensions,this._isServer,n);this._sender=new sender(e,this._extensions),this._receiver=r,this._socket=e,r[kWebSocket$1]=this,e[kWebSocket$1]=this,r.on("conclude",receiverOnConclude),r.on("drain",receiverOnDrain),r.on("error",receiverOnError),r.on("message",receiverOnMessage),r.on("ping",receiverOnPing),r.on("pong",receiverOnPong),e.setTimeout(0),e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",socketOnClose),e.on("data",socketOnData),e.on("end",socketOnEnd),e.on("error",socketOnError),this.readyState=WebSocket.OPEN,this.emit("open")}emitClose(){if(!this._socket)return this.readyState=WebSocket.CLOSED,void this.emit("close",this._closeCode,this._closeMessage);this._extensions[permessageDeflate.extensionName]&&this._extensions[permessageDeflate.extensionName].cleanup(),this._receiver.removeAllListeners(),this.readyState=WebSocket.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==WebSocket.CLOSED){if(this.readyState===WebSocket.CONNECTING){const e="WebSocket was closed before the connection was established";return abortHandshake(this,this._req,e)}this.readyState!==WebSocket.CLOSING?(this.readyState=WebSocket.CLOSING,this._sender.close(e,t,!this._isServer,e=>{e||(this._closeFrameSent=!0,this._closeFrameReceived&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),3e4)):this._closeFrameSent&&this._closeFrameReceived&&this._socket.end()}}ping(e,t,n){if(this.readyState===WebSocket.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(n=e,e=t=void 0):"function"==typeof t&&(n=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===WebSocket.OPEN?(void 0===t&&(t=!this._isServer),this._sender.ping(e||EMPTY_BUFFER$2,t,n)):sendAfterClose(this,e,n)}pong(e,t,n){if(this.readyState===WebSocket.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(n=e,e=t=void 0):"function"==typeof t&&(n=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===WebSocket.OPEN?(void 0===t&&(t=!this._isServer),this._sender.pong(e||EMPTY_BUFFER$2,t,n)):sendAfterClose(this,e,n)}send(e,t,n){if(this.readyState===WebSocket.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof t&&(n=t,t={}),"number"==typeof e&&(e=e.toString()),this.readyState!==WebSocket.OPEN)return void sendAfterClose(this,e,n);const r={binary:"string"!=typeof e,mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[permessageDeflate.extensionName]||(r.compress=!1),this._sender.send(e||EMPTY_BUFFER$2,r,n)}terminate(){if(this.readyState!==WebSocket.CLOSED){if(this.readyState===WebSocket.CONNECTING){const e="WebSocket was closed before the connection was established";return abortHandshake(this,this._req,e)}this._socket&&(this.readyState=WebSocket.CLOSING,this._socket.destroy())}}}readyStates.forEach((e,t)=>{WebSocket[e]=t}),["open","error","close","message"].forEach(e=>{Object.defineProperty(WebSocket.prototype,"on"+e,{get(){const t=this.listeners(e);for(let e=0;e{abortHandshake(e,h,"Opening handshake has timed out")}),h.on("error",t=>{e._req.aborted||(h=e._req=null,e.readyState=WebSocket.CLOSING,e.emit("error",t),e.emitClose())}),h.on("response",s=>{const o=s.headers.location,a=s.statusCode;if(o&&i.followRedirects&&a>=300&&a<400){if(++e._redirects>i.maxRedirects)return void abortHandshake(e,h,"Maximum redirects exceeded");h.abort();const s=new URL(o,t);initAsClient(e,s,n,r)}else e.emit("unexpected-response",h,s)||abortHandshake(e,h,"Unexpected server response: "+s.statusCode)}),h.on("upgrade",(t,r,s)=>{if(e.emit("upgrade",t),e.readyState!==WebSocket.CONNECTING)return;h=e._req=null;const o=createHash$1("sha1").update(l+GUID).digest("base64");if(t.headers["sec-websocket-accept"]!==o)return void abortHandshake(e,r,"Invalid Sec-WebSocket-Accept header");const a=t.headers["sec-websocket-protocol"],c=(n||"").split(/, */);let u;if(!n&&a?u="Server sent a subprotocol but none was requested":n&&!a?u="Server sent no subprotocol":a&&!c.includes(a)&&(u="Server sent an invalid subprotocol"),u)abortHandshake(e,r,u);else{if(a&&(e.protocol=a),p)try{const n=parse$d(t.headers["sec-websocket-extensions"]);n[permessageDeflate.extensionName]&&(p.accept(n[permessageDeflate.extensionName]),e._extensions[permessageDeflate.extensionName]=p)}catch(t){return void abortHandshake(e,r,"Invalid Sec-WebSocket-Extensions header")}e.setSocket(r,s,i.maxPayload)}})}function netConnect(e){return e.path=e.socketPath,net$2.connect(e)}function tlsConnect(e){return e.path=void 0,e.servername||""===e.servername||(e.servername=e.host),tls$1.connect(e)}function abortHandshake(e,t,n){e.readyState=WebSocket.CLOSING;const r=new Error(n);Error.captureStackTrace(r,abortHandshake),t.setHeader?(t.abort(),t.once("abort",e.emitClose.bind(e)),e.emit("error",r)):(t.destroy(r),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function sendAfterClose(e,t,n){if(t){const n=toBuffer$1(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(n){n(new Error(`WebSocket is not open: readyState ${e.readyState} (${readyStates[e.readyState]})`))}}function receiverOnConclude(e,t){const n=this[kWebSocket$1];n._socket.removeListener("data",socketOnData),n._socket.resume(),n._closeFrameReceived=!0,n._closeMessage=t,n._closeCode=e,1005===e?n.close():n.close(e,t)}function receiverOnDrain(){this[kWebSocket$1]._socket.resume()}function receiverOnError(e){const t=this[kWebSocket$1];t._socket.removeListener("data",socketOnData),t.readyState=WebSocket.CLOSING,t._closeCode=e[kStatusCode$2],t.emit("error",e),t._socket.destroy()}function receiverOnFinish(){this[kWebSocket$1].emitClose()}function receiverOnMessage(e){this[kWebSocket$1].emit("message",e)}function receiverOnPing(e){const t=this[kWebSocket$1];t.pong(e,!t._isServer,NOOP$2),t.emit("ping",e)}function receiverOnPong(e){this[kWebSocket$1].emit("pong",e)}function socketOnClose(){const e=this[kWebSocket$1];this.removeListener("close",socketOnClose),this.removeListener("end",socketOnEnd),e.readyState=WebSocket.CLOSING,e._socket.read(),e._receiver.end(),this.removeListener("data",socketOnData),this[kWebSocket$1]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",receiverOnFinish),e._receiver.on("finish",receiverOnFinish))}function socketOnData(e){this[kWebSocket$1]._receiver.write(e)||this.pause()}function socketOnEnd(){const e=this[kWebSocket$1];e.readyState=WebSocket.CLOSING,e._receiver.end(),this.end()}function socketOnError(){const e=this[kWebSocket$1];this.removeListener("error",socketOnError),this.on("error",NOOP$2),e&&(e.readyState=WebSocket.CLOSING,this.destroy())}const{Duplex}=require("stream");function emitClose(e){e.emit("close")}function duplexOnEnd(){!this.destroyed&&this._writableState.finished&&this.destroy()}function duplexOnError(e){this.removeListener("error",duplexOnError),this.destroy(),0===this.listenerCount("error")&&this.emit("error",e)}function createWebSocketStream(e,t){let n=!0;function r(){n&&e._socket.resume()}e.readyState===e.CONNECTING?e.once("open",(function(){e._receiver.removeAllListeners("drain"),e._receiver.on("drain",r)})):(e._receiver.removeAllListeners("drain"),e._receiver.on("drain",r));const i=new Duplex({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",(function(t){i.push(t)||(n=!1,e._socket.pause())})),e.once("error",(function(e){i.destroyed||i.destroy(e)})),e.once("close",(function(){i.destroyed||i.push(null)})),i._destroy=function(t,n){if(e.readyState===e.CLOSED)return n(t),void process.nextTick(emitClose,i);let r=!1;e.once("error",(function(e){r=!0,n(e)})),e.once("close",(function(){r||n(t),process.nextTick(emitClose,i)})),e.terminate()},i._final=function(t){e.readyState!==e.CONNECTING?null!==e._socket&&(e._socket._writableState.finished?(t(),i._readableState.endEmitted&&i.destroy()):(e._socket.once("finish",(function(){t()})),e.close())):e.once("open",(function(){i._final(t)}))},i._read=function(){e.readyState!==e.OPEN||n||(n=!0,e._receiver._writableState.needDrain||e._socket.resume())},i._write=function(t,n,r){e.readyState!==e.CONNECTING?e.send(t,r):e.once("open",(function(){i._write(t,n,r)}))},i.on("end",duplexOnEnd),i.on("error",duplexOnError),i}var stream$1=createWebSocketStream;const EventEmitter$1=require("events"),{createHash:createHash$2}=require("crypto"),{createServer,STATUS_CODES:STATUS_CODES$1}=require("http"),{format:format$3,parse:parse$e}=extension,{GUID:GUID$1,kWebSocket:kWebSocket$2}=constants$5,keyRegex=/^[+/0-9A-Za-z]{22}==$/;class WebSocketServer extends EventEmitter$1{constructor(e,t){if(super(),null==(e={maxPayload:104857600,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,...e}).port&&!e.server&&!e.noServer)throw new TypeError('One of the "port", "server", or "noServer" options must be specified');null!=e.port?(this._server=createServer((e,t)=>{const n=STATUS_CODES$1[426];t.writeHead(426,{"Content-Length":n.length,"Content-Type":"text/plain"}),t.end(n)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server&&(this._removeListeners=addListeners(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(e,t,n)=>{this.handleUpgrade(e,t,n,t=>{this.emit("connection",t,e)})}})),!0===e.perMessageDeflate&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set),this.options=e}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(e&&this.once("close",e),this.clients)for(const e of this.clients)e.terminate();const t=this._server;t&&(this._removeListeners(),this._removeListeners=this._server=null,null!=this.options.port)?t.close(()=>this.emit("close")):process.nextTick(emitClose$1,this)}shouldHandle(e){if(this.options.path){const t=e.url.indexOf("?");if((-1!==t?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,r){t.on("error",socketOnError$1);const i=void 0!==e.headers["sec-websocket-key"]&&e.headers["sec-websocket-key"].trim(),s=+e.headers["sec-websocket-version"],o={};if("GET"!==e.method||"websocket"!==e.headers.upgrade.toLowerCase()||!i||!keyRegex.test(i)||8!==s&&13!==s||!this.shouldHandle(e))return abortHandshake$1(t,400);if(this.options.perMessageDeflate){const n=new permessageDeflate(this.options.perMessageDeflate,!0,this.options.maxPayload);try{const t=parse$e(e.headers["sec-websocket-extensions"]);t[permessageDeflate.extensionName]&&(n.accept(t[permessageDeflate.extensionName]),o[permessageDeflate.extensionName]=n)}catch(e){return abortHandshake$1(t,400)}}if(this.options.verifyClient){const a={origin:e.headers[""+(8===s?"sec-websocket-origin":"origin")],secure:!(!e.connection.authorized&&!e.connection.encrypted),req:e};if(2===this.options.verifyClient.length)return void this.options.verifyClient(a,(s,a,c,l)=>{if(!s)return abortHandshake$1(t,a||401,c,l);this.completeUpgrade(i,o,e,t,n,r)});if(!this.options.verifyClient(a))return abortHandshake$1(t,401)}this.completeUpgrade(i,o,e,t,n,r)}completeUpgrade(e,t,n,r,i,s){if(!r.readable||!r.writable)return r.destroy();if(r[kWebSocket$2])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");const o=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade","Sec-WebSocket-Accept: "+createHash$2("sha1").update(e+GUID$1).digest("base64")],a=new websocket(null);let c=n.headers["sec-websocket-protocol"];if(c&&(c=c.trim().split(/ *, */),c=this.options.handleProtocols?this.options.handleProtocols(c,n):c[0],c&&(o.push("Sec-WebSocket-Protocol: "+c),a.protocol=c)),t[permessageDeflate.extensionName]){const e=t[permessageDeflate.extensionName].params,n=format$3({[permessageDeflate.extensionName]:[e]});o.push("Sec-WebSocket-Extensions: "+n),a._extensions=t}this.emit("headers",o,n),r.write(o.concat("\r\n").join("\r\n")),r.removeListener("error",socketOnError$1),a.setSocket(r,i,this.options.maxPayload),this.clients&&(this.clients.add(a),a.on("close",()=>this.clients.delete(a))),s(a)}}var websocketServer=WebSocketServer;function addListeners(e,t){for(const n of Object.keys(t))e.on(n,t[n]);return function(){for(const n of Object.keys(t))e.removeListener(n,t[n])}}function emitClose$1(e){e.emit("close")}function socketOnError$1(){this.destroy()}function abortHandshake$1(e,t,n,r){e.writable&&(n=n||STATUS_CODES$1[t],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(n),...r},e.write(`HTTP/1.1 ${t} ${STATUS_CODES$1[t]}\r\n`+Object.keys(r).map(e=>`${e}: ${r[e]}`).join("\r\n")+"\r\n\r\n"+n)),e.removeListener("error",socketOnError$1),e.destroy()}websocket.createWebSocketStream=stream$1,websocket.Server=websocketServer,websocket.Receiver=receiver,websocket.Sender=sender;var ws=websocket;class WebSocketServer$1 extends ws.Server{constructor(e,t){super({noServer:!0}),this.mountPath=t,e.on("upgrade",this._handleUpgrade.bind(this))}broadcast(e){this.clients.forEach(t=>{t.readyState===ws.OPEN&&t.send(JSON.stringify(e))})}_handleUpgrade(e,t,n){url(e).pathname==this.mountPath?this.handleUpgrade(e,t,n,t=>{t.emit("connection",t,e)}):t.destroy()}}async function server({cwd:e,overlayDir:t,middleware:n,http2:r=!1,compress:i=!0}={}){const s=polka({onError(e,t,n){if("/favicon.ico"==t.path)return n.end();const r="number"==typeof e.code?e.code:500;n.writeHead(r,{"content-type":"text/plain"}),n.end(e+""),console.error(e)}});if(r)try{s.server=await createHttp2Server(),s.http2=!0}catch(e){console.error("Unable to create HTTP2 server, falling back to HTTP1:\n"+e)}if(s.server||(s.server=http$3.createServer(),s.http2=!1),s.ws=new WebSocketServer$1(s.server,"/_hmr"),i){const e=!0===i?1024:i;s.use(compress({threshold:e,level:4}))}return s.use("/@npm",npmMiddleware()),n&&s.use(...n),t&&s.use(sirv(path$n.resolve(e||"",t),{dev:!0})),s.use(sirv(e||"",{ignores:["@npm"],single:!0,dev:!0})),s}const fs$j=require("fs"),{Readable:Readable$2}=require("stream"),sysPath=require("path"),{promisify:promisify$1}=require("util"),readdir$1=promisify$1(fs$j.readdir),stat$1=promisify$1(fs$j.stat),lstat=promisify$1(fs$j.lstat),realpath$2=promisify$1(fs$j.realpath),BANG="!",NORMAL_FLOW_ERRORS=new Set(["ENOENT","EPERM","EACCES","ELOOP"]),FILE_TYPE="files",DIR_TYPE="directories",FILE_DIR_TYPE="files_directories",EVERYTHING_TYPE="all",ALL_TYPES=[FILE_TYPE,DIR_TYPE,FILE_DIR_TYPE,EVERYTHING_TYPE],isNormalFlowError=e=>NORMAL_FLOW_ERRORS.has(e.code),normalizeFilter=e=>{if(void 0!==e){if("function"==typeof e)return e;if("string"==typeof e){const t=picomatch$1(e.trim());return e=>t(e.basename)}if(Array.isArray(e)){const t=[],n=[];for(const r of e){const e=r.trim();"!"===e.charAt(0)?n.push(picomatch$1(e.slice(1))):t.push(picomatch$1(e))}return n.length>0?t.length>0?e=>t.some(t=>t(e.basename))&&!n.some(t=>t(e.basename)):e=>!n.some(t=>t(e.basename)):e=>t.some(t=>t(e.basename))}}};class ReaddirpStream extends Readable$2{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});const t={...ReaddirpStream.defaultOptions,...e},{root:n,type:r}=t;this._fileFilter=normalizeFilter(t.fileFilter),this._directoryFilter=normalizeFilter(t.directoryFilter);const i=t.lstat?lstat:stat$1;"win32"===process.platform&&3===stat$1.length?this._stat=e=>i(e,{bigint:!0}):this._stat=i,this._maxDepth=t.depth,this._wantsDir=[DIR_TYPE,FILE_DIR_TYPE,EVERYTHING_TYPE].includes(r),this._wantsFile=[FILE_TYPE,FILE_DIR_TYPE,EVERYTHING_TYPE].includes(r),this._wantsEverything=r===EVERYTHING_TYPE,this._root=sysPath.resolve(n),this._isDirent="Dirent"in fs$j&&!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){const{path:t,depth:n,files:r=[]}=this.parent||{};if(r.length>0){const i=r.splice(0,e).map(e=>this._formatEntry(e,t));for(const t of await Promise.all(i)){if(this.destroyed)return;const r=await this._getEntryType(t);"directory"===r&&this._directoryFilter(t)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(t.fullPath,n+1)),this._wantsDir&&(this.push(t),e--)):("file"===r||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{const e=this.parents.pop();if(!e){this.push(null);break}if(this.parent=await e,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await readdir$1(e,this._rdOptions)}catch(e){this._onError(e)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let n;try{const r=this._isDirent?e.name:e,i=sysPath.resolve(sysPath.join(t,r));n={path:sysPath.relative(this._root,i),fullPath:i,basename:r},n[this._statsProp]=this._isDirent?e:await this._stat(i)}catch(e){this._onError(e)}return n}_onError(e){isNormalFlowError(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){const t=e&&e[this._statsProp];if(t){if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink())try{const t=await realpath$2(e.fullPath),n=await lstat(t);if(n.isFile())return"file";if(n.isDirectory())return"directory"}catch(e){this._onError(e)}}}_includeAsFile(e){const t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}const readdirp=(e,t={})=>{let n=t.entryType||t.type;if("both"===n&&(n=FILE_DIR_TYPE),n&&(t.type=n),!e)throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");if("string"!=typeof e)throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(n&&!ALL_TYPES.includes(n))throw new Error("readdirp: Invalid type passed. Use one of "+ALL_TYPES.join(", "));return t.root=e,new ReaddirpStream(t)},readdirpPromise=(e,t={})=>new Promise((n,r)=>{const i=[];readdirp(e,t).on("data",e=>i.push(e)).on("end",()=>n(i)).on("error",e=>r(e))});readdirp.promise=readdirpPromise,readdirp.ReaddirpStream=ReaddirpStream,readdirp.default=readdirp;var readdirp_1=readdirp,normalizePath=function(e,t){if("string"!=typeof e)throw new TypeError("expected path to be a string");if("\\"===e||"/"===e)return"/";var n=e.length;if(n<=1)return e;var r="";if(n>4&&"\\"===e[3]){var i=e[2];"?"!==i&&"."!==i||"\\\\"!==e.slice(0,2)||(e=e.slice(2),r="//")}var s=e.split(/[/\\]+/);return!1!==t&&""===s[s.length-1]&&s.pop(),r+s.join("/")},anymatch_1=createCommonjsModule$1((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n={returnIndex:!1},r=(e,t,n,r)=>{const i=Array.isArray(n),s=i?n[0]:n;if(!i&&"string"!=typeof s)throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(s));const o=normalizePath(s);for(let e=0;e{if(null==e)throw new TypeError("anymatch: specify first argument");const s="boolean"==typeof i?{returnIndex:i}:i,o=s.returnIndex||!1,a=(c=e,Array.isArray(c)?c:[c]);var c;const l=a.filter(e=>"string"==typeof e&&"!"===e.charAt(0)).map(e=>e.slice(1)).map(e=>picomatch$1(e,s)),u=a.map(e=>((e,t)=>{if("function"==typeof e)return e;if("string"==typeof e){const n=picomatch$1(e,t);return t=>e===t||n(t)}return e instanceof RegExp?t=>e.test(t):e=>!1})(e,s));return null==t?(e,t=!1)=>r(u,l,e,"boolean"==typeof t&&t):r(u,l,t,o)};i.default=i,e.exports=i})),isExtglob=function(e){if("string"!=typeof e||""===e)return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1},chars$3={"{":"}","(":")","[":"]"},strictRegex=/\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/,relaxedRegex=/\\(.)|(^!|[*?{}()[\]]|\(\?)/,isGlob=function(e,t){if("string"!=typeof e||""===e)return!1;if(isExtglob(e))return!0;var n,r=strictRegex;for(t&&!1===t.strict&&(r=relaxedRegex);n=r.exec(e);){if(n[2])return!0;var i=n.index+n[0].length,s=n[1],o=s?chars$3[s]:null;if(s&&o){var a=e.indexOf(o,i);-1!==a&&(i=a+1)}e=e.slice(i)}return!1},pathPosixDirname=require("path").posix.dirname,isWin32="win32"===require("os").platform(),slash="/",backslash=/\\/g,enclosure=/[\{\[].*[\/]*.*[\}\]]$/,globby=/(^|[^\\])([\{\[]|\([^\)]+$)/,escaped=/\\([\!\*\?\|\[\]\(\)\{\}])/g,globParent=function(e,t){Object.assign({flipBackslashes:!0},t).flipBackslashes&&isWin32&&e.indexOf(slash)<0&&(e=e.replace(backslash,slash)),enclosure.test(e)&&(e+=slash),e+="a";do{e=pathPosixDirname(e)}while(isGlob(e)||globby.test(e));return e.replace(escaped,"$1")},utils$3=createCommonjsModule$1((function(e,t){t.isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),t.find=(e,t)=>e.nodes.find(e=>e.type===t),t.exceedsLimit=(e,n,r=1,i)=>!1!==i&&(!(!t.isInteger(e)||!t.isInteger(n))&&(Number(n)-Number(e))/Number(r)>=i),t.escapeNode=(e,t=0,n)=>{let r=e.nodes[t];r&&(n&&r.type===n||"open"===r.type||"close"===r.type)&&!0!==r.escaped&&(r.value="\\"+r.value,r.escaped=!0)},t.encloseBrace=e=>"brace"===e.type&&(e.commas>>0+e.ranges>>0==0&&(e.invalid=!0,!0)),t.isInvalidBrace=e=>"brace"===e.type&&(!(!0!==e.invalid&&!e.dollar)||(e.commas>>0+e.ranges>>0==0||!0!==e.open||!0!==e.close)&&(e.invalid=!0,!0)),t.isOpenOrClose=e=>"open"===e.type||"close"===e.type||(!0===e.open||!0===e.close),t.reduce=e=>e.reduce((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e),[]),t.flatten=(...e)=>{const t=[],n=e=>{for(let r=0;r{let n=(e,r={})=>{let i=t.escapeInvalid&&utils$3.isInvalidBrace(r),s=!0===e.invalid&&!0===t.escapeInvalid,o="";if(e.value)return(i||s)&&utils$3.isOpenOrClose(e)?"\\"+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(let t of e.nodes)o+=n(t);return o};return n(e)},isNumber=function(e){return"number"==typeof e?e-e==0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))};const toRegexRange=(e,t,n)=>{if(!1===isNumber(e))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===t||e===t)return String(e);if(!1===isNumber(t))throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...n};"boolean"==typeof r.strictZeros&&(r.relaxZeros=!1===r.strictZeros);let i=e+":"+t+"="+String(r.relaxZeros)+String(r.shorthand)+String(r.capture)+String(r.wrap);if(toRegexRange.cache.hasOwnProperty(i))return toRegexRange.cache[i].result;let s=Math.min(e,t),o=Math.max(e,t);if(1===Math.abs(s-o)){let n=e+"|"+t;return r.capture?`(${n})`:!1===r.wrap?n:`(?:${n})`}let a=hasPadding(e)||hasPadding(t),c={min:e,max:t,a:s,b:o},l=[],u=[];if(a&&(c.isPadded=a,c.maxLen=String(c.max).length),s<0){u=splitToPatterns(o<0?Math.abs(o):1,Math.abs(s),c,r),s=c.a=0}return o>=0&&(l=splitToPatterns(s,o,c,r)),c.negatives=u,c.positives=l,c.result=collatePatterns(u,l),!0===r.capture?c.result=`(${c.result})`:!1!==r.wrap&&l.length+u.length>1&&(c.result=`(?:${c.result})`),toRegexRange.cache[i]=c,c.result};function collatePatterns(e,t,n){let r=filterPatterns(e,t,"-",!1)||[],i=filterPatterns(t,e,"",!1)||[],s=filterPatterns(e,t,"-?",!0)||[];return r.concat(s).concat(i).join("|")}function splitToRanges(e,t){let n=1,r=1,i=countNines(e,n),s=new Set([t]);for(;e<=i&&i<=t;)s.add(i),n+=1,i=countNines(e,n);for(i=countZeros(t+1,r)-1;e1&&i.count.pop(),i.count.push(c.count[0]),i.string=i.pattern+toQuantifier(i.count),a=t+1)}return o}function filterPatterns(e,t,n,r,i){let s=[];for(let i of e){let{string:e}=i;r||contains(t,"string",e)||s.push(n+e),r&&contains(t,"string",e)&&s.push(n+e)}return s}function zip(e,t){let n=[];for(let r=0;rt?1:t>e?-1:0}function contains(e,t,n){return e.some(e=>e[t]===n)}function countNines(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function countZeros(e,t){return e-e%Math.pow(10,t)}function toQuantifier(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function toCharacterClass(e,t,n){return`[${e}${t-e==1?"":"-"}${t}]`}function hasPadding(e){return/^-?(0+)\d/.test(e)}function padZeros(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=!1!==n.relaxZeros;switch(r){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${r}}`:`0{${r}}`}}toRegexRange.cache={},toRegexRange.clearCache=()=>toRegexRange.cache={};var toRegexRange_1=toRegexRange;const util$5=require("util"),isObject$4=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),transform$2=e=>t=>!0===e?Number(t):String(t),isValidValue=e=>"number"==typeof e||"string"==typeof e&&""!==e,isNumber$1=e=>Number.isInteger(+e),zeros=e=>{let t=""+e,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},stringify$2=(e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify,pad=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},toMaxLen=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length{e.negatives.sort((e,t)=>et?1:0),e.positives.sort((e,t)=>et?1:0);let n,r=t.capture?"":"?:",i="",s="";return e.positives.length&&(i=e.positives.join("|")),e.negatives.length&&(s=`-(${r}${e.negatives.join("|")})`),n=i&&s?`${i}|${s}`:i||s,t.wrap?`(${r}${n})`:n},toRange=(e,t,n,r)=>{if(n)return toRegexRange_1(e,t,{wrap:!1,...r});let i=String.fromCharCode(e);return e===t?i:`[${i}-${String.fromCharCode(t)}]`},toRegex=(e,t,n)=>{if(Array.isArray(e)){let t=!0===n.wrap,r=n.capture?"":"?:";return t?`(${r}${e.join("|")})`:e.join("|")}return toRegexRange_1(e,t,n)},rangeError=(...e)=>new RangeError("Invalid range arguments: "+util$5.inspect(...e)),invalidRange=(e,t,n)=>{if(!0===n.strictRanges)throw rangeError([e,t]);return[]},invalidStep=(e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]},fillNumbers=(e,t,n=1,r={})=>{let i=Number(e),s=Number(t);if(!Number.isInteger(i)||!Number.isInteger(s)){if(!0===r.strictRanges)throw rangeError([e,t]);return[]}0===i&&(i=0),0===s&&(s=0);let o=i>s,a=String(e),c=String(t),l=String(n);n=Math.max(Math.abs(n),1);let u=zeros(a)||zeros(c)||zeros(l),p=u?Math.max(a.length,c.length,l.length):0,h=!1===u&&!1===stringify$2(e,t,r),d=r.transform||transform$2(h);if(r.toRegex&&1===n)return toRange(toMaxLen(e,p),toMaxLen(t,p),!0,r);let f={negatives:[],positives:[]},m=[],g=0;for(;o?i>=s:i<=s;)!0===r.toRegex&&n>1?f[(_=i)<0?"negatives":"positives"].push(Math.abs(_)):m.push(pad(d(i,g),p,h)),i=o?i-n:i+n,g++;var _;return!0===r.toRegex?n>1?toSequence(f,r):toRegex(m,null,{wrap:!1,...r}):m},fillLetters=(e,t,n=1,r={})=>{if(!isNumber$1(e)&&e.length>1||!isNumber$1(t)&&t.length>1)return invalidRange(e,t,r);let i=r.transform||(e=>String.fromCharCode(e)),s=(""+e).charCodeAt(0),o=(""+t).charCodeAt(0),a=s>o,c=Math.min(s,o),l=Math.max(s,o);if(r.toRegex&&1===n)return toRange(c,l,!1,r);let u=[],p=0;for(;a?s>=o:s<=o;)u.push(i(s,p)),s=a?s-n:s+n,p++;return!0===r.toRegex?toRegex(u,null,{wrap:!1,options:r}):u},fill=(e,t,n,r={})=>{if(null==t&&isValidValue(e))return[e];if(!isValidValue(e)||!isValidValue(t))return invalidRange(e,t,r);if("function"==typeof n)return fill(e,t,1,{transform:n});if(isObject$4(n))return fill(e,t,0,n);let i={...r};return!0===i.capture&&(i.wrap=!0),n=n||i.step||1,isNumber$1(n)?isNumber$1(e)&&isNumber$1(t)?fillNumbers(e,t,n,i):fillLetters(e,t,Math.max(Math.abs(n),1),i):null==n||isObject$4(n)?fill(e,t,1,n):invalidStep(n,i)};var fillRange=fill;const compile=(e,t={})=>{let n=(e,r={})=>{let i=utils$3.isInvalidBrace(r),s=!0===e.invalid&&!0===t.escapeInvalid,o=!0===i||!0===s,a=!0===t.escapeInvalid?"\\":"",c="";if(!0===e.isOpen)return a+e.value;if(!0===e.isClose)return a+e.value;if("open"===e.type)return o?a+e.value:"(";if("close"===e.type)return o?a+e.value:")";if("comma"===e.type)return"comma"===e.prev.type?"":o?e.value:"|";if(e.value)return e.value;if(e.nodes&&e.ranges>0){let n=utils$3.reduce(e.nodes),r=fillRange(...n,{...t,wrap:!1,toRegex:!0});if(0!==r.length)return n.length>1&&r.length>1?`(${r})`:r}if(e.nodes)for(let t of e.nodes)c+=n(t,e);return c};return n(e)};var compile_1=compile;const append=(e="",t="",n=!1)=>{let r=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return n?utils$3.flatten(t).map(e=>`{${e}}`):t;for(let i of e)if(Array.isArray(i))for(let e of i)r.push(append(e,t,n));else for(let e of t)!0===n&&"string"==typeof e&&(e=`{${e}}`),r.push(Array.isArray(e)?append(i,e,n):i+e);return utils$3.flatten(r)},expand$1=(e,t={})=>{let n=void 0===t.rangeLimit?1e3:t.rangeLimit,r=(e,i={})=>{e.queue=[];let s=i,o=i.queue;for(;"brace"!==s.type&&"root"!==s.type&&s.parent;)s=s.parent,o=s.queue;if(e.invalid||e.dollar)return void o.push(append(o.pop(),stringify$1(e,t)));if("brace"===e.type&&!0!==e.invalid&&2===e.nodes.length)return void o.push(append(o.pop(),["{}"]));if(e.nodes&&e.ranges>0){let r=utils$3.reduce(e.nodes);if(utils$3.exceedsLimit(...r,t.step,n))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let i=fillRange(...r,t);return 0===i.length&&(i=stringify$1(e,t)),o.push(append(o.pop(),i)),void(e.nodes=[])}let a=utils$3.encloseBrace(e),c=e.queue,l=e;for(;"brace"!==l.type&&"root"!==l.type&&l.parent;)l=l.parent,c=l.queue;for(let t=0;t",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"};const{MAX_LENGTH:MAX_LENGTH$3,CHAR_BACKSLASH,CHAR_BACKTICK,CHAR_COMMA:CHAR_COMMA$1,CHAR_DOT:CHAR_DOT$1,CHAR_LEFT_PARENTHESES:CHAR_LEFT_PARENTHESES$1,CHAR_RIGHT_PARENTHESES:CHAR_RIGHT_PARENTHESES$1,CHAR_LEFT_CURLY_BRACE:CHAR_LEFT_CURLY_BRACE$1,CHAR_RIGHT_CURLY_BRACE:CHAR_RIGHT_CURLY_BRACE$1,CHAR_LEFT_SQUARE_BRACKET:CHAR_LEFT_SQUARE_BRACKET$1,CHAR_RIGHT_SQUARE_BRACKET:CHAR_RIGHT_SQUARE_BRACKET$1,CHAR_DOUBLE_QUOTE,CHAR_SINGLE_QUOTE,CHAR_NO_BREAK_SPACE,CHAR_ZERO_WIDTH_NOBREAK_SPACE}=constants$6,parse$f=(e,t={})=>{if("string"!=typeof e)throw new TypeError("Expected a string");let n=t||{},r="number"==typeof n.maxLength?Math.min(MAX_LENGTH$3,n.maxLength):MAX_LENGTH$3;if(e.length>r)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${r})`);let i,s={type:"root",input:e,nodes:[]},o=[s],a=s,c=s,l=0,u=e.length,p=0,h=0;const d=()=>e[p++],f=e=>{if("text"===e.type&&"dot"===c.type&&(c.type="text"),!c||"text"!==c.type||"text"!==e.type)return a.nodes.push(e),e.parent=a,e.prev=c,c=e,e;c.value+=e.value};for(f({type:"bos"});p0){if(a.ranges>0){a.ranges=0;let e=a.nodes.shift();a.nodes=[e,{type:"text",value:stringify$1(a)}]}f({type:"comma",value:i}),a.commas++}else if(i===CHAR_DOT$1&&h>0&&0===a.commas){let e=a.nodes;if(0===h||0===e.length){f({type:"text",value:i});continue}if("dot"===c.type){if(a.range=[],c.value+=i,c.type="range",3!==a.nodes.length&&5!==a.nodes.length){a.invalid=!0,a.ranges=0,c.type="text";continue}a.ranges++,a.args=[];continue}if("range"===c.type){e.pop();let t=e[e.length-1];t.value+=c.value+i,c=t,a.ranges--;continue}f({type:"dot",value:i})}else f({type:"text",value:i});else{if("brace"!==a.type){f({type:"text",value:i});continue}let e="close";a=o.pop(),a.close=!0,f({type:e,value:i}),h--,a=o[o.length-1]}else{h++;let e=c.value&&"$"===c.value.slice(-1)||!0===a.dollar;a=f({type:"brace",open:!0,close:!1,dollar:e,depth:h,commas:0,ranges:0,nodes:[]}),o.push(a),f({type:"open",value:i})}else{let e,n=i;for(!0!==t.keepQuotes&&(i="");p{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)});let e=o[o.length-1],t=e.nodes.indexOf(a);e.nodes.splice(t,1,...a.nodes)}}while(o.length>0);return f({type:"eos"}),s};var parse_1$2=parse$f;const braces=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=braces.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(braces.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(n=[...new Set(n)]),n};braces.parse=(e,t={})=>parse_1$2(e,t),braces.stringify=(e,t={})=>stringify$1("string"==typeof e?braces.parse(e,t):e,t),braces.compile=(e,t={})=>("string"==typeof e&&(e=braces.parse(e,t)),compile_1(e,t)),braces.expand=(e,t={})=>{"string"==typeof e&&(e=braces.parse(e,t));let n=expand_1(e,t);return!0===t.noempty&&(n=n.filter(Boolean)),!0===t.nodupes&&(n=[...new Set(n)]),n},braces.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?braces.compile(e,t):braces.expand(e,t);var braces_1=braces,binaryExtensions$1=["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","oga","ogg","ogv","otf","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rtf","rz","s3m","s7z","scpt","sgi","shar","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"],binaryExtensions$2=Object.freeze({__proto__:null,default:binaryExtensions$1}),require$$0$3=getCjsExportFromNamespace$1(binaryExtensions$2),binaryExtensions$3=require$$0$3;const path$m=require("path"),extensions=new Set(binaryExtensions$3);var isBinaryPath=e=>extensions.has(path$m.extname(e).slice(1).toLowerCase()),constants$7=createCommonjsModule$1((function(e,t){const{sep:n}=require("path"),{platform:r}=process;t.EV_ALL="all",t.EV_READY="ready",t.EV_ADD="add",t.EV_CHANGE="change",t.EV_ADD_DIR="addDir",t.EV_UNLINK="unlink",t.EV_UNLINK_DIR="unlinkDir",t.EV_RAW="raw",t.EV_ERROR="error",t.STR_DATA="data",t.STR_END="end",t.STR_CLOSE="close",t.FSEVENT_CREATED="created",t.FSEVENT_MODIFIED="modified",t.FSEVENT_DELETED="deleted",t.FSEVENT_MOVED="moved",t.FSEVENT_CLONED="cloned",t.FSEVENT_UNKNOWN="unknown",t.FSEVENT_TYPE_FILE="file",t.FSEVENT_TYPE_DIRECTORY="directory",t.FSEVENT_TYPE_SYMLINK="symlink",t.KEY_LISTENERS="listeners",t.KEY_ERR="errHandlers",t.KEY_RAW="rawEmitters",t.HANDLER_KEYS=[t.KEY_LISTENERS,t.KEY_ERR,t.KEY_RAW],t.DOT_SLASH="."+n,t.BACK_SLASH_RE=/\\/g,t.DOUBLE_SLASH_RE=/\/\//,t.SLASH_OR_BACK_SLASH_RE=/[/\\]/,t.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,t.REPLACER_RE=/^\.[/\\]/,t.SLASH="/",t.BRACE_START="{",t.BANG="!",t.ONE_DOT=".",t.TWO_DOTS="..",t.STAR="*",t.GLOBSTAR="**",t.ROOT_GLOBSTAR="/**/*",t.SLASH_GLOBSTAR="/**",t.DIR_SUFFIX="Dir",t.ANYMATCH_OPTS={dot:!0},t.STRING_TYPE="string",t.FUNCTION_TYPE="function",t.EMPTY_STR="",t.EMPTY_FN=()=>{},t.IDENTITY_FN=e=>e,t.isWindows="win32"===r,t.isMacos="darwin"===r}));const fs$k=require("fs"),sysPath$1=require("path"),{promisify:promisify$2}=require("util"),{isWindows:isWindows$5,EMPTY_FN,EMPTY_STR,KEY_LISTENERS,KEY_ERR,KEY_RAW,HANDLER_KEYS,EV_CHANGE,EV_ADD,EV_ADD_DIR,EV_ERROR,STR_DATA,STR_END,BRACE_START,STAR:STAR$1}=constants$7,THROTTLE_MODE_WATCH="watch",open=promisify$2(fs$k.open),stat$2=promisify$2(fs$k.stat),lstat$1=promisify$2(fs$k.lstat),close=promisify$2(fs$k.close),fsrealpath=promisify$2(fs$k.realpath),statMethods={lstat:lstat$1,stat:stat$2},foreach=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},addAndConvert=(e,t,n)=>{let r=e[t];r instanceof Set||(e[t]=r=new Set([r])),r.add(n)},clearItem=e=>t=>{const n=e[t];n instanceof Set?n.clear():delete e[t]},delFromSet=(e,t,n)=>{const r=e[t];r instanceof Set?r.delete(n):r===n&&delete e[t]},isEmptySet=e=>e instanceof Set?0===e.size:!e,FsWatchInstances=new Map;function createFsWatchInstance(e,t,n,r,i){const s=(t,r)=>{n(e),i(t,r,{watchedPath:e}),r&&e!==r&&fsWatchBroadcast(sysPath$1.resolve(e,r),KEY_LISTENERS,sysPath$1.join(e,r))};try{return fs$k.watch(e,t,s)}catch(e){r(e)}}const fsWatchBroadcast=(e,t,n,r,i)=>{const s=FsWatchInstances.get(e);s&&foreach(s[t],e=>{e(n,r,i)})},setFsWatchListener=(e,t,n,r)=>{const{listener:i,errHandler:s,rawEmitter:o}=r;let a,c=FsWatchInstances.get(t);if(!n.persistent)return a=createFsWatchInstance(e,n,i,s,o),a.close.bind(a);if(c)addAndConvert(c,KEY_LISTENERS,i),addAndConvert(c,KEY_ERR,s),addAndConvert(c,KEY_RAW,o);else{if(a=createFsWatchInstance(e,n,fsWatchBroadcast.bind(null,t,KEY_LISTENERS),s,fsWatchBroadcast.bind(null,t,KEY_RAW)),!a)return;a.on(EV_ERROR,async n=>{const r=fsWatchBroadcast.bind(null,t,KEY_ERR);if(c.watcherUnusable=!0,isWindows$5&&"EPERM"===n.code)try{const t=await open(e,"r");await close(t),r(n)}catch(e){}else r(n)}),c={listeners:i,errHandlers:s,rawEmitters:o,watcher:a},FsWatchInstances.set(t,c)}return()=>{delFromSet(c,KEY_LISTENERS,i),delFromSet(c,KEY_ERR,s),delFromSet(c,KEY_RAW,o),isEmptySet(c.listeners)&&(c.watcher.close(),FsWatchInstances.delete(t),HANDLER_KEYS.forEach(clearItem(c)),c.watcher=void 0,Object.freeze(c))}},FsWatchFileInstances=new Map,setFsWatchFileListener=(e,t,n,r)=>{const{listener:i,rawEmitter:s}=r;let o=FsWatchFileInstances.get(t),a=new Set,c=new Set;const l=o&&o.options;return l&&(l.persistentn.interval)&&(a=o.listeners,c=o.rawEmitters,fs$k.unwatchFile(t),o=void 0),o?(addAndConvert(o,KEY_LISTENERS,i),addAndConvert(o,KEY_RAW,s)):(o={listeners:i,rawEmitters:s,options:n,watcher:fs$k.watchFile(t,n,(n,r)=>{foreach(o.rawEmitters,e=>{e(EV_CHANGE,t,{curr:n,prev:r})});const i=n.mtimeMs;(n.size!==r.size||i>r.mtimeMs||0===i)&&foreach(o.listeners,t=>t(e,n))})},FsWatchFileInstances.set(t,o)),()=>{delFromSet(o,KEY_LISTENERS,i),delFromSet(o,KEY_RAW,s),isEmptySet(o.listeners)&&(FsWatchFileInstances.delete(t),fs$k.unwatchFile(t),o.options=o.watcher=void 0,Object.freeze(o))}};class NodeFsHandler{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){const n=this.fsw.options,r=sysPath$1.dirname(e),i=sysPath$1.basename(e);this.fsw._getWatchedDir(r).add(i);const s=sysPath$1.resolve(e),o={persistent:n.persistent};let a;return t||(t=EMPTY_FN),n.usePolling?(o.interval=n.enableBinaryInterval&&isBinaryPath(i)?n.binaryInterval:n.interval,a=setFsWatchFileListener(e,s,o,{listener:t,rawEmitter:this.fsw._emitRaw})):a=setFsWatchListener(e,s,o,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),a}_handleFile(e,t,n){if(this.fsw.closed)return;const r=sysPath$1.dirname(e),i=sysPath$1.basename(e),s=this.fsw._getWatchedDir(r);let o=t;if(s.has(i))return;const a=this._watchWithNodeFs(e,async(t,n)=>{if(this.fsw._throttle("watch",e,5))if(n&&0!==n.mtimeMs){if(s.has(i)){const t=n.atimeMs,r=n.mtimeMs;(!t||t<=r||r!==o.mtimeMs)&&this.fsw._emit(EV_CHANGE,e,n),o=n}}else try{const t=await stat$2(e);if(this.fsw.closed)return;const n=t.atimeMs,r=t.mtimeMs;(!n||n<=r||r!==o.mtimeMs)&&this.fsw._emit(EV_CHANGE,e,t),o=t}catch(e){this.fsw._remove(r,i)}});if((!n||!this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(EV_ADD,e,0))return;this.fsw._emit(EV_ADD,e,t)}return a}async _handleSymlink(e,t,n,r){if(this.fsw.closed)return;const i=e.fullPath,s=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();const t=await fsrealpath(n);if(this.fsw.closed)return;return s.has(r)?this.fsw._symlinkPaths.get(i)!==t&&(this.fsw._symlinkPaths.set(i,t),this.fsw._emit(EV_CHANGE,n,e.stats)):(s.add(r),this.fsw._symlinkPaths.set(i,t),this.fsw._emit(EV_ADD,n,e.stats)),this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(i))return!0;this.fsw._symlinkPaths.set(i,!0)}_handleRead(e,t,n,r,i,s,o){if(e=sysPath$1.join(e,EMPTY_STR),!n.hasGlob&&!(o=this.fsw._throttle("readdir",e,1e3)))return;const a=this.fsw._getWatchedDir(n.path),c=new Set;let l=this.fsw._readdirp(e,{fileFilter:e=>n.filterPath(e),directoryFilter:e=>n.filterDir(e),depth:0}).on(STR_DATA,async o=>{if(this.fsw.closed)return void(l=void 0);const u=o.path;let p=sysPath$1.join(e,u);c.add(u),o.stats.isSymbolicLink()&&await this._handleSymlink(o,e,p,u)||(this.fsw.closed?l=void 0:u!==r&&(r||a.has(u))||(this.fsw._incrReadyCount(),p=sysPath$1.join(i,sysPath$1.relative(i,p)),this._addToNodeFs(p,t,n,s+1)))}).on(EV_ERROR,this._boundHandleError);return new Promise(t=>l.once(STR_END,()=>{if(this.fsw.closed)return void(l=void 0);const u=!!o&&o.clear();t(),a.getChildren().filter(t=>t!==e&&!c.has(t)&&(!n.hasGlob||n.filterPath({fullPath:sysPath$1.resolve(e,t)}))).forEach(t=>{this.fsw._remove(e,t)}),l=void 0,u&&this._handleRead(e,!1,n,r,i,s,o)}))}async _handleDir(e,t,n,r,i,s,o){const a=this.fsw._getWatchedDir(sysPath$1.dirname(e)),c=a.has(sysPath$1.basename(e));let l;n&&this.fsw.options.ignoreInitial||i||c||s.hasGlob&&!s.globFilter(e)||this.fsw._emit(EV_ADD_DIR,e,t),a.add(sysPath$1.basename(e)),this.fsw._getWatchedDir(e);const u=this.fsw.options.depth;if((null==u||r<=u)&&!this.fsw._symlinkPaths.has(o)){if(!i&&(await this._handleRead(e,n,s,i,e,r,void 0),this.fsw.closed))return;l=this._watchWithNodeFs(e,(t,n)=>{n&&0===n.mtimeMs||this._handleRead(t,!1,s,i,e,r,void 0)})}return l}async _addToNodeFs(e,t,n,r,i){const s=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return s(),!1;const o=this.fsw._getWatchHelpers(e,r);!o.hasGlob&&n&&(o.hasGlob=n.hasGlob,o.globFilter=n.globFilter,o.filterPath=e=>n.filterPath(e),o.filterDir=e=>n.filterDir(e));try{const n=await statMethods[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,n))return s(),!1;const a=this.fsw.options.followSymlinks&&!e.includes(STAR$1)&&!e.includes(BRACE_START);let c;if(n.isDirectory()){const s=a?await fsrealpath(e):e;if(this.fsw.closed)return;if(c=await this._handleDir(o.watchPath,n,t,r,i,o,s),this.fsw.closed)return;e!==s&&void 0!==s&&this.fsw._symlinkPaths.set(s,!0)}else if(n.isSymbolicLink()){const i=a?await fsrealpath(e):e;if(this.fsw.closed)return;const s=sysPath$1.dirname(o.watchPath);if(this.fsw._getWatchedDir(s).add(o.watchPath),this.fsw._emit(EV_ADD,o.watchPath,n),c=await this._handleDir(s,n,t,r,e,o,i),this.fsw.closed)return;void 0!==i&&this.fsw._symlinkPaths.set(sysPath$1.resolve(e),i)}else c=this._handleFile(o.watchPath,n,t);return s(),this.fsw._addPathCloser(e,c),!1}catch(t){if(this.fsw._handleError(t))return s(),e}}}var nodefsHandler=NodeFsHandler;const fs$l=require("fs"),sysPath$2=require("path"),{promisify:promisify$3}=require("util");let fsevents;try{fsevents=require("fsevents")}catch(error){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(error)}if(fsevents){const e=process.version.match(/v(\d+)\.(\d+)/);if(e&&e[1]&&e[2]){const t=Number.parseInt(e[1],10),n=Number.parseInt(e[2],10);8===t&&n<16&&(fsevents=void 0)}}const{EV_ADD:EV_ADD$1,EV_CHANGE:EV_CHANGE$1,EV_ADD_DIR:EV_ADD_DIR$1,EV_UNLINK,EV_ERROR:EV_ERROR$1,STR_DATA:STR_DATA$1,STR_END:STR_END$1,FSEVENT_CREATED,FSEVENT_MODIFIED,FSEVENT_DELETED,FSEVENT_MOVED,FSEVENT_UNKNOWN,FSEVENT_TYPE_FILE,FSEVENT_TYPE_DIRECTORY,FSEVENT_TYPE_SYMLINK,ROOT_GLOBSTAR,DIR_SUFFIX,DOT_SLASH,FUNCTION_TYPE,EMPTY_FN:EMPTY_FN$1,IDENTITY_FN}=constants$7,Depth=e=>isNaN(e)?{}:{depth:e},stat$3=promisify$3(fs$l.stat),lstat$2=promisify$3(fs$l.lstat),realpath$3=promisify$3(fs$l.realpath),statMethods$1={stat:stat$3,lstat:lstat$2},FSEventsWatchers=new Map,consolidateThreshhold=10,wrongEventFlags=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),createFSEventsInstance=(e,t)=>({stop:fsevents.watch(e,t)});function setFSEventsListener(e,t,n,r,i){let s=sysPath$2.extname(e)?sysPath$2.dirname(e):e;const o=sysPath$2.dirname(s);let a=FSEventsWatchers.get(s);couldConsolidate(o)&&(s=o);const c=sysPath$2.resolve(e),l=c!==t,u=(e,r,i)=>{l&&(e=e.replace(t,c)),e!==c&&e.indexOf(c+sysPath$2.sep)||n(e,r,i)};let p=!1;for(const e of FSEventsWatchers.keys())if(0===t.indexOf(sysPath$2.resolve(e)+sysPath$2.sep)){s=e,a=FSEventsWatchers.get(s),p=!0;break}return a||p?a.listeners.add(u):(a={listeners:new Set([u]),rawEmitter:r,watcher:createFSEventsInstance(s,(e,t)=>{if(i.closed)return;const n=fsevents.getInfo(e,t);a.listeners.forEach(r=>{r(e,t,n)}),a.rawEmitter(n.event,e,n)})},FSEventsWatchers.set(s,a)),()=>{const e=a.listeners;if(e.delete(u),!e.size&&(FSEventsWatchers.delete(s),a.watcher))return a.watcher.stop().then(()=>{a.rawEmitter=a.watcher=void 0,Object.freeze(a)})}}const couldConsolidate=e=>{let t=0;for(const n of FSEventsWatchers.keys())if(0===n.indexOf(e)&&(t++,t>=10))return!0;return!1},canUse=()=>fsevents&&FSEventsWatchers.size<128,calcDepth=(e,t)=>{let n=0;for(;!e.indexOf(t)&&(e=sysPath$2.dirname(e))!==t;)n++;return n},sameTypes=(e,t)=>e.type===FSEVENT_TYPE_DIRECTORY&&t.isDirectory()||e.type===FSEVENT_TYPE_SYMLINK&&t.isSymbolicLink()||e.type===FSEVENT_TYPE_FILE&&t.isFile();class FsEventsHandler{constructor(e){this.fsw=e}checkIgnored(e,t){const n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,t))return n.add(e),t&&t.isDirectory()&&n.add(e+ROOT_GLOBSTAR),!0;n.delete(e),n.delete(e+ROOT_GLOBSTAR)}addOrChange(e,t,n,r,i,s,o,a){const c=i.has(s)?EV_CHANGE$1:EV_ADD$1;this.handleEvent(c,e,t,n,r,i,s,o,a)}async checkExists(e,t,n,r,i,s,o,a){try{const c=await stat$3(e);if(this.fsw.closed)return;if(this.fsw.closed)return;sameTypes(o,c)?this.addOrChange(e,t,n,r,i,s,o,a):this.handleEvent(EV_UNLINK,e,t,n,r,i,s,o,a)}catch(c){"EACCES"===c.code?this.addOrChange(e,t,n,r,i,s,o,a):this.handleEvent(EV_UNLINK,e,t,n,r,i,s,o,a)}}handleEvent(e,t,n,r,i,s,o,a,c){if(!this.fsw.closed&&!this.checkIgnored(t))if(e===EV_UNLINK){const e=a.type===FSEVENT_TYPE_DIRECTORY;(e||s.has(o))&&this.fsw._remove(i,o,e)}else{if(e===EV_ADD$1){if(a.type===FSEVENT_TYPE_DIRECTORY&&this.fsw._getWatchedDir(t),a.type===FSEVENT_TYPE_SYMLINK&&c.followSymlinks){const e=void 0===c.depth?void 0:calcDepth(n,r)+1;return this._addToFsEvents(t,!1,!0,e)}this.fsw._getWatchedDir(i).add(o)}const s=a.type===FSEVENT_TYPE_DIRECTORY?e+DIR_SUFFIX:e;this.fsw._emit(s,t),s===EV_ADD_DIR$1&&this._addToFsEvents(t,!1,!0)}}_watchWithFsEvents(e,t,n,r){if(this.fsw.closed)return;if(this.fsw._isIgnored(e))return;const i=this.fsw.options,s=setFSEventsListener(e,t,async(s,o,a)=>{if(this.fsw.closed)return;if(void 0!==i.depth&&calcDepth(s,t)>i.depth)return;const c=n(sysPath$2.join(e,sysPath$2.relative(e,s)));if(r&&!r(c))return;const l=sysPath$2.dirname(c),u=sysPath$2.basename(c),p=this.fsw._getWatchedDir(a.type===FSEVENT_TYPE_DIRECTORY?c:l);if(wrongEventFlags.has(o)||a.event===FSEVENT_UNKNOWN)if(typeof i.ignored===FUNCTION_TYPE){let e;try{e=await stat$3(c)}catch(e){}if(this.fsw.closed)return;if(this.checkIgnored(c,e))return;sameTypes(a,e)?this.addOrChange(c,s,t,l,p,u,a,i):this.handleEvent(EV_UNLINK,c,s,t,l,p,u,a,i)}else this.checkExists(c,s,t,l,p,u,a,i);else switch(a.event){case FSEVENT_CREATED:case FSEVENT_MODIFIED:return this.addOrChange(c,s,t,l,p,u,a,i);case FSEVENT_DELETED:case FSEVENT_MOVED:return this.checkExists(c,s,t,l,p,u,a,i)}},this.fsw._emitRaw,this.fsw);return this.fsw._emitReady(),s}async _handleFsEventsSymlink(e,t,n,r){if(!this.fsw.closed&&!this.fsw._symlinkPaths.has(t)){this.fsw._symlinkPaths.set(t,!0),this.fsw._incrReadyCount();try{const t=await realpath$3(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(t))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(t||e,r=>{let i=e;return t&&t!==DOT_SLASH?i=r.replace(t,e):r!==DOT_SLASH&&(i=sysPath$2.join(e,r)),n(i)},!1,r)}catch(e){if(this.fsw._handleError(e))return this.fsw._emitReady()}}}emitAdd(e,t,n,r,i){const s=n(e),o=t.isDirectory(),a=this.fsw._getWatchedDir(sysPath$2.dirname(s)),c=sysPath$2.basename(s);o&&this.fsw._getWatchedDir(s),a.has(c)||(a.add(c),r.ignoreInitial&&!0!==i||this.fsw._emit(o?EV_ADD_DIR$1:EV_ADD$1,s,t))}initWatch(e,t,n,r){if(this.fsw.closed)return;const i=this._watchWithFsEvents(n.watchPath,sysPath$2.resolve(e||n.watchPath),r,n.globFilter);this.fsw._addPathCloser(t,i)}async _addToFsEvents(e,t,n,r){if(this.fsw.closed)return;const i=this.fsw.options,s=typeof t===FUNCTION_TYPE?t:IDENTITY_FN,o=this.fsw._getWatchHelpers(e);try{const t=await statMethods$1[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,t))throw null;if(t.isDirectory()){if(o.globFilter||this.emitAdd(s(e),t,s,i,n),r&&r>i.depth)return;this.fsw._readdirp(o.watchPath,{fileFilter:e=>o.filterPath(e),directoryFilter:e=>o.filterDir(e),...Depth(i.depth-(r||0))}).on(STR_DATA$1,e=>{if(this.fsw.closed)return;if(e.stats.isDirectory()&&!o.filterPath(e))return;const t=sysPath$2.join(o.watchPath,e.path),{fullPath:r}=e;if(o.followSymlinks&&e.stats.isSymbolicLink()){const e=void 0===i.depth?void 0:calcDepth(t,sysPath$2.resolve(o.watchPath))+1;this._handleFsEventsSymlink(t,r,s,e)}else this.emitAdd(t,e.stats,s,i,n)}).on(EV_ERROR$1,EMPTY_FN$1).on(STR_END$1,()=>{this.fsw._emitReady()})}else this.emitAdd(o.watchPath,t,s,i,n),this.fsw._emitReady()}catch(e){e&&!this.fsw._handleError(e)||(this.fsw._emitReady(),this.fsw._emitReady())}if(i.persistent&&!0!==n)if(typeof t===FUNCTION_TYPE)this.initWatch(void 0,e,o,s);else{let t;try{t=await realpath$3(o.watchPath)}catch(e){}this.initWatch(t,e,o,s)}}}var fseventsHandler=FsEventsHandler,canUse_1=canUse;fseventsHandler.canUse=canUse_1;const{EventEmitter:EventEmitter$2}=require("events"),fs$m=require("fs"),sysPath$3=require("path"),{promisify:promisify$4}=require("util"),anymatch=anymatch_1.default,{EV_ALL,EV_READY,EV_ADD:EV_ADD$2,EV_CHANGE:EV_CHANGE$2,EV_UNLINK:EV_UNLINK$1,EV_ADD_DIR:EV_ADD_DIR$2,EV_UNLINK_DIR,EV_RAW,EV_ERROR:EV_ERROR$2,STR_CLOSE,STR_END:STR_END$2,BACK_SLASH_RE,DOUBLE_SLASH_RE,SLASH_OR_BACK_SLASH_RE,DOT_RE,REPLACER_RE,SLASH:SLASH$1,BRACE_START:BRACE_START$1,BANG:BANG$1,ONE_DOT,TWO_DOTS,GLOBSTAR:GLOBSTAR$2,SLASH_GLOBSTAR,ANYMATCH_OPTS,STRING_TYPE,FUNCTION_TYPE:FUNCTION_TYPE$1,EMPTY_STR:EMPTY_STR$1,EMPTY_FN:EMPTY_FN$2,isWindows:isWindows$6,isMacos}=constants$7,stat$4=promisify$4(fs$m.stat),readdir$2=promisify$4(fs$m.readdir),arrify=(e=[])=>Array.isArray(e)?e:[e],flatten$1=(e,t=[])=>(e.forEach(e=>{Array.isArray(e)?flatten$1(e,t):t.push(e)}),t),unifyPaths=e=>{const t=flatten$1(arrify(e));if(!t.every(e=>typeof e===STRING_TYPE))throw new TypeError("Non-string provided as watch path: "+t);return t.map(normalizePathToUnix)},toUnix=e=>{let t=e.replace(BACK_SLASH_RE,SLASH$1);for(;t.match(DOUBLE_SLASH_RE);)t=t.replace(DOUBLE_SLASH_RE,SLASH$1);return t},normalizePathToUnix=e=>toUnix(sysPath$3.normalize(toUnix(e))),normalizeIgnored=(e=EMPTY_STR$1)=>t=>typeof t!==STRING_TYPE?t:normalizePathToUnix(sysPath$3.isAbsolute(t)?t:sysPath$3.join(e,t)),getAbsolutePath=(e,t)=>sysPath$3.isAbsolute(e)?e:e.startsWith(BANG$1)?BANG$1+sysPath$3.join(t,e.slice(1)):sysPath$3.join(t,e),undef=(e,t)=>void 0===e[t];class DirEntry{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){const{items:t}=this;t&&e!==ONE_DOT&&e!==TWO_DOTS&&t.add(e)}async remove(e){const{items:t}=this;if(!t)return;if(t.delete(e),t.size>0)return;const n=this.path;try{await readdir$2(n)}catch(e){this._removeWatcher&&this._removeWatcher(sysPath$3.dirname(n),sysPath$3.basename(n))}}has(e){const{items:t}=this;if(t)return t.has(e)}getChildren(){const{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}}const STAT_METHOD_F="stat",STAT_METHOD_L="lstat";class WatchHelper{constructor(e,t,n,r){this.fsw=r,this.path=e=e.replace(REPLACER_RE,EMPTY_STR$1),this.watchPath=t,this.fullWatchPath=sysPath$3.resolve(t),this.hasGlob=t!==e,e===EMPTY_STR$1&&(this.hasGlob=!1),this.globSymlink=!(!this.hasGlob||!n)&&void 0,this.globFilter=!!this.hasGlob&&anymatch(e,void 0,ANYMATCH_OPTS),this.dirParts=this.getDirParts(e),this.dirParts.forEach(e=>{e.length>1&&e.pop()}),this.followSymlinks=n,this.statMethod=n?"stat":"lstat"}checkGlobSymlink(e){return void 0===this.globSymlink&&(this.globSymlink=e.fullParentDir!==this.fullWatchPath&&{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return sysPath$3.join(this.watchPath,sysPath$3.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){const{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);const n=this.entryPath(e);return(!this.hasGlob||typeof this.globFilter!==FUNCTION_TYPE$1||this.globFilter(n))&&this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];const t=[];return(e.includes(BRACE_START$1)?braces_1.expand(e):[e]).forEach(e=>{t.push(sysPath$3.relative(this.watchPath,e).split(SLASH_OR_BACK_SLASH_RE))}),t}filterDir(e){if(this.hasGlob){const t=this.getDirParts(this.checkGlobSymlink(e));let n=!1;this.unmatchedGlob=!this.dirParts.some(e=>e.every((e,r)=>(e===GLOBSTAR$2&&(n=!0),n||!t[0][r]||anymatch(e,t[0][r],ANYMATCH_OPTS))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class FSWatcher extends EventEmitter$2{constructor(e){super();const t={};e&&Object.assign(t,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,undef(t,"persistent")&&(t.persistent=!0),undef(t,"ignoreInitial")&&(t.ignoreInitial=!1),undef(t,"ignorePermissionErrors")&&(t.ignorePermissionErrors=!1),undef(t,"interval")&&(t.interval=100),undef(t,"binaryInterval")&&(t.binaryInterval=300),undef(t,"disableGlobbing")&&(t.disableGlobbing=!1),t.enableBinaryInterval=t.binaryInterval!==t.interval,undef(t,"useFsEvents")&&(t.useFsEvents=!t.usePolling);fseventsHandler.canUse()||(t.useFsEvents=!1),undef(t,"usePolling")&&!t.useFsEvents&&(t.usePolling=isMacos);const n=process.env.CHOKIDAR_USEPOLLING;if(void 0!==n){const e=n.toLowerCase();t.usePolling="false"!==e&&"0"!==e&&("true"===e||"1"===e||!!e)}const r=process.env.CHOKIDAR_INTERVAL;r&&(t.interval=Number.parseInt(r,10)),undef(t,"atomic")&&(t.atomic=!t.usePolling&&!t.useFsEvents),t.atomic&&(this._pendingUnlinks=new Map),undef(t,"followSymlinks")&&(t.followSymlinks=!0),undef(t,"awaitWriteFinish")&&(t.awaitWriteFinish=!1),!0===t.awaitWriteFinish&&(t.awaitWriteFinish={});const i=t.awaitWriteFinish;i&&(i.stabilityThreshold||(i.stabilityThreshold=2e3),i.pollInterval||(i.pollInterval=100),this._pendingWrites=new Map),t.ignored&&(t.ignored=arrify(t.ignored));let s=0;this._emitReady=()=>{s++,s>=this._readyCount&&(this._emitReady=EMPTY_FN$2,this._readyEmitted=!0,process.nextTick(()=>this.emit(EV_READY)))},this._emitRaw=(...e)=>this.emit(EV_RAW,...e),this._readyEmitted=!1,this.options=t,t.useFsEvents?this._fsEventsHandler=new fseventsHandler(this):this._nodeFsHandler=new nodefsHandler(this),Object.freeze(t)}add(e,t,n){const{cwd:r,disableGlobbing:i}=this.options;this.closed=!1;let s=unifyPaths(e);return r&&(s=s.map(e=>{const t=getAbsolutePath(e,r);return i||!isGlob(e)?t:normalizePath(t)})),s=s.filter(e=>e.startsWith(BANG$1)?(this._ignoredPaths.add(e.slice(1)),!1):(this._ignoredPaths.delete(e),this._ignoredPaths.delete(e+SLASH_GLOBSTAR),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=s.length),this.options.persistent&&(this._readyCount*=2),s.forEach(e=>this._fsEventsHandler._addToFsEvents(e))):(this._readyCount||(this._readyCount=0),this._readyCount+=s.length,Promise.all(s.map(async e=>{const r=await this._nodeFsHandler._addToNodeFs(e,!n,0,0,t);return r&&this._emitReady(),r})).then(e=>{this.closed||e.filter(e=>e).forEach(e=>{this.add(sysPath$3.dirname(e),sysPath$3.basename(t||e))})})),this}unwatch(e){if(this.closed)return this;const t=unifyPaths(e),{cwd:n}=this.options;return t.forEach(e=>{sysPath$3.isAbsolute(e)||this._closers.has(e)||(n&&(e=sysPath$3.join(n,e)),e=sysPath$3.resolve(e)),this._closePath(e),this._ignoredPaths.add(e),this._watched.has(e)&&this._ignoredPaths.add(e+SLASH_GLOBSTAR),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();const e=[];return this._closers.forEach(t=>t.forEach(t=>{const n=t();n instanceof Promise&&e.push(n)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(e=>{this["_"+e].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){const e={};return this._watched.forEach((t,n)=>{const r=this.options.cwd?sysPath$3.relative(this.options.cwd,n):n;e[r||ONE_DOT]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(...t),e!==EV_ERROR$2&&this.emit(EV_ALL,...t)}async _emit(e,t,n,r,i){if(this.closed)return;const s=this.options;isWindows$6&&(t=sysPath$3.normalize(t)),s.cwd&&(t=sysPath$3.relative(s.cwd,t));const o=[e,t];void 0!==i?o.push(n,r,i):void 0!==r?o.push(n,r):void 0!==n&&o.push(n);const a=s.awaitWriteFinish;let c;if(a&&(c=this._pendingWrites.get(t)))return c.lastChange=new Date,this;if(s.atomic){if(e===EV_UNLINK$1)return this._pendingUnlinks.set(t,o),setTimeout(()=>{this._pendingUnlinks.forEach((e,t)=>{this.emit(...e),this.emit(EV_ALL,...e),this._pendingUnlinks.delete(t)})},"number"==typeof s.atomic?s.atomic:100),this;e===EV_ADD$2&&this._pendingUnlinks.has(t)&&(e=o[0]=EV_CHANGE$2,this._pendingUnlinks.delete(t))}if(a&&(e===EV_ADD$2||e===EV_CHANGE$2)&&this._readyEmitted){const n=(t,n)=>{t?(e=o[0]=EV_ERROR$2,o[1]=t,this.emitWithAll(e,o)):n&&(o.length>2?o[2]=n:o.push(n),this.emitWithAll(e,o))};return this._awaitWriteFinish(t,a.stabilityThreshold,e,n),this}if(e===EV_CHANGE$2){if(!this._throttle(EV_CHANGE$2,t,50))return this}if(s.alwaysStat&&void 0===n&&(e===EV_ADD$2||e===EV_ADD_DIR$2||e===EV_CHANGE$2)){const e=s.cwd?sysPath$3.join(s.cwd,t):t;let n;try{n=await stat$4(e)}catch(e){}if(!n||this.closed)return;o.push(n)}return this.emitWithAll(e,o),this}_handleError(e){const t=e&&e.code;return e&&"ENOENT"!==t&&"ENOTDIR"!==t&&(!this.options.ignorePermissionErrors||"EPERM"!==t&&"EACCES"!==t)&&this.emit(EV_ERROR$2,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);const r=this._throttled.get(e),i=r.get(t);if(i)return i.count++,!1;let s;const o=()=>{const e=r.get(t),n=e?e.count:0;return r.delete(t),clearTimeout(s),e&&clearTimeout(e.timeoutObject),n};s=setTimeout(o,n);const a={timeoutObject:s,clear:o,count:0};return r.set(t,a),a}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,r){let i,s=e;this.options.cwd&&!sysPath$3.isAbsolute(e)&&(s=sysPath$3.join(this.options.cwd,e));const o=new Date,a=n=>{fs$m.stat(s,(s,o)=>{if(s||!this._pendingWrites.has(e))return void(s&&"ENOENT"!==s.code&&r(s));const c=Number(new Date);n&&o.size!==n.size&&(this._pendingWrites.get(e).lastChange=c);c-this._pendingWrites.get(e).lastChange>=t?(this._pendingWrites.delete(e),r(void 0,o)):i=setTimeout(a,this.options.awaitWriteFinish.pollInterval,o)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:o,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(i),n)}),i=setTimeout(a,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,t){if(this.options.atomic&&DOT_RE.test(e))return!0;if(!this._userIgnored){const{cwd:e}=this.options,t=this.options.ignored,n=t&&t.map(normalizeIgnored(e)),r=arrify(n).filter(e=>typeof e===STRING_TYPE&&!isGlob(e)).map(e=>e+SLASH_GLOBSTAR),i=this._getGlobIgnored().map(normalizeIgnored(e)).concat(n,r);this._userIgnored=anymatch(i,void 0,ANYMATCH_OPTS)}return this._userIgnored([e,t])}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e,t){const n=t||this.options.disableGlobbing||!isGlob(e)?e:globParent(e),r=this.options.followSymlinks;return new WatchHelper(e,n,r,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));const t=sysPath$3.resolve(e);return this._watched.has(t)||this._watched.set(t,new DirEntry(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;const t=511&(e&&Number.parseInt(e.mode,10)),n=Number.parseInt(t.toString(8)[0],10);return Boolean(4&n)}_remove(e,t,n){const r=sysPath$3.join(e,t),i=sysPath$3.resolve(r);if(n=null!=n?n:this._watched.has(r)||this._watched.has(i),!this._throttle("remove",r,100))return;n||this.options.useFsEvents||1!==this._watched.size||this.add(e,t,!0);this._getWatchedDir(r).getChildren().forEach(e=>this._remove(r,e));const s=this._getWatchedDir(e),o=s.has(t);s.remove(t);let a=r;if(this.options.cwd&&(a=sysPath$3.relative(this.options.cwd,r)),this.options.awaitWriteFinish&&this._pendingWrites.has(a)){if(this._pendingWrites.get(a).cancelWait()===EV_ADD$2)return}this._watched.delete(r),this._watched.delete(i);const c=n?EV_UNLINK_DIR:EV_UNLINK$1;o&&!this._isIgnored(r)&&this._emit(c,r),this.options.useFsEvents||this._closePath(r)}_closePath(e){const t=this._closers.get(e);if(!t)return;t.forEach(e=>e()),this._closers.delete(e);const n=sysPath$3.dirname(e);this._getWatchedDir(n).remove(sysPath$3.basename(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;const n={type:EV_ALL,alwaysStat:!0,lstat:!0,...t};let r=readdirp_1(e,n);return this._streams.add(r),r.once(STR_CLOSE,()=>{r=void 0}),r.once(STR_END$2,()=>{r&&(this._streams.delete(r),r=void 0)}),r}}var FSWatcher_1=FSWatcher;const watch$1=(e,t)=>{const n=new FSWatcher(t);return n.add(e),n};var watch_1=watch$1,chokidar={FSWatcher:FSWatcher_1,watch:watch_1};const cjsDefault$1=e=>"default"in e?e.default:e,{Parser:Parser$2}=cjsDefault$1(acorn$1);function createPluginContainer(e,t={}){let n;Array.isArray(e)||(e=[e]);let r=Parser$2;const i={meta:{},options:{},parse:(e,t)=>r.parse(e,{sourceType:"module",ecmaVersion:2020,locations:!0,onComment:[],...t}),warn(...e){console.log(`[${n.name}]`,...e)}},s={ctx:i,options(t){for(n of e)n.options&&(t=n.options.call(i,t)||t);return t.acornInjectPlugins&&(r=Parser$2.extend(...[].concat(t.acornInjectPlugins))),t},resolveImportMeta(t){for(n of e){if(!n.resolveImportMeta)continue;const e=n.resolveImportMeta.call(i,t);if(e)return e}},async resolveId(t,r){const s={};for(n of e){if(!n.resolveId)continue;const e=await n.resolveId.call(i,t,r);if(!e)return null;"string"==typeof e?t=e:(t=e.id,Object.assign(s,e))}return s.id=t,Object.keys(s).length>1?s:t},async transform(t,r){for(n of e){if(!n.transform)continue;const e=await n.transform.call(i,t,r);e&&(t="object"==typeof e?e.code:e)}return t}};return i.options=s.options({acornInjectPlugins:[]}),s}const withCache$1=e=>e,ROLLUP_FAST_OUTPUT={compact:!0,hoistTransitiveImports:!1,indent:!1,interop:!1,minifyInternalExports:!1,preferConst:!0,sourcemap:!1};let cache;const compileSingleModule=async(e,{cwd:t,out:n})=>{e=e.replace(/\.css\.js$/,".css");const r=await rollup({input:e,treeshake:!1,preserveModules:!0,inlineDynamicImports:!1,preserveEntrySignatures:"strict",cache,plugins:[{name:"wmr-single-file-resolver",resolveId:t=>t==e?null:("wmr"===t?t="/_wmr.js":/^\.?\.?(\/|$)/.test(t)?/\.css$/.test(t)&&(t+=".js"):t="/@npm/"+t,{id:t,external:!0,moduleSideEffects:!0})},wmrPlugin(),htmPlugin()]});cache=r.cache;return(await r.write({...ROLLUP_FAST_OUTPUT,dir:n,assetFileNames:"[name].[ext]",paths:e=>e,format:"es"})).output[0].code};function wmrMiddleware({cwd:e,out:t=".dist",onError:n,onChange:r}={}){e=path$n.resolve(process.cwd(),e||".");const i=chokidar.watch(e,{cwd:e,disableGlobbing:!0,ignored:/(^|[/\\])node_modules[/\\]/}),s=new Set;function o(){r({changes:Array.from(s),duration:0}),s.clear()}return i.on("change",(e,t)=>{s.size||setTimeout(o,60),s.add("/"+e)}),async(r,i,s)=>{const o=path$n.normalize(r.path),a=path$n.join(e,o),c=path$n.relative(e,a).replace(/^\.\//,""),l=lite.getType(a);l&&i.setHeader("content-type",l);const u={req:r,res:i,id:c,file:a,path:o,cwd:e,out:t,next:s};let p;p="/_wmr.js"===o?getWmrClient.bind(null):/\.css\.js$/.test(a)?TRANSFORMS.cssModule:/\.([mc]js|[tj]sx?)$/.test(a)?TRANSFORMS.js:/\.(css|s[ac]ss)$/.test(a)?TRANSFORMS.css:TRANSFORMS.generic;try{const e=Date.now(),t=await p(u);if(!1===t)return s();if(null!=t){const n=Date.now()-e;i.writeHead(200,{"content-length":t.length,"server-timing":`${p.name};dur=${n}`}),i.end(t)}}catch(e){if(null==e)return s();n(e),s(e)}}}const NonRollup=createPluginContainer([wmrPlugin(),htmPlugin()]),TRANSFORMS={async js_test(e){let t=Date.now(),n=await TRANSFORMS.js_bundled(e);const r=Date.now()-t;t=Date.now(),n=await TRANSFORMS.js(e);const i=Date.now()-t;return console.log(`Bundled: ${r}ms, Raw: ${i}ms`),n},async js({id:e,file:t,res:n,cwd:r,out:i}){const s=path$n.resolve(r,t);let o=await fs$n.promises.readFile(s,"utf-8");return o=await NonRollup.transform(o,e),o=o.replace(/\bimport\.meta\.([a-zA-Z_$][a-zA-Z0-9_$]*)\b/g,(e,t)=>NonRollup.resolveImportMeta(t)||e),o=o.replace(/\b(import\s*(?:(?:\{.*?\}(?:\s*,\s*[\w$]+(?:\s+as\s+[\w$]+)?)?|[\w$]+(?:\s+as\s+[\w$]+)?(?:\s*,\s*\{.*?\})?)\s*from\s*)?)(['"])(.*?)\2/g,(e,t,n,r)=>(r.endsWith(".css")&&(r+=".js"),"wmr"===r?r="/_wmr.js":"."!==r[0]&&"/"!==r[0]&&(r="/@npm/"+r),`${t}${n}${r}${n}`)),n.setHeader("content-type","application/javascript"),writeCacheFile(i,e,o),o},async js_bundled({id:e,file:t,res:n,cwd:r,out:i}){const s=path$n.resolve(r,t),o=await compileSingleModule(s,{cwd:r,out:i});return n.setHeader("content-type","application/javascript"),o},async cssModule({id:e,file:t,cwd:n,out:r,res:i}){e=e.replace(/\.js$/,""),t=t.replace(/\.js$/,"");const s=wmrStylesPlugin({cwd:n}),o=new Map;let a=0;const c={meta:{},emitFile({type:e,name:t,source:n}){if("asset"!==e)throw Error("Unsupported type "+e);const i=String(++a),s=crypto$3.createHash("md5").update(n).digest("hex").substring(0,5),c=path$n.resolve(r,t).replace(/([^/]+?)(\.[\w]+)?$/,`$1-${s}$2`);return o.set(i,{id:i,name:t,filename:c}),fs$n.promises.writeFile(c,n),i}};await s.options.call(c,{input:n+"/_.js"});const l=await s.load.call(c,t);let u=l&&l.code||l;i.setHeader("content-type","application/javascript");const p=wmrPlugin();u=u.replace(/\bimport\.meta\.([\w$]+)/g,(e,t)=>p.resolveImportMeta.call(c,t)||e);const h=await p.transform.call(c,u,e);return u=h&&h.code||h||u,u.replace(/(['"])wmr\1/g,"$1/_wmr.js$1").replace(/import\.meta\.ROLLUP_FILE_URL_(\d+)/g,(e,t)=>JSON.stringify("/"+path$n.relative(r,o.get(t).filename)))},async css({id:e,path:t,file:n,cwd:r}){if(!/\.module\.css$/.test(t))throw null;let i=await fs$n.promises.readFile(n,"utf-8");if(e.match(/\.module\.css$/)){const t="_"+hash(e);i=i.replace(/\.([a-z0-9_-]+)/gi,(e,n)=>{const r=n+t;/^\d|[^a-z0-9_$]/gi.test(n);return"."+r})}return i},generic:({file:e,res:t})=>!1};async function writeCacheFile(e,t,n){const r=path$n.resolve(e,t);path$n.dirname(r)!==e&&await fs$n.promises.mkdir(path$n.dirname(r),{recursive:!0}),await fs$n.promises.writeFile(r,n)}async function getFreePort(e){let t=!1,n=0;for("string"==typeof e&&(e=parseInt(e,10));!t&&n<=20;)try{await new Promise((n,r)=>{const i=net$3.createServer();i.unref(),i.on("error",r),i.listen({port:e},()=>{e=i.address().port,t=!0,i.close(n)})})}catch(t){if("EADDRINUSE"!==t.code)throw t;e++,n++}return e}function getServerAddresses(e,{https:t=!1}={}){if("string"==typeof e)return"Listening on "+e;const n=t?"https:":"http:",r=e.address.replace("::","localhost"),i=e.port,s=os$4__default.networkInterfaces(),o=[];for(const e in s)for(const t of s[e]){const{family:e,address:s,internal:a}=t;"IPv4"!==e||s===r||a||o.push(`${n}//${s}:${i}`)}let a=`Listening on ${n}//${r}:${i}`;return o.length&&(a+="\n ⌙ "+o.join(", ")),a}async function start(e={}){function t(e){if(r.ws.clients.size>0)r.ws.broadcast({type:"error",error:e.clientMessage||e.message});else{const t=/^Error/.test(e.message)?e.message:e+"";console.error(t)}}function n({changes:e}){r.ws.broadcast({type:"update",changes:e})}setCwd(e.cwd),(e=await normalizeOptions(e)).prebuild?bundleDev({...e,onError:t,onBuild:n}):e.middleware=[wmrMiddleware({...e,onError:t,onChange:n})];const r=await server(e),i=await getFreePort(e.port||process.env.PORT||8080),s=e.host||process.env.HOST;r.listen(i,s),console.log(getServerAddresses(r.server.address(),{https:r.http2}))}const prog=lib$1("wmr");prog.command("build","make a production build").option("--cwd","Your web app root directory (default: ./public)").option("--out","Where to store generated files (default: ./dist)").action(e=>{build(e)}).command("start","Start a development server",{default:!0}).option("--port, -p","HTTP port to listen on (default: $PORT or 8080)").option("--host, -h","HTTP host to listen on (default: localhost)").option("--http2","Use HTTP/2 (default: false)").option("--compress","Enable compression (default: enabled)").option("--sourcemap","Enable Source Maps").option("--profile","Generate build statistics").option("--cwd","Your web app root directory (default: ./public)").option("--out","Where to store generated files (default: ./.dist)").option("--prebuild","Build modules at startup using Rollup").action(e=>{/true|false/.test(e.compress)&&(e.compress="false"!==e.compress),/true/.test(process.env.PROFILE)&&(e.profile=!0),start(e)}),prog.parse(process.argv),module.exports={get watch(){return require("fsevents/fsevents.js").watch},get getInfo(){return require("fsevents/fsevents.js").getInfo},get constants(){return require("fsevents/fsevents.js").constants}};var _virtual_fsevents=Object.freeze({__proto__:null}),utils$4=createCommonjsModule((function(e,t){t.isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),t.find=(e,t)=>e.nodes.find(e=>e.type===t),t.exceedsLimit=(e,n,r=1,i)=>!1!==i&&(!(!t.isInteger(e)||!t.isInteger(n))&&(Number(n)-Number(e))/Number(r)>=i),t.escapeNode=(e,t=0,n)=>{let r=e.nodes[t];r&&(n&&r.type===n||"open"===r.type||"close"===r.type)&&!0!==r.escaped&&(r.value="\\"+r.value,r.escaped=!0)},t.encloseBrace=e=>"brace"===e.type&&(e.commas>>0+e.ranges>>0==0&&(e.invalid=!0,!0)),t.isInvalidBrace=e=>"brace"===e.type&&(!(!0!==e.invalid&&!e.dollar)||(e.commas>>0+e.ranges>>0==0||!0!==e.open||!0!==e.close)&&(e.invalid=!0,!0)),t.isOpenOrClose=e=>"open"===e.type||"close"===e.type||(!0===e.open||!0===e.close),t.reduce=e=>e.reduce((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e),[]),t.flatten=(...e)=>{const t=[],n=e=>{for(let r=0;r{let n=(e,r={})=>{let i=t.escapeInvalid&&utils$4.isInvalidBrace(r),s=!0===e.invalid&&!0===t.escapeInvalid,o="";if(e.value)return(i||s)&&utils$4.isOpenOrClose(e)?"\\"+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(let t of e.nodes)o+=n(t);return o};return n(e)},isNumber$2=function(e){return"number"==typeof e?e-e==0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))};const toRegexRange$1=(e,t,n)=>{if(!1===isNumber$2(e))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===t||e===t)return String(e);if(!1===isNumber$2(t))throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...n};"boolean"==typeof r.strictZeros&&(r.relaxZeros=!1===r.strictZeros);let i=e+":"+t+"="+String(r.relaxZeros)+String(r.shorthand)+String(r.capture)+String(r.wrap);if(toRegexRange$1.cache.hasOwnProperty(i))return toRegexRange$1.cache[i].result;let s=Math.min(e,t),o=Math.max(e,t);if(1===Math.abs(s-o)){let n=e+"|"+t;return r.capture?`(${n})`:!1===r.wrap?n:`(?:${n})`}let a=hasPadding$1(e)||hasPadding$1(t),c={min:e,max:t,a:s,b:o},l=[],u=[];if(a&&(c.isPadded=a,c.maxLen=String(c.max).length),s<0){u=splitToPatterns$1(o<0?Math.abs(o):1,Math.abs(s),c,r),s=c.a=0}return o>=0&&(l=splitToPatterns$1(s,o,c,r)),c.negatives=u,c.positives=l,c.result=collatePatterns$1(u,l),!0===r.capture?c.result=`(${c.result})`:!1!==r.wrap&&l.length+u.length>1&&(c.result=`(?:${c.result})`),toRegexRange$1.cache[i]=c,c.result};function collatePatterns$1(e,t,n){let r=filterPatterns$1(e,t,"-",!1)||[],i=filterPatterns$1(t,e,"",!1)||[],s=filterPatterns$1(e,t,"-?",!0)||[];return r.concat(s).concat(i).join("|")}function splitToRanges$1(e,t){let n=1,r=1,i=countNines$1(e,n),s=new Set([t]);for(;e<=i&&i<=t;)s.add(i),n+=1,i=countNines$1(e,n);for(i=countZeros$1(t+1,r)-1;e1&&i.count.pop(),i.count.push(c.count[0]),i.string=i.pattern+toQuantifier$1(i.count),a=t+1)}return o}function filterPatterns$1(e,t,n,r,i){let s=[];for(let i of e){let{string:e}=i;r||contains$1(t,"string",e)||s.push(n+e),r&&contains$1(t,"string",e)&&s.push(n+e)}return s}function zip$1(e,t){let n=[];for(let r=0;rt?1:t>e?-1:0}function contains$1(e,t,n){return e.some(e=>e[t]===n)}function countNines$1(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function countZeros$1(e,t){return e-e%Math.pow(10,t)}function toQuantifier$1(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function toCharacterClass$1(e,t,n){return`[${e}${t-e==1?"":"-"}${t}]`}function hasPadding$1(e){return/^-?(0+)\d/.test(e)}function padZeros$1(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=!1!==n.relaxZeros;switch(r){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${r}}`:`0{${r}}`}}toRegexRange$1.cache={},toRegexRange$1.clearCache=()=>toRegexRange$1.cache={};var toRegexRange_1$1=toRegexRange$1;const isObject$5=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),transform$3=e=>t=>!0===e?Number(t):String(t),isValidValue$1=e=>"number"==typeof e||"string"==typeof e&&""!==e,isNumber$1$1=e=>Number.isInteger(+e),zeros$1=e=>{let t=""+e,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},stringify$1$1=(e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify,pad$1=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},toMaxLen$1=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length{e.negatives.sort((e,t)=>et?1:0),e.positives.sort((e,t)=>et?1:0);let n,r=t.capture?"":"?:",i="",s="";return e.positives.length&&(i=e.positives.join("|")),e.negatives.length&&(s=`-(${r}${e.negatives.join("|")})`),n=i&&s?`${i}|${s}`:i||s,t.wrap?`(${r}${n})`:n},toRange$1=(e,t,n,r)=>{if(n)return toRegexRange_1$1(e,t,{wrap:!1,...r});let i=String.fromCharCode(e);return e===t?i:`[${i}-${String.fromCharCode(t)}]`},toRegex$1=(e,t,n)=>{if(Array.isArray(e)){let t=!0===n.wrap,r=n.capture?"":"?:";return t?`(${r}${e.join("|")})`:e.join("|")}return toRegexRange_1$1(e,t,n)},rangeError$1=(...e)=>new RangeError("Invalid range arguments: "+util$6.inspect(...e)),invalidRange$1=(e,t,n)=>{if(!0===n.strictRanges)throw rangeError$1([e,t]);return[]},invalidStep$1=(e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]},fillNumbers$1=(e,t,n=1,r={})=>{let i=Number(e),s=Number(t);if(!Number.isInteger(i)||!Number.isInteger(s)){if(!0===r.strictRanges)throw rangeError$1([e,t]);return[]}0===i&&(i=0),0===s&&(s=0);let o=i>s,a=String(e),c=String(t),l=String(n);n=Math.max(Math.abs(n),1);let u=zeros$1(a)||zeros$1(c)||zeros$1(l),p=u?Math.max(a.length,c.length,l.length):0,h=!1===u&&!1===stringify$1$1(e,t,r),d=r.transform||transform$3(h);if(r.toRegex&&1===n)return toRange$1(toMaxLen$1(e,p),toMaxLen$1(t,p),!0,r);let f={negatives:[],positives:[]},m=[],g=0;for(;o?i>=s:i<=s;)!0===r.toRegex&&n>1?f[(_=i)<0?"negatives":"positives"].push(Math.abs(_)):m.push(pad$1(d(i,g),p,h)),i=o?i-n:i+n,g++;var _;return!0===r.toRegex?n>1?toSequence$1(f,r):toRegex$1(m,null,{wrap:!1,...r}):m},fillLetters$1=(e,t,n=1,r={})=>{if(!isNumber$1$1(e)&&e.length>1||!isNumber$1$1(t)&&t.length>1)return invalidRange$1(e,t,r);let i=r.transform||(e=>String.fromCharCode(e)),s=(""+e).charCodeAt(0),o=(""+t).charCodeAt(0),a=s>o,c=Math.min(s,o),l=Math.max(s,o);if(r.toRegex&&1===n)return toRange$1(c,l,!1,r);let u=[],p=0;for(;a?s>=o:s<=o;)u.push(i(s,p)),s=a?s-n:s+n,p++;return!0===r.toRegex?toRegex$1(u,null,{wrap:!1,options:r}):u},fill$1=(e,t,n,r={})=>{if(null==t&&isValidValue$1(e))return[e];if(!isValidValue$1(e)||!isValidValue$1(t))return invalidRange$1(e,t,r);if("function"==typeof n)return fill$1(e,t,1,{transform:n});if(isObject$5(n))return fill$1(e,t,0,n);let i={...r};return!0===i.capture&&(i.wrap=!0),n=n||i.step||1,isNumber$1$1(n)?isNumber$1$1(e)&&isNumber$1$1(t)?fillNumbers$1(e,t,n,i):fillLetters$1(e,t,Math.max(Math.abs(n),1),i):null==n||isObject$5(n)?fill$1(e,t,1,n):invalidStep$1(n,i)};var fillRange$1=fill$1;const compile$1=(e,t={})=>{let n=(e,r={})=>{let i=utils$4.isInvalidBrace(r),s=!0===e.invalid&&!0===t.escapeInvalid,o=!0===i||!0===s,a=!0===t.escapeInvalid?"\\":"",c="";if(!0===e.isOpen)return a+e.value;if(!0===e.isClose)return a+e.value;if("open"===e.type)return o?a+e.value:"(";if("close"===e.type)return o?a+e.value:")";if("comma"===e.type)return"comma"===e.prev.type?"":o?e.value:"|";if(e.value)return e.value;if(e.nodes&&e.ranges>0){let n=utils$4.reduce(e.nodes),r=fillRange$1(...n,{...t,wrap:!1,toRegex:!0});if(0!==r.length)return n.length>1&&r.length>1?`(${r})`:r}if(e.nodes)for(let t of e.nodes)c+=n(t,e);return c};return n(e)};var compile_1$1=compile$1;const append$1=(e="",t="",n=!1)=>{let r=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return n?utils$4.flatten(t).map(e=>`{${e}}`):t;for(let i of e)if(Array.isArray(i))for(let e of i)r.push(append$1(e,t,n));else for(let e of t)!0===n&&"string"==typeof e&&(e=`{${e}}`),r.push(Array.isArray(e)?append$1(i,e,n):i+e);return utils$4.flatten(r)},expand$2=(e,t={})=>{let n=void 0===t.rangeLimit?1e3:t.rangeLimit,r=(e,i={})=>{e.queue=[];let s=i,o=i.queue;for(;"brace"!==s.type&&"root"!==s.type&&s.parent;)s=s.parent,o=s.queue;if(e.invalid||e.dollar)return void o.push(append$1(o.pop(),stringify$3(e,t)));if("brace"===e.type&&!0!==e.invalid&&2===e.nodes.length)return void o.push(append$1(o.pop(),["{}"]));if(e.nodes&&e.ranges>0){let r=utils$4.reduce(e.nodes);if(utils$4.exceedsLimit(...r,t.step,n))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let i=fillRange$1(...r,t);return 0===i.length&&(i=stringify$3(e,t)),o.push(append$1(o.pop(),i)),void(e.nodes=[])}let a=utils$4.encloseBrace(e),c=e.queue,l=e;for(;"brace"!==l.type&&"root"!==l.type&&l.parent;)l=l.parent,c=l.queue;for(let t=0;t",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"};const{MAX_LENGTH:MAX_LENGTH$4,CHAR_BACKSLASH:CHAR_BACKSLASH$1,CHAR_BACKTICK:CHAR_BACKTICK$1,CHAR_COMMA:CHAR_COMMA$2,CHAR_DOT:CHAR_DOT$2,CHAR_LEFT_PARENTHESES:CHAR_LEFT_PARENTHESES$2,CHAR_RIGHT_PARENTHESES:CHAR_RIGHT_PARENTHESES$2,CHAR_LEFT_CURLY_BRACE:CHAR_LEFT_CURLY_BRACE$2,CHAR_RIGHT_CURLY_BRACE:CHAR_RIGHT_CURLY_BRACE$2,CHAR_LEFT_SQUARE_BRACKET:CHAR_LEFT_SQUARE_BRACKET$2,CHAR_RIGHT_SQUARE_BRACKET:CHAR_RIGHT_SQUARE_BRACKET$2,CHAR_DOUBLE_QUOTE:CHAR_DOUBLE_QUOTE$1,CHAR_SINGLE_QUOTE:CHAR_SINGLE_QUOTE$1,CHAR_NO_BREAK_SPACE:CHAR_NO_BREAK_SPACE$1,CHAR_ZERO_WIDTH_NOBREAK_SPACE:CHAR_ZERO_WIDTH_NOBREAK_SPACE$1}=constants$8,parse$g=(e,t={})=>{if("string"!=typeof e)throw new TypeError("Expected a string");let n=t||{},r="number"==typeof n.maxLength?Math.min(MAX_LENGTH$4,n.maxLength):MAX_LENGTH$4;if(e.length>r)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${r})`);let i,s={type:"root",input:e,nodes:[]},o=[s],a=s,c=s,l=0,u=e.length,p=0,h=0;const d=()=>e[p++],f=e=>{if("text"===e.type&&"dot"===c.type&&(c.type="text"),!c||"text"!==c.type||"text"!==e.type)return a.nodes.push(e),e.parent=a,e.prev=c,c=e,e;c.value+=e.value};for(f({type:"bos"});p0){if(a.ranges>0){a.ranges=0;let e=a.nodes.shift();a.nodes=[e,{type:"text",value:stringify$3(a)}]}f({type:"comma",value:i}),a.commas++}else if(i===CHAR_DOT$2&&h>0&&0===a.commas){let e=a.nodes;if(0===h||0===e.length){f({type:"text",value:i});continue}if("dot"===c.type){if(a.range=[],c.value+=i,c.type="range",3!==a.nodes.length&&5!==a.nodes.length){a.invalid=!0,a.ranges=0,c.type="text";continue}a.ranges++,a.args=[];continue}if("range"===c.type){e.pop();let t=e[e.length-1];t.value+=c.value+i,c=t,a.ranges--;continue}f({type:"dot",value:i})}else f({type:"text",value:i});else{if("brace"!==a.type){f({type:"text",value:i});continue}let e="close";a=o.pop(),a.close=!0,f({type:e,value:i}),h--,a=o[o.length-1]}else{h++;let e=c.value&&"$"===c.value.slice(-1)||!0===a.dollar;a=f({type:"brace",open:!0,close:!1,dollar:e,depth:h,commas:0,ranges:0,nodes:[]}),o.push(a),f({type:"open",value:i})}else{let e,n=i;for(!0!==t.keepQuotes&&(i="");p{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)});let e=o[o.length-1],t=e.nodes.indexOf(a);e.nodes.splice(t,1,...a.nodes)}}while(o.length>0);return f({type:"eos"}),s};var parse_1$3=parse$g;const braces$1=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=braces$1.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(braces$1.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(n=[...new Set(n)]),n};braces$1.parse=(e,t={})=>parse_1$3(e,t),braces$1.stringify=(e,t={})=>stringify$3("string"==typeof e?braces$1.parse(e,t):e,t),braces$1.compile=(e,t={})=>("string"==typeof e&&(e=braces$1.parse(e,t)),compile_1$1(e,t)),braces$1.expand=(e,t={})=>{"string"==typeof e&&(e=braces$1.parse(e,t));let n=expand_1$1(e,t);return!0===t.noempty&&(n=n.filter(Boolean)),!0===t.nodupes&&(n=[...new Set(n)]),n},braces$1.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?braces$1.compile(e,t):braces$1.expand(e,t);var braces_1$1=braces$1;const WIN_SLASH$1="\\\\/",WIN_NO_SLASH$1="[^\\\\/]",DOT_LITERAL$1="\\.",PLUS_LITERAL$1="\\+",QMARK_LITERAL$1="\\?",SLASH_LITERAL$1="\\/",ONE_CHAR$1="(?=.)",QMARK$2="[^/]",END_ANCHOR$1="(?:\\/|$)",START_ANCHOR$1="(?:^|\\/)",DOTS_SLASH$1="\\.{1,2}(?:\\/|$)",NO_DOT$1="(?!\\.)",NO_DOTS$1="(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH$1="(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH$1="(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT$1="[^.\\/]",STAR$2="[^/]*?",POSIX_CHARS$1={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:DOTS_SLASH$1,NO_DOT:"(?!\\.)",NO_DOTS:NO_DOTS$1,NO_DOT_SLASH:NO_DOT_SLASH$1,NO_DOTS_SLASH:NO_DOTS_SLASH$1,QMARK_NO_DOT:"[^.\\/]",STAR:STAR$2,START_ANCHOR:"(?:^|\\/)"},WINDOWS_CHARS$1={...POSIX_CHARS$1,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)"},POSIX_REGEX_SOURCE$2={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};var constants$1$1={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:POSIX_REGEX_SOURCE$2,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:path$n__default.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?WINDOWS_CHARS$1:POSIX_CHARS$1},utils$1$1=createCommonjsModule((function(e,t){const n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:o}=constants$1$1;t.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),t.hasRegexChars=e=>s.test(e),t.isRegexChar=e=>1===e.length&&t.hasRegexChars(e),t.escapeRegex=e=>e.replace(o,"\\$1"),t.toPosixSlashes=e=>e.replace(r,"/"),t.removeBackslashes=e=>e.replace(i,e=>"\\"===e?"":e),t.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},t.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===n||"\\"===path$n__default.sep,t.escapeLast=(e,n,r)=>{const i=e.lastIndexOf(n,r);return-1===i?e:"\\"===e[i-1]?t.escapeLast(e,n,i-1):`${e.slice(0,i)}\\${e.slice(i)}`},t.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},t.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r}}));const{CHAR_ASTERISK:CHAR_ASTERISK$1,CHAR_AT:CHAR_AT$1,CHAR_BACKWARD_SLASH:CHAR_BACKWARD_SLASH$1,CHAR_COMMA:CHAR_COMMA$1$1,CHAR_DOT:CHAR_DOT$1$1,CHAR_EXCLAMATION_MARK:CHAR_EXCLAMATION_MARK$1,CHAR_FORWARD_SLASH:CHAR_FORWARD_SLASH$1,CHAR_LEFT_CURLY_BRACE:CHAR_LEFT_CURLY_BRACE$1$1,CHAR_LEFT_PARENTHESES:CHAR_LEFT_PARENTHESES$1$1,CHAR_LEFT_SQUARE_BRACKET:CHAR_LEFT_SQUARE_BRACKET$1$1,CHAR_PLUS:CHAR_PLUS$1,CHAR_QUESTION_MARK:CHAR_QUESTION_MARK$1,CHAR_RIGHT_CURLY_BRACE:CHAR_RIGHT_CURLY_BRACE$1$1,CHAR_RIGHT_PARENTHESES:CHAR_RIGHT_PARENTHESES$1$1,CHAR_RIGHT_SQUARE_BRACKET:CHAR_RIGHT_SQUARE_BRACKET$1$1}=constants$1$1,isPathSeparator$1=e=>e===CHAR_FORWARD_SLASH$1||e===CHAR_BACKWARD_SLASH$1,depth$1=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)},scan$1=(e,t)=>{const n=t||{},r=e.length-1,i=!0===n.parts||!0===n.scanToEnd,s=[],o=[],a=[];let c,l,u=e,p=-1,h=0,d=0,f=!1,m=!1,g=!1,_=!1,E=!1,y=!1,v=!1,S=!1,b=!1,A=0,C={value:"",depth:0,isGlob:!1};const x=()=>p>=r,$=()=>(c=l,u.charCodeAt(++p));for(;p0&&(T=u.slice(0,h),u=u.slice(h),d-=h),w&&!0===g&&d>0?(w=u.slice(0,d),R=u.slice(d)):!0===g?(w="",R=u):w=u,w&&""!==w&&"/"!==w&&w!==u&&isPathSeparator$1(w.charCodeAt(w.length-1))&&(w=w.slice(0,-1)),!0===n.unescape&&(R&&(R=utils$1$1.removeBackslashes(R)),w&&!0===v&&(w=utils$1$1.removeBackslashes(w)));const N={prefix:T,input:e,start:h,base:w,glob:R,isBrace:f,isBracket:m,isGlob:g,isExtglob:_,isGlobstar:E,negated:S};if(!0===n.tokens&&(N.maxDepth=0,isPathSeparator$1(l)||o.push(C),N.tokens=o),!0===n.parts||!0===n.tokens){let t;for(let r=0;r{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();return`[${e.join("-")}]`},syntaxError$1=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,parse$1$1=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");e=REPLACEMENTS$1[e]||e;const n={...t},r="number"==typeof n.maxLength?Math.min(MAX_LENGTH$1$1,n.maxLength):MAX_LENGTH$1$1;let i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);const s={type:"bos",value:"",output:n.prepend||""},o=[s],a=n.capture?"":"?:",c=utils$1$1.isWindows(t),l=constants$1$1.globChars(c),u=constants$1$1.extglobChars(l),{DOT_LITERAL:p,PLUS_LITERAL:h,SLASH_LITERAL:d,ONE_CHAR:f,DOTS_SLASH:m,NO_DOT:g,NO_DOT_SLASH:_,NO_DOTS_SLASH:E,QMARK:y,QMARK_NO_DOT:v,STAR:S,START_ANCHOR:b}=l,A=e=>`(${a}(?:(?!${b}${e.dot?m:p}).)*?)`,C=n.dot?"":g,x=n.dot?y:v;let $=!0===n.bash?A(n):S;n.capture&&($=`(${$})`),"boolean"==typeof n.noext&&(n.noextglob=n.noext);const w={input:e,index:-1,start:0,dot:!0===n.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};e=utils$1$1.removePrefix(e,w),i=e.length;const T=[],R=[],N=[];let D,k=s;const O=()=>w.index===i-1,I=w.peek=(t=1)=>e[w.index+t],P=w.advance=()=>e[++w.index],M=()=>e.slice(w.index+1),F=(e="",t=0)=>{w.consumed+=e,w.index+=t},L=e=>{w.output+=null!=e.output?e.output:e.value,F(e.value)},B=()=>{let e=1;for(;"!"===I()&&("("!==I(2)||"?"===I(3));)P(),w.start++,e++;return e%2!=0&&(w.negated=!0,w.start++,!0)},V=e=>{w[e]++,N.push(e)},U=e=>{w[e]--,N.pop()},H=e=>{if("globstar"===k.type){const t=w.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||T.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(w.output=w.output.slice(0,-k.output.length),k.type="star",k.value="*",k.output=$,w.output+=k.output)}if(T.length&&"paren"!==e.type&&!u[e.value]&&(T[T.length-1].inner+=e.value),(e.value||e.output)&&L(e),k&&"text"===k.type&&"text"===e.type)return k.value+=e.value,void(k.output=(k.output||"")+e.value);e.prev=k,o.push(e),k=e},G=(e,t)=>{const r={...u[t],conditions:1,inner:""};r.prev=k,r.parens=w.parens,r.output=w.output;const i=(n.capture?"(":"")+r.open;V("parens"),H({type:e,value:t,output:w.output?"":f}),H({type:"paren",extglob:!0,value:P(),output:i}),T.push(r)},j=e=>{let t=e.close+(n.capture?")":"");if("negate"===e.type){let r=$;e.inner&&e.inner.length>1&&e.inner.includes("/")&&(r=A(n)),(r!==$||O()||/^\)+$/.test(M()))&&(t=e.close=")$))"+r),"bos"===e.prev.type&&O()&&(w.negatedExtglob=!0)}H({type:"paren",extglob:!0,value:D,output:t}),U("parens")};if(!1!==n.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let r=!1,i=e.replace(REGEX_SPECIAL_CHARS_BACKREF$1,(e,t,n,i,s,o)=>"\\"===i?(r=!0,e):"?"===i?t?t+i+(s?y.repeat(s.length):""):0===o?x+(s?y.repeat(s.length):""):y.repeat(n.length):"."===i?p.repeat(n.length):"*"===i?t?t+i+(s?$:""):$:t?e:"\\"+e);return!0===r&&(i=!0===n.unescape?i.replace(/\\/g,""):i.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),i===e&&!0===n.contains?(w.output=e,w):(w.output=utils$1$1.wrapOutput(i,w,t),w)}for(;!O();){if(D=P(),"\0"===D)continue;if("\\"===D){const e=I();if("/"===e&&!0!==n.bash)continue;if("."===e||";"===e)continue;if(!e){D+="\\",H({type:"text",value:D});continue}const t=/^\\+/.exec(M());let r=0;if(t&&t[0].length>2&&(r=t[0].length,w.index+=r,r%2!=0&&(D+="\\")),!0===n.unescape?D=P()||"":D+=P()||"",0===w.brackets){H({type:"text",value:D});continue}}if(w.brackets>0&&("]"!==D||"["===k.value||"[^"===k.value)){if(!1!==n.posix&&":"===D){const e=k.value.slice(1);if(e.includes("[")&&(k.posix=!0,e.includes(":"))){const e=k.value.lastIndexOf("["),t=k.value.slice(0,e),n=k.value.slice(e+2),r=POSIX_REGEX_SOURCE$1$1[n];if(r){k.value=t+r,w.backtrack=!0,P(),s.output||1!==o.indexOf(k)||(s.output=f);continue}}}("["===D&&":"!==I()||"-"===D&&"]"===I())&&(D="\\"+D),"]"!==D||"["!==k.value&&"[^"!==k.value||(D="\\"+D),!0===n.posix&&"!"===D&&"["===k.value&&(D="^"),k.value+=D,L({value:D});continue}if(1===w.quotes&&'"'!==D){D=utils$1$1.escapeRegex(D),k.value+=D,L({value:D});continue}if('"'===D){w.quotes=1===w.quotes?0:1,!0===n.keepQuotes&&H({type:"text",value:D});continue}if("("===D){V("parens"),H({type:"paren",value:D});continue}if(")"===D){if(0===w.parens&&!0===n.strictBrackets)throw new SyntaxError(syntaxError$1("opening","("));const e=T[T.length-1];if(e&&w.parens===e.parens+1){j(T.pop());continue}H({type:"paren",value:D,output:w.parens?")":"\\)"}),U("parens");continue}if("["===D){if(!0!==n.nobracket&&M().includes("]"))V("brackets");else{if(!0!==n.nobracket&&!0===n.strictBrackets)throw new SyntaxError(syntaxError$1("closing","]"));D="\\"+D}H({type:"bracket",value:D});continue}if("]"===D){if(!0===n.nobracket||k&&"bracket"===k.type&&1===k.value.length){H({type:"text",value:D,output:"\\"+D});continue}if(0===w.brackets){if(!0===n.strictBrackets)throw new SyntaxError(syntaxError$1("opening","["));H({type:"text",value:D,output:"\\"+D});continue}U("brackets");const e=k.value.slice(1);if(!0===k.posix||"^"!==e[0]||e.includes("/")||(D="/"+D),k.value+=D,L({value:D}),!1===n.literalBrackets||utils$1$1.hasRegexChars(e))continue;const t=utils$1$1.escapeRegex(k.value);if(w.output=w.output.slice(0,-k.value.length),!0===n.literalBrackets){w.output+=t,k.value=t;continue}k.value=`(${a}${t}|${k.value})`,w.output+=k.value;continue}if("{"===D&&!0!==n.nobrace){V("braces");const e={type:"brace",value:D,output:"(",outputIndex:w.output.length,tokensIndex:w.tokens.length};R.push(e),H(e);continue}if("}"===D){const e=R[R.length-1];if(!0===n.nobrace||!e){H({type:"text",value:D,output:D});continue}let t=")";if(!0===e.dots){const e=o.slice(),r=[];for(let t=e.length-1;t>=0&&(o.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&r.unshift(e[t].value);t=expandRange$1(r,n),w.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=w.output.slice(0,e.outputIndex),r=w.tokens.slice(e.tokensIndex);e.value=e.output="\\{",D=t="\\}",w.output=n;for(const e of r)w.output+=e.output||e.value}H({type:"brace",value:D,output:t}),U("braces"),R.pop();continue}if("|"===D){T.length>0&&T[T.length-1].conditions++,H({type:"text",value:D});continue}if(","===D){let e=D;const t=R[R.length-1];t&&"braces"===N[N.length-1]&&(t.comma=!0,e="|"),H({type:"comma",value:D,output:e});continue}if("/"===D){if("dot"===k.type&&w.index===w.start+1){w.start=w.index+1,w.consumed="",w.output="",o.pop(),k=s;continue}H({type:"slash",value:D,output:d});continue}if("."===D){if(w.braces>0&&"dot"===k.type){"."===k.value&&(k.output=p);const e=R[R.length-1];k.type="dots",k.output+=D,k.value+=D,e.dots=!0;continue}if(w.braces+w.parens===0&&"bos"!==k.type&&"slash"!==k.type){H({type:"text",value:D,output:p});continue}H({type:"dot",value:D,output:p});continue}if("?"===D){if(!(k&&"("===k.value)&&!0!==n.noextglob&&"("===I()&&"?"!==I(2)){G("qmark",D);continue}if(k&&"paren"===k.type){const e=I();let t=D;if("<"===e&&!utils$1$1.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===k.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(M()))&&(t="\\"+D),H({type:"text",value:D,output:t});continue}if(!0!==n.dot&&("slash"===k.type||"bos"===k.type)){H({type:"qmark",value:D,output:v});continue}H({type:"qmark",value:D,output:y});continue}if("!"===D){if(!0!==n.noextglob&&"("===I()&&("?"!==I(2)||!/[!=<:]/.test(I(3)))){G("negate",D);continue}if(!0!==n.nonegate&&0===w.index){B();continue}}if("+"===D){if(!0!==n.noextglob&&"("===I()&&"?"!==I(2)){G("plus",D);continue}if(k&&"("===k.value||!1===n.regex){H({type:"plus",value:D,output:h});continue}if(k&&("bracket"===k.type||"paren"===k.type||"brace"===k.type)||w.parens>0){H({type:"plus",value:D});continue}H({type:"plus",value:h});continue}if("@"===D){if(!0!==n.noextglob&&"("===I()&&"?"!==I(2)){H({type:"at",extglob:!0,value:D,output:""});continue}H({type:"text",value:D});continue}if("*"!==D){"$"!==D&&"^"!==D||(D="\\"+D);const e=REGEX_NON_SPECIAL_CHARS$1.exec(M());e&&(D+=e[0],w.index+=e[0].length),H({type:"text",value:D});continue}if(k&&("globstar"===k.type||!0===k.star)){k.type="star",k.star=!0,k.value+=D,k.output=$,w.backtrack=!0,w.globstar=!0,F(D);continue}let t=M();if(!0!==n.noextglob&&/^\([^?]/.test(t)){G("star",D);continue}if("star"===k.type){if(!0===n.noglobstar){F(D);continue}const r=k.prev,i=r.prev,s="slash"===r.type||"bos"===r.type,o=i&&("star"===i.type||"globstar"===i.type);if(!0===n.bash&&(!s||t[0]&&"/"!==t[0])){H({type:"star",value:D,output:""});continue}const a=w.braces>0&&("comma"===r.type||"brace"===r.type),c=T.length&&("pipe"===r.type||"paren"===r.type);if(!s&&"paren"!==r.type&&!a&&!c){H({type:"star",value:D,output:""});continue}for(;"/**"===t.slice(0,3);){const n=e[w.index+4];if(n&&"/"!==n)break;t=t.slice(3),F("/**",3)}if("bos"===r.type&&O()){k.type="globstar",k.value+=D,k.output=A(n),w.output=k.output,w.globstar=!0,F(D);continue}if("slash"===r.type&&"bos"!==r.prev.type&&!o&&O()){w.output=w.output.slice(0,-(r.output+k.output).length),r.output="(?:"+r.output,k.type="globstar",k.output=A(n)+(n.strictSlashes?")":"|$)"),k.value+=D,w.globstar=!0,w.output+=r.output+k.output,F(D);continue}if("slash"===r.type&&"bos"!==r.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";w.output=w.output.slice(0,-(r.output+k.output).length),r.output="(?:"+r.output,k.type="globstar",k.output=`${A(n)}${d}|${d}${e})`,k.value+=D,w.output+=r.output+k.output,w.globstar=!0,F(D+P()),H({type:"slash",value:"/",output:""});continue}if("bos"===r.type&&"/"===t[0]){k.type="globstar",k.value+=D,k.output=`(?:^|${d}|${A(n)}${d})`,w.output=k.output,w.globstar=!0,F(D+P()),H({type:"slash",value:"/",output:""});continue}w.output=w.output.slice(0,-k.output.length),k.type="globstar",k.output=A(n),k.value+=D,w.output+=k.output,w.globstar=!0,F(D);continue}const r={type:"star",value:D,output:$};!0!==n.bash?!k||"bracket"!==k.type&&"paren"!==k.type||!0!==n.regex?(w.index!==w.start&&"slash"!==k.type&&"dot"!==k.type||("dot"===k.type?(w.output+=_,k.output+=_):!0===n.dot?(w.output+=E,k.output+=E):(w.output+=C,k.output+=C),"*"!==I()&&(w.output+=f,k.output+=f)),H(r)):(r.output=D,H(r)):(r.output=".*?","bos"!==k.type&&"slash"!==k.type||(r.output=C+r.output),H(r))}for(;w.brackets>0;){if(!0===n.strictBrackets)throw new SyntaxError(syntaxError$1("closing","]"));w.output=utils$1$1.escapeLast(w.output,"["),U("brackets")}for(;w.parens>0;){if(!0===n.strictBrackets)throw new SyntaxError(syntaxError$1("closing",")"));w.output=utils$1$1.escapeLast(w.output,"("),U("parens")}for(;w.braces>0;){if(!0===n.strictBrackets)throw new SyntaxError(syntaxError$1("closing","}"));w.output=utils$1$1.escapeLast(w.output,"{"),U("braces")}if(!0===n.strictSlashes||"star"!==k.type&&"bracket"!==k.type||H({type:"maybe_slash",value:"",output:d+"?"}),!0===w.backtrack){w.output="";for(const e of w.tokens)w.output+=null!=e.output?e.output:e.value,e.suffix&&(w.output+=e.suffix)}return w};parse$1$1.fastpaths=(e,t)=>{const n={...t},r="number"==typeof n.maxLength?Math.min(MAX_LENGTH$1$1,n.maxLength):MAX_LENGTH$1$1,i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);e=REPLACEMENTS$1[e]||e;const s=utils$1$1.isWindows(t),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:u,NO_DOTS:p,NO_DOTS_SLASH:h,STAR:d,START_ANCHOR:f}=constants$1$1.globChars(s),m=n.dot?p:u,g=n.dot?h:u,_=n.capture?"":"?:";let E=!0===n.bash?".*?":d;n.capture&&(E=`(${E})`);const y=e=>!0===e.noglobstar?E:`(${_}(?:(?!${f}${e.dot?l:o}).)*?)`,v=e=>{switch(e){case"*":return`${m}${c}${E}`;case".*":return`${o}${c}${E}`;case"*.*":return`${m}${E}${o}${c}${E}`;case"*/*":return`${m}${E}${a}${c}${g}${E}`;case"**":return m+y(n);case"**/*":return`(?:${m}${y(n)}${a})?${g}${c}${E}`;case"**/*.*":return`(?:${m}${y(n)}${a})?${g}${E}${o}${c}${E}`;case"**/.*":return`(?:${m}${y(n)}${a})?${o}${c}${E}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=v(t[1]);if(!n)return;return n+o+t[2]}}},S=utils$1$1.removePrefix(e,{negated:!1,prefix:""});let b=v(S);return b&&!0!==n.strictSlashes&&(b+=a+"?"),b};var parse_1$1$1=parse$1$1;const isObject$1$1=e=>e&&"object"==typeof e&&!Array.isArray(e),picomatch$2=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map(e=>picomatch$2(e,t,n));return e=>{for(const t of r){const n=t(e);if(n)return n}return!1}}const r=(i=e)&&"object"==typeof i&&!Array.isArray(i)&&e.tokens&&e.input;var i;if(""===e||"string"!=typeof e&&!r)throw new TypeError("Expected pattern to be a non-empty string");const s=t||{},o=utils$1$1.isWindows(t),a=r?picomatch$2.compileRe(e,t):picomatch$2.makeRe(e,t,!1,!0),c=a.state;delete a.state;let l=()=>!1;if(s.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};l=picomatch$2(s.ignore,e,n)}const u=(n,r=!1)=>{const{isMatch:i,match:u,output:p}=picomatch$2.test(n,a,t,{glob:e,posix:o}),h={glob:e,state:c,regex:a,posix:o,input:n,output:p,match:u,isMatch:i};return"function"==typeof s.onResult&&s.onResult(h),!1===i?(h.isMatch=!1,!!r&&h):l(n)?("function"==typeof s.onIgnore&&s.onIgnore(h),h.isMatch=!1,!!r&&h):("function"==typeof s.onMatch&&s.onMatch(h),!r||h)};return n&&(u.state=c),u};picomatch$2.test=(e,t,n,{glob:r,posix:i}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const s=n||{},o=s.format||(i?utils$1$1.toPosixSlashes:null);let a=e===r,c=a&&o?o(e):e;return!1===a&&(c=o?o(e):e,a=c===r),!1!==a&&!0!==s.capture||(a=!0===s.matchBase||!0===s.basename?picomatch$2.matchBase(e,t,n,i):t.exec(c)),{isMatch:Boolean(a),match:a,output:c}},picomatch$2.matchBase=(e,t,n,r=utils$1$1.isWindows(n))=>(t instanceof RegExp?t:picomatch$2.makeRe(t,n)).test(path$n__default.basename(e)),picomatch$2.isMatch=(e,t,n)=>picomatch$2(t,n)(e),picomatch$2.parse=(e,t)=>Array.isArray(e)?e.map(e=>picomatch$2.parse(e,t)):parse_1$1$1(e,{...t,fastpaths:!1}),picomatch$2.scan=(e,t)=>scan_1$1(e,t),picomatch$2.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const i=t||{},s=i.contains?"":"^",o=i.contains?"":"$";let a=`${s}(?:${e.output})${o}`;e&&!0===e.negated&&(a=`^(?!${a}).*$`);const c=picomatch$2.toRegex(a,t);return!0===r&&(c.state=e),c},picomatch$2.makeRe=(e,t,n=!1,r=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");const i=t||{};let s,o={negated:!1,fastpaths:!0},a="";return e.startsWith("./")&&(e=e.slice(2),a=o.prefix="./"),!1===i.fastpaths||"."!==e[0]&&"*"!==e[0]||(s=parse_1$1$1.fastpaths(e,t)),void 0===s?(o=parse_1$1$1(e,t),o.prefix=a+(o.prefix||"")):o.output=s,picomatch$2.compileRe(o,t,n,r)},picomatch$2.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},picomatch$2.constants=constants$1$1;var picomatch_1$1=picomatch$2,picomatch$1$1=picomatch_1$1;const isEmptyString=e=>"string"==typeof e&&(""===e||"./"===e),micromatch=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let r=new Set,i=new Set,s=new Set,o=0,a=e=>{s.add(e.output),n&&n.onResult&&n.onResult(e)};for(let s=0;s!r.has(e));if(n&&0===c.length){if(!0===n.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===n.nonull||!0===n.nullglob)return n.unescape?t.map(e=>e.replace(/\\/g,"")):t}return c};micromatch.match=micromatch,micromatch.matcher=(e,t)=>picomatch$1$1(e,t),micromatch.any=micromatch.isMatch=(e,t,n)=>picomatch$1$1(t,n)(e),micromatch.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,i=[],s=micromatch(e,t,{...n,onResult:e=>{n.onResult&&n.onResult(e),i.push(e.output)}});for(let e of i)s.includes(e)||r.add(e);return[...r]},micromatch.contains=(e,t,n)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${util$6.inspect(e)}"`);if(Array.isArray(t))return t.some(t=>micromatch.contains(e,t,n));if("string"==typeof t){if(isEmptyString(e)||isEmptyString(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return micromatch.isMatch(e,t,{...n,contains:!0})},micromatch.matchKeys=(e,t,n)=>{if(!utils$1$1.isObject(e))throw new TypeError("Expected the first argument to be an object");let r=micromatch(Object.keys(e),t,n),i={};for(let t of r)i[t]=e[t];return i},micromatch.some=(e,t,n)=>{let r=[].concat(e);for(let e of[].concat(t)){let t=picomatch$1$1(String(e),n);if(r.some(e=>t(e)))return!0}return!1},micromatch.every=(e,t,n)=>{let r=[].concat(e);for(let e of[].concat(t)){let t=picomatch$1$1(String(e),n);if(!r.every(e=>t(e)))return!1}return!0},micromatch.all=(e,t,n)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${util$6.inspect(e)}"`);return[].concat(t).every(t=>picomatch$1$1(t,n)(e))},micromatch.capture=(e,t,n)=>{let r=utils$1$1.isWindows(n),i=picomatch$1$1.makeRe(String(e),{...n,capture:!0}).exec(r?utils$1$1.toPosixSlashes(t):t);if(i)return i.slice(1).map(e=>void 0===e?"":e)},micromatch.makeRe=(...e)=>picomatch$1$1.makeRe(...e),micromatch.scan=(...e)=>picomatch$1$1.scan(...e),micromatch.parse=(e,t)=>{let n=[];for(let r of[].concat(e||[]))for(let e of braces_1$1(String(r),t))n.push(picomatch$1$1.parse(e,t));return n},micromatch.braces=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return t&&!0===t.nobrace||!/\{.*\}/.test(e)?[e]:braces_1$1(e,t)},micromatch.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return micromatch.braces(e,{...t,expand:!0})};var micromatch_1=micromatch;function ensureArray$2(e){return Array.isArray(e)?e:null==e?[]:[e]}function getMatcherString$1(e,t){return!1===t?e:path$n.resolve(..."string"==typeof t?[t,e]:[e])}const createFilter$1=function(e,t,n){const r=n&&n.resolve,i=e=>e instanceof RegExp?e:{test:micromatch_1.matcher(getMatcherString$1(e,r).split(path$n.sep).join("/"),{dot:!0})},s=ensureArray$2(e).map(i),o=ensureArray$2(t).map(i);return function(e){if("string"!=typeof e)return!1;if(/\0/.test(e))return!1;e=e.split(path$n.sep).join("/");for(let t=0;tmergeOutputOptions(e,r,s));return warnUnknownOptions(r,Object.keys(i).concat(Object.keys(a[0]).filter(e=>"sourcemapPathTransform"!==e),Object.keys(commandAliases),"config","environment","plugin","silent","stdin","waitForBundleInput"),"CLI flags",s,/^_$|output$|config/),i.output=a,i}function getCommandOptions(e){const t=e.external&&"string"==typeof e.external?e.external.split(","):[];return{...e,external:t,globals:"string"==typeof e.globals?e.globals.split(",").reduce((e,n)=>{const[r,i]=n.split(":");return e[r]=i,-1===t.indexOf(r)&&t.push(r),e},Object.create(null)):void 0}}function mergeInputOptions(e,t,n){const r=n=>{var r;return null!==(r=t[n])&&void 0!==r?r:e[n]},i={acorn:r("acorn"),acornInjectPlugins:e.acornInjectPlugins,cache:e.cache,context:r("context"),experimentalCacheExpiry:r("experimentalCacheExpiry"),external:getExternal(e,t),inlineDynamicImports:r("inlineDynamicImports"),input:r("input")||[],manualChunks:r("manualChunks"),moduleContext:r("moduleContext"),onwarn:getOnWarn(e,n),perf:r("perf"),plugins:ensureArray(e.plugins),preserveEntrySignatures:r("preserveEntrySignatures"),preserveModules:r("preserveModules"),preserveSymlinks:r("preserveSymlinks"),shimMissingExports:r("shimMissingExports"),strictDeprecations:r("strictDeprecations"),treeshake:getObjectOption(e,t,"treeshake"),watch:getWatch(e,t,"watch")};return warnUnknownOptions(e,Object.keys(i),"input options",i.onwarn,/^output$/),i}const getExternal=(e,t)=>{const n=e.external;return"function"==typeof n?(e,r,i)=>n(e,r,i)||-1!==t.external.indexOf(e):ensureArray(n).concat(t.external)},getOnWarn=(e,t)=>e.onwarn?n=>e.onwarn(n,t):t,getObjectOption=(e,t,n)=>{const r=normalizeObjectOptionValue(t[n]),i=normalizeObjectOptionValue(e[n]);return void 0!==r?r&&{...i,...r}:i},getWatch=(e,t,n)=>!1!==e.watch&&getObjectOption(e,t,n),normalizeObjectOptionValue=e=>e?Array.isArray(e)?e.reduce((e,t)=>t&&e&&{...e,...t},{}):"object"!=typeof e?{}:e:e;function mergeOutputOptions(e,t,n){const r=n=>{var r;return null!==(r=t[n])&&void 0!==r?r:e[n]},i={amd:getObjectOption(e,t,"amd"),assetFileNames:r("assetFileNames"),banner:r("banner"),chunkFileNames:r("chunkFileNames"),compact:r("compact"),dir:r("dir"),dynamicImportFunction:r("dynamicImportFunction"),entryFileNames:r("entryFileNames"),esModule:r("esModule"),exports:r("exports"),extend:r("extend"),externalLiveBindings:r("externalLiveBindings"),file:r("file"),footer:r("footer"),format:r("format"),freeze:r("freeze"),globals:r("globals"),hoistTransitiveImports:r("hoistTransitiveImports"),indent:r("indent"),interop:r("interop"),intro:r("intro"),minifyInternalExports:r("minifyInternalExports"),name:r("name"),namespaceToStringTag:r("namespaceToStringTag"),noConflict:r("noConflict"),outro:r("outro"),paths:r("paths"),plugins:ensureArray(e.plugins),preferConst:r("preferConst"),sourcemap:r("sourcemap"),sourcemapExcludeSources:r("sourcemapExcludeSources"),sourcemapFile:r("sourcemapFile"),sourcemapPathTransform:r("sourcemapPathTransform"),strict:r("strict"),systemNullSetters:r("systemNullSetters")};return warnUnknownOptions(e,Object.keys(i),"output options",n),i}const{Readable:Readable$3}=Stream,{promisify:promisify$5}=util$6,readdir$3=promisify$5(fs$n__default.readdir),stat$5=promisify$5(fs$n__default.stat),lstat$3=promisify$5(fs$n__default.lstat),realpath$4=promisify$5(fs$n__default.realpath),BANG$2="!",NORMAL_FLOW_ERRORS$1=new Set(["ENOENT","EPERM","EACCES","ELOOP"]),FILE_TYPE$1="files",DIR_TYPE$1="directories",FILE_DIR_TYPE$1="files_directories",EVERYTHING_TYPE$1="all",ALL_TYPES$1=[FILE_TYPE$1,DIR_TYPE$1,FILE_DIR_TYPE$1,EVERYTHING_TYPE$1],isNormalFlowError$1=e=>NORMAL_FLOW_ERRORS$1.has(e.code),normalizeFilter$1=e=>{if(void 0!==e){if("function"==typeof e)return e;if("string"==typeof e){const t=picomatch$1$1(e.trim());return e=>t(e.basename)}if(Array.isArray(e)){const t=[],n=[];for(const r of e){const e=r.trim();"!"===e.charAt(0)?n.push(picomatch$1$1(e.slice(1))):t.push(picomatch$1$1(e))}return n.length>0?t.length>0?e=>t.some(t=>t(e.basename))&&!n.some(t=>t(e.basename)):e=>!n.some(t=>t(e.basename)):e=>t.some(t=>t(e.basename))}}};class ReaddirpStream$1 extends Readable$3{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:FILE_TYPE$1,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});const t={...ReaddirpStream$1.defaultOptions,...e},{root:n,type:r}=t;this._fileFilter=normalizeFilter$1(t.fileFilter),this._directoryFilter=normalizeFilter$1(t.directoryFilter);const i=t.lstat?lstat$3:stat$5;"win32"===process.platform&&3===stat$5.length?this._stat=e=>i(e,{bigint:!0}):this._stat=i,this._maxDepth=t.depth,this._wantsDir=[DIR_TYPE$1,FILE_DIR_TYPE$1,EVERYTHING_TYPE$1].includes(r),this._wantsFile=[FILE_TYPE$1,FILE_DIR_TYPE$1,EVERYTHING_TYPE$1].includes(r),this._wantsEverything=r===EVERYTHING_TYPE$1,this._root=path$n__default.resolve(n),this._isDirent="Dirent"in fs$n__default&&!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){const{path:t,depth:n,files:r=[]}=this.parent||{};if(r.length>0){const i=r.splice(0,e).map(e=>this._formatEntry(e,t));for(const t of await Promise.all(i)){if(this.destroyed)return;const r=await this._getEntryType(t);"directory"===r&&this._directoryFilter(t)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(t.fullPath,n+1)),this._wantsDir&&(this.push(t),e--)):("file"===r||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{const e=this.parents.pop();if(!e){this.push(null);break}if(this.parent=await e,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await readdir$3(e,this._rdOptions)}catch(e){this._onError(e)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let n;try{const r=this._isDirent?e.name:e,i=path$n__default.resolve(path$n__default.join(t,r));n={path:path$n__default.relative(this._root,i),fullPath:i,basename:r},n[this._statsProp]=this._isDirent?e:await this._stat(i)}catch(e){this._onError(e)}return n}_onError(e){isNormalFlowError$1(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){const t=e&&e[this._statsProp];if(t){if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink())try{const t=await realpath$4(e.fullPath),n=await lstat$3(t);if(n.isFile())return"file";if(n.isDirectory())return"directory"}catch(e){this._onError(e)}}}_includeAsFile(e){const t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}const readdirp$1=(e,t={})=>{let n=t.entryType||t.type;if("both"===n&&(n=FILE_DIR_TYPE$1),n&&(t.type=n),!e)throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");if("string"!=typeof e)throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(n&&!ALL_TYPES$1.includes(n))throw new Error("readdirp: Invalid type passed. Use one of "+ALL_TYPES$1.join(", "));return t.root=e,new ReaddirpStream$1(t)},readdirpPromise$1=(e,t={})=>new Promise((n,r)=>{const i=[];readdirp$1(e,t).on("data",e=>i.push(e)).on("end",()=>n(i)).on("error",e=>r(e))});readdirp$1.promise=readdirpPromise$1,readdirp$1.ReaddirpStream=ReaddirpStream$1,readdirp$1.default=readdirp$1;var readdirp_1$1=readdirp$1,normalizePath$1=function(e,t){if("string"!=typeof e)throw new TypeError("expected path to be a string");if("\\"===e||"/"===e)return"/";var n=e.length;if(n<=1)return e;var r="";if(n>4&&"\\"===e[3]){var i=e[2];"?"!==i&&"."!==i||"\\\\"!==e.slice(0,2)||(e=e.slice(2),r="//")}var s=e.split(/[/\\]+/);return!1!==t&&""===s[s.length-1]&&s.pop(),r+s.join("/")},anymatch_1$1=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n={returnIndex:!1},r=(e,t,n,r)=>{const i=Array.isArray(n),s=i?n[0]:n;if(!i&&"string"!=typeof s)throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(s));const o=normalizePath$1(s);for(let e=0;e{if(null==e)throw new TypeError("anymatch: specify first argument");const s="boolean"==typeof i?{returnIndex:i}:i,o=s.returnIndex||!1,a=(c=e,Array.isArray(c)?c:[c]);var c;const l=a.filter(e=>"string"==typeof e&&"!"===e.charAt(0)).map(e=>e.slice(1)).map(e=>picomatch$1$1(e,s)),u=a.map(e=>((e,t)=>{if("function"==typeof e)return e;if("string"==typeof e){const n=picomatch$1$1(e,t);return t=>e===t||n(t)}return e instanceof RegExp?t=>e.test(t):e=>!1})(e,s));return null==t?(e,t=!1)=>r(u,l,e,"boolean"==typeof t&&t):r(u,l,t,o)};i.default=i,e.exports=i})),isExtglob$1=function(e){if("string"!=typeof e||""===e)return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1},chars$4={"{":"}","(":")","[":"]"},strictRegex$1=/\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/,relaxedRegex$1=/\\(.)|(^!|[*?{}()[\]]|\(\?)/,isGlob$1=function(e,t){if("string"!=typeof e||""===e)return!1;if(isExtglob$1(e))return!0;var n,r=strictRegex$1;for(t&&!1===t.strict&&(r=relaxedRegex$1);n=r.exec(e);){if(n[2])return!0;var i=n.index+n[0].length,s=n[1],o=s?chars$4[s]:null;if(s&&o){var a=e.indexOf(o,i);-1!==a&&(i=a+1)}e=e.slice(i)}return!1},pathPosixDirname$1=path$n__default.posix.dirname,isWin32$1="win32"===os$4__default.platform(),slash$1="/",backslash$1=/\\/g,enclosure$1=/[\{\[].*[\/]*.*[\}\]]$/,globby$1=/(^|[^\\])([\{\[]|\([^\)]+$)/,escaped$1=/\\([\!\*\?\|\[\]\(\)\{\}])/g,globParent$1=function(e,t){Object.assign({flipBackslashes:!0},t).flipBackslashes&&isWin32$1&&e.indexOf(slash$1)<0&&(e=e.replace(backslash$1,slash$1)),enclosure$1.test(e)&&(e+=slash$1),e+="a";do{e=pathPosixDirname$1(e)}while(isGlob$1(e)||globby$1.test(e));return e.replace(escaped$1,"$1")},binaryExtensions$4=["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","oga","ogg","ogv","otf","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rtf","rz","s3m","s7z","scpt","sgi","shar","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"],binaryExtensions$1$1={__proto__:null,default:binaryExtensions$4},require$$0$4=getCjsExportFromNamespace(binaryExtensions$1$1),binaryExtensions$2$1=require$$0$4;const extensions$1=new Set(binaryExtensions$2$1);var isBinaryPath$1=e=>extensions$1.has(path$n__default.extname(e).slice(1).toLowerCase()),constants$2$1=createCommonjsModule((function(e,t){const{sep:n}=path$n__default,{platform:r}=process;t.EV_ALL="all",t.EV_READY="ready",t.EV_ADD="add",t.EV_CHANGE="change",t.EV_ADD_DIR="addDir",t.EV_UNLINK="unlink",t.EV_UNLINK_DIR="unlinkDir",t.EV_RAW="raw",t.EV_ERROR="error",t.STR_DATA="data",t.STR_END="end",t.STR_CLOSE="close",t.FSEVENT_CREATED="created",t.FSEVENT_MODIFIED="modified",t.FSEVENT_DELETED="deleted",t.FSEVENT_MOVED="moved",t.FSEVENT_CLONED="cloned",t.FSEVENT_UNKNOWN="unknown",t.FSEVENT_TYPE_FILE="file",t.FSEVENT_TYPE_DIRECTORY="directory",t.FSEVENT_TYPE_SYMLINK="symlink",t.KEY_LISTENERS="listeners",t.KEY_ERR="errHandlers",t.KEY_RAW="rawEmitters",t.HANDLER_KEYS=[t.KEY_LISTENERS,t.KEY_ERR,t.KEY_RAW],t.DOT_SLASH="."+n,t.BACK_SLASH_RE=/\\/g,t.DOUBLE_SLASH_RE=/\/\//,t.SLASH_OR_BACK_SLASH_RE=/[/\\]/,t.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,t.REPLACER_RE=/^\.[/\\]/,t.SLASH="/",t.BRACE_START="{",t.BANG="!",t.ONE_DOT=".",t.TWO_DOTS="..",t.STAR="*",t.GLOBSTAR="**",t.ROOT_GLOBSTAR="/**/*",t.SLASH_GLOBSTAR="/**",t.DIR_SUFFIX="Dir",t.ANYMATCH_OPTS={dot:!0},t.STRING_TYPE="string",t.FUNCTION_TYPE="function",t.EMPTY_STR="",t.EMPTY_FN=()=>{},t.IDENTITY_FN=e=>e,t.isWindows="win32"===r,t.isMacos="darwin"===r}));const{promisify:promisify$1$1}=util$6,{isWindows:isWindows$7,EMPTY_FN:EMPTY_FN$3,EMPTY_STR:EMPTY_STR$2,KEY_LISTENERS:KEY_LISTENERS$1,KEY_ERR:KEY_ERR$1,KEY_RAW:KEY_RAW$1,HANDLER_KEYS:HANDLER_KEYS$1,EV_CHANGE:EV_CHANGE$3,EV_ADD:EV_ADD$3,EV_ADD_DIR:EV_ADD_DIR$3,EV_ERROR:EV_ERROR$3,STR_DATA:STR_DATA$2,STR_END:STR_END$3,BRACE_START:BRACE_START$2,STAR:STAR$1$1}=constants$2$1,THROTTLE_MODE_WATCH$1="watch",open$1=promisify$1$1(fs$n__default.open),stat$1$1=promisify$1$1(fs$n__default.stat),lstat$1$1=promisify$1$1(fs$n__default.lstat),close$1=promisify$1$1(fs$n__default.close),fsrealpath$1=promisify$1$1(fs$n__default.realpath),statMethods$2={lstat:lstat$1$1,stat:stat$1$1},foreach$1=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},addAndConvert$1=(e,t,n)=>{let r=e[t];r instanceof Set||(e[t]=r=new Set([r])),r.add(n)},clearItem$1=e=>t=>{const n=e[t];n instanceof Set?n.clear():delete e[t]},delFromSet$1=(e,t,n)=>{const r=e[t];r instanceof Set?r.delete(n):r===n&&delete e[t]},isEmptySet$1=e=>e instanceof Set?0===e.size:!e,FsWatchInstances$1=new Map;function createFsWatchInstance$1(e,t,n,r,i){const s=(t,r)=>{n(e),i(t,r,{watchedPath:e}),r&&e!==r&&fsWatchBroadcast$1(path$n__default.resolve(e,r),KEY_LISTENERS$1,path$n__default.join(e,r))};try{return fs$n__default.watch(e,t,s)}catch(e){r(e)}}const fsWatchBroadcast$1=(e,t,n,r,i)=>{const s=FsWatchInstances$1.get(e);s&&foreach$1(s[t],e=>{e(n,r,i)})},setFsWatchListener$1=(e,t,n,r)=>{const{listener:i,errHandler:s,rawEmitter:o}=r;let a,c=FsWatchInstances$1.get(t);if(!n.persistent)return a=createFsWatchInstance$1(e,n,i,s,o),a.close.bind(a);if(c)addAndConvert$1(c,KEY_LISTENERS$1,i),addAndConvert$1(c,KEY_ERR$1,s),addAndConvert$1(c,KEY_RAW$1,o);else{if(a=createFsWatchInstance$1(e,n,fsWatchBroadcast$1.bind(null,t,KEY_LISTENERS$1),s,fsWatchBroadcast$1.bind(null,t,KEY_RAW$1)),!a)return;a.on(EV_ERROR$3,async n=>{const r=fsWatchBroadcast$1.bind(null,t,KEY_ERR$1);if(c.watcherUnusable=!0,isWindows$7&&"EPERM"===n.code)try{const t=await open$1(e,"r");await close$1(t),r(n)}catch(e){}else r(n)}),c={listeners:i,errHandlers:s,rawEmitters:o,watcher:a},FsWatchInstances$1.set(t,c)}return()=>{delFromSet$1(c,KEY_LISTENERS$1,i),delFromSet$1(c,KEY_ERR$1,s),delFromSet$1(c,KEY_RAW$1,o),isEmptySet$1(c.listeners)&&(c.watcher.close(),FsWatchInstances$1.delete(t),HANDLER_KEYS$1.forEach(clearItem$1(c)),c.watcher=void 0,Object.freeze(c))}},FsWatchFileInstances$1=new Map,setFsWatchFileListener$1=(e,t,n,r)=>{const{listener:i,rawEmitter:s}=r;let o=FsWatchFileInstances$1.get(t);const a=o&&o.options;return a&&(a.persistentn.interval)&&(fs$n__default.unwatchFile(t),o=void 0),o?(addAndConvert$1(o,KEY_LISTENERS$1,i),addAndConvert$1(o,KEY_RAW$1,s)):(o={listeners:i,rawEmitters:s,options:n,watcher:fs$n__default.watchFile(t,n,(n,r)=>{foreach$1(o.rawEmitters,e=>{e(EV_CHANGE$3,t,{curr:n,prev:r})});const i=n.mtimeMs;(n.size!==r.size||i>r.mtimeMs||0===i)&&foreach$1(o.listeners,t=>t(e,n))})},FsWatchFileInstances$1.set(t,o)),()=>{delFromSet$1(o,KEY_LISTENERS$1,i),delFromSet$1(o,KEY_RAW$1,s),isEmptySet$1(o.listeners)&&(FsWatchFileInstances$1.delete(t),fs$n__default.unwatchFile(t),o.options=o.watcher=void 0,Object.freeze(o))}};class NodeFsHandler$1{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){const n=this.fsw.options,r=path$n__default.dirname(e),i=path$n__default.basename(e);this.fsw._getWatchedDir(r).add(i);const s=path$n__default.resolve(e),o={persistent:n.persistent};let a;return t||(t=EMPTY_FN$3),n.usePolling?(o.interval=n.enableBinaryInterval&&isBinaryPath$1(i)?n.binaryInterval:n.interval,a=setFsWatchFileListener$1(e,s,o,{listener:t,rawEmitter:this.fsw._emitRaw})):a=setFsWatchListener$1(e,s,o,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),a}_handleFile(e,t,n){if(this.fsw.closed)return;const r=path$n__default.dirname(e),i=path$n__default.basename(e),s=this.fsw._getWatchedDir(r);let o=t;if(s.has(i))return;const a=this._watchWithNodeFs(e,async(t,n)=>{if(this.fsw._throttle("watch",e,5))if(n&&0!==n.mtimeMs){if(s.has(i)){const t=n.atimeMs,r=n.mtimeMs;(!t||t<=r||r!==o.mtimeMs)&&this.fsw._emit(EV_CHANGE$3,e,n),o=n}}else try{const t=await stat$1$1(e);if(this.fsw.closed)return;const n=t.atimeMs,r=t.mtimeMs;(!n||n<=r||r!==o.mtimeMs)&&this.fsw._emit(EV_CHANGE$3,e,t),o=t}catch(e){this.fsw._remove(r,i)}});if((!n||!this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(EV_ADD$3,e,0))return;this.fsw._emit(EV_ADD$3,e,t)}return a}async _handleSymlink(e,t,n,r){if(this.fsw.closed)return;const i=e.fullPath,s=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();const t=await fsrealpath$1(n);if(this.fsw.closed)return;return s.has(r)?this.fsw._symlinkPaths.get(i)!==t&&(this.fsw._symlinkPaths.set(i,t),this.fsw._emit(EV_CHANGE$3,n,e.stats)):(s.add(r),this.fsw._symlinkPaths.set(i,t),this.fsw._emit(EV_ADD$3,n,e.stats)),this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(i))return!0;this.fsw._symlinkPaths.set(i,!0)}_handleRead(e,t,n,r,i,s,o){if(e=path$n__default.join(e,EMPTY_STR$2),!n.hasGlob&&!(o=this.fsw._throttle("readdir",e,1e3)))return;const a=this.fsw._getWatchedDir(n.path),c=new Set;let l=this.fsw._readdirp(e,{fileFilter:e=>n.filterPath(e),directoryFilter:e=>n.filterDir(e),depth:0}).on(STR_DATA$2,async o=>{if(this.fsw.closed)return void(l=void 0);const u=o.path;let p=path$n__default.join(e,u);c.add(u),o.stats.isSymbolicLink()&&await this._handleSymlink(o,e,p,u)||(this.fsw.closed?l=void 0:u!==r&&(r||a.has(u))||(this.fsw._incrReadyCount(),p=path$n__default.join(i,path$n__default.relative(i,p)),this._addToNodeFs(p,t,n,s+1)))}).on(EV_ERROR$3,this._boundHandleError);return new Promise(t=>l.once(STR_END$3,()=>{if(this.fsw.closed)return void(l=void 0);const u=!!o&&o.clear();t(),a.getChildren().filter(t=>t!==e&&!c.has(t)&&(!n.hasGlob||n.filterPath({fullPath:path$n__default.resolve(e,t)}))).forEach(t=>{this.fsw._remove(e,t)}),l=void 0,u&&this._handleRead(e,!1,n,r,i,s,o)}))}async _handleDir(e,t,n,r,i,s,o){const a=this.fsw._getWatchedDir(path$n__default.dirname(e)),c=a.has(path$n__default.basename(e));let l;n&&this.fsw.options.ignoreInitial||i||c||s.hasGlob&&!s.globFilter(e)||this.fsw._emit(EV_ADD_DIR$3,e,t),a.add(path$n__default.basename(e)),this.fsw._getWatchedDir(e);const u=this.fsw.options.depth;if((null==u||r<=u)&&!this.fsw._symlinkPaths.has(o)){if(!i&&(await this._handleRead(e,n,s,i,e,r,void 0),this.fsw.closed))return;l=this._watchWithNodeFs(e,(t,n)=>{n&&0===n.mtimeMs||this._handleRead(t,!1,s,i,e,r,void 0)})}return l}async _addToNodeFs(e,t,n,r,i){const s=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return s(),!1;const o=this.fsw._getWatchHelpers(e,r);!o.hasGlob&&n&&(o.hasGlob=n.hasGlob,o.globFilter=n.globFilter,o.filterPath=e=>n.filterPath(e),o.filterDir=e=>n.filterDir(e));try{const n=await statMethods$2[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,n))return s(),!1;const a=this.fsw.options.followSymlinks&&!e.includes(STAR$1$1)&&!e.includes(BRACE_START$2);let c;if(n.isDirectory()){const s=a?await fsrealpath$1(e):e;if(this.fsw.closed)return;if(c=await this._handleDir(o.watchPath,n,t,r,i,o,s),this.fsw.closed)return;e!==s&&void 0!==s&&this.fsw._symlinkPaths.set(s,!0)}else if(n.isSymbolicLink()){const i=a?await fsrealpath$1(e):e;if(this.fsw.closed)return;const s=path$n__default.dirname(o.watchPath);if(this.fsw._getWatchedDir(s).add(o.watchPath),this.fsw._emit(EV_ADD$3,o.watchPath,n),c=await this._handleDir(s,n,t,r,e,o,i),this.fsw.closed)return;void 0!==i&&this.fsw._symlinkPaths.set(path$n__default.resolve(e),i)}else c=this._handleFile(o.watchPath,n,t);return s(),this.fsw._addPathCloser(e,c),!1}catch(t){if(this.fsw._handleError(t))return s(),e}}}var nodefsHandler$1=NodeFsHandler$1,require$$1=getCjsExportFromNamespace(fseventsImporter);const{promisify:promisify$2$1}=util$6;let fsevents$1;try{fsevents$1=require$$1.getFsEvents()}catch(error){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(error)}if(fsevents$1){const e=process.version.match(/v(\d+)\.(\d+)/);if(e&&e[1]&&e[2]){const t=Number.parseInt(e[1],10),n=Number.parseInt(e[2],10);8===t&&n<16&&(fsevents$1=void 0)}}const{EV_ADD:EV_ADD$1$1,EV_CHANGE:EV_CHANGE$1$1,EV_ADD_DIR:EV_ADD_DIR$1$1,EV_UNLINK:EV_UNLINK$2,EV_ERROR:EV_ERROR$1$1,STR_DATA:STR_DATA$1$1,STR_END:STR_END$1$1,FSEVENT_CREATED:FSEVENT_CREATED$1,FSEVENT_MODIFIED:FSEVENT_MODIFIED$1,FSEVENT_DELETED:FSEVENT_DELETED$1,FSEVENT_MOVED:FSEVENT_MOVED$1,FSEVENT_UNKNOWN:FSEVENT_UNKNOWN$1,FSEVENT_TYPE_FILE:FSEVENT_TYPE_FILE$1,FSEVENT_TYPE_DIRECTORY:FSEVENT_TYPE_DIRECTORY$1,FSEVENT_TYPE_SYMLINK:FSEVENT_TYPE_SYMLINK$1,ROOT_GLOBSTAR:ROOT_GLOBSTAR$1,DIR_SUFFIX:DIR_SUFFIX$1,DOT_SLASH:DOT_SLASH$1,FUNCTION_TYPE:FUNCTION_TYPE$2,EMPTY_FN:EMPTY_FN$1$1,IDENTITY_FN:IDENTITY_FN$1}=constants$2$1,Depth$1=e=>isNaN(e)?{}:{depth:e},stat$2$1=promisify$2$1(fs$n__default.stat),lstat$2$1=promisify$2$1(fs$n__default.lstat),realpath$1$1=promisify$2$1(fs$n__default.realpath),statMethods$1$1={stat:stat$2$1,lstat:lstat$2$1},FSEventsWatchers$1=new Map,consolidateThreshhold$1=10,wrongEventFlags$1=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),createFSEventsInstance$1=(e,t)=>({stop:fsevents$1.watch(e,t)});function setFSEventsListener$1(e,t,n,r,i){let s=path$n__default.extname(e)?path$n__default.dirname(e):e;const o=path$n__default.dirname(s);let a=FSEventsWatchers$1.get(s);couldConsolidate$1(o)&&(s=o);const c=path$n__default.resolve(e),l=c!==t,u=(e,r,i)=>{l&&(e=e.replace(t,c)),e!==c&&e.indexOf(c+path$n__default.sep)||n(e,r,i)};let p=!1;for(const e of FSEventsWatchers$1.keys())if(0===t.indexOf(path$n__default.resolve(e)+path$n__default.sep)){s=e,a=FSEventsWatchers$1.get(s),p=!0;break}return a||p?a.listeners.add(u):(a={listeners:new Set([u]),rawEmitter:r,watcher:createFSEventsInstance$1(s,(e,t)=>{if(i.closed)return;const n=fsevents$1.getInfo(e,t);a.listeners.forEach(r=>{r(e,t,n)}),a.rawEmitter(n.event,e,n)})},FSEventsWatchers$1.set(s,a)),()=>{const e=a.listeners;if(e.delete(u),!e.size&&(FSEventsWatchers$1.delete(s),a.watcher))return a.watcher.stop().then(()=>{a.rawEmitter=a.watcher=void 0,Object.freeze(a)})}}const couldConsolidate$1=e=>{let t=0;for(const n of FSEventsWatchers$1.keys())if(0===n.indexOf(e)&&(t++,t>=10))return!0;return!1},canUse$1=()=>fsevents$1&&FSEventsWatchers$1.size<128,calcDepth$1=(e,t)=>{let n=0;for(;!e.indexOf(t)&&(e=path$n__default.dirname(e))!==t;)n++;return n},sameTypes$1=(e,t)=>e.type===FSEVENT_TYPE_DIRECTORY$1&&t.isDirectory()||e.type===FSEVENT_TYPE_SYMLINK$1&&t.isSymbolicLink()||e.type===FSEVENT_TYPE_FILE$1&&t.isFile();class FsEventsHandler$1{constructor(e){this.fsw=e}checkIgnored(e,t){const n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,t))return n.add(e),t&&t.isDirectory()&&n.add(e+ROOT_GLOBSTAR$1),!0;n.delete(e),n.delete(e+ROOT_GLOBSTAR$1)}addOrChange(e,t,n,r,i,s,o,a){const c=i.has(s)?EV_CHANGE$1$1:EV_ADD$1$1;this.handleEvent(c,e,t,n,r,i,s,o,a)}async checkExists(e,t,n,r,i,s,o,a){try{const c=await stat$2$1(e);if(this.fsw.closed)return;if(this.fsw.closed)return;sameTypes$1(o,c)?this.addOrChange(e,t,n,r,i,s,o,a):this.handleEvent(EV_UNLINK$2,e,t,n,r,i,s,o,a)}catch(c){"EACCES"===c.code?this.addOrChange(e,t,n,r,i,s,o,a):this.handleEvent(EV_UNLINK$2,e,t,n,r,i,s,o,a)}}handleEvent(e,t,n,r,i,s,o,a,c){if(!this.fsw.closed&&!this.checkIgnored(t))if(e===EV_UNLINK$2){const e=a.type===FSEVENT_TYPE_DIRECTORY$1;(e||s.has(o))&&this.fsw._remove(i,o,e)}else{if(e===EV_ADD$1$1){if(a.type===FSEVENT_TYPE_DIRECTORY$1&&this.fsw._getWatchedDir(t),a.type===FSEVENT_TYPE_SYMLINK$1&&c.followSymlinks){const e=void 0===c.depth?void 0:calcDepth$1(n,r)+1;return this._addToFsEvents(t,!1,!0,e)}this.fsw._getWatchedDir(i).add(o)}const s=a.type===FSEVENT_TYPE_DIRECTORY$1?e+DIR_SUFFIX$1:e;this.fsw._emit(s,t),s===EV_ADD_DIR$1$1&&this._addToFsEvents(t,!1,!0)}}_watchWithFsEvents(e,t,n,r){if(this.fsw.closed)return;if(this.fsw._isIgnored(e))return;const i=this.fsw.options,s=setFSEventsListener$1(e,t,async(s,o,a)=>{if(this.fsw.closed)return;if(void 0!==i.depth&&calcDepth$1(s,t)>i.depth)return;const c=n(path$n__default.join(e,path$n__default.relative(e,s)));if(r&&!r(c))return;const l=path$n__default.dirname(c),u=path$n__default.basename(c),p=this.fsw._getWatchedDir(a.type===FSEVENT_TYPE_DIRECTORY$1?c:l);if(wrongEventFlags$1.has(o)||a.event===FSEVENT_UNKNOWN$1)if(typeof i.ignored===FUNCTION_TYPE$2){let e;try{e=await stat$2$1(c)}catch(e){}if(this.fsw.closed)return;if(this.checkIgnored(c,e))return;sameTypes$1(a,e)?this.addOrChange(c,s,t,l,p,u,a,i):this.handleEvent(EV_UNLINK$2,c,s,t,l,p,u,a,i)}else this.checkExists(c,s,t,l,p,u,a,i);else switch(a.event){case FSEVENT_CREATED$1:case FSEVENT_MODIFIED$1:return this.addOrChange(c,s,t,l,p,u,a,i);case FSEVENT_DELETED$1:case FSEVENT_MOVED$1:return this.checkExists(c,s,t,l,p,u,a,i)}},this.fsw._emitRaw,this.fsw);return this.fsw._emitReady(),s}async _handleFsEventsSymlink(e,t,n,r){if(!this.fsw.closed&&!this.fsw._symlinkPaths.has(t)){this.fsw._symlinkPaths.set(t,!0),this.fsw._incrReadyCount();try{const t=await realpath$1$1(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(t))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(t||e,r=>{let i=e;return t&&t!==DOT_SLASH$1?i=r.replace(t,e):r!==DOT_SLASH$1&&(i=path$n__default.join(e,r)),n(i)},!1,r)}catch(e){if(this.fsw._handleError(e))return this.fsw._emitReady()}}}emitAdd(e,t,n,r,i){const s=n(e),o=t.isDirectory(),a=this.fsw._getWatchedDir(path$n__default.dirname(s)),c=path$n__default.basename(s);o&&this.fsw._getWatchedDir(s),a.has(c)||(a.add(c),r.ignoreInitial&&!0!==i||this.fsw._emit(o?EV_ADD_DIR$1$1:EV_ADD$1$1,s,t))}initWatch(e,t,n,r){if(this.fsw.closed)return;const i=this._watchWithFsEvents(n.watchPath,path$n__default.resolve(e||n.watchPath),r,n.globFilter);this.fsw._addPathCloser(t,i)}async _addToFsEvents(e,t,n,r){if(this.fsw.closed)return;const i=this.fsw.options,s=typeof t===FUNCTION_TYPE$2?t:IDENTITY_FN$1,o=this.fsw._getWatchHelpers(e);try{const t=await statMethods$1$1[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,t))throw null;if(t.isDirectory()){if(o.globFilter||this.emitAdd(s(e),t,s,i,n),r&&r>i.depth)return;this.fsw._readdirp(o.watchPath,{fileFilter:e=>o.filterPath(e),directoryFilter:e=>o.filterDir(e),...Depth$1(i.depth-(r||0))}).on(STR_DATA$1$1,e=>{if(this.fsw.closed)return;if(e.stats.isDirectory()&&!o.filterPath(e))return;const t=path$n__default.join(o.watchPath,e.path),{fullPath:r}=e;if(o.followSymlinks&&e.stats.isSymbolicLink()){const e=void 0===i.depth?void 0:calcDepth$1(t,path$n__default.resolve(o.watchPath))+1;this._handleFsEventsSymlink(t,r,s,e)}else this.emitAdd(t,e.stats,s,i,n)}).on(EV_ERROR$1$1,EMPTY_FN$1$1).on(STR_END$1$1,()=>{this.fsw._emitReady()})}else this.emitAdd(o.watchPath,t,s,i,n),this.fsw._emitReady()}catch(e){e&&!this.fsw._handleError(e)||(this.fsw._emitReady(),this.fsw._emitReady())}if(i.persistent&&!0!==n)if(typeof t===FUNCTION_TYPE$2)this.initWatch(void 0,e,o,s);else{let t;try{t=await realpath$1$1(o.watchPath)}catch(e){}this.initWatch(t,e,o,s)}}}var fseventsHandler$1=FsEventsHandler$1,canUse_1$1=canUse$1;fseventsHandler$1.canUse=canUse_1$1;const{EventEmitter:EventEmitter$3}=events$1__default,{promisify:promisify$3$1}=util$6,anymatch$1=anymatch_1$1.default,{EV_ALL:EV_ALL$1,EV_READY:EV_READY$1,EV_ADD:EV_ADD$2$1,EV_CHANGE:EV_CHANGE$2$1,EV_UNLINK:EV_UNLINK$1$1,EV_ADD_DIR:EV_ADD_DIR$2$1,EV_UNLINK_DIR:EV_UNLINK_DIR$1,EV_RAW:EV_RAW$1,EV_ERROR:EV_ERROR$2$1,STR_CLOSE:STR_CLOSE$1,STR_END:STR_END$2$1,BACK_SLASH_RE:BACK_SLASH_RE$1,DOUBLE_SLASH_RE:DOUBLE_SLASH_RE$1,SLASH_OR_BACK_SLASH_RE:SLASH_OR_BACK_SLASH_RE$1,DOT_RE:DOT_RE$1,REPLACER_RE:REPLACER_RE$1,SLASH:SLASH$2,BRACE_START:BRACE_START$1$1,BANG:BANG$1$1,ONE_DOT:ONE_DOT$1,TWO_DOTS:TWO_DOTS$1,GLOBSTAR:GLOBSTAR$3,SLASH_GLOBSTAR:SLASH_GLOBSTAR$1,ANYMATCH_OPTS:ANYMATCH_OPTS$1,STRING_TYPE:STRING_TYPE$1,FUNCTION_TYPE:FUNCTION_TYPE$1$1,EMPTY_STR:EMPTY_STR$1$1,EMPTY_FN:EMPTY_FN$2$1,isWindows:isWindows$1$1,isMacos:isMacos$1}=constants$2$1,stat$3$1=promisify$3$1(fs$n__default.stat),readdir$1$1=promisify$3$1(fs$n__default.readdir),arrify$1=(e=[])=>Array.isArray(e)?e:[e],flatten$2=(e,t=[])=>(e.forEach(e=>{Array.isArray(e)?flatten$2(e,t):t.push(e)}),t),unifyPaths$1=e=>{const t=flatten$2(arrify$1(e));if(!t.every(e=>typeof e===STRING_TYPE$1))throw new TypeError("Non-string provided as watch path: "+t);return t.map(normalizePathToUnix$1)},toUnix$1=e=>{let t=e.replace(BACK_SLASH_RE$1,SLASH$2);for(;t.match(DOUBLE_SLASH_RE$1);)t=t.replace(DOUBLE_SLASH_RE$1,SLASH$2);return t},normalizePathToUnix$1=e=>toUnix$1(path$n__default.normalize(toUnix$1(e))),normalizeIgnored$1=(e=EMPTY_STR$1$1)=>t=>typeof t!==STRING_TYPE$1?t:normalizePathToUnix$1(path$n__default.isAbsolute(t)?t:path$n__default.join(e,t)),getAbsolutePath$1=(e,t)=>path$n__default.isAbsolute(e)?e:e.startsWith(BANG$1$1)?BANG$1$1+path$n__default.join(t,e.slice(1)):path$n__default.join(t,e),undef$1=(e,t)=>void 0===e[t];class DirEntry$1{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){const{items:t}=this;t&&e!==ONE_DOT$1&&e!==TWO_DOTS$1&&t.add(e)}async remove(e){const{items:t}=this;if(!t)return;if(t.delete(e),t.size>0)return;const n=this.path;try{await readdir$1$1(n)}catch(e){this._removeWatcher&&this._removeWatcher(path$n__default.dirname(n),path$n__default.basename(n))}}has(e){const{items:t}=this;if(t)return t.has(e)}getChildren(){const{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}}const STAT_METHOD_F$1="stat",STAT_METHOD_L$1="lstat";class WatchHelper$1{constructor(e,t,n,r){this.fsw=r,this.path=e=e.replace(REPLACER_RE$1,EMPTY_STR$1$1),this.watchPath=t,this.fullWatchPath=path$n__default.resolve(t),this.hasGlob=t!==e,e===EMPTY_STR$1$1&&(this.hasGlob=!1),this.globSymlink=!(!this.hasGlob||!n)&&void 0,this.globFilter=!!this.hasGlob&&anymatch$1(e,void 0,ANYMATCH_OPTS$1),this.dirParts=this.getDirParts(e),this.dirParts.forEach(e=>{e.length>1&&e.pop()}),this.followSymlinks=n,this.statMethod=n?"stat":"lstat"}checkGlobSymlink(e){return void 0===this.globSymlink&&(this.globSymlink=e.fullParentDir!==this.fullWatchPath&&{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return path$n__default.join(this.watchPath,path$n__default.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){const{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);const n=this.entryPath(e);return(!this.hasGlob||typeof this.globFilter!==FUNCTION_TYPE$1$1||this.globFilter(n))&&this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];const t=[];return(e.includes(BRACE_START$1$1)?braces_1$1.expand(e):[e]).forEach(e=>{t.push(path$n__default.relative(this.watchPath,e).split(SLASH_OR_BACK_SLASH_RE$1))}),t}filterDir(e){if(this.hasGlob){const t=this.getDirParts(this.checkGlobSymlink(e));let n=!1;this.unmatchedGlob=!this.dirParts.some(e=>e.every((e,r)=>(e===GLOBSTAR$3&&(n=!0),n||!t[0][r]||anymatch$1(e,t[0][r],ANYMATCH_OPTS$1))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class FSWatcher$1 extends EventEmitter$3{constructor(e){super();const t={};e&&Object.assign(t,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,undef$1(t,"persistent")&&(t.persistent=!0),undef$1(t,"ignoreInitial")&&(t.ignoreInitial=!1),undef$1(t,"ignorePermissionErrors")&&(t.ignorePermissionErrors=!1),undef$1(t,"interval")&&(t.interval=100),undef$1(t,"binaryInterval")&&(t.binaryInterval=300),undef$1(t,"disableGlobbing")&&(t.disableGlobbing=!1),t.enableBinaryInterval=t.binaryInterval!==t.interval,undef$1(t,"useFsEvents")&&(t.useFsEvents=!t.usePolling);fseventsHandler$1.canUse()||(t.useFsEvents=!1),undef$1(t,"usePolling")&&!t.useFsEvents&&(t.usePolling=isMacos$1);const n=process.env.CHOKIDAR_USEPOLLING;if(void 0!==n){const e=n.toLowerCase();t.usePolling="false"!==e&&"0"!==e&&("true"===e||"1"===e||!!e)}const r=process.env.CHOKIDAR_INTERVAL;r&&(t.interval=Number.parseInt(r,10)),undef$1(t,"atomic")&&(t.atomic=!t.usePolling&&!t.useFsEvents),t.atomic&&(this._pendingUnlinks=new Map),undef$1(t,"followSymlinks")&&(t.followSymlinks=!0),undef$1(t,"awaitWriteFinish")&&(t.awaitWriteFinish=!1),!0===t.awaitWriteFinish&&(t.awaitWriteFinish={});const i=t.awaitWriteFinish;i&&(i.stabilityThreshold||(i.stabilityThreshold=2e3),i.pollInterval||(i.pollInterval=100),this._pendingWrites=new Map),t.ignored&&(t.ignored=arrify$1(t.ignored));let s=0;this._emitReady=()=>{s++,s>=this._readyCount&&(this._emitReady=EMPTY_FN$2$1,this._readyEmitted=!0,process.nextTick(()=>this.emit(EV_READY$1)))},this._emitRaw=(...e)=>this.emit(EV_RAW$1,...e),this._readyEmitted=!1,this.options=t,t.useFsEvents?this._fsEventsHandler=new fseventsHandler$1(this):this._nodeFsHandler=new nodefsHandler$1(this),Object.freeze(t)}add(e,t,n){const{cwd:r,disableGlobbing:i}=this.options;this.closed=!1;let s=unifyPaths$1(e);return r&&(s=s.map(e=>{const t=getAbsolutePath$1(e,r);return i||!isGlob$1(e)?t:normalizePath$1(t)})),s=s.filter(e=>e.startsWith(BANG$1$1)?(this._ignoredPaths.add(e.slice(1)),!1):(this._ignoredPaths.delete(e),this._ignoredPaths.delete(e+SLASH_GLOBSTAR$1),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=s.length),this.options.persistent&&(this._readyCount*=2),s.forEach(e=>this._fsEventsHandler._addToFsEvents(e))):(this._readyCount||(this._readyCount=0),this._readyCount+=s.length,Promise.all(s.map(async e=>{const r=await this._nodeFsHandler._addToNodeFs(e,!n,0,0,t);return r&&this._emitReady(),r})).then(e=>{this.closed||e.filter(e=>e).forEach(e=>{this.add(path$n__default.dirname(e),path$n__default.basename(t||e))})})),this}unwatch(e){if(this.closed)return this;const t=unifyPaths$1(e),{cwd:n}=this.options;return t.forEach(e=>{path$n__default.isAbsolute(e)||this._closers.has(e)||(n&&(e=path$n__default.join(n,e)),e=path$n__default.resolve(e)),this._closePath(e),this._ignoredPaths.add(e),this._watched.has(e)&&this._ignoredPaths.add(e+SLASH_GLOBSTAR$1),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();const e=[];return this._closers.forEach(t=>t.forEach(t=>{const n=t();n instanceof Promise&&e.push(n)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(e=>{this["_"+e].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){const e={};return this._watched.forEach((t,n)=>{const r=this.options.cwd?path$n__default.relative(this.options.cwd,n):n;e[r||ONE_DOT$1]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(...t),e!==EV_ERROR$2$1&&this.emit(EV_ALL$1,...t)}async _emit(e,t,n,r,i){if(this.closed)return;const s=this.options;isWindows$1$1&&(t=path$n__default.normalize(t)),s.cwd&&(t=path$n__default.relative(s.cwd,t));const o=[e,t];void 0!==i?o.push(n,r,i):void 0!==r?o.push(n,r):void 0!==n&&o.push(n);const a=s.awaitWriteFinish;let c;if(a&&(c=this._pendingWrites.get(t)))return c.lastChange=new Date,this;if(s.atomic){if(e===EV_UNLINK$1$1)return this._pendingUnlinks.set(t,o),setTimeout(()=>{this._pendingUnlinks.forEach((e,t)=>{this.emit(...e),this.emit(EV_ALL$1,...e),this._pendingUnlinks.delete(t)})},"number"==typeof s.atomic?s.atomic:100),this;e===EV_ADD$2$1&&this._pendingUnlinks.has(t)&&(e=o[0]=EV_CHANGE$2$1,this._pendingUnlinks.delete(t))}if(a&&(e===EV_ADD$2$1||e===EV_CHANGE$2$1)&&this._readyEmitted){const n=(t,n)=>{t?(e=o[0]=EV_ERROR$2$1,o[1]=t,this.emitWithAll(e,o)):n&&(o.length>2?o[2]=n:o.push(n),this.emitWithAll(e,o))};return this._awaitWriteFinish(t,a.stabilityThreshold,e,n),this}if(e===EV_CHANGE$2$1){if(!this._throttle(EV_CHANGE$2$1,t,50))return this}if(s.alwaysStat&&void 0===n&&(e===EV_ADD$2$1||e===EV_ADD_DIR$2$1||e===EV_CHANGE$2$1)){const e=s.cwd?path$n__default.join(s.cwd,t):t;let n;try{n=await stat$3$1(e)}catch(e){}if(!n||this.closed)return;o.push(n)}return this.emitWithAll(e,o),this}_handleError(e){const t=e&&e.code;return e&&"ENOENT"!==t&&"ENOTDIR"!==t&&(!this.options.ignorePermissionErrors||"EPERM"!==t&&"EACCES"!==t)&&this.emit(EV_ERROR$2$1,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);const r=this._throttled.get(e),i=r.get(t);if(i)return i.count++,!1;let s;const o=()=>{const e=r.get(t),n=e?e.count:0;return r.delete(t),clearTimeout(s),e&&clearTimeout(e.timeoutObject),n};s=setTimeout(o,n);const a={timeoutObject:s,clear:o,count:0};return r.set(t,a),a}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,r){let i,s=e;this.options.cwd&&!path$n__default.isAbsolute(e)&&(s=path$n__default.join(this.options.cwd,e));const o=new Date,a=n=>{fs$n__default.stat(s,(s,o)=>{if(s||!this._pendingWrites.has(e))return void(s&&"ENOENT"!==s.code&&r(s));const c=Number(new Date);n&&o.size!==n.size&&(this._pendingWrites.get(e).lastChange=c);c-this._pendingWrites.get(e).lastChange>=t?(this._pendingWrites.delete(e),r(void 0,o)):i=setTimeout(a,this.options.awaitWriteFinish.pollInterval,o)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:o,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(i),n)}),i=setTimeout(a,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,t){if(this.options.atomic&&DOT_RE$1.test(e))return!0;if(!this._userIgnored){const{cwd:e}=this.options,t=this.options.ignored,n=t&&t.map(normalizeIgnored$1(e)),r=arrify$1(n).filter(e=>typeof e===STRING_TYPE$1&&!isGlob$1(e)).map(e=>e+SLASH_GLOBSTAR$1),i=this._getGlobIgnored().map(normalizeIgnored$1(e)).concat(n,r);this._userIgnored=anymatch$1(i,void 0,ANYMATCH_OPTS$1)}return this._userIgnored([e,t])}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e,t){const n=t||this.options.disableGlobbing||!isGlob$1(e)?e:globParent$1(e),r=this.options.followSymlinks;return new WatchHelper$1(e,n,r,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));const t=path$n__default.resolve(e);return this._watched.has(t)||this._watched.set(t,new DirEntry$1(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;const t=511&(e&&Number.parseInt(e.mode,10)),n=Number.parseInt(t.toString(8)[0],10);return Boolean(4&n)}_remove(e,t,n){const r=path$n__default.join(e,t),i=path$n__default.resolve(r);if(n=null!=n?n:this._watched.has(r)||this._watched.has(i),!this._throttle("remove",r,100))return;n||this.options.useFsEvents||1!==this._watched.size||this.add(e,t,!0);this._getWatchedDir(r).getChildren().forEach(e=>this._remove(r,e));const s=this._getWatchedDir(e),o=s.has(t);s.remove(t);let a=r;if(this.options.cwd&&(a=path$n__default.relative(this.options.cwd,r)),this.options.awaitWriteFinish&&this._pendingWrites.has(a)){if(this._pendingWrites.get(a).cancelWait()===EV_ADD$2$1)return}this._watched.delete(r),this._watched.delete(i);const c=n?EV_UNLINK_DIR$1:EV_UNLINK$1$1;o&&!this._isIgnored(r)&&this._emit(c,r),this.options.useFsEvents||this._closePath(r)}_closePath(e){const t=this._closers.get(e);if(!t)return;t.forEach(e=>e()),this._closers.delete(e);const n=path$n__default.dirname(e);this._getWatchedDir(n).remove(path$n__default.basename(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;const n={type:EV_ALL$1,alwaysStat:!0,lstat:!0,...t};let r=readdirp_1$1(e,n);return this._streams.add(r),r.once(STR_CLOSE$1,()=>{r=void 0}),r.once(STR_END$2$1,()=>{r&&(this._streams.delete(r),r=void 0)}),r}}var FSWatcher_1$1=FSWatcher$1;const watch$2=(e,t)=>{const n=new FSWatcher$1(t);return n.add(e),n};var watch_1$1=watch$2,chokidar$1={FSWatcher:FSWatcher_1$1,watch:watch_1$1};class FileWatcher{constructor(e,t){this.transformWatchers=new Map,this.chokidarOptions=t,this.task=e,this.watcher=this.createWatcher(null)}close(){this.watcher.close();for(const e of this.transformWatchers.values())e.close()}unwatch(e){this.watcher.unwatch(e);const t=this.transformWatchers.get(e);t&&(this.transformWatchers.delete(e),t.close())}watch(e,t){if(t){const t=this.transformWatchers.get(e)||this.createWatcher(e);t.add(e),this.transformWatchers.set(e,t)}else this.watcher.add(e)}createWatcher(e){const t=this.task,n="linux"===os$4.platform(),r=null!==e,i=i=>{const o=e||i;n&&(s.unwatch(o),s.add(o)),t.invalidate(o,r)},s=chokidar$1.watch([],this.chokidarOptions).on("change",i).on("unlink",i);return s}}class Watcher{constructor(e,t){this.buildDelay=0,this.buildTimeout=null,this.invalidatedIds=new Set,this.rerun=!1,this.emitter=t,t.close=this.close.bind(this),this.tasks=e.map(e=>new Task(this,e)),this.buildDelay=e.reduce((e,{watch:t})=>t&&"number"==typeof t.buildDelay?Math.max(e,t.buildDelay):e,this.buildDelay),this.running=!0,process.nextTick(()=>this.run())}close(){this.buildTimeout&&clearTimeout(this.buildTimeout);for(const e of this.tasks)e.close();this.emitter.removeAllListeners()}emit(e,t){this.emitter.emit(e,t)}invalidate(e){e&&this.invalidatedIds.add(e),this.running?this.rerun=!0:(this.buildTimeout&&clearTimeout(this.buildTimeout),this.buildTimeout=setTimeout(()=>{this.buildTimeout=null;for(const e of this.invalidatedIds)this.emit("change",e);this.invalidatedIds.clear(),this.emit("restart"),this.run()},this.buildDelay))}async run(){this.running=!0,this.emit("event",{code:"START"});try{for(const e of this.tasks)await e.run();this.running=!1,this.emit("event",{code:"END"})}catch(e){this.running=!1,this.emit("event",{code:"ERROR",error:e})}this.rerun&&(this.rerun=!1,this.invalidate())}}class Task{constructor(e,t){this.cache={modules:[]},this.watchFiles=[],this.invalidated=!0,this.watcher=e,this.closed=!1,this.watched=new Set,this.skipWrite=t.watch&&!!t.watch.skipWrite,this.options=mergeOptions(t),this.outputs=this.options.output,this.outputFiles=this.outputs.map(e=>{if(e.file||e.dir)return path$n.resolve(e.file||e.dir)});const n=this.options.watch||{};this.filter=createFilter$1(n.include,n.exclude),this.fileWatcher=new FileWatcher(this,{...n.chokidar,disableGlobbing:!0,ignoreInitial:!0})}close(){this.closed=!0,this.fileWatcher.close()}invalidate(e,t){if(this.invalidated=!0,t)for(const t of this.cache.modules)-1!==t.transformDependencies.indexOf(e)&&(t.originalCode=null);this.watcher.invalidate(e)}async run(){if(!this.invalidated)return;this.invalidated=!1;const e={...this.options,cache:this.cache},t=Date.now();this.watcher.emit("event",{code:"BUNDLE_START",input:this.options.input,output:this.outputFiles});try{const n=await rollupInternal(e,this.watcher.emitter);if(this.closed)return;this.updateWatchedFiles(n),this.skipWrite||await Promise.all(this.outputs.map(e=>n.write(e))),this.watcher.emit("event",{code:"BUNDLE_END",duration:Date.now()-t,input:this.options.input,output:this.outputFiles,result:n})}catch(e){if(this.closed)return;if(Array.isArray(e.watchFiles))for(const t of e.watchFiles)this.watchFile(t);throw e.id&&(this.cache.modules=this.cache.modules.filter(t=>t.id!==e.id)),e}}updateWatchedFiles(e){const t=this.watched;this.watched=new Set,this.watchFiles=e.watchFiles,this.cache=e.cache;for(const e of this.watchFiles)this.watchFile(e);for(const e of this.cache.modules)for(const t of e.transformDependencies)this.watchFile(t,!0);for(const e of t)this.watched.has(e)||this.fileWatcher.unwatch(e)}watchFile(e,t=!1){if(this.filter(e)){if(this.watched.add(e),this.outputFiles.some(t=>t===e))throw new Error("Cannot import the generated bundle");this.fileWatcher.watch(e,t)}}}var watch$3=Object.freeze({__proto__:null,Task,Watcher});