@modern-js/module-tools 2.21.0 → 2.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/compiled/@rollup/plugin-json/@rollup/pluginutils/types/index.d.ts +8 -2
  3. package/compiled/@rollup/plugin-json/estree/index.d.ts +677 -548
  4. package/compiled/@rollup/plugin-json/index.js +1 -1
  5. package/compiled/@rollup/plugin-json/package.json +1 -1
  6. package/compiled/@rollup/plugin-json/rollup/dist/rollup.d.ts +167 -150
  7. package/compiled/@rollup/plugin-json/types/index.d.ts +2 -2
  8. package/compiled/rollup/249.index.js +103 -0
  9. package/compiled/rollup/index.js +36 -21
  10. package/compiled/rollup/package.json +1 -1
  11. package/compiled/rollup/types/rollup.d.ts +167 -150
  12. package/compiled/rollup-plugin-dts/dist/rollup-plugin-dts.d.ts +3 -105
  13. package/compiled/rollup-plugin-dts/index.js +1 -1
  14. package/compiled/rollup-plugin-dts/package.json +1 -1
  15. package/compiled/rollup-plugin-dts/rollup/dist/rollup.d.ts +167 -150
  16. package/dist/build.js +3 -1
  17. package/dist/build.js.map +1 -1
  18. package/dist/builder/build.js +37 -14
  19. package/dist/builder/build.js.map +1 -1
  20. package/dist/builder/clear.js +6 -2
  21. package/dist/builder/clear.js.map +1 -1
  22. package/dist/builder/copy.js +9 -3
  23. package/dist/builder/copy.js.map +1 -1
  24. package/dist/builder/dts/index.js +6 -2
  25. package/dist/builder/dts/index.js.map +1 -1
  26. package/dist/builder/dts/rollup.js +3 -1
  27. package/dist/builder/dts/rollup.js.map +1 -1
  28. package/dist/builder/dts/tsc.js +6 -2
  29. package/dist/builder/dts/tsc.js.map +1 -1
  30. package/dist/builder/index.js +3 -1
  31. package/dist/builder/index.js.map +1 -1
  32. package/dist/builder/platform.js +3 -1
  33. package/dist/builder/platform.js.map +1 -1
  34. package/dist/cli.js +3 -1
  35. package/dist/cli.js.map +1 -1
  36. package/dist/command.js +12 -4
  37. package/dist/command.js.map +1 -1
  38. package/dist/config/defineConfig.js +6 -2
  39. package/dist/config/defineConfig.js.map +1 -1
  40. package/dist/config/legacySchema.js +21 -7
  41. package/dist/config/legacySchema.js.map +1 -1
  42. package/dist/config/normalize.js +18 -6
  43. package/dist/config/normalize.js.map +1 -1
  44. package/dist/config/schema.js +21 -7
  45. package/dist/config/schema.js.map +1 -1
  46. package/dist/config/transformLegacyConfig.js +30 -10
  47. package/dist/config/transformLegacyConfig.js.map +1 -1
  48. package/dist/constants/build.js +3 -1
  49. package/dist/constants/build.js.map +1 -1
  50. package/dist/constants/buildPresets.js +54 -18
  51. package/dist/constants/buildPresets.js.map +1 -1
  52. package/dist/constants/colors.js +9 -3
  53. package/dist/constants/colors.js.map +1 -1
  54. package/dist/constants/dts.js +12 -4
  55. package/dist/constants/dts.js.map +1 -1
  56. package/dist/constants/file.js +9 -3
  57. package/dist/constants/file.js.map +1 -1
  58. package/dist/constants/legacyBuildPresets.js +18 -6
  59. package/dist/constants/legacyBuildPresets.js.map +1 -1
  60. package/dist/constants/log.js +21 -7
  61. package/dist/constants/log.js.map +1 -1
  62. package/dist/dev.js +6 -2
  63. package/dist/dev.js.map +1 -1
  64. package/dist/error.js +18 -6
  65. package/dist/error.js.map +1 -1
  66. package/dist/hooks/build.js +6 -2
  67. package/dist/hooks/build.js.map +1 -1
  68. package/dist/hooks/dev.js +3 -1
  69. package/dist/hooks/dev.js.map +1 -1
  70. package/dist/hooks/index.js +3 -1
  71. package/dist/hooks/index.js.map +1 -1
  72. package/dist/hooks/misc.js +3 -1
  73. package/dist/hooks/misc.js.map +1 -1
  74. package/dist/index.js +12 -4
  75. package/dist/index.js.map +1 -1
  76. package/dist/locale/en.js +3 -1
  77. package/dist/locale/en.js.map +1 -1
  78. package/dist/locale/index.js +6 -2
  79. package/dist/locale/index.js.map +1 -1
  80. package/dist/locale/zh.js +3 -1
  81. package/dist/locale/zh.js.map +1 -1
  82. package/dist/plugins.js +3 -1
  83. package/dist/plugins.js.map +1 -1
  84. package/dist/types/config/index.d.ts +3 -0
  85. package/dist/types/config/index.js.map +1 -1
  86. package/dist/utils/builder.js +15 -5
  87. package/dist/utils/builder.js.map +1 -1
  88. package/dist/utils/common.js +3 -1
  89. package/dist/utils/common.js.map +1 -1
  90. package/dist/utils/config.js +15 -5
  91. package/dist/utils/config.js.map +1 -1
  92. package/dist/utils/context.js +3 -1
  93. package/dist/utils/context.js.map +1 -1
  94. package/dist/utils/dts.js +15 -5
  95. package/dist/utils/dts.js.map +1 -1
  96. package/dist/utils/input.js +15 -5
  97. package/dist/utils/input.js.map +1 -1
  98. package/dist/utils/language.js +3 -1
  99. package/dist/utils/language.js.map +1 -1
  100. package/dist/utils/libuildPlugins.js +6 -2
  101. package/dist/utils/libuildPlugins.js.map +1 -1
  102. package/dist/utils/log.js +3 -1
  103. package/dist/utils/log.js.map +1 -1
  104. package/dist/utils/onExit.js +3 -1
  105. package/dist/utils/onExit.js.map +1 -1
  106. package/dist/utils/path.js +3 -1
  107. package/dist/utils/path.js.map +1 -1
  108. package/dist/utils/print.js +21 -7
  109. package/dist/utils/print.js.map +1 -1
  110. package/dist/utils/style.js +12 -4
  111. package/dist/utils/style.js.map +1 -1
  112. package/dist/utils/tspathsTransform.js +3 -1
  113. package/dist/utils/tspathsTransform.js.map +1 -1
  114. package/package.json +16 -16
  115. package/compiled/@rollup/plugin-json/license +0 -21
@@ -1,4 +1,4 @@
1
- import * as rollup from '../rollup';
1
+ import { PluginImpl } from '../rollup';
2
2
  import ts from 'typescript';
3
3
 
4
4
  interface Options {
@@ -21,108 +21,6 @@ interface Options {
21
21
  tsconfig?: string;
22
22
  }
23
23
 
24
- declare function rollupPluginDts(options?: Options): {
25
- name: string;
26
- outputOptions: (this: rollup.PluginContext, options: rollup.OutputOptions) => {
27
- chunkFileNames: string | ((chunkInfo: rollup.PreRenderedChunk) => string);
28
- entryFileNames: string | ((chunkInfo: rollup.PreRenderedChunk) => string);
29
- format: "es";
30
- exports: "named";
31
- compact: false;
32
- freeze: true;
33
- interop: "esModule";
34
- generatedCode: {
35
- symbols: boolean;
36
- } & (rollup.GeneratedCodePreset | rollup.GeneratedCodeOptions | undefined);
37
- strict: false;
38
- amd?: rollup.AmdOptions | undefined;
39
- assetFileNames?: string | ((chunkInfo: rollup.PreRenderedAsset) => string) | undefined;
40
- banner?: string | rollup.AddonFunction | undefined;
41
- dir?: string | undefined;
42
- dynamicImportFunction?: string | undefined;
43
- dynamicImportInCjs?: boolean | undefined;
44
- esModule?: boolean | "if-default-prop" | undefined;
45
- experimentalDeepDynamicChunkOptimization?: boolean | undefined;
46
- experimentalMinChunkSize?: number | undefined;
47
- extend?: boolean | undefined;
48
- externalImportAssertions?: boolean | undefined;
49
- externalLiveBindings?: boolean | undefined;
50
- file?: string | undefined;
51
- footer?: string | rollup.AddonFunction | undefined;
52
- globals?: rollup.GlobalsOption | undefined;
53
- hoistTransitiveImports?: boolean | undefined;
54
- indent?: string | boolean | undefined;
55
- inlineDynamicImports?: boolean | undefined;
56
- intro?: string | rollup.AddonFunction | undefined;
57
- manualChunks?: rollup.ManualChunksOption | undefined;
58
- minifyInternalExports?: boolean | undefined;
59
- name?: string | undefined;
60
- namespaceToStringTag?: boolean | undefined;
61
- noConflict?: boolean | undefined;
62
- outro?: string | rollup.AddonFunction | undefined;
63
- paths?: rollup.OptionsPaths | undefined;
64
- plugins?: rollup.OutputPluginOption;
65
- preferConst?: boolean | undefined;
66
- preserveModules?: boolean | undefined;
67
- preserveModulesRoot?: string | undefined;
68
- sanitizeFileName?: boolean | ((fileName: string) => string) | undefined;
69
- sourcemap?: boolean | "inline" | "hidden" | undefined;
70
- sourcemapBaseUrl?: string | undefined;
71
- sourcemapExcludeSources?: boolean | undefined;
72
- sourcemapFile?: string | undefined;
73
- sourcemapPathTransform?: rollup.SourcemapPathTransformOption | undefined;
74
- systemNullSetters?: boolean | undefined;
75
- validate?: boolean | undefined;
76
- };
77
- renderChunk: (this: rollup.PluginContext, code: string, chunk: rollup.RenderedChunk, options: rollup.NormalizedOutputOptions) => {
78
- code: string;
79
- map: {
80
- mappings: "";
81
- };
82
- };
83
- options(this: rollup.MinimalPluginContext, options: rollup.InputOptions): {
84
- onwarn(warning: rollup.RollupLog, warn: rollup.WarningHandler): void;
85
- treeshake: {
86
- moduleSideEffects: "no-external";
87
- propertyReadSideEffects: true;
88
- unknownGlobalSideEffects: false;
89
- };
90
- acorn?: Record<string, unknown> | undefined;
91
- acornInjectPlugins?: (() => unknown)[] | (() => unknown) | undefined;
92
- cache?: false | rollup.RollupCache | undefined;
93
- context?: string | undefined;
94
- experimentalCacheExpiry?: number | undefined;
95
- external?: rollup.ExternalOption | undefined;
96
- inlineDynamicImports?: boolean | undefined;
97
- input?: rollup.InputOption | undefined;
98
- makeAbsoluteExternalsRelative?: boolean | "ifRelativeSource" | undefined;
99
- manualChunks?: rollup.ManualChunksOption | undefined;
100
- maxParallelFileOps?: number | undefined;
101
- maxParallelFileReads?: number | undefined;
102
- moduleContext?: ((id: string) => string | rollup.NullValue) | {
103
- [id: string]: string;
104
- } | undefined;
105
- perf?: boolean | undefined;
106
- plugins?: rollup.InputPluginOption;
107
- preserveEntrySignatures?: rollup.PreserveEntrySignaturesOption | undefined;
108
- preserveModules?: boolean | undefined;
109
- preserveSymlinks?: boolean | undefined;
110
- shimMissingExports?: boolean | undefined;
111
- strictDeprecations?: boolean | undefined;
112
- watch?: false | rollup.WatcherOptions | undefined;
113
- };
114
- transform(this: rollup.TransformPluginContext, code: string, id: string): {
115
- code: string;
116
- ast: any;
117
- map: any;
118
- } | null;
119
- resolveId(this: rollup.PluginContext, source: string, importer: string | undefined): {
120
- id: string;
121
- external: true;
122
- } | {
123
- id: string;
124
- external?: undefined;
125
- } | undefined;
126
- };
24
+ declare const plugin: PluginImpl<Options>;
127
25
 
128
- export { Options, rollupPluginDts as default };
26
+ export { Options, plugin as default };
@@ -1 +1 @@
1
- (()=>{var e={248:function(e,t){(function(e,r){true?r(t):0})(this,(function(e){"use strict";const t=",".charCodeAt(0);const r=";".charCodeAt(0);const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";const i=new Uint8Array(64);const o=new Uint8Array(128);for(let e=0;e<n.length;e++){const t=n.charCodeAt(e);i[e]=t;o[t]=e}const s=typeof TextDecoder!=="undefined"?new TextDecoder:typeof Buffer!=="undefined"?{decode(e){const t=Buffer.from(e.buffer,e.byteOffset,e.byteLength);return t.toString()}}:{decode(e){let t="";for(let r=0;r<e.length;r++){t+=String.fromCharCode(e[r])}return t}};function decode(e){const t=new Int32Array(5);const r=[];let n=0;do{const i=indexOf(e,n);const o=[];let s=true;let a=0;t[0]=0;for(let r=n;r<i;r++){let n;r=decodeInteger(e,r,t,0);const c=t[0];if(c<a)s=false;a=c;if(hasMoreVlq(e,r,i)){r=decodeInteger(e,r,t,1);r=decodeInteger(e,r,t,2);r=decodeInteger(e,r,t,3);if(hasMoreVlq(e,r,i)){r=decodeInteger(e,r,t,4);n=[c,t[1],t[2],t[3],t[4]]}else{n=[c,t[1],t[2],t[3]]}}else{n=[c]}o.push(n)}if(!s)sort(o);r.push(o);n=i+1}while(n<=e.length);return r}function indexOf(e,t){const r=e.indexOf(";",t);return r===-1?e.length:r}function decodeInteger(e,t,r,n){let i=0;let s=0;let a=0;do{const r=e.charCodeAt(t++);a=o[r];i|=(a&31)<<s;s+=5}while(a&32);const c=i&1;i>>>=1;if(c){i=-2147483648|-i}r[n]+=i;return t}function hasMoreVlq(e,r,n){if(r>=n)return false;return e.charCodeAt(r)!==t}function sort(e){e.sort(sortComparator)}function sortComparator(e,t){return e[0]-t[0]}function encode(e){const n=new Int32Array(5);const i=1024*16;const o=i-36;const a=new Uint8Array(i);const c=a.subarray(0,o);let l=0;let u="";for(let f=0;f<e.length;f++){const d=e[f];if(f>0){if(l===i){u+=s.decode(a);l=0}a[l++]=r}if(d.length===0)continue;n[0]=0;for(let e=0;e<d.length;e++){const r=d[e];if(l>o){u+=s.decode(c);a.copyWithin(0,o,l);l-=o}if(e>0)a[l++]=t;l=encodeInteger(a,l,n,r,0);if(r.length===1)continue;l=encodeInteger(a,l,n,r,1);l=encodeInteger(a,l,n,r,2);l=encodeInteger(a,l,n,r,3);if(r.length===4)continue;l=encodeInteger(a,l,n,r,4)}}return u+s.decode(a.subarray(0,l))}function encodeInteger(e,t,r,n,o){const s=n[o];let a=s-r[o];r[o]=s;a=a<0?-a<<1|1:a<<1;do{let r=a&31;a>>>=5;if(a>0)r|=32;e[t++]=i[r]}while(a>0);return t}e.decode=decode;e.encode=encode;Object.defineProperty(e,"__esModule",{value:true})}))},571:(e,t,r)=>{"use strict";e=r.nmd(e);const n=r(755);const wrapAnsi16=(e,t)=>function(){const r=e.apply(n,arguments);return`[${r+t}m`};const wrapAnsi256=(e,t)=>function(){const r=e.apply(n,arguments);return`[${38+t};5;${r}m`};const wrapAnsi16m=(e,t)=>function(){const r=e.apply(n,arguments);return`[${38+t};2;${r[0]};${r[1]};${r[2]}m`};function assembleStyles(){const e=new Map;const t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.grey=t.color.gray;for(const r of Object.keys(t)){const n=t[r];for(const r of Object.keys(n)){const i=n[r];t[r]={open:`[${i[0]}m`,close:`[${i[1]}m`};n[r]=t[r];e.set(i[0],i[1])}Object.defineProperty(t,r,{value:n,enumerable:false});Object.defineProperty(t,"codes",{value:e,enumerable:false})}const ansi2ansi=e=>e;const rgb2rgb=(e,t,r)=>[e,t,r];t.color.close="";t.bgColor.close="";t.color.ansi={ansi:wrapAnsi16(ansi2ansi,0)};t.color.ansi256={ansi256:wrapAnsi256(ansi2ansi,0)};t.color.ansi16m={rgb:wrapAnsi16m(rgb2rgb,0)};t.bgColor.ansi={ansi:wrapAnsi16(ansi2ansi,10)};t.bgColor.ansi256={ansi256:wrapAnsi256(ansi2ansi,10)};t.bgColor.ansi16m={rgb:wrapAnsi16m(rgb2rgb,10)};for(let e of Object.keys(n)){if(typeof n[e]!=="object"){continue}const r=n[e];if(e==="ansi16"){e="ansi"}if("ansi16"in r){t.color.ansi[e]=wrapAnsi16(r.ansi16,0);t.bgColor.ansi[e]=wrapAnsi16(r.ansi16,10)}if("ansi256"in r){t.color.ansi256[e]=wrapAnsi256(r.ansi256,0);t.bgColor.ansi256[e]=wrapAnsi256(r.ansi256,10)}if("rgb"in r){t.color.ansi16m[e]=wrapAnsi16m(r.rgb,0);t.bgColor.ansi16m[e]=wrapAnsi16m(r.rgb,10)}}return t}Object.defineProperty(e,"exports",{enumerable:true,get:assembleStyles})},673:(e,t,r)=>{"use strict";const n=r(434);const i=r(571);const o=r(332).stdout;const s=r(956);const a=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm");const c=["ansi","ansi","ansi256","ansi16m"];const l=new Set(["gray"]);const u=Object.create(null);function applyOptions(e,t){t=t||{};const r=o?o.level:0;e.level=t.level===undefined?r:t.level;e.enabled="enabled"in t?t.enabled:e.level>0}function Chalk(e){if(!this||!(this instanceof Chalk)||this.template){const t={};applyOptions(t,e);t.template=function(){const e=[].slice.call(arguments);return chalkTag.apply(null,[t.template].concat(e))};Object.setPrototypeOf(t,Chalk.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=Chalk;return t.template}applyOptions(this,e)}if(a){i.blue.open=""}for(const e of Object.keys(i)){i[e].closeRe=new RegExp(n(i[e].close),"g");u[e]={get(){const t=i[e];return build.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}}}u.visible={get(){return build.call(this,this._styles||[],true,"visible")}};i.color.closeRe=new RegExp(n(i.color.close),"g");for(const e of Object.keys(i.color.ansi)){if(l.has(e)){continue}u[e]={get(){const t=this.level;return function(){const r=i.color[c[t]][e].apply(null,arguments);const n={open:r,close:i.color.close,closeRe:i.color.closeRe};return build.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}}}i.bgColor.closeRe=new RegExp(n(i.bgColor.close),"g");for(const e of Object.keys(i.bgColor.ansi)){if(l.has(e)){continue}const t="bg"+e[0].toUpperCase()+e.slice(1);u[t]={get(){const t=this.level;return function(){const r=i.bgColor[c[t]][e].apply(null,arguments);const n={open:r,close:i.bgColor.close,closeRe:i.bgColor.closeRe};return build.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}}}const f=Object.defineProperties((()=>{}),u);function build(e,t,r){const builder=function(){return applyStyle.apply(builder,arguments)};builder._styles=e;builder._empty=t;const n=this;Object.defineProperty(builder,"level",{enumerable:true,get(){return n.level},set(e){n.level=e}});Object.defineProperty(builder,"enabled",{enumerable:true,get(){return n.enabled},set(e){n.enabled=e}});builder.hasGrey=this.hasGrey||r==="gray"||r==="grey";builder.__proto__=f;return builder}function applyStyle(){const e=arguments;const t=e.length;let r=String(arguments[0]);if(t===0){return""}if(t>1){for(let n=1;n<t;n++){r+=" "+e[n]}}if(!this.enabled||this.level<=0||!r){return this._empty?"":r}const n=i.dim.open;if(a&&this.hasGrey){i.dim.open=""}for(const e of this._styles.slice().reverse()){r=e.open+r.replace(e.closeRe,e.open)+e.close;r=r.replace(/\r?\n/g,`${e.close}$&${e.open}`)}i.dim.open=n;return r}function chalkTag(e,t){if(!Array.isArray(t)){return[].slice.call(arguments,1).join(" ")}const r=[].slice.call(arguments,2);const n=[t.raw[0]];for(let e=1;e<t.length;e++){n.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&"));n.push(String(t.raw[e]))}return s(e,n.join(""))}Object.defineProperties(Chalk.prototype,u);e.exports=Chalk();e.exports.supportsColor=o;e.exports["default"]=e.exports},956:e=>{"use strict";const t=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const r=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const n=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const i=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;const o=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function unescape(e){if(e[0]==="u"&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}return o.get(e)||e}function parseArguments(e,t){const r=[];const o=t.trim().split(/\s*,\s*/g);let s;for(const t of o){if(!isNaN(t)){r.push(Number(t))}else if(s=t.match(n)){r.push(s[2].replace(i,((e,t,r)=>t?unescape(t):r)))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return r}function parseStyle(e){r.lastIndex=0;const t=[];let n;while((n=r.exec(e))!==null){const e=n[1];if(n[2]){const r=parseArguments(e,n[2]);t.push([e].concat(r))}else{t.push([e])}}return t}function buildStyle(e,t){const r={};for(const e of t){for(const t of e.styles){r[t[0]]=e.inverse?null:t.slice(1)}}let n=e;for(const e of Object.keys(r)){if(Array.isArray(r[e])){if(!(e in n)){throw new Error(`Unknown Chalk style: ${e}`)}if(r[e].length>0){n=n[e].apply(n,r[e])}else{n=n[e]}}}return n}e.exports=(e,r)=>{const n=[];const i=[];let o=[];r.replace(t,((t,r,s,a,c,l)=>{if(r){o.push(unescape(r))}else if(a){const t=o.join("");o=[];i.push(n.length===0?t:buildStyle(e,n)(t));n.push({inverse:s,styles:parseStyle(a)})}else if(c){if(n.length===0){throw new Error("Found extraneous } in Chalk template literal")}i.push(buildStyle(e,n)(o.join("")));o=[];n.pop()}else{o.push(l)}}));i.push(o.join(""));if(n.length>0){const e=`Chalk template literal is missing ${n.length} closing bracket${n.length===1?"":"s"} (\`}\`)`;throw new Error(e)}return i.join("")}},461:(e,t,r)=>{var n=r(391);var i={};for(var o in n){if(n.hasOwnProperty(o)){i[n[o]]=o}}var s=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var a in s){if(s.hasOwnProperty(a)){if(!("channels"in s[a])){throw new Error("missing channels property: "+a)}if(!("labels"in s[a])){throw new Error("missing channel labels property: "+a)}if(s[a].labels.length!==s[a].channels){throw new Error("channel and label counts mismatch: "+a)}var c=s[a].channels;var l=s[a].labels;delete s[a].channels;delete s[a].labels;Object.defineProperty(s[a],"channels",{value:c});Object.defineProperty(s[a],"labels",{value:l})}}s.rgb.hsl=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var i=Math.min(t,r,n);var o=Math.max(t,r,n);var s=o-i;var a;var c;var l;if(o===i){a=0}else if(t===o){a=(r-n)/s}else if(r===o){a=2+(n-t)/s}else if(n===o){a=4+(t-r)/s}a=Math.min(a*60,360);if(a<0){a+=360}l=(i+o)/2;if(o===i){c=0}else if(l<=.5){c=s/(o+i)}else{c=s/(2-o-i)}return[a,c*100,l*100]};s.rgb.hsv=function(e){var t;var r;var n;var i;var o;var s=e[0]/255;var a=e[1]/255;var c=e[2]/255;var l=Math.max(s,a,c);var u=l-Math.min(s,a,c);var diffc=function(e){return(l-e)/6/u+1/2};if(u===0){i=o=0}else{o=u/l;t=diffc(s);r=diffc(a);n=diffc(c);if(s===l){i=n-r}else if(a===l){i=1/3+t-n}else if(c===l){i=2/3+r-t}if(i<0){i+=1}else if(i>1){i-=1}}return[i*360,o*100,l*100]};s.rgb.hwb=function(e){var t=e[0];var r=e[1];var n=e[2];var i=s.rgb.hsl(e)[0];var o=1/255*Math.min(t,Math.min(r,n));n=1-1/255*Math.max(t,Math.max(r,n));return[i,o*100,n*100]};s.rgb.cmyk=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var i;var o;var s;var a;a=Math.min(1-t,1-r,1-n);i=(1-t-a)/(1-a)||0;o=(1-r-a)/(1-a)||0;s=(1-n-a)/(1-a)||0;return[i*100,o*100,s*100,a*100]};function comparativeDistance(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}s.rgb.keyword=function(e){var t=i[e];if(t){return t}var r=Infinity;var o;for(var s in n){if(n.hasOwnProperty(s)){var a=n[s];var c=comparativeDistance(e,a);if(c<r){r=c;o=s}}}return o};s.keyword.rgb=function(e){return n[e]};s.rgb.xyz=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92;r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var i=t*.4124+r*.3576+n*.1805;var o=t*.2126+r*.7152+n*.0722;var s=t*.0193+r*.1192+n*.9505;return[i*100,o*100,s*100]};s.rgb.lab=function(e){var t=s.rgb.xyz(e);var r=t[0];var n=t[1];var i=t[2];var o;var a;var c;r/=95.047;n/=100;i/=108.883;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;i=i>.008856?Math.pow(i,1/3):7.787*i+16/116;o=116*n-16;a=500*(r-n);c=200*(n-i);return[o,a,c]};s.hsl.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var i;var o;var s;var a;var c;if(r===0){c=n*255;return[c,c,c]}if(n<.5){o=n*(1+r)}else{o=n+r-n*r}i=2*n-o;a=[0,0,0];for(var l=0;l<3;l++){s=t+1/3*-(l-1);if(s<0){s++}if(s>1){s--}if(6*s<1){c=i+(o-i)*6*s}else if(2*s<1){c=o}else if(3*s<2){c=i+(o-i)*(2/3-s)*6}else{c=i}a[l]=c*255}return a};s.hsl.hsv=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var i=r;var o=Math.max(n,.01);var s;var a;n*=2;r*=n<=1?n:2-n;i*=o<=1?o:2-o;a=(n+r)/2;s=n===0?2*i/(o+i):2*r/(n+r);return[t,s*100,a*100]};s.hsv.rgb=function(e){var t=e[0]/60;var r=e[1]/100;var n=e[2]/100;var i=Math.floor(t)%6;var o=t-Math.floor(t);var s=255*n*(1-r);var a=255*n*(1-r*o);var c=255*n*(1-r*(1-o));n*=255;switch(i){case 0:return[n,c,s];case 1:return[a,n,s];case 2:return[s,n,c];case 3:return[s,a,n];case 4:return[c,s,n];case 5:return[n,s,a]}};s.hsv.hsl=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var i=Math.max(n,.01);var o;var s;var a;a=(2-r)*n;o=(2-r)*i;s=r*i;s/=o<=1?o:2-o;s=s||0;a/=2;return[t,s*100,a*100]};s.hwb.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var i=r+n;var o;var s;var a;var c;if(i>1){r/=i;n/=i}o=Math.floor(6*t);s=1-n;a=6*t-o;if((o&1)!==0){a=1-a}c=r+a*(s-r);var l;var u;var f;switch(o){default:case 6:case 0:l=s;u=c;f=r;break;case 1:l=c;u=s;f=r;break;case 2:l=r;u=s;f=c;break;case 3:l=r;u=c;f=s;break;case 4:l=c;u=r;f=s;break;case 5:l=s;u=r;f=c;break}return[l*255,u*255,f*255]};s.cmyk.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var i=e[3]/100;var o;var s;var a;o=1-Math.min(1,t*(1-i)+i);s=1-Math.min(1,r*(1-i)+i);a=1-Math.min(1,n*(1-i)+i);return[o*255,s*255,a*255]};s.xyz.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var i;var o;var s;i=t*3.2406+r*-1.5372+n*-.4986;o=t*-.9689+r*1.8758+n*.0415;s=t*.0557+r*-.204+n*1.057;i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92;o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92;s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92;i=Math.min(Math.max(0,i),1);o=Math.min(Math.max(0,o),1);s=Math.min(Math.max(0,s),1);return[i*255,o*255,s*255]};s.xyz.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var i;var o;var s;t/=95.047;r/=100;n/=108.883;t=t>.008856?Math.pow(t,1/3):7.787*t+16/116;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;i=116*r-16;o=500*(t-r);s=200*(r-n);return[i,o,s]};s.lab.xyz=function(e){var t=e[0];var r=e[1];var n=e[2];var i;var o;var s;o=(t+16)/116;i=r/500+o;s=o-n/200;var a=Math.pow(o,3);var c=Math.pow(i,3);var l=Math.pow(s,3);o=a>.008856?a:(o-16/116)/7.787;i=c>.008856?c:(i-16/116)/7.787;s=l>.008856?l:(s-16/116)/7.787;i*=95.047;o*=100;s*=108.883;return[i,o,s]};s.lab.lch=function(e){var t=e[0];var r=e[1];var n=e[2];var i;var o;var s;i=Math.atan2(n,r);o=i*360/2/Math.PI;if(o<0){o+=360}s=Math.sqrt(r*r+n*n);return[t,s,o]};s.lch.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var i;var o;var s;s=n/360*2*Math.PI;i=r*Math.cos(s);o=r*Math.sin(s);return[t,i,o]};s.rgb.ansi16=function(e){var t=e[0];var r=e[1];var n=e[2];var i=1 in arguments?arguments[1]:s.rgb.hsv(e)[2];i=Math.round(i/50);if(i===0){return 30}var o=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));if(i===2){o+=60}return o};s.hsv.ansi16=function(e){return s.rgb.ansi16(s.hsv.rgb(e),e[2])};s.rgb.ansi256=function(e){var t=e[0];var r=e[1];var n=e[2];if(t===r&&r===n){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}var i=16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5);return i};s.ansi16.rgb=function(e){var t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}var r=(~~(e>50)+1)*.5;var n=(t&1)*r*255;var i=(t>>1&1)*r*255;var o=(t>>2&1)*r*255;return[n,i,o]};s.ansi256.rgb=function(e){if(e>=232){var t=(e-232)*10+8;return[t,t,t]}e-=16;var r;var n=Math.floor(e/36)/5*255;var i=Math.floor((r=e%36)/6)/5*255;var o=r%6/5*255;return[n,i,o]};s.rgb.hex=function(e){var t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);var r=t.toString(16).toUpperCase();return"000000".substring(r.length)+r};s.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}var r=t[0];if(t[0].length===3){r=r.split("").map((function(e){return e+e})).join("")}var n=parseInt(r,16);var i=n>>16&255;var o=n>>8&255;var s=n&255;return[i,o,s]};s.rgb.hcg=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var i=Math.max(Math.max(t,r),n);var o=Math.min(Math.min(t,r),n);var s=i-o;var a;var c;if(s<1){a=o/(1-s)}else{a=0}if(s<=0){c=0}else if(i===t){c=(r-n)/s%6}else if(i===r){c=2+(n-t)/s}else{c=4+(t-r)/s+4}c/=6;c%=1;return[c*360,s*100,a*100]};s.hsl.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1;var i=0;if(r<.5){n=2*t*r}else{n=2*t*(1-r)}if(n<1){i=(r-.5*n)/(1-n)}return[e[0],n*100,i*100]};s.hsv.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=t*r;var i=0;if(n<1){i=(r-n)/(1-n)}return[e[0],n*100,i*100]};s.hcg.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;if(r===0){return[n*255,n*255,n*255]}var i=[0,0,0];var o=t%1*6;var s=o%1;var a=1-s;var c=0;switch(Math.floor(o)){case 0:i[0]=1;i[1]=s;i[2]=0;break;case 1:i[0]=a;i[1]=1;i[2]=0;break;case 2:i[0]=0;i[1]=1;i[2]=s;break;case 3:i[0]=0;i[1]=a;i[2]=1;break;case 4:i[0]=s;i[1]=0;i[2]=1;break;default:i[0]=1;i[1]=0;i[2]=a}c=(1-r)*n;return[(r*i[0]+c)*255,(r*i[1]+c)*255,(r*i[2]+c)*255]};s.hcg.hsv=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);var i=0;if(n>0){i=t/n}return[e[0],i*100,n*100]};s.hcg.hsl=function(e){var t=e[1]/100;var r=e[2]/100;var n=r*(1-t)+.5*t;var i=0;if(n>0&&n<.5){i=t/(2*n)}else if(n>=.5&&n<1){i=t/(2*(1-n))}return[e[0],i*100,n*100]};s.hcg.hwb=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};s.hwb.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1-r;var i=n-t;var o=0;if(i<1){o=(n-i)/(1-i)}return[e[0],i*100,o*100]};s.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};s.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};s.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};s.gray.hsl=s.gray.hsv=function(e){return[0,0,e[0]]};s.gray.hwb=function(e){return[0,100,e[0]]};s.gray.cmyk=function(e){return[0,0,0,e[0]]};s.gray.lab=function(e){return[e[0],0,0]};s.gray.hex=function(e){var t=Math.round(e[0]/100*255)&255;var r=(t<<16)+(t<<8)+t;var n=r.toString(16).toUpperCase();return"000000".substring(n.length)+n};s.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[t/255*100]}},755:(e,t,r)=>{var n=r(461);var i=r(974);var o={};var s=Object.keys(n);function wrapRaw(e){var wrappedFn=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}return e(t)};if("conversion"in e){wrappedFn.conversion=e.conversion}return wrappedFn}function wrapRounded(e){var wrappedFn=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}var r=e(t);if(typeof r==="object"){for(var n=r.length,i=0;i<n;i++){r[i]=Math.round(r[i])}}return r};if("conversion"in e){wrappedFn.conversion=e.conversion}return wrappedFn}s.forEach((function(e){o[e]={};Object.defineProperty(o[e],"channels",{value:n[e].channels});Object.defineProperty(o[e],"labels",{value:n[e].labels});var t=i(e);var r=Object.keys(t);r.forEach((function(r){var n=t[r];o[e][r]=wrapRounded(n);o[e][r].raw=wrapRaw(n)}))}));e.exports=o},974:(e,t,r)=>{var n=r(461);function buildGraph(){var e={};var t=Object.keys(n);for(var r=t.length,i=0;i<r;i++){e[t[i]]={distance:-1,parent:null}}return e}function deriveBFS(e){var t=buildGraph();var r=[e];t[e].distance=0;while(r.length){var i=r.pop();var o=Object.keys(n[i]);for(var s=o.length,a=0;a<s;a++){var c=o[a];var l=t[c];if(l.distance===-1){l.distance=t[i].distance+1;l.parent=i;r.unshift(c)}}}return t}function link(e,t){return function(r){return t(e(r))}}function wrapConversion(e,t){var r=[t[e].parent,e];var i=n[t[e].parent][e];var o=t[e].parent;while(t[o].parent){r.unshift(t[o].parent);i=link(n[t[o].parent][o],i);o=t[o].parent}i.conversion=r;return i}e.exports=function(e){var t=deriveBFS(e);var r={};var n=Object.keys(t);for(var i=n.length,o=0;o<i;o++){var s=n[o];var a=t[s];if(a.parent===null){continue}r[s]=wrapConversion(s,t)}return r}},391:e=>{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},434:e=>{"use strict";var t=/[|\\{}()[\]^$+*?.]/g;e.exports=function(e){if(typeof e!=="string"){throw new TypeError("Expected a string")}return e.replace(t,"\\$&")}},419:e=>{"use strict";e.exports=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const i=t.indexOf("--");return n!==-1&&(i===-1?true:n<i)}},629:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t["default"]=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;t.matchToToken=function(e){var t={type:"invalid",value:e[0],closed:undefined};if(e[1])t.type="string",t.closed=!!(e[3]||e[4]);else if(e[5])t.type="comment";else if(e[6])t.type="comment",t.closed=!!e[7];else if(e[8])t.type="regex";else if(e[9])t.type="number";else if(e[10])t.type="name";else if(e[11])t.type="punctuator";else if(e[12])t.type="whitespace";return t}},314:(e,t,r)=>{"use strict";var n=r(248);class BitSet{constructor(e){this.bits=e instanceof BitSet?e.bits.slice():[]}add(e){this.bits[e>>5]|=1<<(e&31)}has(e){return!!(this.bits[e>>5]&1<<(e&31))}}class Chunk{constructor(e,t,r){this.start=e;this.end=t;this.original=r;this.intro="";this.outro="";this.content=r;this.storeName=false;this.edited=false;{this.previous=null;this.next=null}}appendLeft(e){this.outro+=e}appendRight(e){this.intro=this.intro+e}clone(){const e=new Chunk(this.start,this.end,this.original);e.intro=this.intro;e.outro=this.outro;e.content=this.content;e.storeName=this.storeName;e.edited=this.edited;return e}contains(e){return this.start<e&&e<this.end}eachNext(e){let t=this;while(t){e(t);t=t.next}}eachPrevious(e){let t=this;while(t){e(t);t=t.previous}}edit(e,t,r){this.content=e;if(!r){this.intro="";this.outro=""}this.storeName=t;this.edited=true;return this}prependLeft(e){this.outro=e+this.outro}prependRight(e){this.intro=e+this.intro}split(e){const t=e-this.start;const r=this.original.slice(0,t);const n=this.original.slice(t);this.original=r;const i=new Chunk(e,this.end,n);i.outro=this.outro;this.outro="";this.end=e;if(this.edited){i.edit("",false);this.content=""}else{this.content=r}i.next=this.next;if(i.next)i.next.previous=i;i.previous=this;this.next=i;return i}toString(){return this.intro+this.content+this.outro}trimEnd(e){this.outro=this.outro.replace(e,"");if(this.outro.length)return true;const t=this.content.replace(e,"");if(t.length){if(t!==this.content){this.split(this.start+t.length).edit("",undefined,true)}return true}else{this.edit("",undefined,true);this.intro=this.intro.replace(e,"");if(this.intro.length)return true}}trimStart(e){this.intro=this.intro.replace(e,"");if(this.intro.length)return true;const t=this.content.replace(e,"");if(t.length){if(t!==this.content){this.split(this.end-t.length);this.edit("",undefined,true)}return true}else{this.edit("",undefined,true);this.outro=this.outro.replace(e,"");if(this.outro.length)return true}}}function getBtoa(){if(typeof window!=="undefined"&&typeof window.btoa==="function"){return e=>window.btoa(unescape(encodeURIComponent(e)))}else if(typeof Buffer==="function"){return e=>Buffer.from(e,"utf-8").toString("base64")}else{return()=>{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}}const i=getBtoa();class SourceMap{constructor(e){this.version=3;this.file=e.file;this.sources=e.sources;this.sourcesContent=e.sourcesContent;this.names=e.names;this.mappings=n.encode(e.mappings);if(typeof e.x_google_ignoreList!=="undefined"){this.x_google_ignoreList=e.x_google_ignoreList}}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+i(this.toString())}}function guessIndent(e){const t=e.split("\n");const r=t.filter((e=>/^\t+/.test(e)));const n=t.filter((e=>/^ {2,}/.test(e)));if(r.length===0&&n.length===0){return null}if(r.length>=n.length){return"\t"}const i=n.reduce(((e,t)=>{const r=/^ +/.exec(t)[0].length;return Math.min(r,e)}),Infinity);return new Array(i+1).join(" ")}function getRelativePath(e,t){const r=e.split(/[/\\]/);const n=t.split(/[/\\]/);r.pop();while(r[0]===n[0]){r.shift();n.shift()}if(r.length){let e=r.length;while(e--)r[e]=".."}return r.concat(n).join("/")}const o=Object.prototype.toString;function isObject(e){return o.call(e)==="[object Object]"}function getLocator(e){const t=e.split("\n");const r=[];for(let e=0,n=0;e<t.length;e++){r.push(n);n+=t[e].length+1}return function locate(e){let t=0;let n=r.length;while(t<n){const i=t+n>>1;if(e<r[i]){n=i}else{t=i+1}}const i=t-1;const o=e-r[i];return{line:i,column:o}}}class Mappings{constructor(e){this.hires=e;this.generatedCodeLine=0;this.generatedCodeColumn=0;this.raw=[];this.rawSegments=this.raw[this.generatedCodeLine]=[];this.pending=null}addEdit(e,t,r,n){if(t.length){const t=[this.generatedCodeColumn,e,r.line,r.column];if(n>=0){t.push(n)}this.rawSegments.push(t)}else if(this.pending){this.rawSegments.push(this.pending)}this.advance(t);this.pending=null}addUneditedChunk(e,t,r,n,i){let o=t.start;let s=true;while(o<t.end){if(this.hires||s||i.has(o)){this.rawSegments.push([this.generatedCodeColumn,e,n.line,n.column])}if(r[o]==="\n"){n.line+=1;n.column=0;this.generatedCodeLine+=1;this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0;s=true}else{n.column+=1;this.generatedCodeColumn+=1;s=false}o+=1}this.pending=null}advance(e){if(!e)return;const t=e.split("\n");if(t.length>1){for(let e=0;e<t.length-1;e++){this.generatedCodeLine++;this.raw[this.generatedCodeLine]=this.rawSegments=[]}this.generatedCodeColumn=0}this.generatedCodeColumn+=t[t.length-1].length}}const s="\n";const a={insertLeft:false,insertRight:false,storeName:false};class MagicString{constructor(e,t={}){const r=new Chunk(0,e.length,e);Object.defineProperties(this,{original:{writable:true,value:e},outro:{writable:true,value:""},intro:{writable:true,value:""},firstChunk:{writable:true,value:r},lastChunk:{writable:true,value:r},lastSearchedChunk:{writable:true,value:r},byStart:{writable:true,value:{}},byEnd:{writable:true,value:{}},filename:{writable:true,value:t.filename},indentExclusionRanges:{writable:true,value:t.indentExclusionRanges},sourcemapLocations:{writable:true,value:new BitSet},storedNames:{writable:true,value:{}},indentStr:{writable:true,value:undefined}});this.byStart[0]=r;this.byEnd[e.length]=r}addSourcemapLocation(e){this.sourcemapLocations.add(e)}append(e){if(typeof e!=="string")throw new TypeError("outro content must be a string");this.outro+=e;return this}appendLeft(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const r=this.byEnd[e];if(r){r.appendLeft(t)}else{this.intro+=t}return this}appendRight(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const r=this.byStart[e];if(r){r.appendRight(t)}else{this.outro+=t}return this}clone(){const e=new MagicString(this.original,{filename:this.filename});let t=this.firstChunk;let r=e.firstChunk=e.lastSearchedChunk=t.clone();while(t){e.byStart[r.start]=r;e.byEnd[r.end]=r;const n=t.next;const i=n&&n.clone();if(i){r.next=i;i.previous=r;r=i}t=n}e.lastChunk=r;if(this.indentExclusionRanges){e.indentExclusionRanges=this.indentExclusionRanges.slice()}e.sourcemapLocations=new BitSet(this.sourcemapLocations);e.intro=this.intro;e.outro=this.outro;return e}generateDecodedMap(e){e=e||{};const t=0;const r=Object.keys(this.storedNames);const n=new Mappings(e.hires);const i=getLocator(this.original);if(this.intro){n.advance(this.intro)}this.firstChunk.eachNext((e=>{const o=i(e.start);if(e.intro.length)n.advance(e.intro);if(e.edited){n.addEdit(t,e.content,o,e.storeName?r.indexOf(e.original):-1)}else{n.addUneditedChunk(t,e,this.original,o,this.sourcemapLocations)}if(e.outro.length)n.advance(e.outro)}));return{file:e.file?e.file.split(/[/\\]/).pop():null,sources:[e.source?getRelativePath(e.file||"",e.source):null],sourcesContent:e.includeContent?[this.original]:[null],names:r,mappings:n.raw}}generateMap(e){return new SourceMap(this.generateDecodedMap(e))}_ensureindentStr(){if(this.indentStr===undefined){this.indentStr=guessIndent(this.original)}}_getRawIndentString(){this._ensureindentStr();return this.indentStr}getIndentString(){this._ensureindentStr();return this.indentStr===null?"\t":this.indentStr}indent(e,t){const r=/^[^\r\n]/gm;if(isObject(e)){t=e;e=undefined}if(e===undefined){this._ensureindentStr();e=this.indentStr||"\t"}if(e==="")return this;t=t||{};const n={};if(t.exclude){const e=typeof t.exclude[0]==="number"?[t.exclude]:t.exclude;e.forEach((e=>{for(let t=e[0];t<e[1];t+=1){n[t]=true}}))}let i=t.indentStart!==false;const replacer=t=>{if(i)return`${e}${t}`;i=true;return t};this.intro=this.intro.replace(r,replacer);let o=0;let s=this.firstChunk;while(s){const t=s.end;if(s.edited){if(!n[o]){s.content=s.content.replace(r,replacer);if(s.content.length){i=s.content[s.content.length-1]==="\n"}}}else{o=s.start;while(o<t){if(!n[o]){const t=this.original[o];if(t==="\n"){i=true}else if(t!=="\r"&&i){i=false;if(o===s.start){s.prependRight(e)}else{this._splitChunk(s,o);s=s.next;s.prependRight(e)}}}o+=1}}o=s.end;s=s.next}this.outro=this.outro.replace(r,replacer);return this}insert(){throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")}insertLeft(e,t){if(!a.insertLeft){console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead");a.insertLeft=true}return this.appendLeft(e,t)}insertRight(e,t){if(!a.insertRight){console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead");a.insertRight=true}return this.prependRight(e,t)}move(e,t,r){if(r>=e&&r<=t)throw new Error("Cannot move a selection inside itself");this._split(e);this._split(t);this._split(r);const n=this.byStart[e];const i=this.byEnd[t];const o=n.previous;const s=i.next;const a=this.byStart[r];if(!a&&i===this.lastChunk)return this;const c=a?a.previous:this.lastChunk;if(o)o.next=s;if(s)s.previous=o;if(c)c.next=n;if(a)a.previous=i;if(!n.previous)this.firstChunk=i.next;if(!i.next){this.lastChunk=n.previous;this.lastChunk.next=null}n.previous=c;i.next=a||null;if(!c)this.firstChunk=n;if(!a)this.lastChunk=i;return this}overwrite(e,t,r,n){n=n||{};return this.update(e,t,r,{...n,overwrite:!n.contentOnly})}update(e,t,r,n){if(typeof r!=="string")throw new TypeError("replacement content must be a string");while(e<0)e+=this.original.length;while(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);if(n===true){if(!a.storeName){console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string");a.storeName=true}n={storeName:true}}const i=n!==undefined?n.storeName:false;const o=n!==undefined?n.overwrite:false;if(i){const r=this.original.slice(e,t);Object.defineProperty(this.storedNames,r,{writable:true,value:true,enumerable:true})}const s=this.byStart[e];const c=this.byEnd[t];if(s){let e=s;while(e!==c){if(e.next!==this.byStart[e.end]){throw new Error("Cannot overwrite across a split point")}e=e.next;e.edit("",false)}s.edit(r,i,!o)}else{const n=new Chunk(e,t,"").edit(r,i);c.next=n;n.previous=c}return this}prepend(e){if(typeof e!=="string")throw new TypeError("outro content must be a string");this.intro=e+this.intro;return this}prependLeft(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const r=this.byEnd[e];if(r){r.prependLeft(t)}else{this.intro=t+this.intro}return this}prependRight(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const r=this.byStart[e];if(r){r.prependRight(t)}else{this.outro=t+this.outro}return this}remove(e,t){while(e<0)e+=this.original.length;while(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);let r=this.byStart[e];while(r){r.intro="";r.outro="";r.edit("");r=t>r.end?this.byStart[r.end]:null}return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let 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);if(this.intro.length)return this.intro[this.intro.length-1];return""}lastLine(){let e=this.outro.lastIndexOf(s);if(e!==-1)return this.outro.substr(e+1);let t=this.outro;let r=this.lastChunk;do{if(r.outro.length>0){e=r.outro.lastIndexOf(s);if(e!==-1)return r.outro.substr(e+1)+t;t=r.outro+t}if(r.content.length>0){e=r.content.lastIndexOf(s);if(e!==-1)return r.content.substr(e+1)+t;t=r.content+t}if(r.intro.length>0){e=r.intro.lastIndexOf(s);if(e!==-1)return r.intro.substr(e+1)+t;t=r.intro+t}}while(r=r.previous);e=this.intro.lastIndexOf(s);if(e!==-1)return this.intro.substr(e+1)+t;return this.intro+t}slice(e=0,t=this.original.length){while(e<0)e+=this.original.length;while(t<0)t+=this.original.length;let r="";let n=this.firstChunk;while(n&&(n.start>e||n.end<=e)){if(n.start<t&&n.end>=t){return r}n=n.next}if(n&&n.edited&&n.start!==e)throw new Error(`Cannot use replaced character ${e} as slice start anchor.`);const i=n;while(n){if(n.intro&&(i!==n||n.start===e)){r+=n.intro}const o=n.start<t&&n.end>=t;if(o&&n.edited&&n.end!==t)throw new Error(`Cannot use replaced character ${t} as slice end anchor.`);const s=i===n?e-n.start:0;const a=o?n.content.length+t-n.end:n.content.length;r+=n.content.slice(s,a);if(n.outro&&(!o||n.end===t)){r+=n.outro}if(o){break}n=n.next}return r}snip(e,t){const r=this.clone();r.remove(0,e);r.remove(t,r.original.length);return r}_split(e){if(this.byStart[e]||this.byEnd[e])return;let t=this.lastSearchedChunk;const r=e>t.end;while(t){if(t.contains(e))return this._splitChunk(t,e);t=r?this.byStart[t.end]:this.byEnd[t.start]}}_splitChunk(e,t){if(e.edited&&e.content.length){const r=getLocator(this.original)(t);throw new Error(`Cannot split a chunk that has already been edited (${r.line}:${r.column} – "${e.original}")`)}const r=e.split(t);this.byEnd[t]=e;this.byStart[t]=r;this.byEnd[r.end]=r;if(e===this.lastChunk)this.lastChunk=r;this.lastSearchedChunk=e;return true}toString(){let e=this.intro;let t=this.firstChunk;while(t){e+=t.toString();t=t.next}return e+this.outro}isEmpty(){let e=this.firstChunk;do{if(e.intro.length&&e.intro.trim()||e.content.length&&e.content.trim()||e.outro.length&&e.outro.trim())return false}while(e=e.next);return true}length(){let e=this.firstChunk;let t=0;do{t+=e.intro.length+e.content.length+e.outro.length}while(e=e.next);return t}trimLines(){return this.trim("[\\r\\n]")}trim(e){return this.trimStart(e).trimEnd(e)}trimEndAborted(e){const t=new RegExp((e||"\\s")+"+$");this.outro=this.outro.replace(t,"");if(this.outro.length)return true;let r=this.lastChunk;do{const e=r.end;const n=r.trimEnd(t);if(r.end!==e){if(this.lastChunk===r){this.lastChunk=r.next}this.byEnd[r.end]=r;this.byStart[r.next.start]=r.next;this.byEnd[r.next.end]=r.next}if(n)return true;r=r.previous}while(r);return false}trimEnd(e){this.trimEndAborted(e);return this}trimStartAborted(e){const t=new RegExp("^"+(e||"\\s")+"+");this.intro=this.intro.replace(t,"");if(this.intro.length)return true;let r=this.firstChunk;do{const e=r.end;const n=r.trimStart(t);if(r.end!==e){if(r===this.lastChunk)this.lastChunk=r.next;this.byEnd[r.end]=r;this.byStart[r.next.start]=r.next;this.byEnd[r.next.end]=r.next}if(n)return true;r=r.next}while(r);return false}trimStart(e){this.trimStartAborted(e);return this}hasChanged(){return this.original!==this.toString()}_replaceRegexp(e,t){function getReplacement(e,r){if(typeof t==="string"){return t.replace(/\$(\$|&|\d+)/g,((t,r)=>{if(r==="$")return"$";if(r==="&")return e[0];const n=+r;if(n<e.length)return e[+r];return`$${r}`}))}else{return t(...e,e.index,r,e.groups)}}function matchAll(e,t){let r;const n=[];while(r=e.exec(t)){n.push(r)}return n}if(e.global){const t=matchAll(e,this.original);t.forEach((e=>{if(e.index!=null)this.overwrite(e.index,e.index+e[0].length,getReplacement(e,this.original))}))}else{const t=this.original.match(e);if(t&&t.index!=null)this.overwrite(t.index,t.index+t[0].length,getReplacement(t,this.original))}return this}_replaceString(e,t){const{original:r}=this;const n=r.indexOf(e);if(n!==-1){this.overwrite(n,n+e.length,t)}return this}replace(e,t){if(typeof e==="string"){return this._replaceString(e,t)}return this._replaceRegexp(e,t)}_replaceAllString(e,t){const{original:r}=this;const n=e.length;for(let i=r.indexOf(e);i!==-1;i=r.indexOf(e,i+n)){this.overwrite(i,i+n,t)}return this}replaceAll(e,t){if(typeof e==="string"){return this._replaceAllString(e,t)}if(!e.global){throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument")}return this._replaceRegexp(e,t)}}const c=Object.prototype.hasOwnProperty;class Bundle{constructor(e={}){this.intro=e.intro||"";this.separator=e.separator!==undefined?e.separator:"\n";this.sources=[];this.uniqueSources=[];this.uniqueSourceIndexByFilename={}}addSource(e){if(e instanceof MagicString){return this.addSource({content:e,filename:e.filename,separator:this.separator})}if(!isObject(e)||!e.content){throw new Error("bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`")}["filename","indentExclusionRanges","separator"].forEach((t=>{if(!c.call(e,t))e[t]=e.content[t]}));if(e.separator===undefined){e.separator=this.separator}if(e.filename){if(!c.call(this.uniqueSourceIndexByFilename,e.filename)){this.uniqueSourceIndexByFilename[e.filename]=this.uniqueSources.length;this.uniqueSources.push({filename:e.filename,content:e.content.original})}else{const t=this.uniqueSources[this.uniqueSourceIndexByFilename[e.filename]];if(e.content.original!==t.content){throw new Error(`Illegal source: same filename (${e.filename}), different contents`)}}}this.sources.push(e);return this}append(e,t){this.addSource({content:new MagicString(e),separator:t&&t.separator||""});return this}clone(){const e=new Bundle({intro:this.intro,separator:this.separator});this.sources.forEach((t=>{e.addSource({filename:t.filename,content:t.content.clone(),separator:t.separator})}));return e}generateDecodedMap(e={}){const t=[];this.sources.forEach((e=>{Object.keys(e.content.storedNames).forEach((e=>{if(!~t.indexOf(e))t.push(e)}))}));const r=new Mappings(e.hires);if(this.intro){r.advance(this.intro)}this.sources.forEach(((e,n)=>{if(n>0){r.advance(this.separator)}const i=e.filename?this.uniqueSourceIndexByFilename[e.filename]:-1;const o=e.content;const s=getLocator(o.original);if(o.intro){r.advance(o.intro)}o.firstChunk.eachNext((n=>{const a=s(n.start);if(n.intro.length)r.advance(n.intro);if(e.filename){if(n.edited){r.addEdit(i,n.content,a,n.storeName?t.indexOf(n.original):-1)}else{r.addUneditedChunk(i,n,o.original,a,o.sourcemapLocations)}}else{r.advance(n.content)}if(n.outro.length)r.advance(n.outro)}));if(o.outro){r.advance(o.outro)}}));return{file:e.file?e.file.split(/[/\\]/).pop():null,sources:this.uniqueSources.map((t=>e.file?getRelativePath(e.file,t.filename):t.filename)),sourcesContent:this.uniqueSources.map((t=>e.includeContent?t.content:null)),names:t,mappings:r.raw}}generateMap(e){return new SourceMap(this.generateDecodedMap(e))}getIndentString(){const e={};this.sources.forEach((t=>{const r=t.content._getRawIndentString();if(r===null)return;if(!e[r])e[r]=0;e[r]+=1}));return Object.keys(e).sort(((t,r)=>e[t]-e[r]))[0]||"\t"}indent(e){if(!arguments.length){e=this.getIndentString()}if(e==="")return this;let t=!this.intro||this.intro.slice(-1)==="\n";this.sources.forEach(((r,n)=>{const i=r.separator!==undefined?r.separator:this.separator;const o=t||n>0&&/\r?\n$/.test(i);r.content.indent(e,{exclude:r.indentExclusionRanges,indentStart:o});t=r.content.lastChar()==="\n"}));if(this.intro){this.intro=e+this.intro.replace(/^[^\n]/gm,((t,r)=>r>0?e+t:t))}return this}prepend(e){this.intro=e+this.intro;return this}toString(){const e=this.sources.map(((e,t)=>{const r=e.separator!==undefined?e.separator:this.separator;const n=(t>0?r:"")+e.content.toString();return n})).join("");return this.intro+e}isEmpty(){if(this.intro.length&&this.intro.trim())return false;if(this.sources.some((e=>!e.content.isEmpty())))return false;return true}length(){return this.sources.reduce(((e,t)=>e+t.content.length()),this.intro.length)}trimLines(){return this.trim("[\\r\\n]")}trim(e){return this.trimStart(e).trimEnd(e)}trimStart(e){const t=new RegExp("^"+(e||"\\s")+"+");this.intro=this.intro.replace(t,"");if(!this.intro){let t;let r=0;do{t=this.sources[r++];if(!t){break}}while(!t.content.trimStartAborted(e))}return this}trimEnd(e){const t=new RegExp((e||"\\s")+"+$");let r;let n=this.sources.length-1;do{r=this.sources[n--];if(!r){this.intro=this.intro.replace(t,"");break}}while(!r.content.trimEndAborted(e));return this}}MagicString.Bundle=Bundle;MagicString.SourceMap=SourceMap;MagicString.default=MagicString;e.exports=MagicString},332:(e,t,r)=>{"use strict";const n=r(37);const i=r(419);const o=process.env;let s;if(i("no-color")||i("no-colors")||i("color=false")){s=false}else if(i("color")||i("colors")||i("color=true")||i("color=always")){s=true}if("FORCE_COLOR"in o){s=o.FORCE_COLOR.length===0||parseInt(o.FORCE_COLOR,10)!==0}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(s===false){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!e.isTTY&&s!==true){return 0}const t=s?1:0;if(process.platform==="win32"){const e=n.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in o){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in o))||o.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in o){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0}if(o.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in o){const e=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(o.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)){return 1}if("COLORTERM"in o){return 1}if(o.TERM==="dumb"){return t}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},188:e=>{"use strict";e.exports=require("module")},37:e=>{"use strict";e.exports=require("os")},17:e=>{"use strict";e.exports=require("path")},440:e=>{"use strict";e.exports=require("typescript")},310:e=>{"use strict";e.exports=require("url")},528:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.codeFrameColumns=codeFrameColumns;t["default"]=_default;var n=r(505);let i=false;function getDefs(e){return{gutter:e.grey,marker:e.red.bold,message:e.red.bold}}const o=/\r\n|[\n\r\u2028\u2029]/;function getMarkerLines(e,t,r){const n=Object.assign({column:0,line:-1},e.start);const i=Object.assign({},n,e.end);const{linesAbove:o=2,linesBelow:s=3}=r||{};const a=n.line;const c=n.column;const l=i.line;const u=i.column;let f=Math.max(a-(o+1),0);let d=Math.min(t.length,l+s);if(a===-1){f=0}if(l===-1){d=t.length}const h=l-a;const p={};if(h){for(let e=0;e<=h;e++){const r=e+a;if(!c){p[r]=true}else if(e===0){const e=t[r-1].length;p[r]=[c,e-c+1]}else if(e===h){p[r]=[0,u]}else{const n=t[r-e].length;p[r]=[0,n]}}}else{if(c===u){if(c){p[a]=[c,0]}else{p[a]=true}}else{p[a]=[c,u-c]}}return{start:f,end:d,markerLines:p}}function codeFrameColumns(e,t,r={}){const i=(r.highlightCode||r.forceColor)&&(0,n.shouldHighlight)(r);const s=(0,n.getChalk)(r);const a=getDefs(s);const maybeHighlight=(e,t)=>i?e(t):t;const c=e.split(o);const{start:l,end:u,markerLines:f}=getMarkerLines(t,c,r);const d=t.start&&typeof t.start.column==="number";const h=String(u).length;const p=i?(0,n.default)(e,r):e;let g=p.split(o,u).slice(l,u).map(((e,t)=>{const n=l+1+t;const i=` ${n}`.slice(-h);const o=` ${i} |`;const s=f[n];const c=!f[n+1];if(s){let t="";if(Array.isArray(s)){const n=e.slice(0,Math.max(s[0]-1,0)).replace(/[^\t]/g," ");const i=s[1]||1;t=["\n ",maybeHighlight(a.gutter,o.replace(/\d/g," "))," ",n,maybeHighlight(a.marker,"^").repeat(i)].join("");if(c&&r.message){t+=" "+maybeHighlight(a.message,r.message)}}return[maybeHighlight(a.marker,">"),maybeHighlight(a.gutter,o),e.length>0?` ${e}`:"",t].join("")}else{return` ${maybeHighlight(a.gutter,o)}${e.length>0?` ${e}`:""}`}})).join("\n");if(r.message&&!d){g=`${" ".repeat(h+1)}${r.message}\n${g}`}if(i){return s.reset(g)}else{return g}}function _default(e,t,r,n={}){if(!i){i=true;const e="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning){process.emitWarning(e,"DeprecationWarning")}else{const t=new Error(e);t.name="DeprecationWarning";console.warn(new Error(e))}}r=Math.max(r,0);const o={start:{column:r,line:t}};return codeFrameColumns(e,o,n)}},266:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isIdentifierChar=isIdentifierChar;t.isIdentifierName=isIdentifierName;t.isIdentifierStart=isIdentifierStart;let r="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";let n="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_";const i=new RegExp("["+r+"]");const o=new RegExp("["+r+n+"]");r=n=null;const s=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191];const a=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];function isInAstralSet(e,t){let r=65536;for(let n=0,i=t.length;n<i;n+=2){r+=t[n];if(r>e)return false;r+=t[n+1];if(r>=e)return true}return false}function isIdentifierStart(e){if(e<65)return e===36;if(e<=90)return true;if(e<97)return e===95;if(e<=122)return true;if(e<=65535){return e>=170&&i.test(String.fromCharCode(e))}return isInAstralSet(e,s)}function isIdentifierChar(e){if(e<48)return e===36;if(e<58)return true;if(e<65)return false;if(e<=90)return true;if(e<97)return e===95;if(e<=122)return true;if(e<=65535){return e>=170&&o.test(String.fromCharCode(e))}return isInAstralSet(e,s)||isInAstralSet(e,a)}function isIdentifierName(e){let t=true;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if((n&64512)===55296&&r+1<e.length){const t=e.charCodeAt(++r);if((t&64512)===56320){n=65536+((n&1023)<<10)+(t&1023)}}if(t){t=false;if(!isIdentifierStart(n)){return false}}else if(!isIdentifierChar(n)){return false}}return!t}},740:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});Object.defineProperty(t,"isIdentifierChar",{enumerable:true,get:function(){return n.isIdentifierChar}});Object.defineProperty(t,"isIdentifierName",{enumerable:true,get:function(){return n.isIdentifierName}});Object.defineProperty(t,"isIdentifierStart",{enumerable:true,get:function(){return n.isIdentifierStart}});Object.defineProperty(t,"isKeyword",{enumerable:true,get:function(){return i.isKeyword}});Object.defineProperty(t,"isReservedWord",{enumerable:true,get:function(){return i.isReservedWord}});Object.defineProperty(t,"isStrictBindOnlyReservedWord",{enumerable:true,get:function(){return i.isStrictBindOnlyReservedWord}});Object.defineProperty(t,"isStrictBindReservedWord",{enumerable:true,get:function(){return i.isStrictBindReservedWord}});Object.defineProperty(t,"isStrictReservedWord",{enumerable:true,get:function(){return i.isStrictReservedWord}});var n=r(266);var i=r(563)},563:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isKeyword=isKeyword;t.isReservedWord=isReservedWord;t.isStrictBindOnlyReservedWord=isStrictBindOnlyReservedWord;t.isStrictBindReservedWord=isStrictBindReservedWord;t.isStrictReservedWord=isStrictReservedWord;const r={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]};const n=new Set(r.keyword);const i=new Set(r.strict);const o=new Set(r.strictBind);function isReservedWord(e,t){return t&&e==="await"||e==="enum"}function isStrictReservedWord(e,t){return isReservedWord(e,t)||i.has(e)}function isStrictBindOnlyReservedWord(e){return o.has(e)}function isStrictBindReservedWord(e,t){return isStrictReservedWord(e,t)||isStrictBindOnlyReservedWord(e)}function isKeyword(e){return n.has(e)}},505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=highlight;t.getChalk=getChalk;t.shouldHighlight=shouldHighlight;var n=r(629);var i=r(740);var o=r(673);const s=new Set(["as","async","from","get","of","set"]);function getDefs(e){return{keyword:e.cyan,capitalized:e.yellow,jsxIdentifier:e.yellow,punctuator:e.yellow,number:e.magenta,string:e.green,regex:e.magenta,comment:e.grey,invalid:e.white.bgRed.bold}}const a=/\r\n|[\n\r\u2028\u2029]/;const c=/^[()[\]{}]$/;let l;{const e=/^[a-z][\w-]*$/i;const getTokenType=function(t,r,n){if(t.type==="name"){if((0,i.isKeyword)(t.value)||(0,i.isStrictReservedWord)(t.value,true)||s.has(t.value)){return"keyword"}if(e.test(t.value)&&(n[r-1]==="<"||n.slice(r-2,r)=="</")){return"jsxIdentifier"}if(t.value[0]!==t.value[0].toLowerCase()){return"capitalized"}}if(t.type==="punctuator"&&c.test(t.value)){return"bracket"}if(t.type==="invalid"&&(t.value==="@"||t.value==="#")){return"punctuator"}return t.type};l=function*(e){let t;while(t=n.default.exec(e)){const r=n.matchToToken(t);yield{type:getTokenType(r,t.index,e),value:r.value}}}}function highlightTokens(e,t){let r="";for(const{type:n,value:i}of l(t)){const t=e[n];if(t){r+=i.split(a).map((e=>t(e))).join("\n")}else{r+=i}}return r}function shouldHighlight(e){return!!o.supportsColor||e.forceColor}function getChalk(e){return e.forceColor?new o.constructor({enabled:true,level:1}):o}function highlight(e,t={}){if(e!==""&&shouldHighlight(t)){const r=getChalk(t);const n=getDefs(r);return highlightTokens(n,e)}else{return e}}}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var i=t[r]={id:r,loaded:false,exports:{}};var o=true;try{e[r].call(i.exports,i,i.exports,__nccwpck_require__);o=false}finally{if(o)delete t[r]}i.loaded=true;return i.exports}(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r={};(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:true});var t=__nccwpck_require__(17);var n=__nccwpck_require__(440);var i=__nccwpck_require__(188);var o=__nccwpck_require__(314);function _interopNamespaceDefault(e){var t=Object.create(null);if(e){Object.keys(e).forEach((function(r){if(r!=="default"){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:true,get:function(){return e[r]}})}}))}t.default=e;return Object.freeze(t)}var s=_interopNamespaceDefault(t);function resolveDefaultOptions(e){return{...e,compilerOptions:e.compilerOptions??{},respectExternal:e.respectExternal??false}}const a=".d.ts";const c={getCurrentDirectory:()=>n.sys.getCurrentDirectory(),getNewLine:()=>n.sys.newLine,getCanonicalFileName:n.sys.useCaseSensitiveFileNames?e=>e:e=>e.toLowerCase()};const l={declaration:true,noEmit:false,emitDeclarationOnly:true,noEmitOnError:true,checkJs:false,declarationMap:false,skipLibCheck:true,preserveSymlinks:true,target:n.ScriptTarget.ESNext};const u=new Map;const logCache=(...e)=>process.env.DTS_LOG_CACHE?console.log("[cache]",...e):null;function cacheConfig([e,t],r){logCache(e);u.set(e,r);while(e!==t&&e!==s.dirname(e)){e=s.dirname(e);logCache("up",e);if(u.has(e))return logCache("has",e);u.set(e,r)}}function getCompilerOptions(e,t,r){const i={...l,...t};let o=s.dirname(e);let f=[];const d=r||o;if(!u.has(d)){logCache("miss",d);const e=r?s.resolve(process.cwd(),r):n.findConfigFile(o,n.sys.fileExists);if(!e){return{dtsFiles:f,dirName:o,compilerOptions:i}}let t=o;o=s.dirname(e);const{config:a,error:l}=n.readConfigFile(e,n.sys.readFile);if(l){console.error(n.formatDiagnostic(l,c));return{dtsFiles:f,dirName:o,compilerOptions:i}}logCache("tsconfig",a);const u=n.parseJsonConfigFileContent(a,n.sys,o);if(r){cacheConfig([r,r],u)}else{cacheConfig([t,o],u)}}else{logCache("HIT",d)}const{fileNames:h,options:p,errors:g}=u.get(d);f=h.filter((e=>e.endsWith(a)));if(g.length){console.error(n.formatDiagnostics(g,c));return{dtsFiles:f,dirName:o,compilerOptions:i}}return{dtsFiles:f,dirName:o,compilerOptions:{...p,...i}}}function createProgram$1(e,t,r){const{dtsFiles:i,compilerOptions:o}=getCompilerOptions(e,t,r);return n.createProgram([e].concat(Array.from(i)),o,n.createCompilerHost(o,true))}function createPrograms(e,t,r){const i=[];let o=[];let c=new Set;let l="";let u={};for(let f of e){if(f.endsWith(a)){continue}f=s.resolve(f);const e=getCompilerOptions(f,t,r);e.dtsFiles.forEach(c.add,c);if(!o.length){o.push(f);({dirName:l,compilerOptions:u}=e);continue}if(e.dirName===l){o.push(f)}else{const t=n.createCompilerHost(u,true);const r=n.createProgram(o.concat(Array.from(c)),u,t);i.push(r);o=[f];({dirName:l,compilerOptions:u}=e)}}if(o.length){const e=n.createCompilerHost(u,true);const t=n.createProgram(o.concat(Array.from(c)),u,e);i.push(t)}return i}function getCodeFrame(){let e=undefined;try{({codeFrameColumns:e}=__nccwpck_require__(528));return e}catch{try{const t=i.createRequire(typeof document==="undefined"?new(__nccwpck_require__(310).URL)("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("rollup-plugin-dts.cjs",document.baseURI).href);({codeFrameColumns:e}=t("@babel/code-frame"));return e}catch{}}return undefined}function getLocation(e){const t=e.getSourceFile();const r=t.getLineAndCharacterOfPosition(e.getStart());const n=t.getLineAndCharacterOfPosition(e.getEnd());return{start:{line:r.line+1,column:r.character+1},end:{line:n.line+1,column:n.character+1}}}function frameNode(e){const t=getCodeFrame();const r=e.getSourceFile();const n=r.getFullText();const i=getLocation(e);if(t){return"\n"+t(n,i,{highlightCode:true})}else{return`\n${i.start.line}:${i.start.column}: \`${e.getFullText().trim()}\``}}class UnsupportedSyntaxError extends Error{constructor(e,t="Syntax not yet supported"){super(`${t}\n${frameNode(e)}`)}}class NamespaceFixer{constructor(e){this.sourceFile=e}findNamespaces(){const e=[];const t={};for(const r of this.sourceFile.statements){const i={start:r.getStart(),end:r.getEnd()};if(n.isEmptyStatement(r)){e.unshift({name:"",exports:[],location:i});continue}if((n.isImportDeclaration(r)||n.isExportDeclaration(r))&&r.moduleSpecifier&&n.isStringLiteral(r.moduleSpecifier)){let{text:t}=r.moduleSpecifier;if(t.startsWith(".")&&(t.endsWith(".d.ts")||t.endsWith(".d.cts")||t.endsWith(".d.mts"))){let n=r.moduleSpecifier.getStart()+1;let i=r.moduleSpecifier.getEnd()-1;e.unshift({name:"",exports:[],location:{start:n,end:i},textBeforeCodeAfter:t.replace(/\.d\.ts$/,".js").replace(/\.d\.cts$/,".cjs").replace(/\.d\.mts$/,".mjs")})}}if(n.isModuleDeclaration(r)&&r.body&&n.isModuleBlock(r.body)){for(const t of r.body.statements){if(n.isExportDeclaration(t)&&t.exportClause){if(n.isNamespaceExport(t.exportClause)){continue}for(const r of t.exportClause.elements){if(r.propertyName&&r.propertyName.getText()==r.name.getText()){e.unshift({name:"",exports:[],location:{start:r.propertyName.getEnd(),end:r.name.getEnd()}})}}}}}if(n.isClassDeclaration(r)){t[r.name.getText()]={type:"class",generics:r.typeParameters}}else if(n.isFunctionDeclaration(r)){t[r.name.getText()]={type:"function"}}else if(n.isInterfaceDeclaration(r)){t[r.name.getText()]={type:"interface",generics:r.typeParameters}}else if(n.isTypeAliasDeclaration(r)){t[r.name.getText()]={type:"type",generics:r.typeParameters}}else if(n.isModuleDeclaration(r)&&n.isIdentifier(r.name)){t[r.name.getText()]={type:"namespace"}}else if(n.isEnumDeclaration(r)){t[r.name.getText()]={type:"enum"}}if(!n.isVariableStatement(r)){continue}const{declarations:o}=r.declarationList;if(o.length!==1){continue}const s=o[0];const a=s.name.getText();if(!s.initializer||!n.isCallExpression(s.initializer)){t[a]={type:"var"};continue}const c=s.initializer.arguments[0];if(!s.initializer.expression.getFullText().includes("/*#__PURE__*/Object.freeze")||!n.isObjectLiteralExpression(c)){continue}const l=[];for(const e of c.properties){if(!n.isPropertyAssignment(e)||!(n.isIdentifier(e.name)||n.isStringLiteral(e.name))||e.name.text!=="__proto__"&&!n.isIdentifier(e.initializer)){throw new UnsupportedSyntaxError(e,"Expected a property assignment")}if(e.name.text==="__proto__"){continue}l.push({exportedName:e.name.text,localName:e.initializer.getText()})}e.unshift({name:a,exports:l,location:i})}return{namespaces:e,itemTypes:t}}fix(){let e=this.sourceFile.getFullText();const{namespaces:t,itemTypes:r}=this.findNamespaces();for(const n of t){const t=e.slice(n.location.end);e=e.slice(0,n.location.start);for(const{exportedName:t,localName:i}of n.exports){if(t===i){const{type:o,generics:s}=r[i]||{};if(o==="interface"||o==="type"){const r=renderTypeParams(s);e+=`type ${n.name}_${t}${r.in} = ${i}${r.out};\n`}else if(o==="enum"||o==="class"){const r=renderTypeParams(s);e+=`type ${n.name}_${t}${r.in} = ${i}${r.out};\n`;e+=`declare const ${n.name}_${t}: typeof ${i};\n`}else{e+=`declare const ${n.name}_${t}: typeof ${i};\n`}}}if(n.name){e+=`declare namespace ${n.name} {\n`;e+=` export {\n`;for(const{exportedName:t,localName:r}of n.exports){if(t===r){e+=` ${n.name}_${t} as ${t},\n`}else{e+=` ${r} as ${t},\n`}}e+=` };\n`;e+=`}`}e+=n.textBeforeCodeAfter??"";e+=t}return e}}function renderTypeParams(e){if(!e||!e.length){return{in:"",out:""}}return{in:`<${e.map((e=>e.getText())).join(", ")}>`,out:`<${e.map((e=>e.name.getText())).join(", ")}>`}}let f=1;function createProgram(e){return withStartEnd({type:"Program",sourceType:"module",body:[]},{start:e.getFullStart(),end:e.getEnd()})}function createReference(e){const t={type:"Identifier",name:String(f++)};return{ident:t,expr:{type:"AssignmentPattern",left:t,right:e}}}function createIdentifier(e){return withStartEnd({type:"Identifier",name:e.getText()},e)}function createIIFE(e){const t=withStartEnd({type:"FunctionExpression",id:null,params:[],body:{type:"BlockStatement",body:[]}},e);const r=withStartEnd({type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:String(f++)},arguments:[t],optional:false}},e);return{fn:t,iife:r}}function createReturn(){const e={type:"ArrayExpression",elements:[]};return{expr:e,stmt:{type:"ReturnStatement",argument:e}}}function createDeclaration(e,t){return withStartEnd({type:"FunctionDeclaration",id:withStartEnd({type:"Identifier",name:n.idText(e)},e),params:[],body:{type:"BlockStatement",body:[]}},t)}function convertExpression(e){if(n.isLiteralExpression(e)){return{type:"Literal",value:e.text}}if(n.isPropertyAccessExpression(e)){if(n.isPrivateIdentifier(e.name)){throw new UnsupportedSyntaxError(e.name)}return withStartEnd({type:"MemberExpression",computed:false,optional:false,object:convertExpression(e.expression),property:convertExpression(e.name)},{start:e.expression.getStart(),end:e.name.getEnd()})}if(n.isIdentifier(e)){return createIdentifier(e)}else if(e.kind==n.SyntaxKind.NullKeyword){return{type:"Literal",value:null}}else{throw new UnsupportedSyntaxError(e)}}function withStartEnd(e,t){let r="start"in t?t:{start:t.getStart(),end:t.getEnd()};return Object.assign(e,r)}function matchesModifier(e,t){const r=n.getCombinedModifierFlags(e);return(r&t)===t}function preProcess({sourceFile:e}){const t=new o(e.getFullText());const r=new Set;const i=new Set;let s="";const a=new Map;const c=new Map;for(const o of e.statements){if(n.isEmptyStatement(o)){t.remove(o.getStart(),o.getEnd());continue}if(n.isEnumDeclaration(o)||n.isFunctionDeclaration(o)||n.isInterfaceDeclaration(o)||n.isClassDeclaration(o)||n.isTypeAliasDeclaration(o)||n.isModuleDeclaration(o)){if(o.name){const e=o.name.getText();r.add(e);if(matchesModifier(o,n.ModifierFlags.ExportDefault)){s=e}else if(matchesModifier(o,n.ModifierFlags.Export)){i.add(e)}if(!(o.flags&n.NodeFlags.GlobalAugmentation)){pushNamedNode(e,[getStart(o),getEnd(o)])}}if(n.isModuleDeclaration(o)){duplicateExports(t,o)}fixModifiers(t,o)}else if(n.isVariableStatement(o)){const{declarations:e}=o.declarationList;const s=matchesModifier(o,n.ModifierFlags.Export);for(const e of o.declarationList.declarations){if(n.isIdentifier(e.name)){const t=e.name.getText();r.add(t);if(s){i.add(t)}}}fixModifiers(t,o);if(e.length==1){const t=e[0];if(n.isIdentifier(t.name)){pushNamedNode(t.name.getText(),[getStart(o),getEnd(o)])}}else{const t=e.slice();const r=t.shift();pushNamedNode(r.name.getText(),[getStart(o),r.getEnd()]);for(const e of t){if(n.isIdentifier(e.name)){pushNamedNode(e.name.getText(),[e.getFullStart(),e.getEnd()])}}}const{flags:a}=o.declarationList;const c=a&n.NodeFlags.Let?"let":a&n.NodeFlags.Const?"const":"var";const l=`declare ${c} `;const u=o.declarationList.getChildren().find((e=>e.kind===n.SyntaxKind.SyntaxList)).getChildren();let f=0;for(const e of u){if(e.kind===n.SyntaxKind.CommaToken){f=e.getStart();t.remove(f,e.getEnd())}else if(f){t.appendLeft(f,";\n");const r=e.getFullStart();const n=t.slice(r,e.getStart());let i=n.length-n.trimStart().length;if(i){t.overwrite(r,r+i,l)}else{t.appendLeft(r,l)}}}}}for(const r of e.statements){checkInlineImport(r);if(!matchesModifier(r,n.ModifierFlags.ExportDefault)){continue}if(n.isFunctionDeclaration(r)||n.isClassDeclaration(r)){if(r.name){continue}if(!s){s=uniqName("export_default")}const e=r.getChildren();const i=e.findIndex((e=>e.kind===n.SyntaxKind.ClassKeyword||e.kind===n.SyntaxKind.FunctionKeyword));const o=e[i];const a=e[i+1];const c=a.kind>=n.SyntaxKind.FirstPunctuation&&a.kind<=n.SyntaxKind.LastPunctuation;if(c){t.appendLeft(a.getStart(),s)}else{t.appendRight(o.getEnd(),` ${s}`)}}}for(const e of c.values()){const r=e.pop();const n=r[0];for(const r of e){t.move(r[0],r[1],n)}}if(s){t.append(`\nexport default ${s};\n`)}if(i.size){t.append(`\nexport { ${[...i].join(", ")} };\n`)}for(const[e,r]of a.entries()){t.prepend(`import * as ${r} from "${e}";\n`)}const l=e.getLineStarts();const u=new Set;for(const r of e.typeReferenceDirectives){u.add(r.fileName);const{line:n}=e.getLineAndCharacterOfPosition(r.pos);const i=l[n];let o=e.getLineEndOfPosition(r.pos);if(t.slice(o,o+1)=="\n"){o+=1}t.remove(i,o)}const f=new Set;for(const r of e.referencedFiles){f.add(r.fileName);const{line:n}=e.getLineAndCharacterOfPosition(r.pos);const i=l[n];let o=e.getLineEndOfPosition(r.pos);if(t.slice(o,o+1)=="\n"){o+=1}t.remove(i,o)}return{code:t,typeReferences:u,fileReferences:f};function checkInlineImport(e){n.forEachChild(e,checkInlineImport);if(n.isImportTypeNode(e)){if(!n.isLiteralTypeNode(e.argument)||!n.isStringLiteral(e.argument.literal)){throw new UnsupportedSyntaxError(e,"inline imports should have a literal argument")}const r=e.argument.literal.text;const i=e.getChildren();const o=i.find((e=>e.kind===n.SyntaxKind.ImportKeyword)).getStart();let s=e.getEnd();const a=i.find((e=>e.kind===n.SyntaxKind.DotToken||e.kind===n.SyntaxKind.LessThanToken));if(a){s=a.getStart()}const c=createNamespaceImport(r);t.overwrite(o,s,c)}}function createNamespaceImport(e){let t=a.get(e);if(!t){t=uniqName(e.replace(/[^a-zA-Z0-9_$]/g,(()=>"_")));a.set(e,t)}return t}function uniqName(e){let t=e;while(r.has(t)){t=`_${t}`}r.add(t);return t}function pushNamedNode(e,t){let r=c.get(e);if(!r){r=[t];c.set(e,r)}else{const e=r[r.length-1];if(e[1]===t[0]){e[1]=t[1]}else{r.push(t)}}}}function fixModifiers(e,t){let r=false;const i=n.isClassDeclaration(t)||n.isFunctionDeclaration(t)||n.isModuleDeclaration(t)||n.isVariableStatement(t);for(const i of t.modifiers??[]){switch(i.kind){case n.SyntaxKind.ExportKeyword:case n.SyntaxKind.DefaultKeyword:e.remove(i.getStart(),i.getEnd()+1);break;case n.SyntaxKind.DeclareKeyword:r=true}}if(i&&!r){e.appendRight(t.getStart(),"declare ")}}function duplicateExports(e,t){if(!t.body||!n.isModuleBlock(t.body)){return}for(const r of t.body.statements){if(n.isExportDeclaration(r)&&r.exportClause){if(n.isNamespaceExport(r.exportClause)){continue}for(const t of r.exportClause.elements){if(!t.propertyName){e.appendLeft(t.name.getEnd(),` as ${t.name.getText()}`)}}}}}function getStart(e){const t=e.getFullStart();return t+(newlineAt(e,t)?1:0)}function getEnd(e){const t=e.getEnd();return t+(newlineAt(e,t)?1:0)}function newlineAt(e,t){return e.getSourceFile().getFullText()[t]=="\n"}const d=new Set([n.SyntaxKind.LiteralType,n.SyntaxKind.VoidKeyword,n.SyntaxKind.UnknownKeyword,n.SyntaxKind.AnyKeyword,n.SyntaxKind.BooleanKeyword,n.SyntaxKind.NumberKeyword,n.SyntaxKind.StringKeyword,n.SyntaxKind.ObjectKeyword,n.SyntaxKind.NullKeyword,n.SyntaxKind.UndefinedKeyword,n.SyntaxKind.SymbolKeyword,n.SyntaxKind.NeverKeyword,n.SyntaxKind.ThisKeyword,n.SyntaxKind.ThisType,n.SyntaxKind.BigIntKeyword]);class DeclarationScope{constructor({id:e,range:t}){this.scopes=[];if(e){this.declaration=createDeclaration(e,t)}else{const{iife:e,fn:r}=createIIFE(t);this.iife=e;this.declaration=r}const r=createReturn();this.declaration.body.body.push(r.stmt);this.returnExpr=r.expr}pushScope(){this.scopes.push(new Set)}popScope(e=1){for(let t=0;t<e;t++){this.scopes.pop()}}pushTypeVariable(e){const t=e.getText();this.scopes[this.scopes.length-1]?.add(t)}pushReference(e){let t;if(e.type==="Identifier"){t=e.name}else if(e.type==="MemberExpression"){if(e.object.type==="Identifier"){t=e.object.name}}if(t){for(const e of this.scopes){if(e.has(t)){return}}}const{ident:r,expr:n}=createReference(e);this.declaration.params.push(n);this.returnExpr.elements.push(r)}pushIdentifierReference(e){this.pushReference(createIdentifier(e))}convertEntityName(e){if(n.isIdentifier(e)){return createIdentifier(e)}return withStartEnd({type:"MemberExpression",computed:false,optional:false,object:this.convertEntityName(e.left),property:createIdentifier(e.right)},e)}convertPropertyAccess(e){if(!n.isIdentifier(e.expression)&&!n.isPropertyAccessExpression(e.expression)){throw new UnsupportedSyntaxError(e.expression)}if(n.isPrivateIdentifier(e.name)){throw new UnsupportedSyntaxError(e.name)}let t=n.isIdentifier(e.expression)?createIdentifier(e.expression):this.convertPropertyAccess(e.expression);return withStartEnd({type:"MemberExpression",computed:false,optional:false,object:t,property:createIdentifier(e.name)},e)}convertComputedPropertyName(e){if(!e.name||!n.isComputedPropertyName(e.name)){return}const{expression:t}=e.name;if(n.isLiteralExpression(t)||n.isPrefixUnaryExpression(t)){return}if(n.isIdentifier(t)){return this.pushReference(createIdentifier(t))}if(n.isPropertyAccessExpression(t)){return this.pushReference(this.convertPropertyAccess(t))}throw new UnsupportedSyntaxError(t)}convertParametersAndType(e){this.convertComputedPropertyName(e);const t=this.convertTypeParameters(e.typeParameters);for(const t of e.parameters){this.convertTypeNode(t.type)}this.convertTypeNode(e.type);this.popScope(t)}convertHeritageClauses(e){for(const t of e.heritageClauses||[]){for(const e of t.types){this.pushReference(convertExpression(e.expression));this.convertTypeArguments(e)}}}convertTypeArguments(e){if(!e.typeArguments){return}for(const t of e.typeArguments){this.convertTypeNode(t)}}convertMembers(e){for(const t of e){if(n.isPropertyDeclaration(t)||n.isPropertySignature(t)||n.isIndexSignatureDeclaration(t)){if(n.isPropertyDeclaration(t)&&t.initializer&&n.isPropertyAccessExpression(t.initializer)){this.pushReference(this.convertPropertyAccess(t.initializer))}this.convertComputedPropertyName(t);this.convertTypeNode(t.type);continue}if(n.isMethodDeclaration(t)||n.isMethodSignature(t)||n.isConstructorDeclaration(t)||n.isConstructSignatureDeclaration(t)||n.isCallSignatureDeclaration(t)||n.isGetAccessorDeclaration(t)||n.isSetAccessorDeclaration(t)){this.convertParametersAndType(t)}else{throw new UnsupportedSyntaxError(t)}}}convertTypeParameters(e){if(!e){return 0}for(const t of e){this.convertTypeNode(t.constraint);this.convertTypeNode(t.default);this.pushScope();this.pushTypeVariable(t.name)}return e.length}convertTypeNode(e){if(!e){return}if(d.has(e.kind)){return}if(n.isTypeReferenceNode(e)){this.pushReference(this.convertEntityName(e.typeName));this.convertTypeArguments(e);return}if(n.isTypeLiteralNode(e)){return this.convertMembers(e.members)}if(n.isArrayTypeNode(e)){return this.convertTypeNode(e.elementType)}if(n.isTupleTypeNode(e)){for(const t of e.elements){this.convertTypeNode(t)}return}if(n.isNamedTupleMember(e)||n.isParenthesizedTypeNode(e)||n.isTypeOperatorNode(e)||n.isTypePredicateNode(e)){return this.convertTypeNode(e.type)}if(n.isUnionTypeNode(e)||n.isIntersectionTypeNode(e)){for(const t of e.types){this.convertTypeNode(t)}return}if(n.isMappedTypeNode(e)){const{typeParameter:t,type:r,nameType:n}=e;this.convertTypeNode(t.constraint);this.pushScope();this.pushTypeVariable(t.name);this.convertTypeNode(r);if(n){this.convertTypeNode(n)}this.popScope();return}if(n.isConditionalTypeNode(e)){this.convertTypeNode(e.checkType);this.pushScope();this.convertTypeNode(e.extendsType);this.convertTypeNode(e.trueType);this.convertTypeNode(e.falseType);this.popScope();return}if(n.isIndexedAccessTypeNode(e)){this.convertTypeNode(e.objectType);this.convertTypeNode(e.indexType);return}if(n.isFunctionOrConstructorTypeNode(e)){this.convertParametersAndType(e);return}if(n.isTypeQueryNode(e)){this.pushReference(this.convertEntityName(e.exprName));return}if(n.isRestTypeNode(e)){this.convertTypeNode(e.type);return}if(n.isOptionalTypeNode(e)){this.convertTypeNode(e.type);return}if(n.isTemplateLiteralTypeNode(e)){for(const t of e.templateSpans){this.convertTypeNode(t.type)}return}if(n.isInferTypeNode(e)){const{typeParameter:t}=e;this.convertTypeNode(t.constraint);this.pushTypeVariable(t.name);return}else{throw new UnsupportedSyntaxError(e)}}convertNamespace(e,t=false){this.pushScope();if(t&&e.body&&n.isModuleDeclaration(e.body)){this.convertNamespace(e.body,true);return}if(!e.body||!n.isModuleBlock(e.body)){throw new UnsupportedSyntaxError(e,`namespace must have a "ModuleBlock" body.`)}const{statements:r}=e.body;for(const e of r){if(n.isEnumDeclaration(e)||n.isFunctionDeclaration(e)||n.isClassDeclaration(e)||n.isInterfaceDeclaration(e)||n.isTypeAliasDeclaration(e)||n.isModuleDeclaration(e)){if(e.name&&n.isIdentifier(e.name)){this.pushTypeVariable(e.name)}else{throw new UnsupportedSyntaxError(e,`non-Identifier name not supported`)}continue}if(n.isVariableStatement(e)){for(const t of e.declarationList.declarations){if(n.isIdentifier(t.name)){this.pushTypeVariable(t.name)}else{throw new UnsupportedSyntaxError(t,`non-Identifier name not supported`)}}continue}if(n.isExportDeclaration(e));else{throw new UnsupportedSyntaxError(e,`namespace child (hoisting) not supported yet`)}}for(const e of r){if(n.isVariableStatement(e)){for(const t of e.declarationList.declarations){if(t.type){this.convertTypeNode(t.type)}}continue}if(n.isFunctionDeclaration(e)){this.convertParametersAndType(e);continue}if(n.isInterfaceDeclaration(e)||n.isClassDeclaration(e)){const t=this.convertTypeParameters(e.typeParameters);this.convertHeritageClauses(e);this.convertMembers(e.members);this.popScope(t);continue}if(n.isTypeAliasDeclaration(e)){const t=this.convertTypeParameters(e.typeParameters);this.convertTypeNode(e.type);this.popScope(t);continue}if(n.isModuleDeclaration(e)){this.convertNamespace(e,t);continue}if(n.isEnumDeclaration(e)){continue}if(n.isExportDeclaration(e)){if(e.exportClause){if(n.isNamespaceExport(e.exportClause)){throw new UnsupportedSyntaxError(e.exportClause)}for(const t of e.exportClause.elements){const e=t.propertyName||t.name;this.pushIdentifierReference(e)}}}else{throw new UnsupportedSyntaxError(e,`namespace child (walking) not supported yet`)}}this.popScope()}}function convert({sourceFile:e}){const t=new Transformer(e);return t.transform()}class Transformer{constructor(e){this.sourceFile=e;this.declarations=new Map;this.ast=createProgram(e);for(const t of e.statements){this.convertStatement(t)}}transform(){return{ast:this.ast}}pushStatement(e){this.ast.body.push(e)}createDeclaration(e,t){const r={start:e.getFullStart(),end:e.getEnd()};if(!t){const e=new DeclarationScope({range:r});this.pushStatement(e.iife);return e}const n=t.getText();const i=new DeclarationScope({id:t,range:r});const o=this.declarations.get(n);if(o){o.pushIdentifierReference(t);o.declaration.end=r.end;let e=this.ast.body.findIndex((e=>e==o.declaration));for(let t=e+1;t<this.ast.body.length;t++){const e=this.ast.body[t];e.start=e.end=r.end}}else{this.pushStatement(i.declaration);this.declarations.set(n,i)}return o||i}convertStatement(e){if(n.isEnumDeclaration(e)){return this.convertEnumDeclaration(e)}if(n.isFunctionDeclaration(e)){return this.convertFunctionDeclaration(e)}if(n.isInterfaceDeclaration(e)||n.isClassDeclaration(e)){return this.convertClassOrInterfaceDeclaration(e)}if(n.isTypeAliasDeclaration(e)){return this.convertTypeAliasDeclaration(e)}if(n.isVariableStatement(e)){return this.convertVariableStatement(e)}if(n.isExportDeclaration(e)||n.isExportAssignment(e)){return this.convertExportDeclaration(e)}if(n.isModuleDeclaration(e)){return this.convertNamespaceDeclaration(e)}if(e.kind==n.SyntaxKind.NamespaceExportDeclaration){return this.removeStatement(e)}if(n.isImportDeclaration(e)||n.isImportEqualsDeclaration(e)){return this.convertImportDeclaration(e)}else{throw new UnsupportedSyntaxError(e)}}removeStatement(e){this.pushStatement(withStartEnd({type:"ExpressionStatement",expression:{type:"Literal",value:"pls remove me"}},e))}convertNamespaceDeclaration(e){const t=e.flags&n.NodeFlags.GlobalAugmentation;if(t||!n.isIdentifier(e.name)){const t=this.createDeclaration(e);t.convertNamespace(e,true);return}const r=this.createDeclaration(e,e.name);r.pushIdentifierReference(e.name);r.convertNamespace(e)}convertEnumDeclaration(e){const t=this.createDeclaration(e,e.name);t.pushIdentifierReference(e.name)}convertFunctionDeclaration(e){if(!e.name){throw new UnsupportedSyntaxError(e,`FunctionDeclaration should have a name`)}const t=this.createDeclaration(e,e.name);t.pushIdentifierReference(e.name);t.convertParametersAndType(e)}convertClassOrInterfaceDeclaration(e){if(!e.name){throw new UnsupportedSyntaxError(e,`ClassDeclaration / InterfaceDeclaration should have a name`)}const t=this.createDeclaration(e,e.name);const r=t.convertTypeParameters(e.typeParameters);t.convertHeritageClauses(e);t.convertMembers(e.members);t.popScope(r)}convertTypeAliasDeclaration(e){const t=this.createDeclaration(e,e.name);const r=t.convertTypeParameters(e.typeParameters);t.convertTypeNode(e.type);t.popScope(r)}convertVariableStatement(e){const{declarations:t}=e.declarationList;if(t.length!==1){throw new UnsupportedSyntaxError(e,`VariableStatement with more than one declaration not yet supported`)}for(const r of t){if(!n.isIdentifier(r.name)){throw new UnsupportedSyntaxError(e,`VariableDeclaration must have a name`)}const t=this.createDeclaration(e,r.name);t.convertTypeNode(r.type)}}convertExportDeclaration(e){if(n.isExportAssignment(e)){this.pushStatement(withStartEnd({type:"ExportDefaultDeclaration",declaration:convertExpression(e.expression)},e));return}const t=e.moduleSpecifier?convertExpression(e.moduleSpecifier):undefined;if(!e.exportClause){this.pushStatement(withStartEnd({type:"ExportAllDeclaration",source:t,exported:null},e))}else if(n.isNamespaceExport(e.exportClause)){this.pushStatement(withStartEnd({type:"ExportAllDeclaration",source:t,exported:createIdentifier(e.exportClause.name)},e))}else{const r=[];for(const t of e.exportClause.elements){r.push(this.convertExportSpecifier(t))}this.pushStatement(withStartEnd({type:"ExportNamedDeclaration",declaration:null,specifiers:r,source:t},e))}}convertImportDeclaration(e){if(n.isImportEqualsDeclaration(e)){if(!n.isExternalModuleReference(e.moduleReference)){throw new UnsupportedSyntaxError(e,"ImportEquals should have a literal source.")}this.pushStatement(withStartEnd({type:"ImportDeclaration",specifiers:[{type:"ImportDefaultSpecifier",local:createIdentifier(e.name)}],source:convertExpression(e.moduleReference.expression)},e));return}const t=convertExpression(e.moduleSpecifier);const r=e.importClause&&e.importClause.namedBindings?this.convertNamedImportBindings(e.importClause.namedBindings):[];if(e.importClause&&e.importClause.name){r.push({type:"ImportDefaultSpecifier",local:createIdentifier(e.importClause.name)})}this.pushStatement(withStartEnd({type:"ImportDeclaration",specifiers:r,source:t},e))}convertNamedImportBindings(e){if(n.isNamedImports(e)){return e.elements.map((e=>{const t=createIdentifier(e.name);const r=e.propertyName?createIdentifier(e.propertyName):t;return{type:"ImportSpecifier",local:t,imported:r}}))}return[{type:"ImportNamespaceSpecifier",local:createIdentifier(e.name)}]}convertExportSpecifier(e){const t=createIdentifier(e.name);return{type:"ExportSpecifier",exported:t,local:e.propertyName?createIdentifier(e.propertyName):t}}}function parse(e,t){return n.createSourceFile(e,t,n.ScriptTarget.Latest,true)}const transform=()=>{const e=new Map;const t=new Map;return{name:"dts-transform",options(e){const{onwarn:t}=e;return{...e,onwarn(e,r){if(e.code!="CIRCULAR_DEPENDENCY"){if(t){t(e,r)}else{r(e)}}},treeshake:{moduleSideEffects:"no-external",propertyReadSideEffects:true,unknownGlobalSideEffects:false}}},outputOptions(e){return{...e,chunkFileNames:e.chunkFileNames||"[name]-[hash].d.ts",entryFileNames:e.entryFileNames||"[name].d.ts",format:"es",exports:"named",compact:false,freeze:true,interop:"esModule",generatedCode:Object.assign({symbols:false},e.generatedCode),strict:false}},transform(r,n){let i=parse(n,r);const o=preProcess({sourceFile:i});e.set(i.fileName,o.typeReferences);t.set(i.fileName,o.fileReferences);r=o.code.toString();i=parse(n,r);const s=convert({sourceFile:i});if(process.env.DTS_DUMP_AST){console.log(n);console.log(r);console.log(JSON.stringify(s.ast.body,undefined,2))}return{code:r,ast:s.ast,map:o.code.generateMap()}},renderChunk(r,n,i){const o=parse(n.fileName,r);const a=new NamespaceFixer(o);const c=new Set;const l=new Set;for(const r of Object.keys(n.modules)){for(const t of e.get(r.split("\\").join("/"))||[]){c.add(t)}for(const e of t.get(r.split("\\").join("/"))||[]){if(e.startsWith(".")){const t=s.join(s.dirname(r),e);const o=i.file&&s.dirname(i.file)||n.facadeModuleId&&s.dirname(n.facadeModuleId)||".";let a=s.relative(o,t).split("\\").join("/");if(a[0]!=="."){a="./"+a}l.add(a)}else{l.add(e)}}}r=writeBlock(Array.from(l,(e=>`/// <reference path="${e}" />`)));r+=writeBlock(Array.from(c,(e=>`/// <reference types="${e}" />`)));r+=a.fix();if(!r){r+="\nexport { }"}return{code:r,map:{mappings:""}}}}};function writeBlock(e){if(e.length){return e.join("\n")+"\n"}return""}const h=/\.([cm]ts|[tj]sx?)$/;function getModule({programs:e,resolvedOptions:{compilerOptions:t,tsconfig:r}},i,o){if(!e.length&&i.endsWith(a)){return{code:o}}const s=e.find((e=>!!e.getSourceFile(i)));if(s){const e=s.getSourceFile(i);return{code:e.getFullText(),source:e,program:s}}else if(n.sys.fileExists(i)){const n=createProgram$1(i,t,r);e.push(n);const o=n.getSourceFile(i);return{code:o.getFullText(),source:o,program:n}}else{return null}}function rollupPluginDts(e={}){const t=transform();const r={programs:[],resolvedOptions:resolveDefaultOptions(e)};return{name:"dts",outputOptions:t.outputOptions,renderChunk:t.renderChunk,options(e){let{input:n=[]}=e;if(!Array.isArray(n)){n=typeof n==="string"?[n]:Object.values(n)}else if(n.length>1){e.input={};for(const t of n){let r=t.replace(/((\.d)?\.(t|j)sx?)$/,"");if(s.isAbsolute(t)){r=s.basename(r)}else{r=s.normalize(r)}e.input[r]=t}}r.programs=createPrograms(Object.values(n),r.resolvedOptions.compilerOptions,r.resolvedOptions.tsconfig);return t.options.call(this,e)},transform(e,i){if(!h.test(i)){return null}const watchFiles=e=>{if(e.program){const t=s.dirname(i);const r=e.program.getSourceFiles().map((e=>e.fileName)).filter((e=>e.startsWith(t)));r.forEach(this.addWatchFile)}};const handleDtsFile=()=>{const n=getModule(r,i,e);if(n){watchFiles(n);return t.transform.call(this,n.code,i)}return null};const treatTsAsDts=()=>{const n=i.replace(h,a);let o=getModule(r,n,e);if(o){watchFiles(o);return t.transform.call(this,o.code,n)}return null};const generateDtsFromTs=()=>{const o=getModule(r,i,e);if(!o||!o.source||!o.program)return null;watchFiles(o);const s=i.replace(h,a);let l;const{emitSkipped:u,diagnostics:f}=o.program.emit(o.source,((e,r)=>{l=t.transform.call(this,r,s)}),undefined,true);if(u){const e=f.filter((e=>e.category===n.DiagnosticCategory.Error));if(e.length){console.error(n.formatDiagnostics(e,c));this.error("Failed to compile. Check the logs above.")}}return l};if(i.endsWith(a))return handleDtsFile();return treatTsAsDts()??generateDtsFromTs()},resolveId(e,t){if(!t){return}t=t.split("\\").join("/");let i=r.resolvedOptions.compilerOptions;if(r.resolvedOptions.tsconfig){const n=e.startsWith(".")?s.resolve(s.dirname(t),e):e;i=getCompilerOptions(n,r.resolvedOptions.compilerOptions,r.resolvedOptions.tsconfig).compilerOptions}const{resolvedModule:o}=n.nodeModuleNameResolver(e,t,i,n.sys);if(!o){return}if(!r.resolvedOptions.respectExternal&&o.isExternalLibraryImport){return{id:e,external:true}}else{return{id:s.resolve(o.resolvedFileName)}}}}}e["default"]=rollupPluginDts})();module.exports=r})();
1
+ (()=>{var e={248:function(e,t){(function(e,r){true?r(t):0})(this,(function(e){"use strict";const t=",".charCodeAt(0);const r=";".charCodeAt(0);const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";const i=new Uint8Array(64);const o=new Uint8Array(128);for(let e=0;e<n.length;e++){const t=n.charCodeAt(e);i[e]=t;o[t]=e}const s=typeof TextDecoder!=="undefined"?new TextDecoder:typeof Buffer!=="undefined"?{decode(e){const t=Buffer.from(e.buffer,e.byteOffset,e.byteLength);return t.toString()}}:{decode(e){let t="";for(let r=0;r<e.length;r++){t+=String.fromCharCode(e[r])}return t}};function decode(e){const t=new Int32Array(5);const r=[];let n=0;do{const i=indexOf(e,n);const o=[];let s=true;let a=0;t[0]=0;for(let r=n;r<i;r++){let n;r=decodeInteger(e,r,t,0);const c=t[0];if(c<a)s=false;a=c;if(hasMoreVlq(e,r,i)){r=decodeInteger(e,r,t,1);r=decodeInteger(e,r,t,2);r=decodeInteger(e,r,t,3);if(hasMoreVlq(e,r,i)){r=decodeInteger(e,r,t,4);n=[c,t[1],t[2],t[3],t[4]]}else{n=[c,t[1],t[2],t[3]]}}else{n=[c]}o.push(n)}if(!s)sort(o);r.push(o);n=i+1}while(n<=e.length);return r}function indexOf(e,t){const r=e.indexOf(";",t);return r===-1?e.length:r}function decodeInteger(e,t,r,n){let i=0;let s=0;let a=0;do{const r=e.charCodeAt(t++);a=o[r];i|=(a&31)<<s;s+=5}while(a&32);const c=i&1;i>>>=1;if(c){i=-2147483648|-i}r[n]+=i;return t}function hasMoreVlq(e,r,n){if(r>=n)return false;return e.charCodeAt(r)!==t}function sort(e){e.sort(sortComparator)}function sortComparator(e,t){return e[0]-t[0]}function encode(e){const n=new Int32Array(5);const i=1024*16;const o=i-36;const a=new Uint8Array(i);const c=a.subarray(0,o);let l=0;let u="";for(let f=0;f<e.length;f++){const d=e[f];if(f>0){if(l===i){u+=s.decode(a);l=0}a[l++]=r}if(d.length===0)continue;n[0]=0;for(let e=0;e<d.length;e++){const r=d[e];if(l>o){u+=s.decode(c);a.copyWithin(0,o,l);l-=o}if(e>0)a[l++]=t;l=encodeInteger(a,l,n,r,0);if(r.length===1)continue;l=encodeInteger(a,l,n,r,1);l=encodeInteger(a,l,n,r,2);l=encodeInteger(a,l,n,r,3);if(r.length===4)continue;l=encodeInteger(a,l,n,r,4)}}return u+s.decode(a.subarray(0,l))}function encodeInteger(e,t,r,n,o){const s=n[o];let a=s-r[o];r[o]=s;a=a<0?-a<<1|1:a<<1;do{let r=a&31;a>>>=5;if(a>0)r|=32;e[t++]=i[r]}while(a>0);return t}e.decode=decode;e.encode=encode;Object.defineProperty(e,"__esModule",{value:true})}))},571:(e,t,r)=>{"use strict";e=r.nmd(e);const n=r(755);const wrapAnsi16=(e,t)=>function(){const r=e.apply(n,arguments);return`[${r+t}m`};const wrapAnsi256=(e,t)=>function(){const r=e.apply(n,arguments);return`[${38+t};5;${r}m`};const wrapAnsi16m=(e,t)=>function(){const r=e.apply(n,arguments);return`[${38+t};2;${r[0]};${r[1]};${r[2]}m`};function assembleStyles(){const e=new Map;const t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.grey=t.color.gray;for(const r of Object.keys(t)){const n=t[r];for(const r of Object.keys(n)){const i=n[r];t[r]={open:`[${i[0]}m`,close:`[${i[1]}m`};n[r]=t[r];e.set(i[0],i[1])}Object.defineProperty(t,r,{value:n,enumerable:false});Object.defineProperty(t,"codes",{value:e,enumerable:false})}const ansi2ansi=e=>e;const rgb2rgb=(e,t,r)=>[e,t,r];t.color.close="";t.bgColor.close="";t.color.ansi={ansi:wrapAnsi16(ansi2ansi,0)};t.color.ansi256={ansi256:wrapAnsi256(ansi2ansi,0)};t.color.ansi16m={rgb:wrapAnsi16m(rgb2rgb,0)};t.bgColor.ansi={ansi:wrapAnsi16(ansi2ansi,10)};t.bgColor.ansi256={ansi256:wrapAnsi256(ansi2ansi,10)};t.bgColor.ansi16m={rgb:wrapAnsi16m(rgb2rgb,10)};for(let e of Object.keys(n)){if(typeof n[e]!=="object"){continue}const r=n[e];if(e==="ansi16"){e="ansi"}if("ansi16"in r){t.color.ansi[e]=wrapAnsi16(r.ansi16,0);t.bgColor.ansi[e]=wrapAnsi16(r.ansi16,10)}if("ansi256"in r){t.color.ansi256[e]=wrapAnsi256(r.ansi256,0);t.bgColor.ansi256[e]=wrapAnsi256(r.ansi256,10)}if("rgb"in r){t.color.ansi16m[e]=wrapAnsi16m(r.rgb,0);t.bgColor.ansi16m[e]=wrapAnsi16m(r.rgb,10)}}return t}Object.defineProperty(e,"exports",{enumerable:true,get:assembleStyles})},673:(e,t,r)=>{"use strict";const n=r(434);const i=r(571);const o=r(332).stdout;const s=r(956);const a=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm");const c=["ansi","ansi","ansi256","ansi16m"];const l=new Set(["gray"]);const u=Object.create(null);function applyOptions(e,t){t=t||{};const r=o?o.level:0;e.level=t.level===undefined?r:t.level;e.enabled="enabled"in t?t.enabled:e.level>0}function Chalk(e){if(!this||!(this instanceof Chalk)||this.template){const t={};applyOptions(t,e);t.template=function(){const e=[].slice.call(arguments);return chalkTag.apply(null,[t.template].concat(e))};Object.setPrototypeOf(t,Chalk.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=Chalk;return t.template}applyOptions(this,e)}if(a){i.blue.open=""}for(const e of Object.keys(i)){i[e].closeRe=new RegExp(n(i[e].close),"g");u[e]={get(){const t=i[e];return build.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}}}u.visible={get(){return build.call(this,this._styles||[],true,"visible")}};i.color.closeRe=new RegExp(n(i.color.close),"g");for(const e of Object.keys(i.color.ansi)){if(l.has(e)){continue}u[e]={get(){const t=this.level;return function(){const r=i.color[c[t]][e].apply(null,arguments);const n={open:r,close:i.color.close,closeRe:i.color.closeRe};return build.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}}}i.bgColor.closeRe=new RegExp(n(i.bgColor.close),"g");for(const e of Object.keys(i.bgColor.ansi)){if(l.has(e)){continue}const t="bg"+e[0].toUpperCase()+e.slice(1);u[t]={get(){const t=this.level;return function(){const r=i.bgColor[c[t]][e].apply(null,arguments);const n={open:r,close:i.bgColor.close,closeRe:i.bgColor.closeRe};return build.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}}}const f=Object.defineProperties((()=>{}),u);function build(e,t,r){const builder=function(){return applyStyle.apply(builder,arguments)};builder._styles=e;builder._empty=t;const n=this;Object.defineProperty(builder,"level",{enumerable:true,get(){return n.level},set(e){n.level=e}});Object.defineProperty(builder,"enabled",{enumerable:true,get(){return n.enabled},set(e){n.enabled=e}});builder.hasGrey=this.hasGrey||r==="gray"||r==="grey";builder.__proto__=f;return builder}function applyStyle(){const e=arguments;const t=e.length;let r=String(arguments[0]);if(t===0){return""}if(t>1){for(let n=1;n<t;n++){r+=" "+e[n]}}if(!this.enabled||this.level<=0||!r){return this._empty?"":r}const n=i.dim.open;if(a&&this.hasGrey){i.dim.open=""}for(const e of this._styles.slice().reverse()){r=e.open+r.replace(e.closeRe,e.open)+e.close;r=r.replace(/\r?\n/g,`${e.close}$&${e.open}`)}i.dim.open=n;return r}function chalkTag(e,t){if(!Array.isArray(t)){return[].slice.call(arguments,1).join(" ")}const r=[].slice.call(arguments,2);const n=[t.raw[0]];for(let e=1;e<t.length;e++){n.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&"));n.push(String(t.raw[e]))}return s(e,n.join(""))}Object.defineProperties(Chalk.prototype,u);e.exports=Chalk();e.exports.supportsColor=o;e.exports["default"]=e.exports},956:e=>{"use strict";const t=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const r=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const n=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const i=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;const o=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function unescape(e){if(e[0]==="u"&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}return o.get(e)||e}function parseArguments(e,t){const r=[];const o=t.trim().split(/\s*,\s*/g);let s;for(const t of o){if(!isNaN(t)){r.push(Number(t))}else if(s=t.match(n)){r.push(s[2].replace(i,((e,t,r)=>t?unescape(t):r)))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return r}function parseStyle(e){r.lastIndex=0;const t=[];let n;while((n=r.exec(e))!==null){const e=n[1];if(n[2]){const r=parseArguments(e,n[2]);t.push([e].concat(r))}else{t.push([e])}}return t}function buildStyle(e,t){const r={};for(const e of t){for(const t of e.styles){r[t[0]]=e.inverse?null:t.slice(1)}}let n=e;for(const e of Object.keys(r)){if(Array.isArray(r[e])){if(!(e in n)){throw new Error(`Unknown Chalk style: ${e}`)}if(r[e].length>0){n=n[e].apply(n,r[e])}else{n=n[e]}}}return n}e.exports=(e,r)=>{const n=[];const i=[];let o=[];r.replace(t,((t,r,s,a,c,l)=>{if(r){o.push(unescape(r))}else if(a){const t=o.join("");o=[];i.push(n.length===0?t:buildStyle(e,n)(t));n.push({inverse:s,styles:parseStyle(a)})}else if(c){if(n.length===0){throw new Error("Found extraneous } in Chalk template literal")}i.push(buildStyle(e,n)(o.join("")));o=[];n.pop()}else{o.push(l)}}));i.push(o.join(""));if(n.length>0){const e=`Chalk template literal is missing ${n.length} closing bracket${n.length===1?"":"s"} (\`}\`)`;throw new Error(e)}return i.join("")}},461:(e,t,r)=>{var n=r(391);var i={};for(var o in n){if(n.hasOwnProperty(o)){i[n[o]]=o}}var s=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var a in s){if(s.hasOwnProperty(a)){if(!("channels"in s[a])){throw new Error("missing channels property: "+a)}if(!("labels"in s[a])){throw new Error("missing channel labels property: "+a)}if(s[a].labels.length!==s[a].channels){throw new Error("channel and label counts mismatch: "+a)}var c=s[a].channels;var l=s[a].labels;delete s[a].channels;delete s[a].labels;Object.defineProperty(s[a],"channels",{value:c});Object.defineProperty(s[a],"labels",{value:l})}}s.rgb.hsl=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var i=Math.min(t,r,n);var o=Math.max(t,r,n);var s=o-i;var a;var c;var l;if(o===i){a=0}else if(t===o){a=(r-n)/s}else if(r===o){a=2+(n-t)/s}else if(n===o){a=4+(t-r)/s}a=Math.min(a*60,360);if(a<0){a+=360}l=(i+o)/2;if(o===i){c=0}else if(l<=.5){c=s/(o+i)}else{c=s/(2-o-i)}return[a,c*100,l*100]};s.rgb.hsv=function(e){var t;var r;var n;var i;var o;var s=e[0]/255;var a=e[1]/255;var c=e[2]/255;var l=Math.max(s,a,c);var u=l-Math.min(s,a,c);var diffc=function(e){return(l-e)/6/u+1/2};if(u===0){i=o=0}else{o=u/l;t=diffc(s);r=diffc(a);n=diffc(c);if(s===l){i=n-r}else if(a===l){i=1/3+t-n}else if(c===l){i=2/3+r-t}if(i<0){i+=1}else if(i>1){i-=1}}return[i*360,o*100,l*100]};s.rgb.hwb=function(e){var t=e[0];var r=e[1];var n=e[2];var i=s.rgb.hsl(e)[0];var o=1/255*Math.min(t,Math.min(r,n));n=1-1/255*Math.max(t,Math.max(r,n));return[i,o*100,n*100]};s.rgb.cmyk=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var i;var o;var s;var a;a=Math.min(1-t,1-r,1-n);i=(1-t-a)/(1-a)||0;o=(1-r-a)/(1-a)||0;s=(1-n-a)/(1-a)||0;return[i*100,o*100,s*100,a*100]};function comparativeDistance(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}s.rgb.keyword=function(e){var t=i[e];if(t){return t}var r=Infinity;var o;for(var s in n){if(n.hasOwnProperty(s)){var a=n[s];var c=comparativeDistance(e,a);if(c<r){r=c;o=s}}}return o};s.keyword.rgb=function(e){return n[e]};s.rgb.xyz=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92;r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var i=t*.4124+r*.3576+n*.1805;var o=t*.2126+r*.7152+n*.0722;var s=t*.0193+r*.1192+n*.9505;return[i*100,o*100,s*100]};s.rgb.lab=function(e){var t=s.rgb.xyz(e);var r=t[0];var n=t[1];var i=t[2];var o;var a;var c;r/=95.047;n/=100;i/=108.883;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;i=i>.008856?Math.pow(i,1/3):7.787*i+16/116;o=116*n-16;a=500*(r-n);c=200*(n-i);return[o,a,c]};s.hsl.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var i;var o;var s;var a;var c;if(r===0){c=n*255;return[c,c,c]}if(n<.5){o=n*(1+r)}else{o=n+r-n*r}i=2*n-o;a=[0,0,0];for(var l=0;l<3;l++){s=t+1/3*-(l-1);if(s<0){s++}if(s>1){s--}if(6*s<1){c=i+(o-i)*6*s}else if(2*s<1){c=o}else if(3*s<2){c=i+(o-i)*(2/3-s)*6}else{c=i}a[l]=c*255}return a};s.hsl.hsv=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var i=r;var o=Math.max(n,.01);var s;var a;n*=2;r*=n<=1?n:2-n;i*=o<=1?o:2-o;a=(n+r)/2;s=n===0?2*i/(o+i):2*r/(n+r);return[t,s*100,a*100]};s.hsv.rgb=function(e){var t=e[0]/60;var r=e[1]/100;var n=e[2]/100;var i=Math.floor(t)%6;var o=t-Math.floor(t);var s=255*n*(1-r);var a=255*n*(1-r*o);var c=255*n*(1-r*(1-o));n*=255;switch(i){case 0:return[n,c,s];case 1:return[a,n,s];case 2:return[s,n,c];case 3:return[s,a,n];case 4:return[c,s,n];case 5:return[n,s,a]}};s.hsv.hsl=function(e){var t=e[0];var r=e[1]/100;var n=e[2]/100;var i=Math.max(n,.01);var o;var s;var a;a=(2-r)*n;o=(2-r)*i;s=r*i;s/=o<=1?o:2-o;s=s||0;a/=2;return[t,s*100,a*100]};s.hwb.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;var i=r+n;var o;var s;var a;var c;if(i>1){r/=i;n/=i}o=Math.floor(6*t);s=1-n;a=6*t-o;if((o&1)!==0){a=1-a}c=r+a*(s-r);var l;var u;var f;switch(o){default:case 6:case 0:l=s;u=c;f=r;break;case 1:l=c;u=s;f=r;break;case 2:l=r;u=s;f=c;break;case 3:l=r;u=c;f=s;break;case 4:l=c;u=r;f=s;break;case 5:l=s;u=r;f=c;break}return[l*255,u*255,f*255]};s.cmyk.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var i=e[3]/100;var o;var s;var a;o=1-Math.min(1,t*(1-i)+i);s=1-Math.min(1,r*(1-i)+i);a=1-Math.min(1,n*(1-i)+i);return[o*255,s*255,a*255]};s.xyz.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var n=e[2]/100;var i;var o;var s;i=t*3.2406+r*-1.5372+n*-.4986;o=t*-.9689+r*1.8758+n*.0415;s=t*.0557+r*-.204+n*1.057;i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92;o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92;s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92;i=Math.min(Math.max(0,i),1);o=Math.min(Math.max(0,o),1);s=Math.min(Math.max(0,s),1);return[i*255,o*255,s*255]};s.xyz.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var i;var o;var s;t/=95.047;r/=100;n/=108.883;t=t>.008856?Math.pow(t,1/3):7.787*t+16/116;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;n=n>.008856?Math.pow(n,1/3):7.787*n+16/116;i=116*r-16;o=500*(t-r);s=200*(r-n);return[i,o,s]};s.lab.xyz=function(e){var t=e[0];var r=e[1];var n=e[2];var i;var o;var s;o=(t+16)/116;i=r/500+o;s=o-n/200;var a=Math.pow(o,3);var c=Math.pow(i,3);var l=Math.pow(s,3);o=a>.008856?a:(o-16/116)/7.787;i=c>.008856?c:(i-16/116)/7.787;s=l>.008856?l:(s-16/116)/7.787;i*=95.047;o*=100;s*=108.883;return[i,o,s]};s.lab.lch=function(e){var t=e[0];var r=e[1];var n=e[2];var i;var o;var s;i=Math.atan2(n,r);o=i*360/2/Math.PI;if(o<0){o+=360}s=Math.sqrt(r*r+n*n);return[t,s,o]};s.lch.lab=function(e){var t=e[0];var r=e[1];var n=e[2];var i;var o;var s;s=n/360*2*Math.PI;i=r*Math.cos(s);o=r*Math.sin(s);return[t,i,o]};s.rgb.ansi16=function(e){var t=e[0];var r=e[1];var n=e[2];var i=1 in arguments?arguments[1]:s.rgb.hsv(e)[2];i=Math.round(i/50);if(i===0){return 30}var o=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));if(i===2){o+=60}return o};s.hsv.ansi16=function(e){return s.rgb.ansi16(s.hsv.rgb(e),e[2])};s.rgb.ansi256=function(e){var t=e[0];var r=e[1];var n=e[2];if(t===r&&r===n){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}var i=16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5);return i};s.ansi16.rgb=function(e){var t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}var r=(~~(e>50)+1)*.5;var n=(t&1)*r*255;var i=(t>>1&1)*r*255;var o=(t>>2&1)*r*255;return[n,i,o]};s.ansi256.rgb=function(e){if(e>=232){var t=(e-232)*10+8;return[t,t,t]}e-=16;var r;var n=Math.floor(e/36)/5*255;var i=Math.floor((r=e%36)/6)/5*255;var o=r%6/5*255;return[n,i,o]};s.rgb.hex=function(e){var t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);var r=t.toString(16).toUpperCase();return"000000".substring(r.length)+r};s.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}var r=t[0];if(t[0].length===3){r=r.split("").map((function(e){return e+e})).join("")}var n=parseInt(r,16);var i=n>>16&255;var o=n>>8&255;var s=n&255;return[i,o,s]};s.rgb.hcg=function(e){var t=e[0]/255;var r=e[1]/255;var n=e[2]/255;var i=Math.max(Math.max(t,r),n);var o=Math.min(Math.min(t,r),n);var s=i-o;var a;var c;if(s<1){a=o/(1-s)}else{a=0}if(s<=0){c=0}else if(i===t){c=(r-n)/s%6}else if(i===r){c=2+(n-t)/s}else{c=4+(t-r)/s+4}c/=6;c%=1;return[c*360,s*100,a*100]};s.hsl.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1;var i=0;if(r<.5){n=2*t*r}else{n=2*t*(1-r)}if(n<1){i=(r-.5*n)/(1-n)}return[e[0],n*100,i*100]};s.hsv.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=t*r;var i=0;if(n<1){i=(r-n)/(1-n)}return[e[0],n*100,i*100]};s.hcg.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var n=e[2]/100;if(r===0){return[n*255,n*255,n*255]}var i=[0,0,0];var o=t%1*6;var s=o%1;var a=1-s;var c=0;switch(Math.floor(o)){case 0:i[0]=1;i[1]=s;i[2]=0;break;case 1:i[0]=a;i[1]=1;i[2]=0;break;case 2:i[0]=0;i[1]=1;i[2]=s;break;case 3:i[0]=0;i[1]=a;i[2]=1;break;case 4:i[0]=s;i[1]=0;i[2]=1;break;default:i[0]=1;i[1]=0;i[2]=a}c=(1-r)*n;return[(r*i[0]+c)*255,(r*i[1]+c)*255,(r*i[2]+c)*255]};s.hcg.hsv=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);var i=0;if(n>0){i=t/n}return[e[0],i*100,n*100]};s.hcg.hsl=function(e){var t=e[1]/100;var r=e[2]/100;var n=r*(1-t)+.5*t;var i=0;if(n>0&&n<.5){i=t/(2*n)}else if(n>=.5&&n<1){i=t/(2*(1-n))}return[e[0],i*100,n*100]};s.hcg.hwb=function(e){var t=e[1]/100;var r=e[2]/100;var n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};s.hwb.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var n=1-r;var i=n-t;var o=0;if(i<1){o=(n-i)/(1-i)}return[e[0],i*100,o*100]};s.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};s.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};s.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};s.gray.hsl=s.gray.hsv=function(e){return[0,0,e[0]]};s.gray.hwb=function(e){return[0,100,e[0]]};s.gray.cmyk=function(e){return[0,0,0,e[0]]};s.gray.lab=function(e){return[e[0],0,0]};s.gray.hex=function(e){var t=Math.round(e[0]/100*255)&255;var r=(t<<16)+(t<<8)+t;var n=r.toString(16).toUpperCase();return"000000".substring(n.length)+n};s.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[t/255*100]}},755:(e,t,r)=>{var n=r(461);var i=r(974);var o={};var s=Object.keys(n);function wrapRaw(e){var wrappedFn=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}return e(t)};if("conversion"in e){wrappedFn.conversion=e.conversion}return wrappedFn}function wrapRounded(e){var wrappedFn=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}var r=e(t);if(typeof r==="object"){for(var n=r.length,i=0;i<n;i++){r[i]=Math.round(r[i])}}return r};if("conversion"in e){wrappedFn.conversion=e.conversion}return wrappedFn}s.forEach((function(e){o[e]={};Object.defineProperty(o[e],"channels",{value:n[e].channels});Object.defineProperty(o[e],"labels",{value:n[e].labels});var t=i(e);var r=Object.keys(t);r.forEach((function(r){var n=t[r];o[e][r]=wrapRounded(n);o[e][r].raw=wrapRaw(n)}))}));e.exports=o},974:(e,t,r)=>{var n=r(461);function buildGraph(){var e={};var t=Object.keys(n);for(var r=t.length,i=0;i<r;i++){e[t[i]]={distance:-1,parent:null}}return e}function deriveBFS(e){var t=buildGraph();var r=[e];t[e].distance=0;while(r.length){var i=r.pop();var o=Object.keys(n[i]);for(var s=o.length,a=0;a<s;a++){var c=o[a];var l=t[c];if(l.distance===-1){l.distance=t[i].distance+1;l.parent=i;r.unshift(c)}}}return t}function link(e,t){return function(r){return t(e(r))}}function wrapConversion(e,t){var r=[t[e].parent,e];var i=n[t[e].parent][e];var o=t[e].parent;while(t[o].parent){r.unshift(t[o].parent);i=link(n[t[o].parent][o],i);o=t[o].parent}i.conversion=r;return i}e.exports=function(e){var t=deriveBFS(e);var r={};var n=Object.keys(t);for(var i=n.length,o=0;o<i;o++){var s=n[o];var a=t[s];if(a.parent===null){continue}r[s]=wrapConversion(s,t)}return r}},391:e=>{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},434:e=>{"use strict";var t=/[|\\{}()[\]^$+*?.]/g;e.exports=function(e){if(typeof e!=="string"){throw new TypeError("Expected a string")}return e.replace(t,"\\$&")}},419:e=>{"use strict";e.exports=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const i=t.indexOf("--");return n!==-1&&(i===-1?true:n<i)}},629:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t["default"]=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;t.matchToToken=function(e){var t={type:"invalid",value:e[0],closed:undefined};if(e[1])t.type="string",t.closed=!!(e[3]||e[4]);else if(e[5])t.type="comment";else if(e[6])t.type="comment",t.closed=!!e[7];else if(e[8])t.type="regex";else if(e[9])t.type="number";else if(e[10])t.type="name";else if(e[11])t.type="punctuator";else if(e[12])t.type="whitespace";return t}},302:(e,t,r)=>{"use strict";var n=r(248);class BitSet{constructor(e){this.bits=e instanceof BitSet?e.bits.slice():[]}add(e){this.bits[e>>5]|=1<<(e&31)}has(e){return!!(this.bits[e>>5]&1<<(e&31))}}class Chunk{constructor(e,t,r){this.start=e;this.end=t;this.original=r;this.intro="";this.outro="";this.content=r;this.storeName=false;this.edited=false;{this.previous=null;this.next=null}}appendLeft(e){this.outro+=e}appendRight(e){this.intro=this.intro+e}clone(){const e=new Chunk(this.start,this.end,this.original);e.intro=this.intro;e.outro=this.outro;e.content=this.content;e.storeName=this.storeName;e.edited=this.edited;return e}contains(e){return this.start<e&&e<this.end}eachNext(e){let t=this;while(t){e(t);t=t.next}}eachPrevious(e){let t=this;while(t){e(t);t=t.previous}}edit(e,t,r){this.content=e;if(!r){this.intro="";this.outro=""}this.storeName=t;this.edited=true;return this}prependLeft(e){this.outro=e+this.outro}prependRight(e){this.intro=e+this.intro}split(e){const t=e-this.start;const r=this.original.slice(0,t);const n=this.original.slice(t);this.original=r;const i=new Chunk(e,this.end,n);i.outro=this.outro;this.outro="";this.end=e;if(this.edited){i.edit("",false);this.content=""}else{this.content=r}i.next=this.next;if(i.next)i.next.previous=i;i.previous=this;this.next=i;return i}toString(){return this.intro+this.content+this.outro}trimEnd(e){this.outro=this.outro.replace(e,"");if(this.outro.length)return true;const t=this.content.replace(e,"");if(t.length){if(t!==this.content){this.split(this.start+t.length).edit("",undefined,true)}return true}else{this.edit("",undefined,true);this.intro=this.intro.replace(e,"");if(this.intro.length)return true}}trimStart(e){this.intro=this.intro.replace(e,"");if(this.intro.length)return true;const t=this.content.replace(e,"");if(t.length){if(t!==this.content){this.split(this.end-t.length);this.edit("",undefined,true)}return true}else{this.edit("",undefined,true);this.outro=this.outro.replace(e,"");if(this.outro.length)return true}}}function getBtoa(){if(typeof window!=="undefined"&&typeof window.btoa==="function"){return e=>window.btoa(unescape(encodeURIComponent(e)))}else if(typeof Buffer==="function"){return e=>Buffer.from(e,"utf-8").toString("base64")}else{return()=>{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}}const i=getBtoa();class SourceMap{constructor(e){this.version=3;this.file=e.file;this.sources=e.sources;this.sourcesContent=e.sourcesContent;this.names=e.names;this.mappings=n.encode(e.mappings);if(typeof e.x_google_ignoreList!=="undefined"){this.x_google_ignoreList=e.x_google_ignoreList}}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+i(this.toString())}}function guessIndent(e){const t=e.split("\n");const r=t.filter((e=>/^\t+/.test(e)));const n=t.filter((e=>/^ {2,}/.test(e)));if(r.length===0&&n.length===0){return null}if(r.length>=n.length){return"\t"}const i=n.reduce(((e,t)=>{const r=/^ +/.exec(t)[0].length;return Math.min(r,e)}),Infinity);return new Array(i+1).join(" ")}function getRelativePath(e,t){const r=e.split(/[/\\]/);const n=t.split(/[/\\]/);r.pop();while(r[0]===n[0]){r.shift();n.shift()}if(r.length){let e=r.length;while(e--)r[e]=".."}return r.concat(n).join("/")}const o=Object.prototype.toString;function isObject(e){return o.call(e)==="[object Object]"}function getLocator(e){const t=e.split("\n");const r=[];for(let e=0,n=0;e<t.length;e++){r.push(n);n+=t[e].length+1}return function locate(e){let t=0;let n=r.length;while(t<n){const i=t+n>>1;if(e<r[i]){n=i}else{t=i+1}}const i=t-1;const o=e-r[i];return{line:i,column:o}}}class Mappings{constructor(e){this.hires=e;this.generatedCodeLine=0;this.generatedCodeColumn=0;this.raw=[];this.rawSegments=this.raw[this.generatedCodeLine]=[];this.pending=null}addEdit(e,t,r,n){if(t.length){const t=[this.generatedCodeColumn,e,r.line,r.column];if(n>=0){t.push(n)}this.rawSegments.push(t)}else if(this.pending){this.rawSegments.push(this.pending)}this.advance(t);this.pending=null}addUneditedChunk(e,t,r,n,i){let o=t.start;let s=true;while(o<t.end){if(this.hires||s||i.has(o)){this.rawSegments.push([this.generatedCodeColumn,e,n.line,n.column])}if(r[o]==="\n"){n.line+=1;n.column=0;this.generatedCodeLine+=1;this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0;s=true}else{n.column+=1;this.generatedCodeColumn+=1;s=false}o+=1}this.pending=null}advance(e){if(!e)return;const t=e.split("\n");if(t.length>1){for(let e=0;e<t.length-1;e++){this.generatedCodeLine++;this.raw[this.generatedCodeLine]=this.rawSegments=[]}this.generatedCodeColumn=0}this.generatedCodeColumn+=t[t.length-1].length}}const s="\n";const a={insertLeft:false,insertRight:false,storeName:false};class MagicString{constructor(e,t={}){const r=new Chunk(0,e.length,e);Object.defineProperties(this,{original:{writable:true,value:e},outro:{writable:true,value:""},intro:{writable:true,value:""},firstChunk:{writable:true,value:r},lastChunk:{writable:true,value:r},lastSearchedChunk:{writable:true,value:r},byStart:{writable:true,value:{}},byEnd:{writable:true,value:{}},filename:{writable:true,value:t.filename},indentExclusionRanges:{writable:true,value:t.indentExclusionRanges},sourcemapLocations:{writable:true,value:new BitSet},storedNames:{writable:true,value:{}},indentStr:{writable:true,value:undefined},ignoreList:{writable:true,value:t.ignoreList}});this.byStart[0]=r;this.byEnd[e.length]=r}addSourcemapLocation(e){this.sourcemapLocations.add(e)}append(e){if(typeof e!=="string")throw new TypeError("outro content must be a string");this.outro+=e;return this}appendLeft(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const r=this.byEnd[e];if(r){r.appendLeft(t)}else{this.intro+=t}return this}appendRight(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const r=this.byStart[e];if(r){r.appendRight(t)}else{this.outro+=t}return this}clone(){const e=new MagicString(this.original,{filename:this.filename});let t=this.firstChunk;let r=e.firstChunk=e.lastSearchedChunk=t.clone();while(t){e.byStart[r.start]=r;e.byEnd[r.end]=r;const n=t.next;const i=n&&n.clone();if(i){r.next=i;i.previous=r;r=i}t=n}e.lastChunk=r;if(this.indentExclusionRanges){e.indentExclusionRanges=this.indentExclusionRanges.slice()}e.sourcemapLocations=new BitSet(this.sourcemapLocations);e.intro=this.intro;e.outro=this.outro;return e}generateDecodedMap(e){e=e||{};const t=0;const r=Object.keys(this.storedNames);const n=new Mappings(e.hires);const i=getLocator(this.original);if(this.intro){n.advance(this.intro)}this.firstChunk.eachNext((e=>{const o=i(e.start);if(e.intro.length)n.advance(e.intro);if(e.edited){n.addEdit(t,e.content,o,e.storeName?r.indexOf(e.original):-1)}else{n.addUneditedChunk(t,e,this.original,o,this.sourcemapLocations)}if(e.outro.length)n.advance(e.outro)}));return{file:e.file?e.file.split(/[/\\]/).pop():undefined,sources:[e.source?getRelativePath(e.file||"",e.source):e.file||""],sourcesContent:e.includeContent?[this.original]:undefined,names:r,mappings:n.raw,x_google_ignoreList:this.ignoreList?[t]:undefined}}generateMap(e){return new SourceMap(this.generateDecodedMap(e))}_ensureindentStr(){if(this.indentStr===undefined){this.indentStr=guessIndent(this.original)}}_getRawIndentString(){this._ensureindentStr();return this.indentStr}getIndentString(){this._ensureindentStr();return this.indentStr===null?"\t":this.indentStr}indent(e,t){const r=/^[^\r\n]/gm;if(isObject(e)){t=e;e=undefined}if(e===undefined){this._ensureindentStr();e=this.indentStr||"\t"}if(e==="")return this;t=t||{};const n={};if(t.exclude){const e=typeof t.exclude[0]==="number"?[t.exclude]:t.exclude;e.forEach((e=>{for(let t=e[0];t<e[1];t+=1){n[t]=true}}))}let i=t.indentStart!==false;const replacer=t=>{if(i)return`${e}${t}`;i=true;return t};this.intro=this.intro.replace(r,replacer);let o=0;let s=this.firstChunk;while(s){const t=s.end;if(s.edited){if(!n[o]){s.content=s.content.replace(r,replacer);if(s.content.length){i=s.content[s.content.length-1]==="\n"}}}else{o=s.start;while(o<t){if(!n[o]){const t=this.original[o];if(t==="\n"){i=true}else if(t!=="\r"&&i){i=false;if(o===s.start){s.prependRight(e)}else{this._splitChunk(s,o);s=s.next;s.prependRight(e)}}}o+=1}}o=s.end;s=s.next}this.outro=this.outro.replace(r,replacer);return this}insert(){throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")}insertLeft(e,t){if(!a.insertLeft){console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead");a.insertLeft=true}return this.appendLeft(e,t)}insertRight(e,t){if(!a.insertRight){console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead");a.insertRight=true}return this.prependRight(e,t)}move(e,t,r){if(r>=e&&r<=t)throw new Error("Cannot move a selection inside itself");this._split(e);this._split(t);this._split(r);const n=this.byStart[e];const i=this.byEnd[t];const o=n.previous;const s=i.next;const a=this.byStart[r];if(!a&&i===this.lastChunk)return this;const c=a?a.previous:this.lastChunk;if(o)o.next=s;if(s)s.previous=o;if(c)c.next=n;if(a)a.previous=i;if(!n.previous)this.firstChunk=i.next;if(!i.next){this.lastChunk=n.previous;this.lastChunk.next=null}n.previous=c;i.next=a||null;if(!c)this.firstChunk=n;if(!a)this.lastChunk=i;return this}overwrite(e,t,r,n){n=n||{};return this.update(e,t,r,{...n,overwrite:!n.contentOnly})}update(e,t,r,n){if(typeof r!=="string")throw new TypeError("replacement content must be a string");while(e<0)e+=this.original.length;while(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);if(n===true){if(!a.storeName){console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string");a.storeName=true}n={storeName:true}}const i=n!==undefined?n.storeName:false;const o=n!==undefined?n.overwrite:false;if(i){const r=this.original.slice(e,t);Object.defineProperty(this.storedNames,r,{writable:true,value:true,enumerable:true})}const s=this.byStart[e];const c=this.byEnd[t];if(s){let e=s;while(e!==c){if(e.next!==this.byStart[e.end]){throw new Error("Cannot overwrite across a split point")}e=e.next;e.edit("",false)}s.edit(r,i,!o)}else{const n=new Chunk(e,t,"").edit(r,i);c.next=n;n.previous=c}return this}prepend(e){if(typeof e!=="string")throw new TypeError("outro content must be a string");this.intro=e+this.intro;return this}prependLeft(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const r=this.byEnd[e];if(r){r.prependLeft(t)}else{this.intro=t+this.intro}return this}prependRight(e,t){if(typeof t!=="string")throw new TypeError("inserted content must be a string");this._split(e);const r=this.byStart[e];if(r){r.prependRight(t)}else{this.outro=t+this.outro}return this}remove(e,t){while(e<0)e+=this.original.length;while(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);let r=this.byStart[e];while(r){r.intro="";r.outro="";r.edit("");r=t>r.end?this.byStart[r.end]:null}return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let 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);if(this.intro.length)return this.intro[this.intro.length-1];return""}lastLine(){let e=this.outro.lastIndexOf(s);if(e!==-1)return this.outro.substr(e+1);let t=this.outro;let r=this.lastChunk;do{if(r.outro.length>0){e=r.outro.lastIndexOf(s);if(e!==-1)return r.outro.substr(e+1)+t;t=r.outro+t}if(r.content.length>0){e=r.content.lastIndexOf(s);if(e!==-1)return r.content.substr(e+1)+t;t=r.content+t}if(r.intro.length>0){e=r.intro.lastIndexOf(s);if(e!==-1)return r.intro.substr(e+1)+t;t=r.intro+t}}while(r=r.previous);e=this.intro.lastIndexOf(s);if(e!==-1)return this.intro.substr(e+1)+t;return this.intro+t}slice(e=0,t=this.original.length){while(e<0)e+=this.original.length;while(t<0)t+=this.original.length;let r="";let n=this.firstChunk;while(n&&(n.start>e||n.end<=e)){if(n.start<t&&n.end>=t){return r}n=n.next}if(n&&n.edited&&n.start!==e)throw new Error(`Cannot use replaced character ${e} as slice start anchor.`);const i=n;while(n){if(n.intro&&(i!==n||n.start===e)){r+=n.intro}const o=n.start<t&&n.end>=t;if(o&&n.edited&&n.end!==t)throw new Error(`Cannot use replaced character ${t} as slice end anchor.`);const s=i===n?e-n.start:0;const a=o?n.content.length+t-n.end:n.content.length;r+=n.content.slice(s,a);if(n.outro&&(!o||n.end===t)){r+=n.outro}if(o){break}n=n.next}return r}snip(e,t){const r=this.clone();r.remove(0,e);r.remove(t,r.original.length);return r}_split(e){if(this.byStart[e]||this.byEnd[e])return;let t=this.lastSearchedChunk;const r=e>t.end;while(t){if(t.contains(e))return this._splitChunk(t,e);t=r?this.byStart[t.end]:this.byEnd[t.start]}}_splitChunk(e,t){if(e.edited&&e.content.length){const r=getLocator(this.original)(t);throw new Error(`Cannot split a chunk that has already been edited (${r.line}:${r.column} – "${e.original}")`)}const r=e.split(t);this.byEnd[t]=e;this.byStart[t]=r;this.byEnd[r.end]=r;if(e===this.lastChunk)this.lastChunk=r;this.lastSearchedChunk=e;return true}toString(){let e=this.intro;let t=this.firstChunk;while(t){e+=t.toString();t=t.next}return e+this.outro}isEmpty(){let e=this.firstChunk;do{if(e.intro.length&&e.intro.trim()||e.content.length&&e.content.trim()||e.outro.length&&e.outro.trim())return false}while(e=e.next);return true}length(){let e=this.firstChunk;let t=0;do{t+=e.intro.length+e.content.length+e.outro.length}while(e=e.next);return t}trimLines(){return this.trim("[\\r\\n]")}trim(e){return this.trimStart(e).trimEnd(e)}trimEndAborted(e){const t=new RegExp((e||"\\s")+"+$");this.outro=this.outro.replace(t,"");if(this.outro.length)return true;let r=this.lastChunk;do{const e=r.end;const n=r.trimEnd(t);if(r.end!==e){if(this.lastChunk===r){this.lastChunk=r.next}this.byEnd[r.end]=r;this.byStart[r.next.start]=r.next;this.byEnd[r.next.end]=r.next}if(n)return true;r=r.previous}while(r);return false}trimEnd(e){this.trimEndAborted(e);return this}trimStartAborted(e){const t=new RegExp("^"+(e||"\\s")+"+");this.intro=this.intro.replace(t,"");if(this.intro.length)return true;let r=this.firstChunk;do{const e=r.end;const n=r.trimStart(t);if(r.end!==e){if(r===this.lastChunk)this.lastChunk=r.next;this.byEnd[r.end]=r;this.byStart[r.next.start]=r.next;this.byEnd[r.next.end]=r.next}if(n)return true;r=r.next}while(r);return false}trimStart(e){this.trimStartAborted(e);return this}hasChanged(){return this.original!==this.toString()}_replaceRegexp(e,t){function getReplacement(e,r){if(typeof t==="string"){return t.replace(/\$(\$|&|\d+)/g,((t,r)=>{if(r==="$")return"$";if(r==="&")return e[0];const n=+r;if(n<e.length)return e[+r];return`$${r}`}))}else{return t(...e,e.index,r,e.groups)}}function matchAll(e,t){let r;const n=[];while(r=e.exec(t)){n.push(r)}return n}if(e.global){const t=matchAll(e,this.original);t.forEach((e=>{if(e.index!=null)this.overwrite(e.index,e.index+e[0].length,getReplacement(e,this.original))}))}else{const t=this.original.match(e);if(t&&t.index!=null)this.overwrite(t.index,t.index+t[0].length,getReplacement(t,this.original))}return this}_replaceString(e,t){const{original:r}=this;const n=r.indexOf(e);if(n!==-1){this.overwrite(n,n+e.length,t)}return this}replace(e,t){if(typeof e==="string"){return this._replaceString(e,t)}return this._replaceRegexp(e,t)}_replaceAllString(e,t){const{original:r}=this;const n=e.length;for(let i=r.indexOf(e);i!==-1;i=r.indexOf(e,i+n)){this.overwrite(i,i+n,t)}return this}replaceAll(e,t){if(typeof e==="string"){return this._replaceAllString(e,t)}if(!e.global){throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument")}return this._replaceRegexp(e,t)}}const c=Object.prototype.hasOwnProperty;class Bundle{constructor(e={}){this.intro=e.intro||"";this.separator=e.separator!==undefined?e.separator:"\n";this.sources=[];this.uniqueSources=[];this.uniqueSourceIndexByFilename={}}addSource(e){if(e instanceof MagicString){return this.addSource({content:e,filename:e.filename,separator:this.separator})}if(!isObject(e)||!e.content){throw new Error("bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`")}["filename","ignoreList","indentExclusionRanges","separator"].forEach((t=>{if(!c.call(e,t))e[t]=e.content[t]}));if(e.separator===undefined){e.separator=this.separator}if(e.filename){if(!c.call(this.uniqueSourceIndexByFilename,e.filename)){this.uniqueSourceIndexByFilename[e.filename]=this.uniqueSources.length;this.uniqueSources.push({filename:e.filename,content:e.content.original})}else{const t=this.uniqueSources[this.uniqueSourceIndexByFilename[e.filename]];if(e.content.original!==t.content){throw new Error(`Illegal source: same filename (${e.filename}), different contents`)}}}this.sources.push(e);return this}append(e,t){this.addSource({content:new MagicString(e),separator:t&&t.separator||""});return this}clone(){const e=new Bundle({intro:this.intro,separator:this.separator});this.sources.forEach((t=>{e.addSource({filename:t.filename,content:t.content.clone(),separator:t.separator})}));return e}generateDecodedMap(e={}){const t=[];let r=undefined;this.sources.forEach((e=>{Object.keys(e.content.storedNames).forEach((e=>{if(!~t.indexOf(e))t.push(e)}))}));const n=new Mappings(e.hires);if(this.intro){n.advance(this.intro)}this.sources.forEach(((e,i)=>{if(i>0){n.advance(this.separator)}const o=e.filename?this.uniqueSourceIndexByFilename[e.filename]:-1;const s=e.content;const a=getLocator(s.original);if(s.intro){n.advance(s.intro)}s.firstChunk.eachNext((r=>{const i=a(r.start);if(r.intro.length)n.advance(r.intro);if(e.filename){if(r.edited){n.addEdit(o,r.content,i,r.storeName?t.indexOf(r.original):-1)}else{n.addUneditedChunk(o,r,s.original,i,s.sourcemapLocations)}}else{n.advance(r.content)}if(r.outro.length)n.advance(r.outro)}));if(s.outro){n.advance(s.outro)}if(e.ignoreList&&o!==-1){if(r===undefined){r=[]}r.push(o)}}));return{file:e.file?e.file.split(/[/\\]/).pop():undefined,sources:this.uniqueSources.map((t=>e.file?getRelativePath(e.file,t.filename):t.filename)),sourcesContent:this.uniqueSources.map((t=>e.includeContent?t.content:null)),names:t,mappings:n.raw,x_google_ignoreList:r}}generateMap(e){return new SourceMap(this.generateDecodedMap(e))}getIndentString(){const e={};this.sources.forEach((t=>{const r=t.content._getRawIndentString();if(r===null)return;if(!e[r])e[r]=0;e[r]+=1}));return Object.keys(e).sort(((t,r)=>e[t]-e[r]))[0]||"\t"}indent(e){if(!arguments.length){e=this.getIndentString()}if(e==="")return this;let t=!this.intro||this.intro.slice(-1)==="\n";this.sources.forEach(((r,n)=>{const i=r.separator!==undefined?r.separator:this.separator;const o=t||n>0&&/\r?\n$/.test(i);r.content.indent(e,{exclude:r.indentExclusionRanges,indentStart:o});t=r.content.lastChar()==="\n"}));if(this.intro){this.intro=e+this.intro.replace(/^[^\n]/gm,((t,r)=>r>0?e+t:t))}return this}prepend(e){this.intro=e+this.intro;return this}toString(){const e=this.sources.map(((e,t)=>{const r=e.separator!==undefined?e.separator:this.separator;const n=(t>0?r:"")+e.content.toString();return n})).join("");return this.intro+e}isEmpty(){if(this.intro.length&&this.intro.trim())return false;if(this.sources.some((e=>!e.content.isEmpty())))return false;return true}length(){return this.sources.reduce(((e,t)=>e+t.content.length()),this.intro.length)}trimLines(){return this.trim("[\\r\\n]")}trim(e){return this.trimStart(e).trimEnd(e)}trimStart(e){const t=new RegExp("^"+(e||"\\s")+"+");this.intro=this.intro.replace(t,"");if(!this.intro){let t;let r=0;do{t=this.sources[r++];if(!t){break}}while(!t.content.trimStartAborted(e))}return this}trimEnd(e){const t=new RegExp((e||"\\s")+"+$");let r;let n=this.sources.length-1;do{r=this.sources[n--];if(!r){this.intro=this.intro.replace(t,"");break}}while(!r.content.trimEndAborted(e));return this}}MagicString.Bundle=Bundle;MagicString.SourceMap=SourceMap;MagicString.default=MagicString;e.exports=MagicString},332:(e,t,r)=>{"use strict";const n=r(37);const i=r(419);const o=process.env;let s;if(i("no-color")||i("no-colors")||i("color=false")){s=false}else if(i("color")||i("colors")||i("color=true")||i("color=always")){s=true}if("FORCE_COLOR"in o){s=o.FORCE_COLOR.length===0||parseInt(o.FORCE_COLOR,10)!==0}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(s===false){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!e.isTTY&&s!==true){return 0}const t=s?1:0;if(process.platform==="win32"){const e=n.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in o){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in o))||o.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in o){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0}if(o.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in o){const e=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(o.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)){return 1}if("COLORTERM"in o){return 1}if(o.TERM==="dumb"){return t}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},188:e=>{"use strict";e.exports=require("module")},37:e=>{"use strict";e.exports=require("os")},17:e=>{"use strict";e.exports=require("path")},440:e=>{"use strict";e.exports=require("typescript")},310:e=>{"use strict";e.exports=require("url")},528:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.codeFrameColumns=codeFrameColumns;t["default"]=_default;var n=r(505);let i=false;function getDefs(e){return{gutter:e.grey,marker:e.red.bold,message:e.red.bold}}const o=/\r\n|[\n\r\u2028\u2029]/;function getMarkerLines(e,t,r){const n=Object.assign({column:0,line:-1},e.start);const i=Object.assign({},n,e.end);const{linesAbove:o=2,linesBelow:s=3}=r||{};const a=n.line;const c=n.column;const l=i.line;const u=i.column;let f=Math.max(a-(o+1),0);let d=Math.min(t.length,l+s);if(a===-1){f=0}if(l===-1){d=t.length}const h=l-a;const p={};if(h){for(let e=0;e<=h;e++){const r=e+a;if(!c){p[r]=true}else if(e===0){const e=t[r-1].length;p[r]=[c,e-c+1]}else if(e===h){p[r]=[0,u]}else{const n=t[r-e].length;p[r]=[0,n]}}}else{if(c===u){if(c){p[a]=[c,0]}else{p[a]=true}}else{p[a]=[c,u-c]}}return{start:f,end:d,markerLines:p}}function codeFrameColumns(e,t,r={}){const i=(r.highlightCode||r.forceColor)&&(0,n.shouldHighlight)(r);const s=(0,n.getChalk)(r);const a=getDefs(s);const maybeHighlight=(e,t)=>i?e(t):t;const c=e.split(o);const{start:l,end:u,markerLines:f}=getMarkerLines(t,c,r);const d=t.start&&typeof t.start.column==="number";const h=String(u).length;const p=i?(0,n.default)(e,r):e;let g=p.split(o,u).slice(l,u).map(((e,t)=>{const n=l+1+t;const i=` ${n}`.slice(-h);const o=` ${i} |`;const s=f[n];const c=!f[n+1];if(s){let t="";if(Array.isArray(s)){const n=e.slice(0,Math.max(s[0]-1,0)).replace(/[^\t]/g," ");const i=s[1]||1;t=["\n ",maybeHighlight(a.gutter,o.replace(/\d/g," "))," ",n,maybeHighlight(a.marker,"^").repeat(i)].join("");if(c&&r.message){t+=" "+maybeHighlight(a.message,r.message)}}return[maybeHighlight(a.marker,">"),maybeHighlight(a.gutter,o),e.length>0?` ${e}`:"",t].join("")}else{return` ${maybeHighlight(a.gutter,o)}${e.length>0?` ${e}`:""}`}})).join("\n");if(r.message&&!d){g=`${" ".repeat(h+1)}${r.message}\n${g}`}if(i){return s.reset(g)}else{return g}}function _default(e,t,r,n={}){if(!i){i=true;const e="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning){process.emitWarning(e,"DeprecationWarning")}else{const t=new Error(e);t.name="DeprecationWarning";console.warn(new Error(e))}}r=Math.max(r,0);const o={start:{column:r,line:t}};return codeFrameColumns(e,o,n)}},266:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isIdentifierChar=isIdentifierChar;t.isIdentifierName=isIdentifierName;t.isIdentifierStart=isIdentifierStart;let r="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";let n="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_";const i=new RegExp("["+r+"]");const o=new RegExp("["+r+n+"]");r=n=null;const s=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,3104,541,1507,4938,6,4191];const a=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];function isInAstralSet(e,t){let r=65536;for(let n=0,i=t.length;n<i;n+=2){r+=t[n];if(r>e)return false;r+=t[n+1];if(r>=e)return true}return false}function isIdentifierStart(e){if(e<65)return e===36;if(e<=90)return true;if(e<97)return e===95;if(e<=122)return true;if(e<=65535){return e>=170&&i.test(String.fromCharCode(e))}return isInAstralSet(e,s)}function isIdentifierChar(e){if(e<48)return e===36;if(e<58)return true;if(e<65)return false;if(e<=90)return true;if(e<97)return e===95;if(e<=122)return true;if(e<=65535){return e>=170&&o.test(String.fromCharCode(e))}return isInAstralSet(e,s)||isInAstralSet(e,a)}function isIdentifierName(e){let t=true;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if((n&64512)===55296&&r+1<e.length){const t=e.charCodeAt(++r);if((t&64512)===56320){n=65536+((n&1023)<<10)+(t&1023)}}if(t){t=false;if(!isIdentifierStart(n)){return false}}else if(!isIdentifierChar(n)){return false}}return!t}},740:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});Object.defineProperty(t,"isIdentifierChar",{enumerable:true,get:function(){return n.isIdentifierChar}});Object.defineProperty(t,"isIdentifierName",{enumerable:true,get:function(){return n.isIdentifierName}});Object.defineProperty(t,"isIdentifierStart",{enumerable:true,get:function(){return n.isIdentifierStart}});Object.defineProperty(t,"isKeyword",{enumerable:true,get:function(){return i.isKeyword}});Object.defineProperty(t,"isReservedWord",{enumerable:true,get:function(){return i.isReservedWord}});Object.defineProperty(t,"isStrictBindOnlyReservedWord",{enumerable:true,get:function(){return i.isStrictBindOnlyReservedWord}});Object.defineProperty(t,"isStrictBindReservedWord",{enumerable:true,get:function(){return i.isStrictBindReservedWord}});Object.defineProperty(t,"isStrictReservedWord",{enumerable:true,get:function(){return i.isStrictReservedWord}});var n=r(266);var i=r(563)},563:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isKeyword=isKeyword;t.isReservedWord=isReservedWord;t.isStrictBindOnlyReservedWord=isStrictBindOnlyReservedWord;t.isStrictBindReservedWord=isStrictBindReservedWord;t.isStrictReservedWord=isStrictReservedWord;const r={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]};const n=new Set(r.keyword);const i=new Set(r.strict);const o=new Set(r.strictBind);function isReservedWord(e,t){return t&&e==="await"||e==="enum"}function isStrictReservedWord(e,t){return isReservedWord(e,t)||i.has(e)}function isStrictBindOnlyReservedWord(e){return o.has(e)}function isStrictBindReservedWord(e,t){return isStrictReservedWord(e,t)||isStrictBindOnlyReservedWord(e)}function isKeyword(e){return n.has(e)}},505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=highlight;t.getChalk=getChalk;t.shouldHighlight=shouldHighlight;var n=r(629);var i=r(740);var o=r(673);const s=new Set(["as","async","from","get","of","set"]);function getDefs(e){return{keyword:e.cyan,capitalized:e.yellow,jsxIdentifier:e.yellow,punctuator:e.yellow,number:e.magenta,string:e.green,regex:e.magenta,comment:e.grey,invalid:e.white.bgRed.bold}}const a=/\r\n|[\n\r\u2028\u2029]/;const c=/^[()[\]{}]$/;let l;{const e=/^[a-z][\w-]*$/i;const getTokenType=function(t,r,n){if(t.type==="name"){if((0,i.isKeyword)(t.value)||(0,i.isStrictReservedWord)(t.value,true)||s.has(t.value)){return"keyword"}if(e.test(t.value)&&(n[r-1]==="<"||n.slice(r-2,r)=="</")){return"jsxIdentifier"}if(t.value[0]!==t.value[0].toLowerCase()){return"capitalized"}}if(t.type==="punctuator"&&c.test(t.value)){return"bracket"}if(t.type==="invalid"&&(t.value==="@"||t.value==="#")){return"punctuator"}return t.type};l=function*(e){let t;while(t=n.default.exec(e)){const r=n.matchToToken(t);yield{type:getTokenType(r,t.index,e),value:r.value}}}}function highlightTokens(e,t){let r="";for(const{type:n,value:i}of l(t)){const t=e[n];if(t){r+=i.split(a).map((e=>t(e))).join("\n")}else{r+=i}}return r}function shouldHighlight(e){return!!o.supportsColor||e.forceColor}function getChalk(e){return e.forceColor?new o.constructor({enabled:true,level:1}):o}function highlight(e,t={}){if(e!==""&&shouldHighlight(t)){const r=getChalk(t);const n=getDefs(r);return highlightTokens(n,e)}else{return e}}}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var i=t[r]={id:r,loaded:false,exports:{}};var o=true;try{e[r].call(i.exports,i,i.exports,__nccwpck_require__);o=false}finally{if(o)delete t[r]}i.loaded=true;return i.exports}(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r={};(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:true});var t=__nccwpck_require__(17);var n=__nccwpck_require__(440);var i=__nccwpck_require__(188);var o=__nccwpck_require__(302);function _interopNamespaceDefault(e){var t=Object.create(null);if(e){Object.keys(e).forEach((function(r){if(r!=="default"){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:true,get:function(){return e[r]}})}}))}t.default=e;return Object.freeze(t)}var s=_interopNamespaceDefault(t);function resolveDefaultOptions(e){return{...e,compilerOptions:e.compilerOptions??{},respectExternal:e.respectExternal??false}}const a=/\.d\.(c|m)?tsx?$/;const c=".d.ts";const l={getCurrentDirectory:()=>n.sys.getCurrentDirectory(),getNewLine:()=>n.sys.newLine,getCanonicalFileName:n.sys.useCaseSensitiveFileNames?e=>e:e=>e.toLowerCase()};const u={declaration:true,noEmit:false,emitDeclarationOnly:true,noEmitOnError:true,checkJs:false,declarationMap:false,skipLibCheck:true,preserveSymlinks:true,target:n.ScriptTarget.ESNext};const f=new Map;const logCache=(...e)=>process.env.DTS_LOG_CACHE?console.log("[cache]",...e):null;function cacheConfig([e,t],r){logCache(e);f.set(e,r);while(e!==t&&e!==s.dirname(e)){e=s.dirname(e);logCache("up",e);if(f.has(e))return logCache("has",e);f.set(e,r)}}function getCompilerOptions(e,t,r){const i={...u,...t};let o=s.dirname(e);let c=[];const d=r||o;if(!f.has(d)){logCache("miss",d);const e=r?s.resolve(process.cwd(),r):n.findConfigFile(o,n.sys.fileExists);if(!e){return{dtsFiles:c,dirName:o,compilerOptions:i}}let t=o;o=s.dirname(e);const{config:a,error:u}=n.readConfigFile(e,n.sys.readFile);if(u){console.error(n.formatDiagnostic(u,l));return{dtsFiles:c,dirName:o,compilerOptions:i}}logCache("tsconfig",a);const f=n.parseJsonConfigFileContent(a,n.sys,o);if(r){cacheConfig([r,r],f)}else{cacheConfig([t,o],f)}}else{logCache("HIT",d)}const{fileNames:h,options:p,errors:g}=f.get(d);c=h.filter((e=>a.test(e)));if(g.length){console.error(n.formatDiagnostics(g,l));return{dtsFiles:c,dirName:o,compilerOptions:i}}return{dtsFiles:c,dirName:o,compilerOptions:{...p,...i}}}function createProgram$1(e,t,r){const{dtsFiles:i,compilerOptions:o}=getCompilerOptions(e,t,r);return n.createProgram([e].concat(Array.from(i)),o,n.createCompilerHost(o,true))}function createPrograms(e,t,r){const i=[];let o=[];let c=new Set;let l="";let u={};for(let f of e){if(a.test(f)){continue}f=s.resolve(f);const e=getCompilerOptions(f,t,r);e.dtsFiles.forEach(c.add,c);if(!o.length){o.push(f);({dirName:l,compilerOptions:u}=e);continue}if(e.dirName===l){o.push(f)}else{const t=n.createCompilerHost(u,true);const r=n.createProgram(o.concat(Array.from(c)),u,t);i.push(r);o=[f];({dirName:l,compilerOptions:u}=e)}}if(o.length){const e=n.createCompilerHost(u,true);const t=n.createProgram(o.concat(Array.from(c)),u,e);i.push(t)}return i}function getCodeFrame(){let e=undefined;try{({codeFrameColumns:e}=__nccwpck_require__(528));return e}catch{try{const t=i.createRequire(typeof document==="undefined"?__nccwpck_require__(310).pathToFileURL(__filename).href:document.currentScript&&document.currentScript.src||new URL("rollup-plugin-dts.cjs",document.baseURI).href);({codeFrameColumns:e}=t("@babel/code-frame"));return e}catch{}}return undefined}function getLocation(e){const t=e.getSourceFile();const r=t.getLineAndCharacterOfPosition(e.getStart());const n=t.getLineAndCharacterOfPosition(e.getEnd());return{start:{line:r.line+1,column:r.character+1},end:{line:n.line+1,column:n.character+1}}}function frameNode(e){const t=getCodeFrame();const r=e.getSourceFile();const n=r.getFullText();const i=getLocation(e);if(t){return"\n"+t(n,i,{highlightCode:true})}else{return`\n${i.start.line}:${i.start.column}: \`${e.getFullText().trim()}\``}}class UnsupportedSyntaxError extends Error{constructor(e,t="Syntax not yet supported"){super(`${t}\n${frameNode(e)}`)}}class NamespaceFixer{constructor(e){this.sourceFile=e}findNamespaces(){const e=[];const t={};for(const r of this.sourceFile.statements){const i={start:r.getStart(),end:r.getEnd()};if(n.isEmptyStatement(r)){e.unshift({name:"",exports:[],location:i});continue}if((n.isImportDeclaration(r)||n.isExportDeclaration(r))&&r.moduleSpecifier&&n.isStringLiteral(r.moduleSpecifier)){let{text:t}=r.moduleSpecifier;if(t.startsWith(".")&&(t.endsWith(".d.ts")||t.endsWith(".d.cts")||t.endsWith(".d.mts"))){let n=r.moduleSpecifier.getStart()+1;let i=r.moduleSpecifier.getEnd()-1;e.unshift({name:"",exports:[],location:{start:n,end:i},textBeforeCodeAfter:t.replace(/\.d\.ts$/,".js").replace(/\.d\.cts$/,".cjs").replace(/\.d\.mts$/,".mjs")})}}if(n.isModuleDeclaration(r)&&r.body&&n.isModuleBlock(r.body)){for(const t of r.body.statements){if(n.isExportDeclaration(t)&&t.exportClause){if(n.isNamespaceExport(t.exportClause)){continue}for(const r of t.exportClause.elements){if(r.propertyName&&r.propertyName.getText()==r.name.getText()){e.unshift({name:"",exports:[],location:{start:r.propertyName.getEnd(),end:r.name.getEnd()}})}}}}}if(n.isClassDeclaration(r)){t[r.name.getText()]={type:"class",generics:r.typeParameters}}else if(n.isFunctionDeclaration(r)){t[r.name.getText()]={type:"function"}}else if(n.isInterfaceDeclaration(r)){t[r.name.getText()]={type:"interface",generics:r.typeParameters}}else if(n.isTypeAliasDeclaration(r)){t[r.name.getText()]={type:"type",generics:r.typeParameters}}else if(n.isModuleDeclaration(r)&&n.isIdentifier(r.name)){t[r.name.getText()]={type:"namespace"}}else if(n.isEnumDeclaration(r)){t[r.name.getText()]={type:"enum"}}if(!n.isVariableStatement(r)){continue}const{declarations:o}=r.declarationList;if(o.length!==1){continue}const s=o[0];const a=s.name.getText();if(!s.initializer||!n.isCallExpression(s.initializer)){t[a]={type:"var"};continue}const c=s.initializer.arguments[0];if(!s.initializer.expression.getFullText().includes("/*#__PURE__*/Object.freeze")||!n.isObjectLiteralExpression(c)){continue}const l=[];for(const e of c.properties){if(!n.isPropertyAssignment(e)||!(n.isIdentifier(e.name)||n.isStringLiteral(e.name))||e.name.text!=="__proto__"&&!n.isIdentifier(e.initializer)){throw new UnsupportedSyntaxError(e,"Expected a property assignment")}if(e.name.text==="__proto__"){continue}l.push({exportedName:e.name.text,localName:e.initializer.getText()})}e.unshift({name:a,exports:l,location:i})}return{namespaces:e,itemTypes:t}}fix(){let e=this.sourceFile.getFullText();const{namespaces:t,itemTypes:r}=this.findNamespaces();for(const n of t){const t=e.slice(n.location.end);e=e.slice(0,n.location.start);for(const{exportedName:t,localName:i}of n.exports){if(t===i){const{type:o,generics:s}=r[i]||{};if(o==="interface"||o==="type"){const r=renderTypeParams(s);e+=`type ${n.name}_${t}${r.in} = ${i}${r.out};\n`}else if(o==="enum"||o==="class"){const r=renderTypeParams(s);e+=`type ${n.name}_${t}${r.in} = ${i}${r.out};\n`;e+=`declare const ${n.name}_${t}: typeof ${i};\n`}else{e+=`declare const ${n.name}_${t}: typeof ${i};\n`}}}if(n.name){e+=`declare namespace ${n.name} {\n`;e+=` export {\n`;for(const{exportedName:t,localName:r}of n.exports){if(t===r){e+=` ${n.name}_${t} as ${t},\n`}else{e+=` ${r} as ${t},\n`}}e+=` };\n`;e+=`}`}e+=n.textBeforeCodeAfter??"";e+=t}return e}}function renderTypeParams(e){if(!e||!e.length){return{in:"",out:""}}return{in:`<${e.map((e=>e.getText())).join(", ")}>`,out:`<${e.map((e=>e.name.getText())).join(", ")}>`}}let d=1;function createProgram(e){return withStartEnd({type:"Program",sourceType:"module",body:[]},{start:e.getFullStart(),end:e.getEnd()})}function createReference(e){const t={type:"Identifier",name:String(d++)};return{ident:t,expr:{type:"AssignmentPattern",left:t,right:e}}}function createIdentifier(e){return withStartEnd({type:"Identifier",name:e.getText()},e)}function createIIFE(e){const t=withStartEnd({type:"FunctionExpression",id:null,params:[],body:{type:"BlockStatement",body:[]}},e);const r=withStartEnd({type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:String(d++)},arguments:[t],optional:false}},e);return{fn:t,iife:r}}function createReturn(){const e={type:"ArrayExpression",elements:[]};return{expr:e,stmt:{type:"ReturnStatement",argument:e}}}function createDeclaration(e,t){return withStartEnd({type:"FunctionDeclaration",id:withStartEnd({type:"Identifier",name:n.idText(e)},e),params:[],body:{type:"BlockStatement",body:[]}},t)}function convertExpression(e){if(n.isLiteralExpression(e)){return{type:"Literal",value:e.text}}if(n.isPropertyAccessExpression(e)){if(n.isPrivateIdentifier(e.name)){throw new UnsupportedSyntaxError(e.name)}return withStartEnd({type:"MemberExpression",computed:false,optional:false,object:convertExpression(e.expression),property:convertExpression(e.name)},{start:e.expression.getStart(),end:e.name.getEnd()})}if(n.isIdentifier(e)){return createIdentifier(e)}else if(e.kind==n.SyntaxKind.NullKeyword){return{type:"Literal",value:null}}else{throw new UnsupportedSyntaxError(e)}}function withStartEnd(e,t){let r="start"in t?t:{start:t.getStart(),end:t.getEnd()};return Object.assign(e,r)}function matchesModifier(e,t){const r=n.getCombinedModifierFlags(e);return(r&t)===t}function preProcess({sourceFile:e}){const t=new o(e.getFullText());const r=new Set;const i=new Set;let s="";const a=new Map;const c=new Map;for(const o of e.statements){if(n.isEmptyStatement(o)){t.remove(o.getStart(),o.getEnd());continue}if(n.isEnumDeclaration(o)||n.isFunctionDeclaration(o)||n.isInterfaceDeclaration(o)||n.isClassDeclaration(o)||n.isTypeAliasDeclaration(o)||n.isModuleDeclaration(o)){if(o.name){const e=o.name.getText();r.add(e);if(matchesModifier(o,n.ModifierFlags.ExportDefault)){s=e}else if(matchesModifier(o,n.ModifierFlags.Export)){i.add(e)}if(!(o.flags&n.NodeFlags.GlobalAugmentation)){pushNamedNode(e,[getStart(o),getEnd(o)])}}if(n.isModuleDeclaration(o)){duplicateExports(t,o)}fixModifiers(t,o)}else if(n.isVariableStatement(o)){const{declarations:e}=o.declarationList;const s=matchesModifier(o,n.ModifierFlags.Export);for(const e of o.declarationList.declarations){if(n.isIdentifier(e.name)){const t=e.name.getText();r.add(t);if(s){i.add(t)}}}fixModifiers(t,o);if(e.length==1){const t=e[0];if(n.isIdentifier(t.name)){pushNamedNode(t.name.getText(),[getStart(o),getEnd(o)])}}else{const t=e.slice();const r=t.shift();pushNamedNode(r.name.getText(),[getStart(o),r.getEnd()]);for(const e of t){if(n.isIdentifier(e.name)){pushNamedNode(e.name.getText(),[e.getFullStart(),e.getEnd()])}}}const{flags:a}=o.declarationList;const c=a&n.NodeFlags.Let?"let":a&n.NodeFlags.Const?"const":"var";const l=`declare ${c} `;const u=o.declarationList.getChildren().find((e=>e.kind===n.SyntaxKind.SyntaxList)).getChildren();let f=0;for(const e of u){if(e.kind===n.SyntaxKind.CommaToken){f=e.getStart();t.remove(f,e.getEnd())}else if(f){t.appendLeft(f,";\n");const r=e.getFullStart();const n=t.slice(r,e.getStart());let i=n.length-n.trimStart().length;if(i){t.overwrite(r,r+i,l)}else{t.appendLeft(r,l)}}}}}for(const r of e.statements){checkInlineImport(r);if(!matchesModifier(r,n.ModifierFlags.ExportDefault)){continue}if(n.isFunctionDeclaration(r)||n.isClassDeclaration(r)){if(r.name){continue}if(!s){s=uniqName("export_default")}const e=r.getChildren();const i=e.findIndex((e=>e.kind===n.SyntaxKind.ClassKeyword||e.kind===n.SyntaxKind.FunctionKeyword));const o=e[i];const a=e[i+1];const c=a.kind>=n.SyntaxKind.FirstPunctuation&&a.kind<=n.SyntaxKind.LastPunctuation;if(c){t.appendLeft(a.getStart(),s)}else{t.appendRight(o.getEnd(),` ${s}`)}}}for(const e of c.values()){const r=e.pop();const n=r[0];for(const r of e){t.move(r[0],r[1],n)}}if(s){t.append(`\nexport default ${s};\n`)}if(i.size){t.append(`\nexport { ${[...i].join(", ")} };\n`)}for(const[e,r]of a.entries()){t.prepend(`import * as ${r} from "${e}";\n`)}const l=e.getLineStarts();const u=new Set;for(const r of e.typeReferenceDirectives){u.add(r.fileName);const{line:n}=e.getLineAndCharacterOfPosition(r.pos);const i=l[n];let o=e.getLineEndOfPosition(r.pos);if(t.slice(o,o+1)=="\n"){o+=1}t.remove(i,o)}const f=new Set;for(const r of e.referencedFiles){f.add(r.fileName);const{line:n}=e.getLineAndCharacterOfPosition(r.pos);const i=l[n];let o=e.getLineEndOfPosition(r.pos);if(t.slice(o,o+1)=="\n"){o+=1}t.remove(i,o)}return{code:t,typeReferences:u,fileReferences:f};function checkInlineImport(e){n.forEachChild(e,checkInlineImport);if(n.isImportTypeNode(e)){if(!n.isLiteralTypeNode(e.argument)||!n.isStringLiteral(e.argument.literal)){throw new UnsupportedSyntaxError(e,"inline imports should have a literal argument")}const r=e.argument.literal.text;const i=e.getChildren();const o=i.find((e=>e.kind===n.SyntaxKind.ImportKeyword)).getStart();let s=e.getEnd();const a=i.find((e=>e.kind===n.SyntaxKind.DotToken||e.kind===n.SyntaxKind.LessThanToken));if(a){s=a.getStart()}const c=createNamespaceImport(r);t.overwrite(o,s,c)}}function createNamespaceImport(e){let t=a.get(e);if(!t){t=uniqName(e.replace(/[^a-zA-Z0-9_$]/g,(()=>"_")));a.set(e,t)}return t}function uniqName(e){let t=e;while(r.has(t)){t=`_${t}`}r.add(t);return t}function pushNamedNode(e,t){let r=c.get(e);if(!r){r=[t];c.set(e,r)}else{const e=r[r.length-1];if(e[1]===t[0]){e[1]=t[1]}else{r.push(t)}}}}function fixModifiers(e,t){if(!n.canHaveModifiers(t)){return}let r=false;const i=n.isEnumDeclaration(t)||n.isClassDeclaration(t)||n.isFunctionDeclaration(t)||n.isModuleDeclaration(t)||n.isVariableStatement(t);for(const i of t.modifiers??[]){switch(i.kind){case n.SyntaxKind.ExportKeyword:case n.SyntaxKind.DefaultKeyword:e.remove(i.getStart(),i.getEnd()+1);break;case n.SyntaxKind.DeclareKeyword:r=true}}if(i&&!r){e.appendRight(t.getStart(),"declare ")}}function duplicateExports(e,t){if(!t.body||!n.isModuleBlock(t.body)){return}for(const r of t.body.statements){if(n.isExportDeclaration(r)&&r.exportClause){if(n.isNamespaceExport(r.exportClause)){continue}for(const t of r.exportClause.elements){if(!t.propertyName){e.appendLeft(t.name.getEnd(),` as ${t.name.getText()}`)}}}}}function getStart(e){const t=e.getFullStart();return t+(newlineAt(e,t)?1:0)}function getEnd(e){const t=e.getEnd();return t+(newlineAt(e,t)?1:0)}function newlineAt(e,t){return e.getSourceFile().getFullText()[t]=="\n"}const h=new Set([n.SyntaxKind.LiteralType,n.SyntaxKind.VoidKeyword,n.SyntaxKind.UnknownKeyword,n.SyntaxKind.AnyKeyword,n.SyntaxKind.BooleanKeyword,n.SyntaxKind.NumberKeyword,n.SyntaxKind.StringKeyword,n.SyntaxKind.ObjectKeyword,n.SyntaxKind.NullKeyword,n.SyntaxKind.UndefinedKeyword,n.SyntaxKind.SymbolKeyword,n.SyntaxKind.NeverKeyword,n.SyntaxKind.ThisKeyword,n.SyntaxKind.ThisType,n.SyntaxKind.BigIntKeyword]);class DeclarationScope{constructor({id:e,range:t}){this.scopes=[];if(e){this.declaration=createDeclaration(e,t)}else{const{iife:e,fn:r}=createIIFE(t);this.iife=e;this.declaration=r}const r=createReturn();this.declaration.body.body.push(r.stmt);this.returnExpr=r.expr}pushScope(){this.scopes.push(new Set)}popScope(e=1){for(let t=0;t<e;t++){this.scopes.pop()}}pushTypeVariable(e){const t=e.getText();this.scopes[this.scopes.length-1]?.add(t)}pushReference(e){let t;if(e.type==="Identifier"){t=e.name}else if(e.type==="MemberExpression"){if(e.object.type==="Identifier"){t=e.object.name}}if(t){for(const e of this.scopes){if(e.has(t)){return}}}const{ident:r,expr:n}=createReference(e);this.declaration.params.push(n);this.returnExpr.elements.push(r)}pushIdentifierReference(e){this.pushReference(createIdentifier(e))}convertEntityName(e){if(n.isIdentifier(e)){return createIdentifier(e)}return withStartEnd({type:"MemberExpression",computed:false,optional:false,object:this.convertEntityName(e.left),property:createIdentifier(e.right)},e)}convertPropertyAccess(e){if(!n.isIdentifier(e.expression)&&!n.isPropertyAccessExpression(e.expression)){throw new UnsupportedSyntaxError(e.expression)}if(n.isPrivateIdentifier(e.name)){throw new UnsupportedSyntaxError(e.name)}let t=n.isIdentifier(e.expression)?createIdentifier(e.expression):this.convertPropertyAccess(e.expression);return withStartEnd({type:"MemberExpression",computed:false,optional:false,object:t,property:createIdentifier(e.name)},e)}convertComputedPropertyName(e){if(!e.name||!n.isComputedPropertyName(e.name)){return}const{expression:t}=e.name;if(n.isLiteralExpression(t)||n.isPrefixUnaryExpression(t)){return}if(n.isIdentifier(t)){return this.pushReference(createIdentifier(t))}if(n.isPropertyAccessExpression(t)){return this.pushReference(this.convertPropertyAccess(t))}throw new UnsupportedSyntaxError(t)}convertParametersAndType(e){this.convertComputedPropertyName(e);const t=this.convertTypeParameters(e.typeParameters);for(const t of e.parameters){this.convertTypeNode(t.type)}this.convertTypeNode(e.type);this.popScope(t)}convertHeritageClauses(e){for(const t of e.heritageClauses||[]){for(const e of t.types){this.pushReference(convertExpression(e.expression));this.convertTypeArguments(e)}}}convertTypeArguments(e){if(!e.typeArguments){return}for(const t of e.typeArguments){this.convertTypeNode(t)}}convertMembers(e){for(const t of e){if(n.isPropertyDeclaration(t)||n.isPropertySignature(t)||n.isIndexSignatureDeclaration(t)){if(n.isPropertyDeclaration(t)&&t.initializer&&n.isPropertyAccessExpression(t.initializer)){this.pushReference(this.convertPropertyAccess(t.initializer))}this.convertComputedPropertyName(t);this.convertTypeNode(t.type);continue}if(n.isMethodDeclaration(t)||n.isMethodSignature(t)||n.isConstructorDeclaration(t)||n.isConstructSignatureDeclaration(t)||n.isCallSignatureDeclaration(t)||n.isGetAccessorDeclaration(t)||n.isSetAccessorDeclaration(t)){this.convertParametersAndType(t)}else{throw new UnsupportedSyntaxError(t)}}}convertTypeParameters(e){if(!e){return 0}for(const t of e){this.convertTypeNode(t.constraint);this.convertTypeNode(t.default);this.pushScope();this.pushTypeVariable(t.name)}return e.length}convertTypeNode(e){if(!e){return}if(h.has(e.kind)){return}if(n.isTypeReferenceNode(e)){this.pushReference(this.convertEntityName(e.typeName));this.convertTypeArguments(e);return}if(n.isTypeLiteralNode(e)){return this.convertMembers(e.members)}if(n.isArrayTypeNode(e)){return this.convertTypeNode(e.elementType)}if(n.isTupleTypeNode(e)){for(const t of e.elements){this.convertTypeNode(t)}return}if(n.isNamedTupleMember(e)||n.isParenthesizedTypeNode(e)||n.isTypeOperatorNode(e)||n.isTypePredicateNode(e)){return this.convertTypeNode(e.type)}if(n.isUnionTypeNode(e)||n.isIntersectionTypeNode(e)){for(const t of e.types){this.convertTypeNode(t)}return}if(n.isMappedTypeNode(e)){const{typeParameter:t,type:r,nameType:n}=e;this.convertTypeNode(t.constraint);this.pushScope();this.pushTypeVariable(t.name);this.convertTypeNode(r);if(n){this.convertTypeNode(n)}this.popScope();return}if(n.isConditionalTypeNode(e)){this.convertTypeNode(e.checkType);this.pushScope();this.convertTypeNode(e.extendsType);this.convertTypeNode(e.trueType);this.convertTypeNode(e.falseType);this.popScope();return}if(n.isIndexedAccessTypeNode(e)){this.convertTypeNode(e.objectType);this.convertTypeNode(e.indexType);return}if(n.isFunctionOrConstructorTypeNode(e)){this.convertParametersAndType(e);return}if(n.isTypeQueryNode(e)){this.pushReference(this.convertEntityName(e.exprName));return}if(n.isRestTypeNode(e)){this.convertTypeNode(e.type);return}if(n.isOptionalTypeNode(e)){this.convertTypeNode(e.type);return}if(n.isTemplateLiteralTypeNode(e)){for(const t of e.templateSpans){this.convertTypeNode(t.type)}return}if(n.isInferTypeNode(e)){const{typeParameter:t}=e;this.convertTypeNode(t.constraint);this.pushTypeVariable(t.name);return}else{throw new UnsupportedSyntaxError(e)}}convertNamespace(e,t=false){this.pushScope();if(t&&e.body&&n.isModuleDeclaration(e.body)){this.convertNamespace(e.body,true);return}if(!e.body||!n.isModuleBlock(e.body)){throw new UnsupportedSyntaxError(e,`namespace must have a "ModuleBlock" body.`)}const{statements:r}=e.body;for(const e of r){if(n.isEnumDeclaration(e)||n.isFunctionDeclaration(e)||n.isClassDeclaration(e)||n.isInterfaceDeclaration(e)||n.isTypeAliasDeclaration(e)||n.isModuleDeclaration(e)){if(e.name&&n.isIdentifier(e.name)){this.pushTypeVariable(e.name)}else{throw new UnsupportedSyntaxError(e,`non-Identifier name not supported`)}continue}if(n.isVariableStatement(e)){for(const t of e.declarationList.declarations){if(n.isIdentifier(t.name)){this.pushTypeVariable(t.name)}else{throw new UnsupportedSyntaxError(t,`non-Identifier name not supported`)}}continue}if(n.isExportDeclaration(e));else{throw new UnsupportedSyntaxError(e,`namespace child (hoisting) not supported yet`)}}for(const e of r){if(n.isVariableStatement(e)){for(const t of e.declarationList.declarations){if(t.type){this.convertTypeNode(t.type)}}continue}if(n.isFunctionDeclaration(e)){this.convertParametersAndType(e);continue}if(n.isInterfaceDeclaration(e)||n.isClassDeclaration(e)){const t=this.convertTypeParameters(e.typeParameters);this.convertHeritageClauses(e);this.convertMembers(e.members);this.popScope(t);continue}if(n.isTypeAliasDeclaration(e)){const t=this.convertTypeParameters(e.typeParameters);this.convertTypeNode(e.type);this.popScope(t);continue}if(n.isModuleDeclaration(e)){this.convertNamespace(e,t);continue}if(n.isEnumDeclaration(e)){continue}if(n.isExportDeclaration(e)){if(e.exportClause){if(n.isNamespaceExport(e.exportClause)){throw new UnsupportedSyntaxError(e.exportClause)}for(const t of e.exportClause.elements){const e=t.propertyName||t.name;this.pushIdentifierReference(e)}}}else{throw new UnsupportedSyntaxError(e,`namespace child (walking) not supported yet`)}}this.popScope()}}function convert({sourceFile:e}){const t=new Transformer(e);return t.transform()}class Transformer{constructor(e){this.sourceFile=e;this.declarations=new Map;this.ast=createProgram(e);for(const t of e.statements){this.convertStatement(t)}}transform(){return{ast:this.ast}}pushStatement(e){this.ast.body.push(e)}createDeclaration(e,t){const r={start:e.getFullStart(),end:e.getEnd()};if(!t){const e=new DeclarationScope({range:r});this.pushStatement(e.iife);return e}const n=t.getText();const i=new DeclarationScope({id:t,range:r});const o=this.declarations.get(n);if(o){o.pushIdentifierReference(t);o.declaration.end=r.end;let e=this.ast.body.findIndex((e=>e==o.declaration));for(let t=e+1;t<this.ast.body.length;t++){const e=this.ast.body[t];e.start=e.end=r.end}}else{this.pushStatement(i.declaration);this.declarations.set(n,i)}return o||i}convertStatement(e){if(n.isEnumDeclaration(e)){return this.convertEnumDeclaration(e)}if(n.isFunctionDeclaration(e)){return this.convertFunctionDeclaration(e)}if(n.isInterfaceDeclaration(e)||n.isClassDeclaration(e)){return this.convertClassOrInterfaceDeclaration(e)}if(n.isTypeAliasDeclaration(e)){return this.convertTypeAliasDeclaration(e)}if(n.isVariableStatement(e)){return this.convertVariableStatement(e)}if(n.isExportDeclaration(e)||n.isExportAssignment(e)){return this.convertExportDeclaration(e)}if(n.isModuleDeclaration(e)){return this.convertNamespaceDeclaration(e)}if(e.kind==n.SyntaxKind.NamespaceExportDeclaration){return this.removeStatement(e)}if(n.isImportDeclaration(e)||n.isImportEqualsDeclaration(e)){return this.convertImportDeclaration(e)}else{throw new UnsupportedSyntaxError(e)}}removeStatement(e){this.pushStatement(withStartEnd({type:"ExpressionStatement",expression:{type:"Literal",value:"pls remove me"}},e))}convertNamespaceDeclaration(e){const t=e.flags&n.NodeFlags.GlobalAugmentation;if(t||!n.isIdentifier(e.name)){const t=this.createDeclaration(e);t.convertNamespace(e,true);return}const r=this.createDeclaration(e,e.name);r.pushIdentifierReference(e.name);r.convertNamespace(e)}convertEnumDeclaration(e){const t=this.createDeclaration(e,e.name);t.pushIdentifierReference(e.name)}convertFunctionDeclaration(e){if(!e.name){throw new UnsupportedSyntaxError(e,`FunctionDeclaration should have a name`)}const t=this.createDeclaration(e,e.name);t.pushIdentifierReference(e.name);t.convertParametersAndType(e)}convertClassOrInterfaceDeclaration(e){if(!e.name){throw new UnsupportedSyntaxError(e,`ClassDeclaration / InterfaceDeclaration should have a name`)}const t=this.createDeclaration(e,e.name);const r=t.convertTypeParameters(e.typeParameters);t.convertHeritageClauses(e);t.convertMembers(e.members);t.popScope(r)}convertTypeAliasDeclaration(e){const t=this.createDeclaration(e,e.name);const r=t.convertTypeParameters(e.typeParameters);t.convertTypeNode(e.type);t.popScope(r)}convertVariableStatement(e){const{declarations:t}=e.declarationList;if(t.length!==1){throw new UnsupportedSyntaxError(e,`VariableStatement with more than one declaration not yet supported`)}for(const r of t){if(!n.isIdentifier(r.name)){throw new UnsupportedSyntaxError(e,`VariableDeclaration must have a name`)}const t=this.createDeclaration(e,r.name);t.convertTypeNode(r.type)}}convertExportDeclaration(e){if(n.isExportAssignment(e)){this.pushStatement(withStartEnd({type:"ExportDefaultDeclaration",declaration:convertExpression(e.expression)},e));return}const t=e.moduleSpecifier?convertExpression(e.moduleSpecifier):undefined;if(!e.exportClause){this.pushStatement(withStartEnd({type:"ExportAllDeclaration",source:t,exported:null},e))}else if(n.isNamespaceExport(e.exportClause)){this.pushStatement(withStartEnd({type:"ExportAllDeclaration",source:t,exported:createIdentifier(e.exportClause.name)},e))}else{const r=[];for(const t of e.exportClause.elements){r.push(this.convertExportSpecifier(t))}this.pushStatement(withStartEnd({type:"ExportNamedDeclaration",declaration:null,specifiers:r,source:t},e))}}convertImportDeclaration(e){if(n.isImportEqualsDeclaration(e)){if(!n.isExternalModuleReference(e.moduleReference)){throw new UnsupportedSyntaxError(e,"ImportEquals should have a literal source.")}this.pushStatement(withStartEnd({type:"ImportDeclaration",specifiers:[{type:"ImportDefaultSpecifier",local:createIdentifier(e.name)}],source:convertExpression(e.moduleReference.expression)},e));return}const t=convertExpression(e.moduleSpecifier);const r=e.importClause&&e.importClause.namedBindings?this.convertNamedImportBindings(e.importClause.namedBindings):[];if(e.importClause&&e.importClause.name){r.push({type:"ImportDefaultSpecifier",local:createIdentifier(e.importClause.name)})}this.pushStatement(withStartEnd({type:"ImportDeclaration",specifiers:r,source:t},e))}convertNamedImportBindings(e){if(n.isNamedImports(e)){return e.elements.map((e=>{const t=createIdentifier(e.name);const r=e.propertyName?createIdentifier(e.propertyName):t;return{type:"ImportSpecifier",local:t,imported:r}}))}return[{type:"ImportNamespaceSpecifier",local:createIdentifier(e.name)}]}convertExportSpecifier(e){const t=createIdentifier(e.name);return{type:"ExportSpecifier",exported:t,local:e.propertyName?createIdentifier(e.propertyName):t}}}function parse(e,t){return n.createSourceFile(e,t,n.ScriptTarget.Latest,true)}const transform=()=>{const e=new Map;const t=new Map;return{name:"dts-transform",options(e){const{onwarn:t}=e;return{...e,onwarn(e,r){if(e.code!="CIRCULAR_DEPENDENCY"){if(t){t(e,r)}else{r(e)}}},treeshake:{moduleSideEffects:"no-external",propertyReadSideEffects:true,unknownGlobalSideEffects:false}}},outputOptions(e){return{...e,chunkFileNames:e.chunkFileNames||"[name]-[hash].d.ts",entryFileNames:e.entryFileNames||"[name].d.ts",format:"es",exports:"named",compact:false,freeze:true,interop:"esModule",generatedCode:Object.assign({symbols:false},e.generatedCode),strict:false}},transform(r,n){let i=parse(n,r);const o=preProcess({sourceFile:i});e.set(i.fileName,o.typeReferences);t.set(i.fileName,o.fileReferences);r=o.code.toString();i=parse(n,r);const s=convert({sourceFile:i});if(process.env.DTS_DUMP_AST){console.log(n);console.log(r);console.log(JSON.stringify(s.ast.body,undefined,2))}return{code:r,ast:s.ast,map:o.code.generateMap()}},renderChunk(r,n,i){const o=parse(n.fileName,r);const a=new NamespaceFixer(o);const c=new Set;const l=new Set;for(const r of Object.keys(n.modules)){for(const t of e.get(r.split("\\").join("/"))||[]){c.add(t)}for(const e of t.get(r.split("\\").join("/"))||[]){if(e.startsWith(".")){const t=s.join(s.dirname(r),e);const o=i.file&&s.dirname(i.file)||n.facadeModuleId&&s.dirname(n.facadeModuleId)||".";let a=s.relative(o,t).split("\\").join("/");if(a[0]!=="."){a="./"+a}l.add(a)}else{l.add(e)}}}r=writeBlock(Array.from(l,(e=>`/// <reference path="${e}" />`)));r+=writeBlock(Array.from(c,(e=>`/// <reference types="${e}" />`)));r+=a.fix();if(!r){r+="\nexport { }"}return{code:r,map:{mappings:""}}}}};function writeBlock(e){if(e.length){return e.join("\n")+"\n"}return""}const p=/\.([cm]ts|[tj]sx?)$/;function getModule({programs:e,resolvedOptions:{compilerOptions:t,tsconfig:r}},i,o){if(!e.length&&a.test(i)){return{code:o}}const s=e.find((e=>!!e.getSourceFile(i)));if(s){const e=s.getSourceFile(i);return{code:e.getFullText(),source:e,program:s}}else if(n.sys.fileExists(i)){const n=createProgram$1(i,t,r);e.push(n);const o=n.getSourceFile(i);return{code:o.getFullText(),source:o,program:n}}else{return null}}const plugin=(e={})=>{const t=transform();const r={programs:[],resolvedOptions:resolveDefaultOptions(e)};return{name:"dts",outputOptions:t.outputOptions,renderChunk:t.renderChunk,options(e){let{input:n=[]}=e;if(!Array.isArray(n)){n=typeof n==="string"?[n]:Object.values(n)}else if(n.length>1){e.input={};for(const t of n){let r=t.replace(/((\.d)?\.(c|m)?(t|j)sx?)$/,"");if(s.isAbsolute(t)){r=s.basename(r)}else{r=s.normalize(r)}e.input[r]=t}}r.programs=createPrograms(Object.values(n),r.resolvedOptions.compilerOptions,r.resolvedOptions.tsconfig);return t.options.call(this,e)},transform(e,i){if(!p.test(i)){return null}const watchFiles=e=>{if(e.program){const t=s.dirname(i);const r=e.program.getSourceFiles().map((e=>e.fileName)).filter((e=>e.startsWith(t)));r.forEach(this.addWatchFile)}};const handleDtsFile=()=>{const n=getModule(r,i,e);if(n){watchFiles(n);return t.transform.call(this,n.code,i)}return null};const treatTsAsDts=()=>{const n=i.replace(p,c);let o=getModule(r,n,e);if(o){watchFiles(o);return t.transform.call(this,o.code,n)}return null};const generateDtsFromTs=()=>{const o=getModule(r,i,e);if(!o||!o.source||!o.program)return null;watchFiles(o);const s=i.replace(p,c);let a;const{emitSkipped:u,diagnostics:f}=o.program.emit(o.source,((e,r)=>{a=t.transform.call(this,r,s)}),undefined,true);if(u){const e=f.filter((e=>e.category===n.DiagnosticCategory.Error));if(e.length){console.error(n.formatDiagnostics(e,l));this.error("Failed to compile. Check the logs above.")}}return a};if(a.test(i))return handleDtsFile();return treatTsAsDts()??generateDtsFromTs()},resolveId(e,t){if(!t){return}t=t.split("\\").join("/");let i=r.resolvedOptions.compilerOptions;if(r.resolvedOptions.tsconfig){const n=e.startsWith(".")?s.resolve(s.dirname(t),e):e;i=getCompilerOptions(n,r.resolvedOptions.compilerOptions,r.resolvedOptions.tsconfig).compilerOptions}const{resolvedModule:o}=n.resolveModuleName(e,t,i,n.sys);if(!o){return}if(!r.resolvedOptions.respectExternal&&o.isExternalLibraryImport){return{id:e,external:true}}else{return{id:s.resolve(o.resolvedFileName)}}}}};e["default"]=plugin})();module.exports=r})();
@@ -1 +1 @@
1
- {"name":"rollup-plugin-dts","author":"Arpad Borsos <arpad.borsos@googlemail.com>","version":"5.2.0","funding":{"url":"https://github.com/sponsors/Swatinem"},"license":"LGPL-3.0","types":"./dist/rollup-plugin-dts.d.ts"}
1
+ {"name":"rollup-plugin-dts","author":"Arpad Borsos <arpad.borsos@googlemail.com>","version":"5.3.0","funding":{"url":"https://github.com/sponsors/Swatinem"},"license":"LGPL-3.0","types":"./dist/rollup-plugin-dts.d.ts"}